Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): api update #3589

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1397
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f5305b253841aee001bed9bf486562184b70df73d31313774fd5b00bc2e7f8e1.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1f3a5920b5590a1e7f4df129cc299fe3d4aaa7bf4ef6915b015dd898b1a1813c.yml
10 changes: 5 additions & 5 deletions accounts/member.go
Original file line number Diff line number Diff line change
Expand Up @@ -1375,8 +1375,8 @@ func (r MemberNewParams) MarshalJSON() (data []byte, err error) {
type MemberNewParamsBody struct {
// The contact email address of the user.
Email param.Field[string] `json:"email,required"`
Policies param.Field[interface{}] `json:"policies,required"`
Roles param.Field[interface{}] `json:"roles,required"`
Policies param.Field[interface{}] `json:"policies"`
Roles param.Field[interface{}] `json:"roles"`
Status param.Field[MemberNewParamsBodyStatus] `json:"status"`
}

Expand Down Expand Up @@ -1570,9 +1570,9 @@ func (r MemberUpdateParams) MarshalJSON() (data []byte, err error) {
}

type MemberUpdateParamsBody struct {
Policies param.Field[interface{}] `json:"policies,required"`
Roles param.Field[interface{}] `json:"roles,required"`
User param.Field[interface{}] `json:"user,required"`
Policies param.Field[interface{}] `json:"policies"`
Roles param.Field[interface{}] `json:"roles"`
User param.Field[interface{}] `json:"user"`
}

func (r MemberUpdateParamsBody) MarshalJSON() (data []byte, err error) {
Expand Down
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4876,7 +4876,7 @@ Methods:

- <code title="post /{account_or_zone}/{account_or_zone_id}/access/service_tokens">client.ZeroTrust.Access.ServiceTokens.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust#AccessServiceTokenService.New">New</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, params <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust#AccessServiceTokenNewParams">AccessServiceTokenNewParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust#AccessServiceTokenNewResponse">AccessServiceTokenNewResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="put /{account_or_zone}/{account_or_zone_id}/access/service_tokens/{service_token_id}">client.ZeroTrust.Access.ServiceTokens.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust#AccessServiceTokenService.Update">Update</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, serviceTokenID <a href="https://pkg.go.dev/builtin#string">string</a>, params <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust#AccessServiceTokenUpdateParams">AccessServiceTokenUpdateParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust#ServiceToken">ServiceToken</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="get /{account_or_zone}/{account_or_zone_id}/access/service_tokens">client.ZeroTrust.Access.ServiceTokens.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust#AccessServiceTokenService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, query <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust#AccessServiceTokenListParams">AccessServiceTokenListParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/packages/pagination">pagination</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/packages/pagination#SinglePage">SinglePage</a>[<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust#ServiceToken">ServiceToken</a>], <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="get /{account_or_zone}/{account_or_zone_id}/access/service_tokens">client.ZeroTrust.Access.ServiceTokens.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust#AccessServiceTokenService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, params <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust#AccessServiceTokenListParams">AccessServiceTokenListParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/packages/pagination">pagination</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/packages/pagination#SinglePage">SinglePage</a>[<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust#ServiceToken">ServiceToken</a>], <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="delete /{account_or_zone}/{account_or_zone_id}/access/service_tokens/{service_token_id}">client.ZeroTrust.Access.ServiceTokens.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust#AccessServiceTokenService.Delete">Delete</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, serviceTokenID <a href="https://pkg.go.dev/builtin#string">string</a>, body <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust#AccessServiceTokenDeleteParams">AccessServiceTokenDeleteParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust#ServiceToken">ServiceToken</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="get /{account_or_zone}/{account_or_zone_id}/access/service_tokens/{service_token_id}">client.ZeroTrust.Access.ServiceTokens.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust#AccessServiceTokenService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, serviceTokenID <a href="https://pkg.go.dev/builtin#string">string</a>, query <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust#AccessServiceTokenGetParams">AccessServiceTokenGetParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust#ServiceToken">ServiceToken</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="post /accounts/{account_id}/access/service_tokens/{service_token_id}/refresh">client.ZeroTrust.Access.ServiceTokens.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust#AccessServiceTokenService.Refresh">Refresh</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, serviceTokenID <a href="https://pkg.go.dev/builtin#string">string</a>, body <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust#AccessServiceTokenRefreshParams">AccessServiceTokenRefreshParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust">zero_trust</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/zero_trust#ServiceToken">ServiceToken</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
Expand Down
30 changes: 15 additions & 15 deletions api_gateway/operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,19 +191,19 @@ func (r APIShieldMethod) IsKnown() bool {
type APIShieldFeatures struct {
// This field can have the runtime type of
// [APIShieldFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting].
APIRouting interface{} `json:"api_routing,required"`
APIRouting interface{} `json:"api_routing"`
// This field can have the runtime type of
// [APIShieldFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals].
ConfidenceIntervals interface{} `json:"confidence_intervals,required"`
ConfidenceIntervals interface{} `json:"confidence_intervals"`
// This field can have the runtime type of
// [APIShieldFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas].
ParameterSchemas interface{} `json:"parameter_schemas,required"`
ParameterSchemas interface{} `json:"parameter_schemas"`
// This field can have the runtime type of
// [APIShieldFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo].
SchemaInfo interface{} `json:"schema_info,required"`
SchemaInfo interface{} `json:"schema_info"`
// This field can have the runtime type of
// [APIShieldFeaturesAPIShieldOperationFeatureThresholdsThresholds].
Thresholds interface{} `json:"thresholds,required"`
Thresholds interface{} `json:"thresholds"`
JSON apiShieldFeaturesJSON `json:"-"`
union APIShieldFeaturesUnion
}
Expand Down Expand Up @@ -832,19 +832,19 @@ func (r OperationListResponseMethod) IsKnown() bool {
type OperationListResponseFeatures struct {
// This field can have the runtime type of
// [OperationListResponseFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting].
APIRouting interface{} `json:"api_routing,required"`
APIRouting interface{} `json:"api_routing"`
// This field can have the runtime type of
// [OperationListResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals].
ConfidenceIntervals interface{} `json:"confidence_intervals,required"`
ConfidenceIntervals interface{} `json:"confidence_intervals"`
// This field can have the runtime type of
// [OperationListResponseFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas].
ParameterSchemas interface{} `json:"parameter_schemas,required"`
ParameterSchemas interface{} `json:"parameter_schemas"`
// This field can have the runtime type of
// [OperationListResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo].
SchemaInfo interface{} `json:"schema_info,required"`
SchemaInfo interface{} `json:"schema_info"`
// This field can have the runtime type of
// [OperationListResponseFeaturesAPIShieldOperationFeatureThresholdsThresholds].
Thresholds interface{} `json:"thresholds,required"`
Thresholds interface{} `json:"thresholds"`
JSON operationListResponseFeaturesJSON `json:"-"`
union OperationListResponseFeaturesUnion
}
Expand Down Expand Up @@ -1518,19 +1518,19 @@ func (r OperationGetResponseMethod) IsKnown() bool {
type OperationGetResponseFeatures struct {
// This field can have the runtime type of
// [OperationGetResponseFeaturesAPIShieldOperationFeatureAPIRoutingAPIRouting].
APIRouting interface{} `json:"api_routing,required"`
APIRouting interface{} `json:"api_routing"`
// This field can have the runtime type of
// [OperationGetResponseFeaturesAPIShieldOperationFeatureConfidenceIntervalsConfidenceIntervals].
ConfidenceIntervals interface{} `json:"confidence_intervals,required"`
ConfidenceIntervals interface{} `json:"confidence_intervals"`
// This field can have the runtime type of
// [OperationGetResponseFeaturesAPIShieldOperationFeatureParameterSchemasParameterSchemas].
ParameterSchemas interface{} `json:"parameter_schemas,required"`
ParameterSchemas interface{} `json:"parameter_schemas"`
// This field can have the runtime type of
// [OperationGetResponseFeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo].
SchemaInfo interface{} `json:"schema_info,required"`
SchemaInfo interface{} `json:"schema_info"`
// This field can have the runtime type of
// [OperationGetResponseFeaturesAPIShieldOperationFeatureThresholdsThresholds].
Thresholds interface{} `json:"thresholds,required"`
Thresholds interface{} `json:"thresholds"`
JSON operationGetResponseFeaturesJSON `json:"-"`
union OperationGetResponseFeaturesUnion
}
Expand Down
10 changes: 5 additions & 5 deletions api_gateway/userschemaoperation.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ type UserSchemaOperationListResponse struct {
// insertion. This will further be Cloudflare-normalized upon insertion. See:
// https://developers.cloudflare.com/rules/normalization/how-it-works/.
Endpoint string `json:"endpoint,required" format:"uri-template"`
// This field can have the runtime type of [APIShieldFeatures].
Features interface{} `json:"features,required"`
// RFC3986-compliant host.
Host string `json:"host,required" format:"hostname"`
// The HTTP method used to access the endpoint.
Method UserSchemaOperationListResponseMethod `json:"method,required"`
LastUpdated time.Time `json:"last_updated" format:"date-time"`
Method UserSchemaOperationListResponseMethod `json:"method,required"`
// This field can have the runtime type of [APIShieldFeatures].
Features interface{} `json:"features"`
LastUpdated time.Time `json:"last_updated" format:"date-time"`
// UUID
OperationID string `json:"operation_id"`
JSON userSchemaOperationListResponseJSON `json:"-"`
Expand All @@ -95,9 +95,9 @@ type UserSchemaOperationListResponse struct {
// [UserSchemaOperationListResponse]
type userSchemaOperationListResponseJSON struct {
Endpoint apijson.Field
Features apijson.Field
Host apijson.Field
Method apijson.Field
Features apijson.Field
LastUpdated apijson.Field
OperationID apijson.Field
raw string
Expand Down
10 changes: 5 additions & 5 deletions cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,13 @@ func (r CachePurgeParams) MarshalJSON() (data []byte, err error) {
}

type CachePurgeParamsBody struct {
Files param.Field[interface{}] `json:"files,required"`
Hosts param.Field[interface{}] `json:"hosts,required"`
Prefixes param.Field[interface{}] `json:"prefixes,required"`
Tags param.Field[interface{}] `json:"tags,required"`
Files param.Field[interface{}] `json:"files"`
Hosts param.Field[interface{}] `json:"hosts"`
Prefixes param.Field[interface{}] `json:"prefixes"`
// For more information, please refer to
// [purge everything documentation page](https://developers.cloudflare.com/cache/how-to/purge-cache/purge-everything/).
PurgeEverything param.Field[bool] `json:"purge_everything"`
PurgeEverything param.Field[bool] `json:"purge_everything"`
Tags param.Field[interface{}] `json:"tags"`
}

func (r CachePurgeParamsBody) MarshalJSON() (data []byte, err error) {
Expand Down
Loading