diff --git a/.stats.yml b/.stats.yml index 9d826750612..4ed54090120 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1490 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f9dc65d353b377858f3d63d594de47559ed3a9d562295719690867315b8ec2fe.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d7f8b3901624cc79465181c32dea2901c658e382a5ed3acada4692760b77f9c0.yml diff --git a/r2/bucket.go b/r2/bucket.go index 4de80eebac9..c44f7f66084 100644 --- a/r2/bucket.go +++ b/r2/bucket.go @@ -49,8 +49,8 @@ func NewBucketService(opts ...option.RequestOption) (r *BucketService) { // Creates a new R2 bucket. func (r *BucketService) New(ctx context.Context, params BucketNewParams, opts ...option.RequestOption) (res *Bucket, err error) { var env BucketNewResponseEnvelope - if params.CfR2Jurisdiction.Present { - opts = append(opts, option.WithHeader("cf-r2-jurisdiction", fmt.Sprintf("%s", params.CfR2Jurisdiction))) + if params.Jurisdiction.Present { + opts = append(opts, option.WithHeader("jurisdiction", fmt.Sprintf("%s", params.Jurisdiction))) } opts = append(r.Options[:], opts...) if params.AccountID.Value == "" { @@ -233,7 +233,7 @@ type BucketNewParams struct { // Storage class for newly uploaded objects, unless specified otherwise. StorageClass param.Field[BucketNewParamsStorageClass] `json:"storageClass"` // Creates the bucket in the provided jurisdiction - CfR2Jurisdiction param.Field[BucketNewParamsCfR2Jurisdiction] `header:"cf-r2-jurisdiction"` + Jurisdiction param.Field[BucketNewParamsCfR2Jurisdiction] `header:"cf-r2-jurisdiction"` } func (r BucketNewParams) MarshalJSON() (data []byte, err error) { diff --git a/r2/bucket_test.go b/r2/bucket_test.go index 8ba885486be..c0ee487ced4 100644 --- a/r2/bucket_test.go +++ b/r2/bucket_test.go @@ -29,11 +29,11 @@ func TestBucketNewWithOptionalParams(t *testing.T) { option.WithAPIEmail("user@example.com"), ) _, err := client.R2.Buckets.New(context.TODO(), r2.BucketNewParams{ - AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), - Name: cloudflare.F("example-bucket"), - LocationHint: cloudflare.F(r2.BucketNewParamsLocationHintApac), - StorageClass: cloudflare.F(r2.BucketNewParamsStorageClassStandard), - CfR2Jurisdiction: cloudflare.F(r2.BucketNewParamsCfR2JurisdictionDefault), + AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), + Name: cloudflare.F("example-bucket"), + LocationHint: cloudflare.F(r2.BucketNewParamsLocationHintApac), + StorageClass: cloudflare.F(r2.BucketNewParamsStorageClassStandard), + Jurisdiction: cloudflare.F(r2.BucketNewParamsCfR2JurisdictionDefault), }) if err != nil { var apierr *cloudflare.Error