diff --git a/.stats.yml b/.stats.yml index feb464512d9..ed5e06afbf5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 1336 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6a566fafa78575febbb420c78fd689eb8df8c3e66ebe37804ab4d950db380fa1.yml +configured_endpoints: 1333 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0b90c8e31d77ee1a893a12f7abdc7a037e8a7e102d267caf174df6c26560c829.yml diff --git a/api.md b/api.md index 0f0d14bcf35..4a34a0c6151 100644 --- a/api.md +++ b/api.md @@ -6775,13 +6775,13 @@ Methods: Response Types: -- origin_post_quantum_encryption.interface{} -- origin_post_quantum_encryption.interface{} +- origin_post_quantum_encryption.OriginPostQuantumEncryptionUpdateResponse +- origin_post_quantum_encryption.OriginPostQuantumEncryptionGetResponse Methods: -- client.OriginPostQuantumEncryption.Update(ctx context.Context, params origin_post_quantum_encryption.OriginPostQuantumEncryptionUpdateParams) (origin_post_quantum_encryption.interface{}, error) -- client.OriginPostQuantumEncryption.Get(ctx context.Context, query origin_post_quantum_encryption.OriginPostQuantumEncryptionGetParams) (origin_post_quantum_encryption.interface{}, error) +- client.OriginPostQuantumEncryption.Update(ctx context.Context, params origin_post_quantum_encryption.OriginPostQuantumEncryptionUpdateParams) (origin_post_quantum_encryption.OriginPostQuantumEncryptionUpdateResponse, error) +- client.OriginPostQuantumEncryption.Get(ctx context.Context, query origin_post_quantum_encryption.OriginPostQuantumEncryptionGetParams) (origin_post_quantum_encryption.OriginPostQuantumEncryptionGetResponse, error) # Speed @@ -7017,26 +7017,8 @@ Methods: ### Configuration -Response Types: - -- event_notifications.R2ConfigurationGetResponse - -Methods: - -- client.EventNotifications.R2.Configuration.Get(ctx context.Context, bucketName string, query event_notifications.R2ConfigurationGetParams) (event_notifications.R2ConfigurationGetResponse, error) - #### Queues -Response Types: - -- event_notifications.R2ConfigurationQueueUpdateResponse -- event_notifications.R2ConfigurationQueueDeleteResponseUnion - -Methods: - -- client.EventNotifications.R2.Configuration.Queues.Update(ctx context.Context, bucketName string, queueID string, params event_notifications.R2ConfigurationQueueUpdateParams) (event_notifications.R2ConfigurationQueueUpdateResponse, error) -- client.EventNotifications.R2.Configuration.Queues.Delete(ctx context.Context, bucketName string, queueID string, body event_notifications.R2ConfigurationQueueDeleteParams) (event_notifications.R2ConfigurationQueueDeleteResponseUnion, error) - # AIGateway Response Types: diff --git a/argo/tieredcaching.go b/argo/tieredcaching.go index 4b54c2e7a6c..a1d2db8f514 100644 --- a/argo/tieredcaching.go +++ b/argo/tieredcaching.go @@ -191,11 +191,11 @@ func (r TieredCachingEditParamsValue) IsKnown() bool { } type TieredCachingEditResponseEnvelope struct { - Errors []shared.ResponseInfo `json:"errors,required"` - Messages []shared.ResponseInfo `json:"messages,required"` - Result TieredCachingEditResponse `json:"result,required"` + Errors []shared.ResponseInfo `json:"errors,required"` + Messages []shared.ResponseInfo `json:"messages,required"` // Whether the API call was successful Success TieredCachingEditResponseEnvelopeSuccess `json:"success,required"` + Result TieredCachingEditResponse `json:"result"` JSON tieredCachingEditResponseEnvelopeJSON `json:"-"` } @@ -204,8 +204,8 @@ type TieredCachingEditResponseEnvelope struct { type tieredCachingEditResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field - Result apijson.Field Success apijson.Field + Result apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -239,11 +239,11 @@ type TieredCachingGetParams struct { } type TieredCachingGetResponseEnvelope struct { - Errors []shared.ResponseInfo `json:"errors,required"` - Messages []shared.ResponseInfo `json:"messages,required"` - Result TieredCachingGetResponse `json:"result,required"` + Errors []shared.ResponseInfo `json:"errors,required"` + Messages []shared.ResponseInfo `json:"messages,required"` // Whether the API call was successful Success TieredCachingGetResponseEnvelopeSuccess `json:"success,required"` + Result TieredCachingGetResponse `json:"result"` JSON tieredCachingGetResponseEnvelopeJSON `json:"-"` } @@ -252,8 +252,8 @@ type TieredCachingGetResponseEnvelope struct { type tieredCachingGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field - Result apijson.Field Success apijson.Field + Result apijson.Field raw string ExtraFields map[string]apijson.Field } diff --git a/cache/cachereserve.go b/cache/cachereserve.go index 1506d03110f..91510b4d8ae 100644 --- a/cache/cachereserve.go +++ b/cache/cachereserve.go @@ -354,14 +354,14 @@ func (r CacheReserveClearParams) MarshalJSON() (data []byte, err error) { type CacheReserveClearResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` + // Whether the API call was successful + Success CacheReserveClearResponseEnvelopeSuccess `json:"success,required"` // You can use Cache Reserve Clear to clear your Cache Reserve, but you must first // disable Cache Reserve. In most cases, this will be accomplished within 24 hours. // You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind // that you cannot undo or cancel this operation. - Result CacheReserveClearResponse `json:"result,required"` - // Whether the API call was successful - Success CacheReserveClearResponseEnvelopeSuccess `json:"success,required"` - JSON cacheReserveClearResponseEnvelopeJSON `json:"-"` + Result CacheReserveClearResponse `json:"result"` + JSON cacheReserveClearResponseEnvelopeJSON `json:"-"` } // cacheReserveClearResponseEnvelopeJSON contains the JSON metadata for the struct @@ -369,8 +369,8 @@ type CacheReserveClearResponseEnvelope struct { type cacheReserveClearResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field - Result apijson.Field Success apijson.Field + Result apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -428,16 +428,16 @@ func (r CacheReserveEditParamsValue) IsKnown() bool { type CacheReserveEditResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` + // Whether the API call was successful + Success CacheReserveEditResponseEnvelopeSuccess `json:"success,required"` // Increase cache lifetimes by automatically storing all cacheable files into // Cloudflare's persistent object storage buckets. Requires Cache Reserve // subscription. Note: using Tiered Cache with Cache Reserve is highly recommended // to reduce Reserve operations costs. See the // [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) // for more information. - Result CacheReserveEditResponse `json:"result,required"` - // Whether the API call was successful - Success CacheReserveEditResponseEnvelopeSuccess `json:"success,required"` - JSON cacheReserveEditResponseEnvelopeJSON `json:"-"` + Result CacheReserveEditResponse `json:"result"` + JSON cacheReserveEditResponseEnvelopeJSON `json:"-"` } // cacheReserveEditResponseEnvelopeJSON contains the JSON metadata for the struct @@ -445,8 +445,8 @@ type CacheReserveEditResponseEnvelope struct { type cacheReserveEditResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field - Result apijson.Field Success apijson.Field + Result apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -482,16 +482,16 @@ type CacheReserveGetParams struct { type CacheReserveGetResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` + // Whether the API call was successful + Success CacheReserveGetResponseEnvelopeSuccess `json:"success,required"` // Increase cache lifetimes by automatically storing all cacheable files into // Cloudflare's persistent object storage buckets. Requires Cache Reserve // subscription. Note: using Tiered Cache with Cache Reserve is highly recommended // to reduce Reserve operations costs. See the // [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) // for more information. - Result CacheReserveGetResponse `json:"result,required"` - // Whether the API call was successful - Success CacheReserveGetResponseEnvelopeSuccess `json:"success,required"` - JSON cacheReserveGetResponseEnvelopeJSON `json:"-"` + Result CacheReserveGetResponse `json:"result"` + JSON cacheReserveGetResponseEnvelopeJSON `json:"-"` } // cacheReserveGetResponseEnvelopeJSON contains the JSON metadata for the struct @@ -499,8 +499,8 @@ type CacheReserveGetResponseEnvelope struct { type cacheReserveGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field - Result apijson.Field Success apijson.Field + Result apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -536,14 +536,14 @@ type CacheReserveStatusParams struct { type CacheReserveStatusResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` + // Whether the API call was successful + Success CacheReserveStatusResponseEnvelopeSuccess `json:"success,required"` // You can use Cache Reserve Clear to clear your Cache Reserve, but you must first // disable Cache Reserve. In most cases, this will be accomplished within 24 hours. // You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind // that you cannot undo or cancel this operation. - Result CacheReserveStatusResponse `json:"result,required"` - // Whether the API call was successful - Success CacheReserveStatusResponseEnvelopeSuccess `json:"success,required"` - JSON cacheReserveStatusResponseEnvelopeJSON `json:"-"` + Result CacheReserveStatusResponse `json:"result"` + JSON cacheReserveStatusResponseEnvelopeJSON `json:"-"` } // cacheReserveStatusResponseEnvelopeJSON contains the JSON metadata for the struct @@ -551,8 +551,8 @@ type CacheReserveStatusResponseEnvelope struct { type cacheReserveStatusResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field - Result apijson.Field Success apijson.Field + Result apijson.Field raw string ExtraFields map[string]apijson.Field } diff --git a/cache/regionaltieredcache.go b/cache/regionaltieredcache.go index 062592974e5..8e55f77790b 100644 --- a/cache/regionaltieredcache.go +++ b/cache/regionaltieredcache.go @@ -240,13 +240,13 @@ func (r RegionalTieredCacheEditParamsValue) IsKnown() bool { type RegionalTieredCacheEditResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` + // Whether the API call was successful + Success RegionalTieredCacheEditResponseEnvelopeSuccess `json:"success,required"` // Instructs Cloudflare to check a regional hub data center on the way to your // upper tier. This can help improve performance for smart and custom tiered cache // topologies. - Result RegionalTieredCacheEditResponse `json:"result,required"` - // Whether the API call was successful - Success RegionalTieredCacheEditResponseEnvelopeSuccess `json:"success,required"` - JSON regionalTieredCacheEditResponseEnvelopeJSON `json:"-"` + Result RegionalTieredCacheEditResponse `json:"result"` + JSON regionalTieredCacheEditResponseEnvelopeJSON `json:"-"` } // regionalTieredCacheEditResponseEnvelopeJSON contains the JSON metadata for the @@ -254,8 +254,8 @@ type RegionalTieredCacheEditResponseEnvelope struct { type regionalTieredCacheEditResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field - Result apijson.Field Success apijson.Field + Result apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -291,13 +291,13 @@ type RegionalTieredCacheGetParams struct { type RegionalTieredCacheGetResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` + // Whether the API call was successful + Success RegionalTieredCacheGetResponseEnvelopeSuccess `json:"success,required"` // Instructs Cloudflare to check a regional hub data center on the way to your // upper tier. This can help improve performance for smart and custom tiered cache // topologies. - Result RegionalTieredCacheGetResponse `json:"result,required"` - // Whether the API call was successful - Success RegionalTieredCacheGetResponseEnvelopeSuccess `json:"success,required"` - JSON regionalTieredCacheGetResponseEnvelopeJSON `json:"-"` + Result RegionalTieredCacheGetResponse `json:"result"` + JSON regionalTieredCacheGetResponseEnvelopeJSON `json:"-"` } // regionalTieredCacheGetResponseEnvelopeJSON contains the JSON metadata for the @@ -305,8 +305,8 @@ type RegionalTieredCacheGetResponseEnvelope struct { type regionalTieredCacheGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field - Result apijson.Field Success apijson.Field + Result apijson.Field raw string ExtraFields map[string]apijson.Field } diff --git a/cache/smarttieredcache.go b/cache/smarttieredcache.go index 9078b481859..324849b4b46 100644 --- a/cache/smarttieredcache.go +++ b/cache/smarttieredcache.go @@ -233,11 +233,11 @@ type SmartTieredCacheDeleteParams struct { } type SmartTieredCacheDeleteResponseEnvelope struct { - Errors []shared.ResponseInfo `json:"errors,required"` - Messages []shared.ResponseInfo `json:"messages,required"` - Result SmartTieredCacheDeleteResponse `json:"result,required"` + Errors []shared.ResponseInfo `json:"errors,required"` + Messages []shared.ResponseInfo `json:"messages,required"` // Whether the API call was successful Success SmartTieredCacheDeleteResponseEnvelopeSuccess `json:"success,required"` + Result SmartTieredCacheDeleteResponse `json:"result"` JSON smartTieredCacheDeleteResponseEnvelopeJSON `json:"-"` } @@ -246,8 +246,8 @@ type SmartTieredCacheDeleteResponseEnvelope struct { type smartTieredCacheDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field - Result apijson.Field Success apijson.Field + Result apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -303,11 +303,11 @@ func (r SmartTieredCacheEditParamsValue) IsKnown() bool { } type SmartTieredCacheEditResponseEnvelope struct { - Errors []shared.ResponseInfo `json:"errors,required"` - Messages []shared.ResponseInfo `json:"messages,required"` - Result SmartTieredCacheEditResponse `json:"result,required"` + Errors []shared.ResponseInfo `json:"errors,required"` + Messages []shared.ResponseInfo `json:"messages,required"` // Whether the API call was successful Success SmartTieredCacheEditResponseEnvelopeSuccess `json:"success,required"` + Result SmartTieredCacheEditResponse `json:"result"` JSON smartTieredCacheEditResponseEnvelopeJSON `json:"-"` } @@ -316,8 +316,8 @@ type SmartTieredCacheEditResponseEnvelope struct { type smartTieredCacheEditResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field - Result apijson.Field Success apijson.Field + Result apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -351,11 +351,11 @@ type SmartTieredCacheGetParams struct { } type SmartTieredCacheGetResponseEnvelope struct { - Errors []shared.ResponseInfo `json:"errors,required"` - Messages []shared.ResponseInfo `json:"messages,required"` - Result SmartTieredCacheGetResponse `json:"result,required"` + Errors []shared.ResponseInfo `json:"errors,required"` + Messages []shared.ResponseInfo `json:"messages,required"` // Whether the API call was successful Success SmartTieredCacheGetResponseEnvelopeSuccess `json:"success,required"` + Result SmartTieredCacheGetResponse `json:"result"` JSON smartTieredCacheGetResponseEnvelopeJSON `json:"-"` } @@ -364,8 +364,8 @@ type SmartTieredCacheGetResponseEnvelope struct { type smartTieredCacheGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field - Result apijson.Field Success apijson.Field + Result apijson.Field raw string ExtraFields map[string]apijson.Field } diff --git a/cache/variant.go b/cache/variant.go index 54e8cd0e6fc..acac7f7a0b6 100644 --- a/cache/variant.go +++ b/cache/variant.go @@ -344,15 +344,15 @@ type VariantDeleteParams struct { type VariantDeleteResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` + // Whether the API call was successful + Success VariantDeleteResponseEnvelopeSuccess `json:"success,required"` // Variant support enables caching variants of images with certain file extensions // in addition to the original. This only applies when the origin server sends the // 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but // does not serve the variant requested, the response will not be cached. This will // be indicated with BYPASS cache status in the response headers. - Result CacheVariant `json:"result,required"` - // Whether the API call was successful - Success VariantDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON variantDeleteResponseEnvelopeJSON `json:"-"` + Result CacheVariant `json:"result"` + JSON variantDeleteResponseEnvelopeJSON `json:"-"` } // variantDeleteResponseEnvelopeJSON contains the JSON metadata for the struct @@ -360,8 +360,8 @@ type VariantDeleteResponseEnvelope struct { type variantDeleteResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field - Result apijson.Field Success apijson.Field + Result apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -444,15 +444,15 @@ func (r VariantEditParamsValue) MarshalJSON() (data []byte, err error) { type VariantEditResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` + // Whether the API call was successful + Success VariantEditResponseEnvelopeSuccess `json:"success,required"` // Variant support enables caching variants of images with certain file extensions // in addition to the original. This only applies when the origin server sends the // 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but // does not serve the variant requested, the response will not be cached. This will // be indicated with BYPASS cache status in the response headers. - Result VariantEditResponse `json:"result,required"` - // Whether the API call was successful - Success VariantEditResponseEnvelopeSuccess `json:"success,required"` - JSON variantEditResponseEnvelopeJSON `json:"-"` + Result VariantEditResponse `json:"result"` + JSON variantEditResponseEnvelopeJSON `json:"-"` } // variantEditResponseEnvelopeJSON contains the JSON metadata for the struct @@ -460,8 +460,8 @@ type VariantEditResponseEnvelope struct { type variantEditResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field - Result apijson.Field Success apijson.Field + Result apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -497,15 +497,15 @@ type VariantGetParams struct { type VariantGetResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` + // Whether the API call was successful + Success VariantGetResponseEnvelopeSuccess `json:"success,required"` // Variant support enables caching variants of images with certain file extensions // in addition to the original. This only applies when the origin server sends the // 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but // does not serve the variant requested, the response will not be cached. This will // be indicated with BYPASS cache status in the response headers. - Result VariantGetResponse `json:"result,required"` - // Whether the API call was successful - Success VariantGetResponseEnvelopeSuccess `json:"success,required"` - JSON variantGetResponseEnvelopeJSON `json:"-"` + Result VariantGetResponse `json:"result"` + JSON variantGetResponseEnvelopeJSON `json:"-"` } // variantGetResponseEnvelopeJSON contains the JSON metadata for the struct @@ -513,8 +513,8 @@ type VariantGetResponseEnvelope struct { type variantGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field - Result apijson.Field Success apijson.Field + Result apijson.Field raw string ExtraFields map[string]apijson.Field } diff --git a/event_notifications/r2configuration.go b/event_notifications/r2configuration.go index 2d69cd4f380..a0f02dce6b0 100644 --- a/event_notifications/r2configuration.go +++ b/event_notifications/r2configuration.go @@ -3,16 +3,7 @@ package event_notifications import ( - "context" - "errors" - "fmt" - "net/http" - - "github.com/cloudflare/cloudflare-go/v3/internal/apijson" - "github.com/cloudflare/cloudflare-go/v3/internal/param" - "github.com/cloudflare/cloudflare-go/v3/internal/requestconfig" "github.com/cloudflare/cloudflare-go/v3/option" - "github.com/cloudflare/cloudflare-go/v3/shared" ) // R2ConfigurationService contains methods and other services that help with @@ -35,146 +26,3 @@ func NewR2ConfigurationService(opts ...option.RequestOption) (r *R2Configuration r.Queues = NewR2ConfigurationQueueService(opts...) return } - -// Returns all notification rules for each queue for which bucket notifications are -// produced. -func (r *R2ConfigurationService) Get(ctx context.Context, bucketName string, query R2ConfigurationGetParams, opts ...option.RequestOption) (res *R2ConfigurationGetResponse, err error) { - var env R2ConfigurationGetResponseEnvelope - opts = append(r.Options[:], opts...) - if query.AccountID.Value == "" { - err = errors.New("missing required account_id parameter") - return - } - if bucketName == "" { - err = errors.New("missing required bucket_name parameter") - return - } - path := fmt.Sprintf("accounts/%s/event_notifications/r2/%s/configuration", query.AccountID, bucketName) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type R2ConfigurationGetResponse map[string]map[string]R2ConfigurationGetResponseItem - -type R2ConfigurationGetResponseItem struct { - // Queue ID that will receive notifications based on the configured rules - Queue string `json:"queue,required"` - // Array of rules to drive notifications - Rules []R2ConfigurationGetResponseItemRule `json:"rules,required"` - JSON r2ConfigurationGetResponseItemJSON `json:"-"` -} - -// r2ConfigurationGetResponseItemJSON contains the JSON metadata for the struct -// [R2ConfigurationGetResponseItem] -type r2ConfigurationGetResponseItemJSON struct { - Queue apijson.Field - Rules apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *R2ConfigurationGetResponseItem) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r r2ConfigurationGetResponseItemJSON) RawJSON() string { - return r.raw -} - -type R2ConfigurationGetResponseItemRule struct { - // Array of R2 object actions that will trigger notifications - Actions []R2ConfigurationGetResponseItemRulesAction `json:"actions,required"` - // Notifications will be sent only for objects with this prefix - Prefix string `json:"prefix"` - // Notifications will be sent only for objects with this suffix - Suffix string `json:"suffix"` - JSON r2ConfigurationGetResponseItemRuleJSON `json:"-"` -} - -// r2ConfigurationGetResponseItemRuleJSON contains the JSON metadata for the struct -// [R2ConfigurationGetResponseItemRule] -type r2ConfigurationGetResponseItemRuleJSON struct { - Actions apijson.Field - Prefix apijson.Field - Suffix apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *R2ConfigurationGetResponseItemRule) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r r2ConfigurationGetResponseItemRuleJSON) RawJSON() string { - return r.raw -} - -type R2ConfigurationGetResponseItemRulesAction string - -const ( - R2ConfigurationGetResponseItemRulesActionPutObject R2ConfigurationGetResponseItemRulesAction = "PutObject" - R2ConfigurationGetResponseItemRulesActionCopyObject R2ConfigurationGetResponseItemRulesAction = "CopyObject" - R2ConfigurationGetResponseItemRulesActionDeleteObject R2ConfigurationGetResponseItemRulesAction = "DeleteObject" - R2ConfigurationGetResponseItemRulesActionCompleteMultipartUpload R2ConfigurationGetResponseItemRulesAction = "CompleteMultipartUpload" - R2ConfigurationGetResponseItemRulesActionAbortMultipartUpload R2ConfigurationGetResponseItemRulesAction = "AbortMultipartUpload" -) - -func (r R2ConfigurationGetResponseItemRulesAction) IsKnown() bool { - switch r { - case R2ConfigurationGetResponseItemRulesActionPutObject, R2ConfigurationGetResponseItemRulesActionCopyObject, R2ConfigurationGetResponseItemRulesActionDeleteObject, R2ConfigurationGetResponseItemRulesActionCompleteMultipartUpload, R2ConfigurationGetResponseItemRulesActionAbortMultipartUpload: - return true - } - return false -} - -type R2ConfigurationGetParams struct { - // Identifier. - AccountID param.Field[string] `path:"account_id,required"` -} - -type R2ConfigurationGetResponseEnvelope struct { - Errors []shared.ResponseInfo `json:"errors,required"` - Messages []shared.ResponseInfo `json:"messages,required"` - Result R2ConfigurationGetResponse `json:"result,required"` - // Whether the API call was successful. - Success R2ConfigurationGetResponseEnvelopeSuccess `json:"success,required"` - JSON r2ConfigurationGetResponseEnvelopeJSON `json:"-"` -} - -// r2ConfigurationGetResponseEnvelopeJSON contains the JSON metadata for the struct -// [R2ConfigurationGetResponseEnvelope] -type r2ConfigurationGetResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *R2ConfigurationGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r r2ConfigurationGetResponseEnvelopeJSON) RawJSON() string { - return r.raw -} - -// Whether the API call was successful. -type R2ConfigurationGetResponseEnvelopeSuccess bool - -const ( - R2ConfigurationGetResponseEnvelopeSuccessTrue R2ConfigurationGetResponseEnvelopeSuccess = true -) - -func (r R2ConfigurationGetResponseEnvelopeSuccess) IsKnown() bool { - switch r { - case R2ConfigurationGetResponseEnvelopeSuccessTrue: - return true - } - return false -} diff --git a/event_notifications/r2configuration_test.go b/event_notifications/r2configuration_test.go deleted file mode 100644 index d9140470d5d..00000000000 --- a/event_notifications/r2configuration_test.go +++ /dev/null @@ -1,44 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -package event_notifications_test - -import ( - "context" - "errors" - "os" - "testing" - - "github.com/cloudflare/cloudflare-go/v3" - "github.com/cloudflare/cloudflare-go/v3/event_notifications" - "github.com/cloudflare/cloudflare-go/v3/internal/testutil" - "github.com/cloudflare/cloudflare-go/v3/option" -) - -func TestR2ConfigurationGet(t *testing.T) { - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("user@example.com"), - ) - _, err := client.EventNotifications.R2.Configuration.Get( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - event_notifications.R2ConfigurationGetParams{ - AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/event_notifications/r2configurationqueue.go b/event_notifications/r2configurationqueue.go index 9b088079062..d5d677c6d95 100644 --- a/event_notifications/r2configurationqueue.go +++ b/event_notifications/r2configurationqueue.go @@ -3,18 +3,7 @@ package event_notifications import ( - "context" - "errors" - "fmt" - "net/http" - "reflect" - - "github.com/cloudflare/cloudflare-go/v3/internal/apijson" - "github.com/cloudflare/cloudflare-go/v3/internal/param" - "github.com/cloudflare/cloudflare-go/v3/internal/requestconfig" "github.com/cloudflare/cloudflare-go/v3/option" - "github.com/cloudflare/cloudflare-go/v3/shared" - "github.com/tidwall/gjson" ) // R2ConfigurationQueueService contains methods and other services that help with @@ -35,235 +24,3 @@ func NewR2ConfigurationQueueService(opts ...option.RequestOption) (r *R2Configur r.Options = opts return } - -// Define the rules for a given queue which will determine event notification -// production. -func (r *R2ConfigurationQueueService) Update(ctx context.Context, bucketName string, queueID string, params R2ConfigurationQueueUpdateParams, opts ...option.RequestOption) (res *R2ConfigurationQueueUpdateResponse, err error) { - var env R2ConfigurationQueueUpdateResponseEnvelope - opts = append(r.Options[:], opts...) - if params.AccountID.Value == "" { - err = errors.New("missing required account_id parameter") - return - } - if bucketName == "" { - err = errors.New("missing required bucket_name parameter") - return - } - if queueID == "" { - err = errors.New("missing required queue_id parameter") - return - } - path := fmt.Sprintf("accounts/%s/event_notifications/r2/%s/configuration/queues/%s", params.AccountID, bucketName, queueID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -// Turn off all event notifications configured for delivery to a given queue. No -// further notifications will be produced for the queue once complete. -func (r *R2ConfigurationQueueService) Delete(ctx context.Context, bucketName string, queueID string, body R2ConfigurationQueueDeleteParams, opts ...option.RequestOption) (res *R2ConfigurationQueueDeleteResponseUnion, err error) { - var env R2ConfigurationQueueDeleteResponseEnvelope - opts = append(r.Options[:], opts...) - if body.AccountID.Value == "" { - err = errors.New("missing required account_id parameter") - return - } - if bucketName == "" { - err = errors.New("missing required bucket_name parameter") - return - } - if queueID == "" { - err = errors.New("missing required queue_id parameter") - return - } - path := fmt.Sprintf("accounts/%s/event_notifications/r2/%s/configuration/queues/%s", body.AccountID, bucketName, queueID) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...) - if err != nil { - return - } - res = &env.Result - return -} - -type R2ConfigurationQueueUpdateResponse struct { - EventNotificationDetailID string `json:"event_notification_detail_id"` - JSON r2ConfigurationQueueUpdateResponseJSON `json:"-"` -} - -// r2ConfigurationQueueUpdateResponseJSON contains the JSON metadata for the struct -// [R2ConfigurationQueueUpdateResponse] -type r2ConfigurationQueueUpdateResponseJSON struct { - EventNotificationDetailID apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *R2ConfigurationQueueUpdateResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r r2ConfigurationQueueUpdateResponseJSON) RawJSON() string { - return r.raw -} - -// Union satisfied by [event_notifications.R2ConfigurationQueueDeleteResponseArray] -// or [shared.UnionString]. -type R2ConfigurationQueueDeleteResponseUnion interface { - ImplementsEventNotificationsR2ConfigurationQueueDeleteResponseUnion() -} - -func init() { - apijson.RegisterUnion( - reflect.TypeOf((*R2ConfigurationQueueDeleteResponseUnion)(nil)).Elem(), - "", - apijson.UnionVariant{ - TypeFilter: gjson.JSON, - Type: reflect.TypeOf(R2ConfigurationQueueDeleteResponseArray{}), - }, - apijson.UnionVariant{ - TypeFilter: gjson.String, - Type: reflect.TypeOf(shared.UnionString("")), - }, - ) -} - -type R2ConfigurationQueueDeleteResponseArray []interface{} - -func (r R2ConfigurationQueueDeleteResponseArray) ImplementsEventNotificationsR2ConfigurationQueueDeleteResponseUnion() { -} - -type R2ConfigurationQueueUpdateParams struct { - // Identifier. - AccountID param.Field[string] `path:"account_id,required"` - // Array of rules to drive notifications - Rules param.Field[[]R2ConfigurationQueueUpdateParamsRule] `json:"rules"` -} - -func (r R2ConfigurationQueueUpdateParams) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type R2ConfigurationQueueUpdateParamsRule struct { - // Array of R2 object actions that will trigger notifications - Actions param.Field[[]R2ConfigurationQueueUpdateParamsRulesAction] `json:"actions,required"` - // Notifications will be sent only for objects with this prefix - Prefix param.Field[string] `json:"prefix"` - // Notifications will be sent only for objects with this suffix - Suffix param.Field[string] `json:"suffix"` -} - -func (r R2ConfigurationQueueUpdateParamsRule) MarshalJSON() (data []byte, err error) { - return apijson.MarshalRoot(r) -} - -type R2ConfigurationQueueUpdateParamsRulesAction string - -const ( - R2ConfigurationQueueUpdateParamsRulesActionPutObject R2ConfigurationQueueUpdateParamsRulesAction = "PutObject" - R2ConfigurationQueueUpdateParamsRulesActionCopyObject R2ConfigurationQueueUpdateParamsRulesAction = "CopyObject" - R2ConfigurationQueueUpdateParamsRulesActionDeleteObject R2ConfigurationQueueUpdateParamsRulesAction = "DeleteObject" - R2ConfigurationQueueUpdateParamsRulesActionCompleteMultipartUpload R2ConfigurationQueueUpdateParamsRulesAction = "CompleteMultipartUpload" - R2ConfigurationQueueUpdateParamsRulesActionAbortMultipartUpload R2ConfigurationQueueUpdateParamsRulesAction = "AbortMultipartUpload" -) - -func (r R2ConfigurationQueueUpdateParamsRulesAction) IsKnown() bool { - switch r { - case R2ConfigurationQueueUpdateParamsRulesActionPutObject, R2ConfigurationQueueUpdateParamsRulesActionCopyObject, R2ConfigurationQueueUpdateParamsRulesActionDeleteObject, R2ConfigurationQueueUpdateParamsRulesActionCompleteMultipartUpload, R2ConfigurationQueueUpdateParamsRulesActionAbortMultipartUpload: - return true - } - return false -} - -type R2ConfigurationQueueUpdateResponseEnvelope struct { - Errors []shared.ResponseInfo `json:"errors,required"` - Messages []shared.ResponseInfo `json:"messages,required"` - Result R2ConfigurationQueueUpdateResponse `json:"result,required"` - // Whether the API call was successful. - Success R2ConfigurationQueueUpdateResponseEnvelopeSuccess `json:"success,required"` - JSON r2ConfigurationQueueUpdateResponseEnvelopeJSON `json:"-"` -} - -// r2ConfigurationQueueUpdateResponseEnvelopeJSON contains the JSON metadata for -// the struct [R2ConfigurationQueueUpdateResponseEnvelope] -type r2ConfigurationQueueUpdateResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *R2ConfigurationQueueUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r r2ConfigurationQueueUpdateResponseEnvelopeJSON) RawJSON() string { - return r.raw -} - -// Whether the API call was successful. -type R2ConfigurationQueueUpdateResponseEnvelopeSuccess bool - -const ( - R2ConfigurationQueueUpdateResponseEnvelopeSuccessTrue R2ConfigurationQueueUpdateResponseEnvelopeSuccess = true -) - -func (r R2ConfigurationQueueUpdateResponseEnvelopeSuccess) IsKnown() bool { - switch r { - case R2ConfigurationQueueUpdateResponseEnvelopeSuccessTrue: - return true - } - return false -} - -type R2ConfigurationQueueDeleteParams struct { - // Identifier. - AccountID param.Field[string] `path:"account_id,required"` -} - -type R2ConfigurationQueueDeleteResponseEnvelope struct { - Errors []shared.ResponseInfo `json:"errors,required"` - Messages []shared.ResponseInfo `json:"messages,required"` - Result R2ConfigurationQueueDeleteResponseUnion `json:"result,required"` - // Whether the API call was successful. - Success R2ConfigurationQueueDeleteResponseEnvelopeSuccess `json:"success,required"` - JSON r2ConfigurationQueueDeleteResponseEnvelopeJSON `json:"-"` -} - -// r2ConfigurationQueueDeleteResponseEnvelopeJSON contains the JSON metadata for -// the struct [R2ConfigurationQueueDeleteResponseEnvelope] -type r2ConfigurationQueueDeleteResponseEnvelopeJSON struct { - Errors apijson.Field - Messages apijson.Field - Result apijson.Field - Success apijson.Field - raw string - ExtraFields map[string]apijson.Field -} - -func (r *R2ConfigurationQueueDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r r2ConfigurationQueueDeleteResponseEnvelopeJSON) RawJSON() string { - return r.raw -} - -// Whether the API call was successful. -type R2ConfigurationQueueDeleteResponseEnvelopeSuccess bool - -const ( - R2ConfigurationQueueDeleteResponseEnvelopeSuccessTrue R2ConfigurationQueueDeleteResponseEnvelopeSuccess = true -) - -func (r R2ConfigurationQueueDeleteResponseEnvelopeSuccess) IsKnown() bool { - switch r { - case R2ConfigurationQueueDeleteResponseEnvelopeSuccessTrue: - return true - } - return false -} diff --git a/event_notifications/r2configurationqueue_test.go b/event_notifications/r2configurationqueue_test.go deleted file mode 100644 index f99248f7cd8..00000000000 --- a/event_notifications/r2configurationqueue_test.go +++ /dev/null @@ -1,88 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -package event_notifications_test - -import ( - "context" - "errors" - "os" - "testing" - - "github.com/cloudflare/cloudflare-go/v3" - "github.com/cloudflare/cloudflare-go/v3/event_notifications" - "github.com/cloudflare/cloudflare-go/v3/internal/testutil" - "github.com/cloudflare/cloudflare-go/v3/option" -) - -func TestR2ConfigurationQueueUpdateWithOptionalParams(t *testing.T) { - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("user@example.com"), - ) - _, err := client.EventNotifications.R2.Configuration.Queues.Update( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", - event_notifications.R2ConfigurationQueueUpdateParams{ - AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), - Rules: cloudflare.F([]event_notifications.R2ConfigurationQueueUpdateParamsRule{{ - Actions: cloudflare.F([]event_notifications.R2ConfigurationQueueUpdateParamsRulesAction{event_notifications.R2ConfigurationQueueUpdateParamsRulesActionPutObject, event_notifications.R2ConfigurationQueueUpdateParamsRulesActionCopyObject}), - Prefix: cloudflare.F("img/"), - Suffix: cloudflare.F(".jpeg"), - }, { - Actions: cloudflare.F([]event_notifications.R2ConfigurationQueueUpdateParamsRulesAction{event_notifications.R2ConfigurationQueueUpdateParamsRulesActionPutObject, event_notifications.R2ConfigurationQueueUpdateParamsRulesActionCopyObject}), - Prefix: cloudflare.F("img/"), - Suffix: cloudflare.F(".jpeg"), - }, { - Actions: cloudflare.F([]event_notifications.R2ConfigurationQueueUpdateParamsRulesAction{event_notifications.R2ConfigurationQueueUpdateParamsRulesActionPutObject, event_notifications.R2ConfigurationQueueUpdateParamsRulesActionCopyObject}), - Prefix: cloudflare.F("img/"), - Suffix: cloudflare.F(".jpeg"), - }}), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} - -func TestR2ConfigurationQueueDelete(t *testing.T) { - baseURL := "http://localhost:4010" - if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { - baseURL = envURL - } - if !testutil.CheckTestServer(t, baseURL) { - return - } - client := cloudflare.NewClient( - option.WithBaseURL(baseURL), - option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"), - option.WithAPIEmail("user@example.com"), - ) - _, err := client.EventNotifications.R2.Configuration.Queues.Delete( - context.TODO(), - "023e105f4ecef8ad9ca31a8372d0c353", - "023e105f4ecef8ad9ca31a8372d0c353", - event_notifications.R2ConfigurationQueueDeleteParams{ - AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), - }, - ) - if err != nil { - var apierr *cloudflare.Error - if errors.As(err, &apierr) { - t.Log(string(apierr.DumpRequest(true))) - } - t.Fatalf("err should be nil: %s", err.Error()) - } -} diff --git a/hyperdrive/config.go b/hyperdrive/config.go index f23f024c3e1..aa625137154 100644 --- a/hyperdrive/config.go +++ b/hyperdrive/config.go @@ -283,7 +283,7 @@ type ConfigDeleteParams struct { type ConfigDeleteResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` - Result interface{} `json:"result,required"` + Result interface{} `json:"result,required,nullable"` // Whether the API call was successful Success ConfigDeleteResponseEnvelopeSuccess `json:"success,required"` JSON configDeleteResponseEnvelopeJSON `json:"-"` diff --git a/kv/namespace.go b/kv/namespace.go index 5ec1ca96a41..07d6d7a87fd 100644 --- a/kv/namespace.go +++ b/kv/namespace.go @@ -182,43 +182,9 @@ func (r namespaceJSON) RawJSON() string { return r.raw } -type NamespaceUpdateResponse struct { - JSON namespaceUpdateResponseJSON `json:"-"` -} - -// namespaceUpdateResponseJSON contains the JSON metadata for the struct -// [NamespaceUpdateResponse] -type namespaceUpdateResponseJSON struct { - raw string - ExtraFields map[string]apijson.Field -} - -func (r *NamespaceUpdateResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r namespaceUpdateResponseJSON) RawJSON() string { - return r.raw -} +type NamespaceUpdateResponse = interface{} -type NamespaceDeleteResponse struct { - JSON namespaceDeleteResponseJSON `json:"-"` -} - -// namespaceDeleteResponseJSON contains the JSON metadata for the struct -// [NamespaceDeleteResponse] -type namespaceDeleteResponseJSON struct { - raw string - ExtraFields map[string]apijson.Field -} - -func (r *NamespaceDeleteResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r namespaceDeleteResponseJSON) RawJSON() string { - return r.raw -} +type NamespaceDeleteResponse = interface{} type NamespaceNewParams struct { // Identifier @@ -290,7 +256,7 @@ type NamespaceUpdateResponseEnvelope struct { Messages []shared.ResponseInfo `json:"messages,required"` // Whether the API call was successful Success NamespaceUpdateResponseEnvelopeSuccess `json:"success,required"` - Result NamespaceUpdateResponse `json:"result,nullable"` + Result NamespaceUpdateResponse `json:"result"` JSON namespaceUpdateResponseEnvelopeJSON `json:"-"` } @@ -391,7 +357,7 @@ type NamespaceDeleteResponseEnvelope struct { Messages []shared.ResponseInfo `json:"messages,required"` // Whether the API call was successful Success NamespaceDeleteResponseEnvelopeSuccess `json:"success,required"` - Result NamespaceDeleteResponse `json:"result,nullable"` + Result NamespaceDeleteResponse `json:"result"` JSON namespaceDeleteResponseEnvelopeJSON `json:"-"` } diff --git a/kv/namespacebulk.go b/kv/namespacebulk.go index 5ae3a59687b..209364ba27e 100644 --- a/kv/namespacebulk.go +++ b/kv/namespacebulk.go @@ -82,43 +82,9 @@ func (r *NamespaceBulkService) Delete(ctx context.Context, namespaceID string, b return } -type NamespaceBulkUpdateResponse struct { - JSON namespaceBulkUpdateResponseJSON `json:"-"` -} - -// namespaceBulkUpdateResponseJSON contains the JSON metadata for the struct -// [NamespaceBulkUpdateResponse] -type namespaceBulkUpdateResponseJSON struct { - raw string - ExtraFields map[string]apijson.Field -} - -func (r *NamespaceBulkUpdateResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r namespaceBulkUpdateResponseJSON) RawJSON() string { - return r.raw -} +type NamespaceBulkUpdateResponse = interface{} -type NamespaceBulkDeleteResponse struct { - JSON namespaceBulkDeleteResponseJSON `json:"-"` -} - -// namespaceBulkDeleteResponseJSON contains the JSON metadata for the struct -// [NamespaceBulkDeleteResponse] -type namespaceBulkDeleteResponseJSON struct { - raw string - ExtraFields map[string]apijson.Field -} - -func (r *NamespaceBulkDeleteResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r namespaceBulkDeleteResponseJSON) RawJSON() string { - return r.raw -} +type NamespaceBulkDeleteResponse = interface{} type NamespaceBulkUpdateParams struct { // Identifier @@ -159,7 +125,7 @@ type NamespaceBulkUpdateResponseEnvelope struct { Messages []shared.ResponseInfo `json:"messages,required"` // Whether the API call was successful Success NamespaceBulkUpdateResponseEnvelopeSuccess `json:"success,required"` - Result NamespaceBulkUpdateResponse `json:"result,nullable"` + Result NamespaceBulkUpdateResponse `json:"result"` JSON namespaceBulkUpdateResponseEnvelopeJSON `json:"-"` } @@ -207,7 +173,7 @@ type NamespaceBulkDeleteResponseEnvelope struct { Messages []shared.ResponseInfo `json:"messages,required"` // Whether the API call was successful Success NamespaceBulkDeleteResponseEnvelopeSuccess `json:"success,required"` - Result NamespaceBulkDeleteResponse `json:"result,nullable"` + Result NamespaceBulkDeleteResponse `json:"result"` JSON namespaceBulkDeleteResponseEnvelopeJSON `json:"-"` } diff --git a/kv/namespacevalue.go b/kv/namespacevalue.go index 7178ffe9997..db2b229d52f 100644 --- a/kv/namespacevalue.go +++ b/kv/namespacevalue.go @@ -115,43 +115,9 @@ func (r *NamespaceValueService) Get(ctx context.Context, namespaceID string, key return } -type NamespaceValueUpdateResponse struct { - JSON namespaceValueUpdateResponseJSON `json:"-"` -} - -// namespaceValueUpdateResponseJSON contains the JSON metadata for the struct -// [NamespaceValueUpdateResponse] -type namespaceValueUpdateResponseJSON struct { - raw string - ExtraFields map[string]apijson.Field -} - -func (r *NamespaceValueUpdateResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r namespaceValueUpdateResponseJSON) RawJSON() string { - return r.raw -} +type NamespaceValueUpdateResponse = interface{} -type NamespaceValueDeleteResponse struct { - JSON namespaceValueDeleteResponseJSON `json:"-"` -} - -// namespaceValueDeleteResponseJSON contains the JSON metadata for the struct -// [NamespaceValueDeleteResponse] -type namespaceValueDeleteResponseJSON struct { - raw string - ExtraFields map[string]apijson.Field -} - -func (r *NamespaceValueDeleteResponse) UnmarshalJSON(data []byte) (err error) { - return apijson.UnmarshalRoot(data, r) -} - -func (r namespaceValueDeleteResponseJSON) RawJSON() string { - return r.raw -} +type NamespaceValueDeleteResponse = interface{} type NamespaceValueUpdateParams struct { // Identifier @@ -171,7 +137,7 @@ type NamespaceValueUpdateResponseEnvelope struct { Messages []shared.ResponseInfo `json:"messages,required"` // Whether the API call was successful Success NamespaceValueUpdateResponseEnvelopeSuccess `json:"success,required"` - Result NamespaceValueUpdateResponse `json:"result,nullable"` + Result NamespaceValueUpdateResponse `json:"result"` JSON namespaceValueUpdateResponseEnvelopeJSON `json:"-"` } @@ -219,7 +185,7 @@ type NamespaceValueDeleteResponseEnvelope struct { Messages []shared.ResponseInfo `json:"messages,required"` // Whether the API call was successful Success NamespaceValueDeleteResponseEnvelopeSuccess `json:"success,required"` - Result NamespaceValueDeleteResponse `json:"result,nullable"` + Result NamespaceValueDeleteResponse `json:"result"` JSON namespaceValueDeleteResponseEnvelopeJSON `json:"-"` } diff --git a/origin_post_quantum_encryption/originpostquantumencryption.go b/origin_post_quantum_encryption/originpostquantumencryption.go index b38ba27624a..80a9208e3c4 100644 --- a/origin_post_quantum_encryption/originpostquantumencryption.go +++ b/origin_post_quantum_encryption/originpostquantumencryption.go @@ -40,7 +40,7 @@ func NewOriginPostQuantumEncryptionService(opts ...option.RequestOption) (r *Ori // connections when the origin supports and prefers PQ), supported means that PQ // algorithms are advertised but only used when requested by the origin, and off // means that PQ algorithms are not advertised -func (r *OriginPostQuantumEncryptionService) Update(ctx context.Context, params OriginPostQuantumEncryptionUpdateParams, opts ...option.RequestOption) (res *interface{}, err error) { +func (r *OriginPostQuantumEncryptionService) Update(ctx context.Context, params OriginPostQuantumEncryptionUpdateParams, opts ...option.RequestOption) (res *OriginPostQuantumEncryptionUpdateResponse, err error) { var env OriginPostQuantumEncryptionUpdateResponseEnvelope opts = append(r.Options[:], opts...) if params.ZoneID.Value == "" { @@ -62,7 +62,7 @@ func (r *OriginPostQuantumEncryptionService) Update(ctx context.Context, params // connections when the origin supports and prefers PQ), supported means that PQ // algorithms are advertised but only used when requested by the origin, and off // means that PQ algorithms are not advertised -func (r *OriginPostQuantumEncryptionService) Get(ctx context.Context, query OriginPostQuantumEncryptionGetParams, opts ...option.RequestOption) (res *interface{}, err error) { +func (r *OriginPostQuantumEncryptionService) Get(ctx context.Context, query OriginPostQuantumEncryptionGetParams, opts ...option.RequestOption) (res *OriginPostQuantumEncryptionGetResponse, err error) { var env OriginPostQuantumEncryptionGetResponseEnvelope opts = append(r.Options[:], opts...) if query.ZoneID.Value == "" { @@ -78,6 +78,10 @@ func (r *OriginPostQuantumEncryptionService) Get(ctx context.Context, query Orig return } +type OriginPostQuantumEncryptionUpdateResponse = interface{} + +type OriginPostQuantumEncryptionGetResponse = interface{} + type OriginPostQuantumEncryptionUpdateParams struct { // Identifier ZoneID param.Field[string] `path:"zone_id,required"` @@ -109,9 +113,9 @@ func (r OriginPostQuantumEncryptionUpdateParamsValue) IsKnown() bool { type OriginPostQuantumEncryptionUpdateResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` - Result interface{} `json:"result,required"` // Whether the API call was successful Success OriginPostQuantumEncryptionUpdateResponseEnvelopeSuccess `json:"success,required"` + Result OriginPostQuantumEncryptionUpdateResponse `json:"result"` JSON originPostQuantumEncryptionUpdateResponseEnvelopeJSON `json:"-"` } @@ -120,8 +124,8 @@ type OriginPostQuantumEncryptionUpdateResponseEnvelope struct { type originPostQuantumEncryptionUpdateResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field - Result apijson.Field Success apijson.Field + Result apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -157,9 +161,9 @@ type OriginPostQuantumEncryptionGetParams struct { type OriginPostQuantumEncryptionGetResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` - Result interface{} `json:"result,required"` // Whether the API call was successful Success OriginPostQuantumEncryptionGetResponseEnvelopeSuccess `json:"success,required"` + Result OriginPostQuantumEncryptionGetResponse `json:"result"` JSON originPostQuantumEncryptionGetResponseEnvelopeJSON `json:"-"` } @@ -168,8 +172,8 @@ type OriginPostQuantumEncryptionGetResponseEnvelope struct { type originPostQuantumEncryptionGetResponseEnvelopeJSON struct { Errors apijson.Field Messages apijson.Field - Result apijson.Field Success apijson.Field + Result apijson.Field raw string ExtraFields map[string]apijson.Field } diff --git a/pages/project.go b/pages/project.go index 27a68c3dc08..fa5de7fb3ae 100644 --- a/pages/project.go +++ b/pages/project.go @@ -2030,7 +2030,7 @@ type ProjectDeleteParams struct { type ProjectDeleteResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` - Result ProjectDeleteResponse `json:"result,required,nullable"` + Result ProjectDeleteResponse `json:"result,required"` // Whether the API call was successful Success ProjectDeleteResponseEnvelopeSuccess `json:"success,required"` JSON projectDeleteResponseEnvelopeJSON `json:"-"` @@ -2182,7 +2182,7 @@ type ProjectPurgeBuildCacheParams struct { type ProjectPurgeBuildCacheResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` - Result ProjectPurgeBuildCacheResponse `json:"result,required,nullable"` + Result ProjectPurgeBuildCacheResponse `json:"result,required"` // Whether the API call was successful Success ProjectPurgeBuildCacheResponseEnvelopeSuccess `json:"success,required"` JSON projectPurgeBuildCacheResponseEnvelopeJSON `json:"-"` diff --git a/pages/projectdeployment.go b/pages/projectdeployment.go index 5cdeff044ac..0e6b29a6712 100644 --- a/pages/projectdeployment.go +++ b/pages/projectdeployment.go @@ -305,7 +305,7 @@ type ProjectDeploymentDeleteParams struct { type ProjectDeploymentDeleteResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` - Result ProjectDeploymentDeleteResponse `json:"result,required,nullable"` + Result ProjectDeploymentDeleteResponse `json:"result,required"` // Whether the API call was successful Success ProjectDeploymentDeleteResponseEnvelopeSuccess `json:"success,required"` JSON projectDeploymentDeleteResponseEnvelopeJSON `json:"-"` diff --git a/pages/projectdomain.go b/pages/projectdomain.go index 09934172d23..b81cd50846e 100644 --- a/pages/projectdomain.go +++ b/pages/projectdomain.go @@ -927,7 +927,7 @@ type ProjectDomainDeleteParams struct { type ProjectDomainDeleteResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` - Result ProjectDomainDeleteResponse `json:"result,required,nullable"` + Result ProjectDomainDeleteResponse `json:"result,required"` // Whether the API call was successful Success ProjectDomainDeleteResponseEnvelopeSuccess `json:"success,required"` JSON projectDomainDeleteResponseEnvelopeJSON `json:"-"` diff --git a/shared/union.go b/shared/union.go index 03f1bc19862..8f8eaeea59c 100644 --- a/shared/union.go +++ b/shared/union.go @@ -56,12 +56,11 @@ func (UnionString) ImplementsZeroTrustAccessApplicationUpdateParamsBodyDeviceEnr } func (UnionString) ImplementsZeroTrustAccessApplicationUpdateParamsBodyBrowserIsolationPermissionsApplicationPolicyUnion() { } -func (UnionString) ImplementsZeroTrustTunnelTokenGetResponseUnion() {} -func (UnionString) ImplementsZeroTrustTunnelManagementNewResponseUnion() {} -func (UnionString) ImplementsRadarRankingTimeseriesGroupsResponseSerie0Union() {} -func (UnionString) ImplementsHostnamesSettingValueUnionParam() {} -func (UnionString) ImplementsHostnamesSettingValueUnion() {} -func (UnionString) ImplementsEventNotificationsR2ConfigurationQueueDeleteResponseUnion() {} +func (UnionString) ImplementsZeroTrustTunnelTokenGetResponseUnion() {} +func (UnionString) ImplementsZeroTrustTunnelManagementNewResponseUnion() {} +func (UnionString) ImplementsRadarRankingTimeseriesGroupsResponseSerie0Union() {} +func (UnionString) ImplementsHostnamesSettingValueUnionParam() {} +func (UnionString) ImplementsHostnamesSettingValueUnion() {} type UnionInt int64 diff --git a/vectorize/index.go b/vectorize/index.go index 4cb328729ee..71dadd31572 100644 --- a/vectorize/index.go +++ b/vectorize/index.go @@ -450,7 +450,7 @@ func (r indexQueryResponseJSON) RawJSON() string { type IndexQueryResponseMatch struct { // Identifier for a Vector ID string `json:"id"` - Metadata interface{} `json:"metadata,nullable"` + Metadata interface{} `json:"metadata"` Namespace string `json:"namespace,nullable"` // The score of the vector according to the index's distance metric Score float64 `json:"score"` @@ -662,7 +662,7 @@ type IndexDeleteParams struct { type IndexDeleteResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` - Result interface{} `json:"result,required"` + Result interface{} `json:"result,required,nullable"` // Whether the API call was successful Success IndexDeleteResponseEnvelopeSuccess `json:"success,required"` JSON indexDeleteResponseEnvelopeJSON `json:"-"` diff --git a/zero_trust/accessapplication.go b/zero_trust/accessapplication.go index 79f68375495..0e5d153ca94 100644 --- a/zero_trust/accessapplication.go +++ b/zero_trust/accessapplication.go @@ -16732,7 +16732,7 @@ type AccessApplicationRevokeTokensParams struct { } type AccessApplicationRevokeTokensResponseEnvelope struct { - Result AccessApplicationRevokeTokensResponse `json:"result,nullable"` + Result AccessApplicationRevokeTokensResponse `json:"result"` Success AccessApplicationRevokeTokensResponseEnvelopeSuccess `json:"success"` JSON accessApplicationRevokeTokensResponseEnvelopeJSON `json:"-"` } diff --git a/zero_trust/device.go b/zero_trust/device.go index 4230f762f48..debf15b6276 100644 --- a/zero_trust/device.go +++ b/zero_trust/device.go @@ -232,7 +232,7 @@ type DeviceGetParams struct { type DeviceGetResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` - Result interface{} `json:"result,required"` + Result interface{} `json:"result,required,nullable"` // Whether the API call was successful. Success DeviceGetResponseEnvelopeSuccess `json:"success,required"` JSON deviceGetResponseEnvelopeJSON `json:"-"` diff --git a/zero_trust/devicepolicycertificate.go b/zero_trust/devicepolicycertificate.go index 3e8ea4f4393..11ec709a4fb 100644 --- a/zero_trust/devicepolicycertificate.go +++ b/zero_trust/devicepolicycertificate.go @@ -91,7 +91,7 @@ func (r DevicePolicyCertificateUpdateParams) MarshalJSON() (data []byte, err err type DevicePolicyCertificateUpdateResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` - Result interface{} `json:"result,required"` + Result interface{} `json:"result,required,nullable"` // Whether the API call was successful. Success DevicePolicyCertificateUpdateResponseEnvelopeSuccess `json:"success,required"` JSON devicePolicyCertificateUpdateResponseEnvelopeJSON `json:"-"` @@ -134,7 +134,7 @@ func (r DevicePolicyCertificateUpdateResponseEnvelopeSuccess) IsKnown() bool { type DevicePolicyCertificateGetResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` - Result interface{} `json:"result,required"` + Result interface{} `json:"result,required,nullable"` // Whether the API call was successful. Success DevicePolicyCertificateGetResponseEnvelopeSuccess `json:"success,required"` JSON devicePolicyCertificateGetResponseEnvelopeJSON `json:"-"` diff --git a/zero_trust/devicepostureintegration.go b/zero_trust/devicepostureintegration.go index b03352bd4db..d8c7e3a23b2 100644 --- a/zero_trust/devicepostureintegration.go +++ b/zero_trust/devicepostureintegration.go @@ -501,7 +501,7 @@ type DevicePostureIntegrationDeleteParams struct { type DevicePostureIntegrationDeleteResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` - Result interface{} `json:"result,required"` + Result interface{} `json:"result,required,nullable"` // Whether the API call was successful. Success DevicePostureIntegrationDeleteResponseEnvelopeSuccess `json:"success,required"` JSON devicePostureIntegrationDeleteResponseEnvelopeJSON `json:"-"` diff --git a/zero_trust/devicerevoke.go b/zero_trust/devicerevoke.go index 78badb0be61..d10920ba113 100644 --- a/zero_trust/devicerevoke.go +++ b/zero_trust/devicerevoke.go @@ -64,7 +64,7 @@ func (r DeviceRevokeNewParams) MarshalJSON() (data []byte, err error) { type DeviceRevokeNewResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` - Result interface{} `json:"result,required"` + Result interface{} `json:"result,required,nullable"` // Whether the API call was successful. Success DeviceRevokeNewResponseEnvelopeSuccess `json:"success,required"` JSON deviceRevokeNewResponseEnvelopeJSON `json:"-"` diff --git a/zero_trust/deviceunrevoke.go b/zero_trust/deviceunrevoke.go index e68ce437c73..2a1dd945c20 100644 --- a/zero_trust/deviceunrevoke.go +++ b/zero_trust/deviceunrevoke.go @@ -64,7 +64,7 @@ func (r DeviceUnrevokeNewParams) MarshalJSON() (data []byte, err error) { type DeviceUnrevokeNewResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` - Result interface{} `json:"result,required"` + Result interface{} `json:"result,required,nullable"` // Whether the API call was successful. Success DeviceUnrevokeNewResponseEnvelopeSuccess `json:"success,required"` JSON deviceUnrevokeNewResponseEnvelopeJSON `json:"-"` diff --git a/zero_trust/dlpprofilecustom.go b/zero_trust/dlpprofilecustom.go index 4ad35927d82..156464c8818 100644 --- a/zero_trust/dlpprofilecustom.go +++ b/zero_trust/dlpprofilecustom.go @@ -667,7 +667,7 @@ type DLPProfileCustomDeleteResponseEnvelope struct { Messages []shared.ResponseInfo `json:"messages,required"` // Whether the API call was successful Success DLPProfileCustomDeleteResponseEnvelopeSuccess `json:"success,required"` - Result DLPProfileCustomDeleteResponse `json:"result,nullable"` + Result DLPProfileCustomDeleteResponse `json:"result"` JSON dlpProfileCustomDeleteResponseEnvelopeJSON `json:"-"` } diff --git a/zero_trust/riskscoring.go b/zero_trust/riskscoring.go index 61742cae231..d492c0f5ee4 100644 --- a/zero_trust/riskscoring.go +++ b/zero_trust/riskscoring.go @@ -264,7 +264,7 @@ type RiskScoringResetResponseEnvelope struct { Messages []shared.ResponseInfo `json:"messages,required"` // Whether the API call was successful Success RiskScoringResetResponseEnvelopeSuccess `json:"success,required"` - Result RiskScoringResetResponse `json:"result,nullable"` + Result RiskScoringResetResponse `json:"result"` JSON riskScoringResetResponseEnvelopeJSON `json:"-"` } diff --git a/zero_trust/riskscoringintegration.go b/zero_trust/riskscoringintegration.go index 648c53dcecf..d0553b5f40e 100644 --- a/zero_trust/riskscoringintegration.go +++ b/zero_trust/riskscoringintegration.go @@ -532,7 +532,7 @@ type RiskScoringIntegrationDeleteResponseEnvelope struct { Messages []shared.ResponseInfo `json:"messages,required"` // Whether the API call was successful Success RiskScoringIntegrationDeleteResponseEnvelopeSuccess `json:"success,required"` - Result RiskScoringIntegrationDeleteResponse `json:"result,nullable"` + Result RiskScoringIntegrationDeleteResponse `json:"result"` JSON riskScoringIntegrationDeleteResponseEnvelopeJSON `json:"-"` }