Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7c11c3b

Browse files
committedMar 13, 2025
feat(api): api update (#3989)
1 parent a380ee9 commit 7c11c3b

File tree

5 files changed

+6
-612
lines changed

5 files changed

+6
-612
lines changed
 

‎.stats.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 1574
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-75bcce96c458e20e6ca2d5c0629c5602bd90976212d315ce4d99b200b6721e53.yml
1+
configured_endpoints: 1571
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b276e45a3a6e2091e331e521767903c1b7a5f7bc64bc93a2dd46bf98476fe3ce.yml

‎api.md

-6
Original file line numberDiff line numberDiff line change
@@ -4373,18 +4373,12 @@ Methods:
43734373
Response Types:
43744374

43754375
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2">r2</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2#BucketDomainCustomNewResponse">BucketDomainCustomNewResponse</a>
4376-
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2">r2</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2#BucketDomainCustomUpdateResponse">BucketDomainCustomUpdateResponse</a>
43774376
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2">r2</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2#BucketDomainCustomListResponse">BucketDomainCustomListResponse</a>
4378-
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2">r2</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2#BucketDomainCustomDeleteResponse">BucketDomainCustomDeleteResponse</a>
4379-
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2">r2</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2#BucketDomainCustomGetResponse">BucketDomainCustomGetResponse</a>
43804377

43814378
Methods:
43824379

43834380
- <code title="post /accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom">client.R2.Buckets.Domains.Custom.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2#BucketDomainCustomService.New">New</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, bucketName <a href="https://pkg.go.dev/builtin#string">string</a>, params <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2">r2</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2#BucketDomainCustomNewParams">BucketDomainCustomNewParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2">r2</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2#BucketDomainCustomNewResponse">BucketDomainCustomNewResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
4384-
- <code title="put /accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom/{domain_name}">client.R2.Buckets.Domains.Custom.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2#BucketDomainCustomService.Update">Update</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, bucketName <a href="https://pkg.go.dev/builtin#string">string</a>, domainName <a href="https://pkg.go.dev/builtin#string">string</a>, params <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2">r2</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2#BucketDomainCustomUpdateParams">BucketDomainCustomUpdateParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2">r2</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2#BucketDomainCustomUpdateResponse">BucketDomainCustomUpdateResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
43854381
- <code title="get /accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom">client.R2.Buckets.Domains.Custom.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2#BucketDomainCustomService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, bucketName <a href="https://pkg.go.dev/builtin#string">string</a>, params <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2">r2</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2#BucketDomainCustomListParams">BucketDomainCustomListParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2">r2</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2#BucketDomainCustomListResponse">BucketDomainCustomListResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
4386-
- <code title="delete /accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom/{domain_name}">client.R2.Buckets.Domains.Custom.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2#BucketDomainCustomService.Delete">Delete</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, bucketName <a href="https://pkg.go.dev/builtin#string">string</a>, domainName <a href="https://pkg.go.dev/builtin#string">string</a>, params <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2">r2</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2#BucketDomainCustomDeleteParams">BucketDomainCustomDeleteParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2">r2</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2#BucketDomainCustomDeleteResponse">BucketDomainCustomDeleteResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
4387-
- <code title="get /accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom/{domain_name}">client.R2.Buckets.Domains.Custom.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2#BucketDomainCustomService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, bucketName <a href="https://pkg.go.dev/builtin#string">string</a>, domainName <a href="https://pkg.go.dev/builtin#string">string</a>, params <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2">r2</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2#BucketDomainCustomGetParams">BucketDomainCustomGetParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2">r2</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v4/r2#BucketDomainCustomGetResponse">BucketDomainCustomGetResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
43884382

43894383
#### Managed
43904384

‎r2/bucket.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,12 @@ const (
178178
BucketLocationEnam BucketLocation = "enam"
179179
BucketLocationWeur BucketLocation = "weur"
180180
BucketLocationWnam BucketLocation = "wnam"
181+
BucketLocationOc BucketLocation = "oc"
181182
)
182183

183184
func (r BucketLocation) IsKnown() bool {
184185
switch r {
185-
case BucketLocationApac, BucketLocationEeur, BucketLocationEnam, BucketLocationWeur, BucketLocationWnam:
186+
case BucketLocationApac, BucketLocationEeur, BucketLocationEnam, BucketLocationWeur, BucketLocationWnam, BucketLocationOc:
186187
return true
187188
}
188189
return false
@@ -253,11 +254,12 @@ const (
253254
BucketNewParamsLocationHintEnam BucketNewParamsLocationHint = "enam"
254255
BucketNewParamsLocationHintWeur BucketNewParamsLocationHint = "weur"
255256
BucketNewParamsLocationHintWnam BucketNewParamsLocationHint = "wnam"
257+
BucketNewParamsLocationHintOc BucketNewParamsLocationHint = "oc"
256258
)
257259

258260
func (r BucketNewParamsLocationHint) IsKnown() bool {
259261
switch r {
260-
case BucketNewParamsLocationHintApac, BucketNewParamsLocationHintEeur, BucketNewParamsLocationHintEnam, BucketNewParamsLocationHintWeur, BucketNewParamsLocationHintWnam:
262+
case BucketNewParamsLocationHintApac, BucketNewParamsLocationHintEeur, BucketNewParamsLocationHintEnam, BucketNewParamsLocationHintWeur, BucketNewParamsLocationHintWnam, BucketNewParamsLocationHintOc:
261263
return true
262264
}
263265
return false

‎r2/bucketdomaincustom.go

-504
Original file line numberDiff line numberDiff line change
@@ -58,34 +58,6 @@ func (r *BucketDomainCustomService) New(ctx context.Context, bucketName string,
5858
return
5959
}
6060

61-
// Edit the configuration for a custom domain on an existing R2 bucket.
62-
func (r *BucketDomainCustomService) Update(ctx context.Context, bucketName string, domainName string, params BucketDomainCustomUpdateParams, opts ...option.RequestOption) (res *BucketDomainCustomUpdateResponse, err error) {
63-
var env BucketDomainCustomUpdateResponseEnvelope
64-
if params.Jurisdiction.Present {
65-
opts = append(opts, option.WithHeader("cf-r2-jurisdiction", fmt.Sprintf("%s", params.Jurisdiction)))
66-
}
67-
opts = append(r.Options[:], opts...)
68-
if params.AccountID.Value == "" {
69-
err = errors.New("missing required account_id parameter")
70-
return
71-
}
72-
if bucketName == "" {
73-
err = errors.New("missing required bucket_name parameter")
74-
return
75-
}
76-
if domainName == "" {
77-
err = errors.New("missing required domain_name parameter")
78-
return
79-
}
80-
path := fmt.Sprintf("accounts/%s/r2/buckets/%s/domains/custom/%s", params.AccountID, bucketName, domainName)
81-
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
82-
if err != nil {
83-
return
84-
}
85-
res = &env.Result
86-
return
87-
}
88-
8961
// Gets a list of all custom domains registered with an existing R2 bucket.
9062
func (r *BucketDomainCustomService) List(ctx context.Context, bucketName string, params BucketDomainCustomListParams, opts ...option.RequestOption) (res *BucketDomainCustomListResponse, err error) {
9163
var env BucketDomainCustomListResponseEnvelope
@@ -110,62 +82,6 @@ func (r *BucketDomainCustomService) List(ctx context.Context, bucketName string,
11082
return
11183
}
11284

113-
// Remove custom domain registration from an existing R2 bucket
114-
func (r *BucketDomainCustomService) Delete(ctx context.Context, bucketName string, domainName string, params BucketDomainCustomDeleteParams, opts ...option.RequestOption) (res *BucketDomainCustomDeleteResponse, err error) {
115-
var env BucketDomainCustomDeleteResponseEnvelope
116-
if params.Jurisdiction.Present {
117-
opts = append(opts, option.WithHeader("cf-r2-jurisdiction", fmt.Sprintf("%s", params.Jurisdiction)))
118-
}
119-
opts = append(r.Options[:], opts...)
120-
if params.AccountID.Value == "" {
121-
err = errors.New("missing required account_id parameter")
122-
return
123-
}
124-
if bucketName == "" {
125-
err = errors.New("missing required bucket_name parameter")
126-
return
127-
}
128-
if domainName == "" {
129-
err = errors.New("missing required domain_name parameter")
130-
return
131-
}
132-
path := fmt.Sprintf("accounts/%s/r2/buckets/%s/domains/custom/%s", params.AccountID, bucketName, domainName)
133-
err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
134-
if err != nil {
135-
return
136-
}
137-
res = &env.Result
138-
return
139-
}
140-
141-
// Get the configuration for a custom domain on an existing R2 bucket.
142-
func (r *BucketDomainCustomService) Get(ctx context.Context, bucketName string, domainName string, params BucketDomainCustomGetParams, opts ...option.RequestOption) (res *BucketDomainCustomGetResponse, err error) {
143-
var env BucketDomainCustomGetResponseEnvelope
144-
if params.Jurisdiction.Present {
145-
opts = append(opts, option.WithHeader("cf-r2-jurisdiction", fmt.Sprintf("%s", params.Jurisdiction)))
146-
}
147-
opts = append(r.Options[:], opts...)
148-
if params.AccountID.Value == "" {
149-
err = errors.New("missing required account_id parameter")
150-
return
151-
}
152-
if bucketName == "" {
153-
err = errors.New("missing required bucket_name parameter")
154-
return
155-
}
156-
if domainName == "" {
157-
err = errors.New("missing required domain_name parameter")
158-
return
159-
}
160-
path := fmt.Sprintf("accounts/%s/r2/buckets/%s/domains/custom/%s", params.AccountID, bucketName, domainName)
161-
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
162-
if err != nil {
163-
return
164-
}
165-
res = &env.Result
166-
return
167-
}
168-
16985
type BucketDomainCustomNewResponse struct {
17086
// Domain name of the affected custom domain
17187
Domain string `json:"domain,required"`
@@ -214,54 +130,6 @@ func (r BucketDomainCustomNewResponseMinTLS) IsKnown() bool {
214130
return false
215131
}
216132

217-
type BucketDomainCustomUpdateResponse struct {
218-
// Domain name of the affected custom domain
219-
Domain string `json:"domain,required"`
220-
// Whether this bucket is publicly accessible at the specified custom domain
221-
Enabled bool `json:"enabled"`
222-
// Minimum TLS Version the custom domain will accept for incoming connections. If
223-
// not set, defaults to 1.0.
224-
MinTLS BucketDomainCustomUpdateResponseMinTLS `json:"minTLS"`
225-
JSON bucketDomainCustomUpdateResponseJSON `json:"-"`
226-
}
227-
228-
// bucketDomainCustomUpdateResponseJSON contains the JSON metadata for the struct
229-
// [BucketDomainCustomUpdateResponse]
230-
type bucketDomainCustomUpdateResponseJSON struct {
231-
Domain apijson.Field
232-
Enabled apijson.Field
233-
MinTLS apijson.Field
234-
raw string
235-
ExtraFields map[string]apijson.Field
236-
}
237-
238-
func (r *BucketDomainCustomUpdateResponse) UnmarshalJSON(data []byte) (err error) {
239-
return apijson.UnmarshalRoot(data, r)
240-
}
241-
242-
func (r bucketDomainCustomUpdateResponseJSON) RawJSON() string {
243-
return r.raw
244-
}
245-
246-
// Minimum TLS Version the custom domain will accept for incoming connections. If
247-
// not set, defaults to 1.0.
248-
type BucketDomainCustomUpdateResponseMinTLS string
249-
250-
const (
251-
BucketDomainCustomUpdateResponseMinTLS1_0 BucketDomainCustomUpdateResponseMinTLS = "1.0"
252-
BucketDomainCustomUpdateResponseMinTLS1_1 BucketDomainCustomUpdateResponseMinTLS = "1.1"
253-
BucketDomainCustomUpdateResponseMinTLS1_2 BucketDomainCustomUpdateResponseMinTLS = "1.2"
254-
BucketDomainCustomUpdateResponseMinTLS1_3 BucketDomainCustomUpdateResponseMinTLS = "1.3"
255-
)
256-
257-
func (r BucketDomainCustomUpdateResponseMinTLS) IsKnown() bool {
258-
switch r {
259-
case BucketDomainCustomUpdateResponseMinTLS1_0, BucketDomainCustomUpdateResponseMinTLS1_1, BucketDomainCustomUpdateResponseMinTLS1_2, BucketDomainCustomUpdateResponseMinTLS1_3:
260-
return true
261-
}
262-
return false
263-
}
264-
265133
type BucketDomainCustomListResponse struct {
266134
Domains []BucketDomainCustomListResponseDomain `json:"domains,required"`
267135
JSON bucketDomainCustomListResponseJSON `json:"-"`
@@ -404,149 +272,6 @@ func (r BucketDomainCustomListResponseDomainsMinTLS) IsKnown() bool {
404272
return false
405273
}
406274

407-
type BucketDomainCustomDeleteResponse struct {
408-
// Name of the removed custom domain
409-
Domain string `json:"domain,required"`
410-
JSON bucketDomainCustomDeleteResponseJSON `json:"-"`
411-
}
412-
413-
// bucketDomainCustomDeleteResponseJSON contains the JSON metadata for the struct
414-
// [BucketDomainCustomDeleteResponse]
415-
type bucketDomainCustomDeleteResponseJSON struct {
416-
Domain apijson.Field
417-
raw string
418-
ExtraFields map[string]apijson.Field
419-
}
420-
421-
func (r *BucketDomainCustomDeleteResponse) UnmarshalJSON(data []byte) (err error) {
422-
return apijson.UnmarshalRoot(data, r)
423-
}
424-
425-
func (r bucketDomainCustomDeleteResponseJSON) RawJSON() string {
426-
return r.raw
427-
}
428-
429-
type BucketDomainCustomGetResponse struct {
430-
// Domain name of the custom domain to be added
431-
Domain string `json:"domain,required"`
432-
// Whether this bucket is publicly accessible at the specified custom domain
433-
Enabled bool `json:"enabled,required"`
434-
Status BucketDomainCustomGetResponseStatus `json:"status,required"`
435-
// Minimum TLS Version the custom domain will accept for incoming connections. If
436-
// not set, defaults to 1.0.
437-
MinTLS BucketDomainCustomGetResponseMinTLS `json:"minTLS"`
438-
// Zone ID of the custom domain resides in
439-
ZoneID string `json:"zoneId"`
440-
// Zone that the custom domain resides in
441-
ZoneName string `json:"zoneName"`
442-
JSON bucketDomainCustomGetResponseJSON `json:"-"`
443-
}
444-
445-
// bucketDomainCustomGetResponseJSON contains the JSON metadata for the struct
446-
// [BucketDomainCustomGetResponse]
447-
type bucketDomainCustomGetResponseJSON struct {
448-
Domain apijson.Field
449-
Enabled apijson.Field
450-
Status apijson.Field
451-
MinTLS apijson.Field
452-
ZoneID apijson.Field
453-
ZoneName apijson.Field
454-
raw string
455-
ExtraFields map[string]apijson.Field
456-
}
457-
458-
func (r *BucketDomainCustomGetResponse) UnmarshalJSON(data []byte) (err error) {
459-
return apijson.UnmarshalRoot(data, r)
460-
}
461-
462-
func (r bucketDomainCustomGetResponseJSON) RawJSON() string {
463-
return r.raw
464-
}
465-
466-
type BucketDomainCustomGetResponseStatus struct {
467-
// Ownership status of the domain
468-
Ownership BucketDomainCustomGetResponseStatusOwnership `json:"ownership,required"`
469-
// SSL certificate status
470-
SSL BucketDomainCustomGetResponseStatusSSL `json:"ssl,required"`
471-
JSON bucketDomainCustomGetResponseStatusJSON `json:"-"`
472-
}
473-
474-
// bucketDomainCustomGetResponseStatusJSON contains the JSON metadata for the
475-
// struct [BucketDomainCustomGetResponseStatus]
476-
type bucketDomainCustomGetResponseStatusJSON struct {
477-
Ownership apijson.Field
478-
SSL apijson.Field
479-
raw string
480-
ExtraFields map[string]apijson.Field
481-
}
482-
483-
func (r *BucketDomainCustomGetResponseStatus) UnmarshalJSON(data []byte) (err error) {
484-
return apijson.UnmarshalRoot(data, r)
485-
}
486-
487-
func (r bucketDomainCustomGetResponseStatusJSON) RawJSON() string {
488-
return r.raw
489-
}
490-
491-
// Ownership status of the domain
492-
type BucketDomainCustomGetResponseStatusOwnership string
493-
494-
const (
495-
BucketDomainCustomGetResponseStatusOwnershipPending BucketDomainCustomGetResponseStatusOwnership = "pending"
496-
BucketDomainCustomGetResponseStatusOwnershipActive BucketDomainCustomGetResponseStatusOwnership = "active"
497-
BucketDomainCustomGetResponseStatusOwnershipDeactivated BucketDomainCustomGetResponseStatusOwnership = "deactivated"
498-
BucketDomainCustomGetResponseStatusOwnershipBlocked BucketDomainCustomGetResponseStatusOwnership = "blocked"
499-
BucketDomainCustomGetResponseStatusOwnershipError BucketDomainCustomGetResponseStatusOwnership = "error"
500-
BucketDomainCustomGetResponseStatusOwnershipUnknown BucketDomainCustomGetResponseStatusOwnership = "unknown"
501-
)
502-
503-
func (r BucketDomainCustomGetResponseStatusOwnership) IsKnown() bool {
504-
switch r {
505-
case BucketDomainCustomGetResponseStatusOwnershipPending, BucketDomainCustomGetResponseStatusOwnershipActive, BucketDomainCustomGetResponseStatusOwnershipDeactivated, BucketDomainCustomGetResponseStatusOwnershipBlocked, BucketDomainCustomGetResponseStatusOwnershipError, BucketDomainCustomGetResponseStatusOwnershipUnknown:
506-
return true
507-
}
508-
return false
509-
}
510-
511-
// SSL certificate status
512-
type BucketDomainCustomGetResponseStatusSSL string
513-
514-
const (
515-
BucketDomainCustomGetResponseStatusSSLInitializing BucketDomainCustomGetResponseStatusSSL = "initializing"
516-
BucketDomainCustomGetResponseStatusSSLPending BucketDomainCustomGetResponseStatusSSL = "pending"
517-
BucketDomainCustomGetResponseStatusSSLActive BucketDomainCustomGetResponseStatusSSL = "active"
518-
BucketDomainCustomGetResponseStatusSSLDeactivated BucketDomainCustomGetResponseStatusSSL = "deactivated"
519-
BucketDomainCustomGetResponseStatusSSLError BucketDomainCustomGetResponseStatusSSL = "error"
520-
BucketDomainCustomGetResponseStatusSSLUnknown BucketDomainCustomGetResponseStatusSSL = "unknown"
521-
)
522-
523-
func (r BucketDomainCustomGetResponseStatusSSL) IsKnown() bool {
524-
switch r {
525-
case BucketDomainCustomGetResponseStatusSSLInitializing, BucketDomainCustomGetResponseStatusSSLPending, BucketDomainCustomGetResponseStatusSSLActive, BucketDomainCustomGetResponseStatusSSLDeactivated, BucketDomainCustomGetResponseStatusSSLError, BucketDomainCustomGetResponseStatusSSLUnknown:
526-
return true
527-
}
528-
return false
529-
}
530-
531-
// Minimum TLS Version the custom domain will accept for incoming connections. If
532-
// not set, defaults to 1.0.
533-
type BucketDomainCustomGetResponseMinTLS string
534-
535-
const (
536-
BucketDomainCustomGetResponseMinTLS1_0 BucketDomainCustomGetResponseMinTLS = "1.0"
537-
BucketDomainCustomGetResponseMinTLS1_1 BucketDomainCustomGetResponseMinTLS = "1.1"
538-
BucketDomainCustomGetResponseMinTLS1_2 BucketDomainCustomGetResponseMinTLS = "1.2"
539-
BucketDomainCustomGetResponseMinTLS1_3 BucketDomainCustomGetResponseMinTLS = "1.3"
540-
)
541-
542-
func (r BucketDomainCustomGetResponseMinTLS) IsKnown() bool {
543-
switch r {
544-
case BucketDomainCustomGetResponseMinTLS1_0, BucketDomainCustomGetResponseMinTLS1_1, BucketDomainCustomGetResponseMinTLS1_2, BucketDomainCustomGetResponseMinTLS1_3:
545-
return true
546-
}
547-
return false
548-
}
549-
550275
type BucketDomainCustomNewParams struct {
551276
// Account ID
552277
AccountID param.Field[string] `path:"account_id,required"`
@@ -647,101 +372,6 @@ func (r BucketDomainCustomNewResponseEnvelopeSuccess) IsKnown() bool {
647372
return false
648373
}
649374

650-
type BucketDomainCustomUpdateParams struct {
651-
// Account ID
652-
AccountID param.Field[string] `path:"account_id,required"`
653-
// Whether to enable public bucket access at the specified custom domain
654-
Enabled param.Field[bool] `json:"enabled"`
655-
// Minimum TLS Version the custom domain will accept for incoming connections. If
656-
// not set, defaults to previous value.
657-
MinTLS param.Field[BucketDomainCustomUpdateParamsMinTLS] `json:"minTLS"`
658-
// The bucket jurisdiction
659-
Jurisdiction param.Field[BucketDomainCustomUpdateParamsCfR2Jurisdiction] `header:"cf-r2-jurisdiction"`
660-
}
661-
662-
func (r BucketDomainCustomUpdateParams) MarshalJSON() (data []byte, err error) {
663-
return apijson.MarshalRoot(r)
664-
}
665-
666-
// Minimum TLS Version the custom domain will accept for incoming connections. If
667-
// not set, defaults to previous value.
668-
type BucketDomainCustomUpdateParamsMinTLS string
669-
670-
const (
671-
BucketDomainCustomUpdateParamsMinTLS1_0 BucketDomainCustomUpdateParamsMinTLS = "1.0"
672-
BucketDomainCustomUpdateParamsMinTLS1_1 BucketDomainCustomUpdateParamsMinTLS = "1.1"
673-
BucketDomainCustomUpdateParamsMinTLS1_2 BucketDomainCustomUpdateParamsMinTLS = "1.2"
674-
BucketDomainCustomUpdateParamsMinTLS1_3 BucketDomainCustomUpdateParamsMinTLS = "1.3"
675-
)
676-
677-
func (r BucketDomainCustomUpdateParamsMinTLS) IsKnown() bool {
678-
switch r {
679-
case BucketDomainCustomUpdateParamsMinTLS1_0, BucketDomainCustomUpdateParamsMinTLS1_1, BucketDomainCustomUpdateParamsMinTLS1_2, BucketDomainCustomUpdateParamsMinTLS1_3:
680-
return true
681-
}
682-
return false
683-
}
684-
685-
// The bucket jurisdiction
686-
type BucketDomainCustomUpdateParamsCfR2Jurisdiction string
687-
688-
const (
689-
BucketDomainCustomUpdateParamsCfR2JurisdictionDefault BucketDomainCustomUpdateParamsCfR2Jurisdiction = "default"
690-
BucketDomainCustomUpdateParamsCfR2JurisdictionEu BucketDomainCustomUpdateParamsCfR2Jurisdiction = "eu"
691-
BucketDomainCustomUpdateParamsCfR2JurisdictionFedramp BucketDomainCustomUpdateParamsCfR2Jurisdiction = "fedramp"
692-
)
693-
694-
func (r BucketDomainCustomUpdateParamsCfR2Jurisdiction) IsKnown() bool {
695-
switch r {
696-
case BucketDomainCustomUpdateParamsCfR2JurisdictionDefault, BucketDomainCustomUpdateParamsCfR2JurisdictionEu, BucketDomainCustomUpdateParamsCfR2JurisdictionFedramp:
697-
return true
698-
}
699-
return false
700-
}
701-
702-
type BucketDomainCustomUpdateResponseEnvelope struct {
703-
Errors []shared.ResponseInfo `json:"errors,required"`
704-
Messages []string `json:"messages,required"`
705-
Result BucketDomainCustomUpdateResponse `json:"result,required"`
706-
// Whether the API call was successful
707-
Success BucketDomainCustomUpdateResponseEnvelopeSuccess `json:"success,required"`
708-
JSON bucketDomainCustomUpdateResponseEnvelopeJSON `json:"-"`
709-
}
710-
711-
// bucketDomainCustomUpdateResponseEnvelopeJSON contains the JSON metadata for the
712-
// struct [BucketDomainCustomUpdateResponseEnvelope]
713-
type bucketDomainCustomUpdateResponseEnvelopeJSON struct {
714-
Errors apijson.Field
715-
Messages apijson.Field
716-
Result apijson.Field
717-
Success apijson.Field
718-
raw string
719-
ExtraFields map[string]apijson.Field
720-
}
721-
722-
func (r *BucketDomainCustomUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
723-
return apijson.UnmarshalRoot(data, r)
724-
}
725-
726-
func (r bucketDomainCustomUpdateResponseEnvelopeJSON) RawJSON() string {
727-
return r.raw
728-
}
729-
730-
// Whether the API call was successful
731-
type BucketDomainCustomUpdateResponseEnvelopeSuccess bool
732-
733-
const (
734-
BucketDomainCustomUpdateResponseEnvelopeSuccessTrue BucketDomainCustomUpdateResponseEnvelopeSuccess = true
735-
)
736-
737-
func (r BucketDomainCustomUpdateResponseEnvelopeSuccess) IsKnown() bool {
738-
switch r {
739-
case BucketDomainCustomUpdateResponseEnvelopeSuccessTrue:
740-
return true
741-
}
742-
return false
743-
}
744-
745375
type BucketDomainCustomListParams struct {
746376
// Account ID
747377
AccountID param.Field[string] `path:"account_id,required"`
@@ -808,137 +438,3 @@ func (r BucketDomainCustomListResponseEnvelopeSuccess) IsKnown() bool {
808438
}
809439
return false
810440
}
811-
812-
type BucketDomainCustomDeleteParams struct {
813-
// Account ID
814-
AccountID param.Field[string] `path:"account_id,required"`
815-
// The bucket jurisdiction
816-
Jurisdiction param.Field[BucketDomainCustomDeleteParamsCfR2Jurisdiction] `header:"cf-r2-jurisdiction"`
817-
}
818-
819-
// The bucket jurisdiction
820-
type BucketDomainCustomDeleteParamsCfR2Jurisdiction string
821-
822-
const (
823-
BucketDomainCustomDeleteParamsCfR2JurisdictionDefault BucketDomainCustomDeleteParamsCfR2Jurisdiction = "default"
824-
BucketDomainCustomDeleteParamsCfR2JurisdictionEu BucketDomainCustomDeleteParamsCfR2Jurisdiction = "eu"
825-
BucketDomainCustomDeleteParamsCfR2JurisdictionFedramp BucketDomainCustomDeleteParamsCfR2Jurisdiction = "fedramp"
826-
)
827-
828-
func (r BucketDomainCustomDeleteParamsCfR2Jurisdiction) IsKnown() bool {
829-
switch r {
830-
case BucketDomainCustomDeleteParamsCfR2JurisdictionDefault, BucketDomainCustomDeleteParamsCfR2JurisdictionEu, BucketDomainCustomDeleteParamsCfR2JurisdictionFedramp:
831-
return true
832-
}
833-
return false
834-
}
835-
836-
type BucketDomainCustomDeleteResponseEnvelope struct {
837-
Errors []shared.ResponseInfo `json:"errors,required"`
838-
Messages []string `json:"messages,required"`
839-
Result BucketDomainCustomDeleteResponse `json:"result,required"`
840-
// Whether the API call was successful
841-
Success BucketDomainCustomDeleteResponseEnvelopeSuccess `json:"success,required"`
842-
JSON bucketDomainCustomDeleteResponseEnvelopeJSON `json:"-"`
843-
}
844-
845-
// bucketDomainCustomDeleteResponseEnvelopeJSON contains the JSON metadata for the
846-
// struct [BucketDomainCustomDeleteResponseEnvelope]
847-
type bucketDomainCustomDeleteResponseEnvelopeJSON struct {
848-
Errors apijson.Field
849-
Messages apijson.Field
850-
Result apijson.Field
851-
Success apijson.Field
852-
raw string
853-
ExtraFields map[string]apijson.Field
854-
}
855-
856-
func (r *BucketDomainCustomDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
857-
return apijson.UnmarshalRoot(data, r)
858-
}
859-
860-
func (r bucketDomainCustomDeleteResponseEnvelopeJSON) RawJSON() string {
861-
return r.raw
862-
}
863-
864-
// Whether the API call was successful
865-
type BucketDomainCustomDeleteResponseEnvelopeSuccess bool
866-
867-
const (
868-
BucketDomainCustomDeleteResponseEnvelopeSuccessTrue BucketDomainCustomDeleteResponseEnvelopeSuccess = true
869-
)
870-
871-
func (r BucketDomainCustomDeleteResponseEnvelopeSuccess) IsKnown() bool {
872-
switch r {
873-
case BucketDomainCustomDeleteResponseEnvelopeSuccessTrue:
874-
return true
875-
}
876-
return false
877-
}
878-
879-
type BucketDomainCustomGetParams struct {
880-
// Account ID
881-
AccountID param.Field[string] `path:"account_id,required"`
882-
// The bucket jurisdiction
883-
Jurisdiction param.Field[BucketDomainCustomGetParamsCfR2Jurisdiction] `header:"cf-r2-jurisdiction"`
884-
}
885-
886-
// The bucket jurisdiction
887-
type BucketDomainCustomGetParamsCfR2Jurisdiction string
888-
889-
const (
890-
BucketDomainCustomGetParamsCfR2JurisdictionDefault BucketDomainCustomGetParamsCfR2Jurisdiction = "default"
891-
BucketDomainCustomGetParamsCfR2JurisdictionEu BucketDomainCustomGetParamsCfR2Jurisdiction = "eu"
892-
BucketDomainCustomGetParamsCfR2JurisdictionFedramp BucketDomainCustomGetParamsCfR2Jurisdiction = "fedramp"
893-
)
894-
895-
func (r BucketDomainCustomGetParamsCfR2Jurisdiction) IsKnown() bool {
896-
switch r {
897-
case BucketDomainCustomGetParamsCfR2JurisdictionDefault, BucketDomainCustomGetParamsCfR2JurisdictionEu, BucketDomainCustomGetParamsCfR2JurisdictionFedramp:
898-
return true
899-
}
900-
return false
901-
}
902-
903-
type BucketDomainCustomGetResponseEnvelope struct {
904-
Errors []shared.ResponseInfo `json:"errors,required"`
905-
Messages []string `json:"messages,required"`
906-
Result BucketDomainCustomGetResponse `json:"result,required"`
907-
// Whether the API call was successful
908-
Success BucketDomainCustomGetResponseEnvelopeSuccess `json:"success,required"`
909-
JSON bucketDomainCustomGetResponseEnvelopeJSON `json:"-"`
910-
}
911-
912-
// bucketDomainCustomGetResponseEnvelopeJSON contains the JSON metadata for the
913-
// struct [BucketDomainCustomGetResponseEnvelope]
914-
type bucketDomainCustomGetResponseEnvelopeJSON struct {
915-
Errors apijson.Field
916-
Messages apijson.Field
917-
Result apijson.Field
918-
Success apijson.Field
919-
raw string
920-
ExtraFields map[string]apijson.Field
921-
}
922-
923-
func (r *BucketDomainCustomGetResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
924-
return apijson.UnmarshalRoot(data, r)
925-
}
926-
927-
func (r bucketDomainCustomGetResponseEnvelopeJSON) RawJSON() string {
928-
return r.raw
929-
}
930-
931-
// Whether the API call was successful
932-
type BucketDomainCustomGetResponseEnvelopeSuccess bool
933-
934-
const (
935-
BucketDomainCustomGetResponseEnvelopeSuccessTrue BucketDomainCustomGetResponseEnvelopeSuccess = true
936-
)
937-
938-
func (r BucketDomainCustomGetResponseEnvelopeSuccess) IsKnown() bool {
939-
switch r {
940-
case BucketDomainCustomGetResponseEnvelopeSuccessTrue:
941-
return true
942-
}
943-
return false
944-
}

‎r2/bucketdomaincustom_test.go

-98
Original file line numberDiff line numberDiff line change
@@ -49,40 +49,6 @@ func TestBucketDomainCustomNewWithOptionalParams(t *testing.T) {
4949
}
5050
}
5151

52-
func TestBucketDomainCustomUpdateWithOptionalParams(t *testing.T) {
53-
t.Skip("TODO: investigate broken test")
54-
baseURL := "http://localhost:4010"
55-
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
56-
baseURL = envURL
57-
}
58-
if !testutil.CheckTestServer(t, baseURL) {
59-
return
60-
}
61-
client := cloudflare.NewClient(
62-
option.WithBaseURL(baseURL),
63-
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
64-
option.WithAPIEmail("user@example.com"),
65-
)
66-
_, err := client.R2.Buckets.Domains.Custom.Update(
67-
context.TODO(),
68-
"example-bucket",
69-
"example-domain/custom-domain.com",
70-
r2.BucketDomainCustomUpdateParams{
71-
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
72-
Enabled: cloudflare.F(true),
73-
MinTLS: cloudflare.F(r2.BucketDomainCustomUpdateParamsMinTLS1_0),
74-
Jurisdiction: cloudflare.F(r2.BucketDomainCustomUpdateParamsCfR2JurisdictionDefault),
75-
},
76-
)
77-
if err != nil {
78-
var apierr *cloudflare.Error
79-
if errors.As(err, &apierr) {
80-
t.Log(string(apierr.DumpRequest(true)))
81-
}
82-
t.Fatalf("err should be nil: %s", err.Error())
83-
}
84-
}
85-
8652
func TestBucketDomainCustomListWithOptionalParams(t *testing.T) {
8753
t.Skip("TODO: investigate broken test")
8854
baseURL := "http://localhost:4010"
@@ -113,67 +79,3 @@ func TestBucketDomainCustomListWithOptionalParams(t *testing.T) {
11379
t.Fatalf("err should be nil: %s", err.Error())
11480
}
11581
}
116-
117-
func TestBucketDomainCustomDeleteWithOptionalParams(t *testing.T) {
118-
t.Skip("TODO: investigate broken test")
119-
baseURL := "http://localhost:4010"
120-
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
121-
baseURL = envURL
122-
}
123-
if !testutil.CheckTestServer(t, baseURL) {
124-
return
125-
}
126-
client := cloudflare.NewClient(
127-
option.WithBaseURL(baseURL),
128-
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
129-
option.WithAPIEmail("user@example.com"),
130-
)
131-
_, err := client.R2.Buckets.Domains.Custom.Delete(
132-
context.TODO(),
133-
"example-bucket",
134-
"example-domain/custom-domain.com",
135-
r2.BucketDomainCustomDeleteParams{
136-
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
137-
Jurisdiction: cloudflare.F(r2.BucketDomainCustomDeleteParamsCfR2JurisdictionDefault),
138-
},
139-
)
140-
if err != nil {
141-
var apierr *cloudflare.Error
142-
if errors.As(err, &apierr) {
143-
t.Log(string(apierr.DumpRequest(true)))
144-
}
145-
t.Fatalf("err should be nil: %s", err.Error())
146-
}
147-
}
148-
149-
func TestBucketDomainCustomGetWithOptionalParams(t *testing.T) {
150-
t.Skip("TODO: investigate broken test")
151-
baseURL := "http://localhost:4010"
152-
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
153-
baseURL = envURL
154-
}
155-
if !testutil.CheckTestServer(t, baseURL) {
156-
return
157-
}
158-
client := cloudflare.NewClient(
159-
option.WithBaseURL(baseURL),
160-
option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
161-
option.WithAPIEmail("user@example.com"),
162-
)
163-
_, err := client.R2.Buckets.Domains.Custom.Get(
164-
context.TODO(),
165-
"example-bucket",
166-
"example-domain/custom-domain.com",
167-
r2.BucketDomainCustomGetParams{
168-
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
169-
Jurisdiction: cloudflare.F(r2.BucketDomainCustomGetParamsCfR2JurisdictionDefault),
170-
},
171-
)
172-
if err != nil {
173-
var apierr *cloudflare.Error
174-
if errors.As(err, &apierr) {
175-
t.Log(string(apierr.DumpRequest(true)))
176-
}
177-
t.Fatalf("err should be nil: %s", err.Error())
178-
}
179-
}

0 commit comments

Comments
 (0)
Please sign in to comment.