Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#1970)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed May 7, 2024
1 parent 6135101 commit a511cea
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4727,7 +4727,7 @@ Params Types:

- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zero_trust#AllowedHeadersParam">AllowedHeadersParam</a>
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zero_trust#AllowedIdPsParam">AllowedIdPsParam</a>
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zero_trust#AllowedMethodsParam">AllowedMethodsParam</a>
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zero_trust#AllowedMethods">AllowedMethods</a>
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zero_trust#AllowedOriginsParam">AllowedOriginsParam</a>
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zero_trust#AppIDUnionParam">AppIDUnionParam</a>
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/zero_trust#ApplicationUnionParam">ApplicationUnionParam</a>
Expand Down
26 changes: 22 additions & 4 deletions zero_trust/accessapplication.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,27 @@ type AllowedIdPs = string

type AllowedIdPsParam = string

type AllowedMethods []AllowedMethodsItemItem
type AllowedMethods string

type AllowedMethodsParam []AllowedMethodsItemItem
const (
AllowedMethodsGet AllowedMethods = "GET"
AllowedMethodsPost AllowedMethods = "POST"
AllowedMethodsHead AllowedMethods = "HEAD"
AllowedMethodsPut AllowedMethods = "PUT"
AllowedMethodsDelete AllowedMethods = "DELETE"
AllowedMethodsConnect AllowedMethods = "CONNECT"
AllowedMethodsOptions AllowedMethods = "OPTIONS"
AllowedMethodsTrace AllowedMethods = "TRACE"
AllowedMethodsPatch AllowedMethods = "PATCH"
)

func (r AllowedMethods) IsKnown() bool {
switch r {
case AllowedMethodsGet, AllowedMethodsPost, AllowedMethodsHead, AllowedMethodsPut, AllowedMethodsDelete, AllowedMethodsConnect, AllowedMethodsOptions, AllowedMethodsTrace, AllowedMethodsPatch:
return true
}
return false
}

type AllowedOrigins = string

Expand Down Expand Up @@ -1868,7 +1886,7 @@ type CORSHeaders struct {
// Allowed HTTP request headers.
AllowedHeaders []AllowedHeaders `json:"allowed_headers"`
// Allowed HTTP request methods.
AllowedMethods AllowedMethods `json:"allowed_methods"`
AllowedMethods []AllowedMethods `json:"allowed_methods"`
// Allowed origins.
AllowedOrigins []AllowedOrigins `json:"allowed_origins"`
// The maximum number of seconds the results of a preflight request can be cached.
Expand Down Expand Up @@ -1911,7 +1929,7 @@ type CORSHeadersParam struct {
// Allowed HTTP request headers.
AllowedHeaders param.Field[[]AllowedHeadersParam] `json:"allowed_headers"`
// Allowed HTTP request methods.
AllowedMethods param.Field[AllowedMethodsParam] `json:"allowed_methods"`
AllowedMethods param.Field[[]AllowedMethods] `json:"allowed_methods"`
// Allowed origins.
AllowedOrigins param.Field[[]AllowedOriginsParam] `json:"allowed_origins"`
// The maximum number of seconds the results of a preflight request can be cached.
Expand Down
4 changes: 2 additions & 2 deletions zero_trust/accessapplication_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestAccessApplicationNewWithOptionalParams(t *testing.T) {
AllowAllOrigins: cloudflare.F(true),
AllowCredentials: cloudflare.F(true),
AllowedHeaders: cloudflare.F([]zero_trust.AllowedHeadersParam{"string", "string", "string"}),
AllowedMethods: cloudflare.F([]zero_trust.AllowedMethodsItemItem{zero_trust.AllowedMethodsItemItemGet}),
AllowedMethods: cloudflare.F([]zero_trust.AllowedMethods{zero_trust.AllowedMethodsGet}),
AllowedOrigins: cloudflare.F([]zero_trust.AllowedOriginsParam{"https://example.com"}),
MaxAge: cloudflare.F(-1.000000),
}),
Expand Down Expand Up @@ -105,7 +105,7 @@ func TestAccessApplicationUpdateWithOptionalParams(t *testing.T) {
AllowAllOrigins: cloudflare.F(true),
AllowCredentials: cloudflare.F(true),
AllowedHeaders: cloudflare.F([]zero_trust.AllowedHeadersParam{"string", "string", "string"}),
AllowedMethods: cloudflare.F([]zero_trust.AllowedMethodsItemItem{zero_trust.AllowedMethodsItemItemGet}),
AllowedMethods: cloudflare.F([]zero_trust.AllowedMethods{zero_trust.AllowedMethodsGet}),
AllowedOrigins: cloudflare.F([]zero_trust.AllowedOriginsParam{"https://example.com"}),
MaxAge: cloudflare.F(-1.000000),
}),
Expand Down

0 comments on commit a511cea

Please sign in to comment.