From b7c89935a3e6e7c5ac8fa4e00d10b4b1a8264c15 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 17:47:24 +0000 Subject: [PATCH] feat(api): OpenAPI spec update via Stainless API (#2095) --- .stats.yml | 2 +- cache/cache.go | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index ca2b4a1f25..30e0514e7c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -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 diff --git a/cache/cache.go b/cache/cache.go index 6b576faf54..8986e48773 100644 --- a/cache/cache.go +++ b/cache/cache.go @@ -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"` @@ -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], @@ -137,6 +141,7 @@ type CachePurgeParamsBodyUnion interface { implementsCacheCachePurgeParamsBodyUnion() } +// Flex purge by tags type CachePurgeParamsBodyCachePurgeTags struct { Tags param.Field[[]string] `json:"tags"` } @@ -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"` } @@ -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"` }