Skip to content

Commit 56a8b59

Browse files
stainless-app[bot]stainless-bot
authored andcommittedNov 26, 2024·
feat(api): api update (#3678)
1 parent d407746 commit 56a8b59

File tree

6 files changed

+37
-27
lines changed

6 files changed

+37
-27
lines changed
 

‎.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1436
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-da11321182930ad0deb0691d0e8e6c3bf9cced28dfb452d612590e86ec13a5a3.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2c78a7b2b9c6b823fa3394dedc7537f11ecc9c05b381df6dd2066c378d22b617.yml

‎custom_hostnames/customhostname.go

+6
Original file line numberDiff line numberDiff line change
@@ -2011,6 +2011,9 @@ type CustomHostnameNewParamsSSL struct {
20112011
BundleMethod param.Field[BundleMethod] `json:"bundle_method"`
20122012
// The Certificate Authority that will issue the certificate
20132013
CertificateAuthority param.Field[shared.CertificateCA] `json:"certificate_authority"`
2014+
// Whether or not to add Cloudflare Branding for the order. This will add a
2015+
// subdomain of sni.cloudflaressl.com as the Common Name if set to true
2016+
CloudflareBranding param.Field[bool] `json:"cloudflare_branding"`
20142017
// If a custom uploaded certificate is used.
20152018
CustomCertificate param.Field[string] `json:"custom_certificate"`
20162019
// The key for a custom uploaded certificate.
@@ -2274,6 +2277,9 @@ type CustomHostnameEditParamsSSL struct {
22742277
BundleMethod param.Field[BundleMethod] `json:"bundle_method"`
22752278
// The Certificate Authority that will issue the certificate
22762279
CertificateAuthority param.Field[shared.CertificateCA] `json:"certificate_authority"`
2280+
// Whether or not to add Cloudflare Branding for the order. This will add a
2281+
// subdomain of sni.cloudflaressl.com as the Common Name if set to true
2282+
CloudflareBranding param.Field[bool] `json:"cloudflare_branding"`
22772283
// If a custom uploaded certificate is used.
22782284
CustomCertificate param.Field[string] `json:"custom_certificate"`
22792285
// The key for a custom uploaded certificate.

‎custom_hostnames/customhostname_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ func TestCustomHostnameNewWithOptionalParams(t *testing.T) {
3434
SSL: cloudflare.F(custom_hostnames.CustomHostnameNewParamsSSL{
3535
BundleMethod: cloudflare.F(custom_hostnames.BundleMethodUbiquitous),
3636
CertificateAuthority: cloudflare.F(shared.CertificateCADigicert),
37+
CloudflareBranding: cloudflare.F(false),
3738
CustomCertificate: cloudflare.F("-----BEGIN CERTIFICATE-----\\nMIIFJDCCBAygAwIBAgIQD0ifmj/Yi5NP/2gdUySbfzANBgkqhkiG9w0BAQsFADBN\\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E...SzSHfXp5lnu/3V08I72q1QNzOCgY1XeL4GKVcj4or6cT6tX6oJH7ePPmfrBfqI/O\\nOeH8gMJ+FuwtXYEPa4hBf38M5eU5xWG7\\n-----END CERTIFICATE-----\\n"),
3839
CustomKey: cloudflare.F("-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/q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0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n"),
3940
Method: cloudflare.F(custom_hostnames.DCVMethodHTTP),
@@ -147,6 +148,7 @@ func TestCustomHostnameEditWithOptionalParams(t *testing.T) {
147148
SSL: cloudflare.F(custom_hostnames.CustomHostnameEditParamsSSL{
148149
BundleMethod: cloudflare.F(custom_hostnames.BundleMethodUbiquitous),
149150
CertificateAuthority: cloudflare.F(shared.CertificateCADigicert),
151+
CloudflareBranding: cloudflare.F(false),
150152
CustomCertificate: cloudflare.F("-----BEGIN CERTIFICATE-----\\nMIIFJDCCBAygAwIBAgIQD0ifmj/Yi5NP/2gdUySbfzANBgkqhkiG9w0BAQsFADBN\\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E...SzSHfXp5lnu/3V08I72q1QNzOCgY1XeL4GKVcj4or6cT6tX6oJH7ePPmfrBfqI/O\\nOeH8gMJ+FuwtXYEPa4hBf38M5eU5xWG7\\n-----END CERTIFICATE-----\\n"),
151153
CustomKey: cloudflare.F("-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0q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GeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n"),
152154
Method: cloudflare.F(custom_hostnames.DCVMethodHTTP),

‎origin_ca_certificates/origincacertificate.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ func NewOriginCACertificateService(opts ...option.RequestOption) (r *OriginCACer
3939
return
4040
}
4141

42-
// Create an Origin CA certificate. Use your Origin CA Key as your User Service Key
43-
// when calling this endpoint ([see above](#requests)).
42+
// Create an Origin CA certificate. You can use an Origin CA Key as your User
43+
// Service Key or an API token when calling this endpoint ([see above](#requests)).
4444
func (r *OriginCACertificateService) New(ctx context.Context, body OriginCACertificateNewParams, opts ...option.RequestOption) (res *OriginCACertificate, err error) {
4545
var env OriginCACertificateNewResponseEnvelope
4646
opts = append(r.Options[:], opts...)
@@ -53,8 +53,8 @@ func (r *OriginCACertificateService) New(ctx context.Context, body OriginCACerti
5353
return
5454
}
5555

56-
// List all existing Origin CA certificates for a given zone. Use your Origin CA
57-
// Key as your User Service Key when calling this endpoint
56+
// List all existing Origin CA certificates for a given zone. You can use an Origin
57+
// CA Key as your User Service Key or an API token when calling this endpoint
5858
// ([see above](#requests)).
5959
func (r *OriginCACertificateService) List(ctx context.Context, query OriginCACertificateListParams, opts ...option.RequestOption) (res *pagination.SinglePage[OriginCACertificate], err error) {
6060
var raw *http.Response
@@ -73,16 +73,16 @@ func (r *OriginCACertificateService) List(ctx context.Context, query OriginCACer
7373
return res, nil
7474
}
7575

76-
// List all existing Origin CA certificates for a given zone. Use your Origin CA
77-
// Key as your User Service Key when calling this endpoint
76+
// List all existing Origin CA certificates for a given zone. You can use an Origin
77+
// CA Key as your User Service Key or an API token when calling this endpoint
7878
// ([see above](#requests)).
7979
func (r *OriginCACertificateService) ListAutoPaging(ctx context.Context, query OriginCACertificateListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[OriginCACertificate] {
8080
return pagination.NewSinglePageAutoPager(r.List(ctx, query, opts...))
8181
}
8282

83-
// Revoke an existing Origin CA certificate by its serial number. Use your Origin
84-
// CA Key as your User Service Key when calling this endpoint
85-
// ([see above](#requests)).
83+
// Revoke an existing Origin CA certificate by its serial number. You can use an
84+
// Origin CA Key as your User Service Key or an API token when calling this
85+
// endpoint ([see above](#requests)).
8686
func (r *OriginCACertificateService) Delete(ctx context.Context, certificateID string, opts ...option.RequestOption) (res *OriginCACertificateDeleteResponse, err error) {
8787
var env OriginCACertificateDeleteResponseEnvelope
8888
opts = append(r.Options[:], opts...)
@@ -99,9 +99,9 @@ func (r *OriginCACertificateService) Delete(ctx context.Context, certificateID s
9999
return
100100
}
101101

102-
// Get an existing Origin CA certificate by its serial number. Use your Origin CA
103-
// Key as your User Service Key when calling this endpoint
104-
// ([see above](#requests)).
102+
// Get an existing Origin CA certificate by its serial number. You can use an
103+
// Origin CA Key as your User Service Key or an API token when calling this
104+
// endpoint ([see above](#requests)).
105105
func (r *OriginCACertificateService) Get(ctx context.Context, certificateID string, opts ...option.RequestOption) (res *OriginCACertificate, err error) {
106106
var env OriginCACertificateGetResponseEnvelope
107107
opts = append(r.Options[:], opts...)

‎ssl/certificatepack.go

+13-11
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ func (r *CertificatePackService) Delete(ctx context.Context, certificatePackID s
104104
return
105105
}
106106

107-
// For a given zone, restart validation for an advanced certificate pack. This is
108-
// only a validation operation for a Certificate Pack in a validation_timed_out
109-
// status.
107+
// For a given zone, restart validation or add cloudflare branding for an advanced
108+
// certificate pack. The former is only a validation operation for a Certificate
109+
// Pack in a validation_timed_out status.
110110
func (r *CertificatePackService) Edit(ctx context.Context, certificatePackID string, params CertificatePackEditParams, opts ...option.RequestOption) (res *CertificatePackEditResponse, err error) {
111111
var env CertificatePackEditResponseEnvelope
112112
opts = append(r.Options[:], opts...)
@@ -232,8 +232,8 @@ type CertificatePackNewResponse struct {
232232
// authority specific details or restrictions
233233
// [see this page for more details.](https://developers.cloudflare.com/ssl/reference/certificate-authorities)
234234
CertificateAuthority CertificatePackNewResponseCertificateAuthority `json:"certificate_authority"`
235-
// Whether or not to add Cloudflare Branding for the order. This will add
236-
// sni.cloudflaressl.com as the Common Name if set true.
235+
// Whether or not to add Cloudflare Branding for the order. This will add a
236+
// subdomain of sni.cloudflaressl.com as the Common Name if set to true.
237237
CloudflareBranding bool `json:"cloudflare_branding"`
238238
// Comma separated list of valid host names for the certificate packs. Must contain
239239
// the zone apex, may not contain more than 50 hosts, and may not be empty.
@@ -372,8 +372,8 @@ type CertificatePackEditResponse struct {
372372
// authority specific details or restrictions
373373
// [see this page for more details.](https://developers.cloudflare.com/ssl/reference/certificate-authorities)
374374
CertificateAuthority CertificatePackEditResponseCertificateAuthority `json:"certificate_authority"`
375-
// Whether or not to add Cloudflare Branding for the order. This will add
376-
// sni.cloudflaressl.com as the Common Name if set true.
375+
// Whether or not to add Cloudflare Branding for the order. This will add a
376+
// subdomain of sni.cloudflaressl.com as the Common Name if set to true.
377377
CloudflareBranding bool `json:"cloudflare_branding"`
378378
// Comma separated list of valid host names for the certificate packs. Must contain
379379
// the zone apex, may not contain more than 50 hosts, and may not be empty.
@@ -499,8 +499,8 @@ type CertificatePackNewParams struct {
499499
ValidationMethod param.Field[CertificatePackNewParamsValidationMethod] `json:"validation_method,required"`
500500
// Validity Days selected for the order.
501501
ValidityDays param.Field[CertificatePackNewParamsValidityDays] `json:"validity_days,required"`
502-
// Whether or not to add Cloudflare Branding for the order. This will add
503-
// sni.cloudflaressl.com as the Common Name if set true.
502+
// Whether or not to add Cloudflare Branding for the order. This will add a
503+
// subdomain of sni.cloudflaressl.com as the Common Name if set to true.
504504
CloudflareBranding param.Field[bool] `json:"cloudflare_branding"`
505505
}
506506

@@ -702,11 +702,13 @@ func (r CertificatePackDeleteResponseEnvelopeSuccess) IsKnown() bool {
702702
type CertificatePackEditParams struct {
703703
// Identifier
704704
ZoneID param.Field[string] `path:"zone_id,required"`
705-
Body interface{} `json:"body,required"`
705+
// Whether or not to add Cloudflare Branding for the order. This will add a
706+
// subdomain of sni.cloudflaressl.com as the Common Name if set to true.
707+
CloudflareBranding param.Field[bool] `json:"cloudflare_branding"`
706708
}
707709

708710
func (r CertificatePackEditParams) MarshalJSON() (data []byte, err error) {
709-
return apijson.MarshalRoot(r.Body)
711+
return apijson.MarshalRoot(r)
710712
}
711713

712714
type CertificatePackEditResponseEnvelope struct {

‎ssl/certificatepack_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func TestCertificatePackDelete(t *testing.T) {
100100
}
101101
}
102102

103-
func TestCertificatePackEdit(t *testing.T) {
103+
func TestCertificatePackEditWithOptionalParams(t *testing.T) {
104104
baseURL := "http://localhost:4010"
105105
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
106106
baseURL = envURL
@@ -117,8 +117,8 @@ func TestCertificatePackEdit(t *testing.T) {
117117
context.TODO(),
118118
"023e105f4ecef8ad9ca31a8372d0c353",
119119
ssl.CertificatePackEditParams{
120-
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
121-
Body: map[string]interface{}{},
120+
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
121+
CloudflareBranding: cloudflare.F(false),
122122
},
123123
)
124124
if err != nil {

0 commit comments

Comments
 (0)
Please sign in to comment.