Skip to content

Commit

Permalink
feat: OpenAPI spec update via Stainless API
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot committed Feb 20, 2024
1 parent 8d7f27a commit cddc1ee
Show file tree
Hide file tree
Showing 5 changed files with 244 additions and 244 deletions.
36 changes: 18 additions & 18 deletions cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,66 +97,66 @@ func (r *CachePurgeResponse) UnmarshalJSON(data []byte) (err error) {
}

// This interface is a union satisfied by one of the following:
// [CachePurgeParamsIHiNlFOkFlex], [CachePurgeParamsIHiNlFOkEverything],
// [CachePurgeParamsIHiNlFOkFiles].
// [CachePurgeParamsI2n6weu1Flex], [CachePurgeParamsI2n6weu1Everything],
// [CachePurgeParamsI2n6weu1Files].
type CachePurgeParams interface {
ImplementsCachePurgeParams()
}

type CachePurgeParamsIHiNlFOkFlex struct {
type CachePurgeParamsI2n6weu1Flex struct {
Hosts param.Field[[]string] `json:"hosts"`
Prefixes param.Field[[]string] `json:"prefixes"`
Tags param.Field[[]string] `json:"tags"`
}

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

func (CachePurgeParamsIHiNlFOkFlex) ImplementsCachePurgeParams() {
func (CachePurgeParamsI2n6weu1Flex) ImplementsCachePurgeParams() {

}

type CachePurgeParamsIHiNlFOkEverything struct {
type CachePurgeParamsI2n6weu1Everything struct {
PurgeEverything param.Field[bool] `json:"purge_everything"`
}

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

func (CachePurgeParamsIHiNlFOkEverything) ImplementsCachePurgeParams() {
func (CachePurgeParamsI2n6weu1Everything) ImplementsCachePurgeParams() {

}

type CachePurgeParamsIHiNlFOkFiles struct {
Files param.Field[[]CachePurgeParamsIHiNlFOkFilesFile] `json:"files"`
type CachePurgeParamsI2n6weu1Files struct {
Files param.Field[[]CachePurgeParamsI2n6weu1FilesFile] `json:"files"`
}

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

func (CachePurgeParamsIHiNlFOkFiles) ImplementsCachePurgeParams() {
func (CachePurgeParamsI2n6weu1Files) ImplementsCachePurgeParams() {

}

// Satisfied by [shared.UnionString],
// [CachePurgeParamsIHiNlFOkFilesFilesIHiNlFOkURLAndHeaders].
type CachePurgeParamsIHiNlFOkFilesFile interface {
ImplementsCachePurgeParamsIHiNlFOkFilesFile()
// [CachePurgeParamsI2n6weu1FilesFilesI2n6weu1URLAndHeaders].
type CachePurgeParamsI2n6weu1FilesFile interface {
ImplementsCachePurgeParamsI2n6weu1FilesFile()
}

type CachePurgeParamsIHiNlFOkFilesFilesIHiNlFOkURLAndHeaders struct {
type CachePurgeParamsI2n6weu1FilesFilesI2n6weu1URLAndHeaders struct {
Headers param.Field[interface{}] `json:"headers"`
URL param.Field[string] `json:"url"`
}

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

func (r CachePurgeParamsIHiNlFOkFilesFilesIHiNlFOkURLAndHeaders) ImplementsCachePurgeParamsIHiNlFOkFilesFile() {
func (r CachePurgeParamsI2n6weu1FilesFilesI2n6weu1URLAndHeaders) ImplementsCachePurgeParamsI2n6weu1FilesFile() {
}

type CachePurgeResponseEnvelope struct {
Expand Down
2 changes: 1 addition & 1 deletion cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestCachePurgeWithOptionalParams(t *testing.T) {
_, err := client.Cache.Purge(
context.TODO(),
"string",
cloudflare.CachePurgeParamsIHiNlFOkFlex{
cloudflare.CachePurgeParamsI2n6weu1Flex{
Hosts: cloudflare.F([]string{"www.example.com", "images.example.com"}),
Prefixes: cloudflare.F([]string{"www.example.com/foo", "images.example.com/bar/baz"}),
Tags: cloudflare.F([]string{"some-tag", "another-tag"}),
Expand Down
2 changes: 1 addition & 1 deletion internal/shared/union.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (UnionString) ImplementsAccessApplicationUserPolicyCheckListParamsAppID()
func (UnionString) ImplementsAccessKeyListResponse() {}
func (UnionString) ImplementsAccessKeyReplaceResponse() {}
func (UnionString) ImplementsAccessKeyRotateResponse() {}
func (UnionString) ImplementsCachePurgeParamsIHiNlFOkFilesFile() {}
func (UnionString) ImplementsCachePurgeParamsI2n6weu1FilesFile() {}
func (UnionString) ImplementsCacheTieredCacheSmartTopologyUpdateResponse() {}
func (UnionString) ImplementsCacheTieredCacheSmartTopologyDeleteResponse() {}
func (UnionString) ImplementsCacheTieredCacheSmartTopologyGetResponse() {}
Expand Down
Loading

0 comments on commit cddc1ee

Please sign in to comment.