Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#2095)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed May 20, 2024
1 parent a3dd6f2 commit b7c8993
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
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

0 comments on commit b7c8993

Please sign in to comment.