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 1f03eb6 commit d95c2db
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:
// [CachePurgeParamsDba3P8WwFlex], [CachePurgeParamsDba3P8WwEverything],
// [CachePurgeParamsDba3P8WwFiles].
// [CachePurgeParamsQepy7bYeFlex], [CachePurgeParamsQepy7bYeEverything],
// [CachePurgeParamsQepy7bYeFiles].
type CachePurgeParams interface {
ImplementsCachePurgeParams()
}

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

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

func (CachePurgeParamsDba3P8WwFlex) ImplementsCachePurgeParams() {
func (CachePurgeParamsQepy7bYeFlex) ImplementsCachePurgeParams() {

}

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

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

func (CachePurgeParamsDba3P8WwEverything) ImplementsCachePurgeParams() {
func (CachePurgeParamsQepy7bYeEverything) ImplementsCachePurgeParams() {

}

type CachePurgeParamsDba3P8WwFiles struct {
Files param.Field[[]CachePurgeParamsDba3P8WwFilesFile] `json:"files"`
type CachePurgeParamsQepy7bYeFiles struct {
Files param.Field[[]CachePurgeParamsQepy7bYeFilesFile] `json:"files"`
}

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

func (CachePurgeParamsDba3P8WwFiles) ImplementsCachePurgeParams() {
func (CachePurgeParamsQepy7bYeFiles) ImplementsCachePurgeParams() {

}

// Satisfied by [shared.UnionString],
// [CachePurgeParamsDba3P8WwFilesFilesDba3P8WwURLAndHeaders].
type CachePurgeParamsDba3P8WwFilesFile interface {
ImplementsCachePurgeParamsDba3P8WwFilesFile()
// [CachePurgeParamsQepy7bYeFilesFilesQepy7bYeURLAndHeaders].
type CachePurgeParamsQepy7bYeFilesFile interface {
ImplementsCachePurgeParamsQepy7bYeFilesFile()
}

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

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

func (r CachePurgeParamsDba3P8WwFilesFilesDba3P8WwURLAndHeaders) ImplementsCachePurgeParamsDba3P8WwFilesFile() {
func (r CachePurgeParamsQepy7bYeFilesFilesQepy7bYeURLAndHeaders) ImplementsCachePurgeParamsQepy7bYeFilesFile() {
}

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.CachePurgeParamsDba3P8WwFlex{
cloudflare.CachePurgeParamsQepy7bYeFlex{
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) ImplementsCachePurgeParamsDba3P8WwFilesFile() {}
func (UnionString) ImplementsCachePurgeParamsQepy7bYeFilesFile() {}
func (UnionString) ImplementsCacheTieredCacheSmartTopologyUpdateResponse() {}
func (UnionString) ImplementsCacheTieredCacheSmartTopologyDeleteResponse() {}
func (UnionString) ImplementsCacheTieredCacheSmartTopologyGetResponse() {}
Expand Down
Loading

0 comments on commit d95c2db

Please sign in to comment.