Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): OpenAPI spec update via Stainless API #2095

Merged
merged 1 commit into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1296
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4661c57253723a62858ec11879e101250e22c7702521b0aedd61e852a5d6e4e9.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-482840aef1f8d1525507e2ef2bc5ec68a6eb3c7eb4c089800265c12ef99121a0.yml
11 changes: 9 additions & 2 deletions cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,16 @@ func (r cachePurgeResponseJSON) RawJSON() string {
}

type CachePurgeParams struct {
ZoneID param.Field[string] `path:"zone_id,required"`
Body CachePurgeParamsBodyUnion `json:"body,required"`
ZoneID param.Field[string] `path:"zone_id,required"`
// Flex purge by tags
Body CachePurgeParamsBodyUnion `json:"body,required"`
}

func (r CachePurgeParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r.Body)
}

// Flex purge by tags
type CachePurgeParamsBody struct {
Tags param.Field[interface{}] `json:"tags,required"`
Hosts param.Field[interface{}] `json:"hosts,required"`
Expand All @@ -128,6 +130,8 @@ func (r CachePurgeParamsBody) MarshalJSON() (data []byte, err error) {

func (r CachePurgeParamsBody) implementsCacheCachePurgeParamsBodyUnion() {}

// Flex purge by tags
//
// Satisfied by [cache.CachePurgeParamsBodyCachePurgeTags],
// [cache.CachePurgeParamsBodyCachePurgeHosts],
// [cache.CachePurgeParamsBodyCachePurgePrefixes],
Expand All @@ -137,6 +141,7 @@ type CachePurgeParamsBodyUnion interface {
implementsCacheCachePurgeParamsBodyUnion()
}

// Flex purge by tags
type CachePurgeParamsBodyCachePurgeTags struct {
Tags param.Field[[]string] `json:"tags"`
}
Expand All @@ -147,6 +152,7 @@ func (r CachePurgeParamsBodyCachePurgeTags) MarshalJSON() (data []byte, err erro

func (r CachePurgeParamsBodyCachePurgeTags) implementsCacheCachePurgeParamsBodyUnion() {}

// Flex purge by host
type CachePurgeParamsBodyCachePurgeHosts struct {
Hosts param.Field[[]string] `json:"hosts"`
}
Expand All @@ -157,6 +163,7 @@ func (r CachePurgeParamsBodyCachePurgeHosts) MarshalJSON() (data []byte, err err

func (r CachePurgeParamsBodyCachePurgeHosts) implementsCacheCachePurgeParamsBodyUnion() {}

// Flex purge by prefixes
type CachePurgeParamsBodyCachePurgePrefixes struct {
Prefixes param.Field[[]string] `json:"prefixes"`
}
Expand Down