Skip to content

Commit 88819fc

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): api update (#2219)
1 parent 55b8cff commit 88819fc

11 files changed

+95
-53
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

src/cloudflare/resources/origin_ca_certificates.py

+20-20
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ def create(
6868
) -> Optional[OriginCACertificate]:
6969
"""Create an Origin CA certificate.
7070
71-
Use your Origin CA Key as your User Service Key
72-
when calling this endpoint ([see above](#requests)).
71+
You can use an Origin CA Key as your User
72+
Service Key or an API token when calling this endpoint ([see above](#requests)).
7373
7474
Args:
7575
csr: The Certificate Signing Request (CSR). Must be newline-encoded.
@@ -124,8 +124,8 @@ def list(
124124
) -> SyncSinglePage[OriginCACertificate]:
125125
"""List all existing Origin CA certificates for a given zone.
126126
127-
Use your Origin CA
128-
Key as your User Service Key when calling this endpoint
127+
You can use an Origin
128+
CA Key as your User Service Key or an API token when calling this endpoint
129129
([see above](#requests)).
130130
131131
Args:
@@ -167,9 +167,9 @@ def delete(
167167
) -> Optional[OriginCACertificateDeleteResponse]:
168168
"""Revoke an existing Origin CA certificate by its serial number.
169169
170-
Use your Origin
171-
CA Key as your User Service Key when calling this endpoint
172-
([see above](#requests)).
170+
You can use an
171+
Origin CA Key as your User Service Key or an API token when calling this
172+
endpoint ([see above](#requests)).
173173
174174
Args:
175175
certificate_id: Identifier
@@ -211,9 +211,9 @@ def get(
211211
) -> Optional[OriginCACertificate]:
212212
"""Get an existing Origin CA certificate by its serial number.
213213
214-
Use your Origin CA
215-
Key as your User Service Key when calling this endpoint
216-
([see above](#requests)).
214+
You can use an
215+
Origin CA Key as your User Service Key or an API token when calling this
216+
endpoint ([see above](#requests)).
217217
218218
Args:
219219
certificate_id: Identifier
@@ -277,8 +277,8 @@ async def create(
277277
) -> Optional[OriginCACertificate]:
278278
"""Create an Origin CA certificate.
279279
280-
Use your Origin CA Key as your User Service Key
281-
when calling this endpoint ([see above](#requests)).
280+
You can use an Origin CA Key as your User
281+
Service Key or an API token when calling this endpoint ([see above](#requests)).
282282
283283
Args:
284284
csr: The Certificate Signing Request (CSR). Must be newline-encoded.
@@ -333,8 +333,8 @@ def list(
333333
) -> AsyncPaginator[OriginCACertificate, AsyncSinglePage[OriginCACertificate]]:
334334
"""List all existing Origin CA certificates for a given zone.
335335
336-
Use your Origin CA
337-
Key as your User Service Key when calling this endpoint
336+
You can use an Origin
337+
CA Key as your User Service Key or an API token when calling this endpoint
338338
([see above](#requests)).
339339
340340
Args:
@@ -376,9 +376,9 @@ async def delete(
376376
) -> Optional[OriginCACertificateDeleteResponse]:
377377
"""Revoke an existing Origin CA certificate by its serial number.
378378
379-
Use your Origin
380-
CA Key as your User Service Key when calling this endpoint
381-
([see above](#requests)).
379+
You can use an
380+
Origin CA Key as your User Service Key or an API token when calling this
381+
endpoint ([see above](#requests)).
382382
383383
Args:
384384
certificate_id: Identifier
@@ -420,9 +420,9 @@ async def get(
420420
) -> Optional[OriginCACertificate]:
421421
"""Get an existing Origin CA certificate by its serial number.
422422
423-
Use your Origin CA
424-
Key as your User Service Key when calling this endpoint
425-
([see above](#requests)).
423+
You can use an
424+
Origin CA Key as your User Service Key or an API token when calling this
425+
endpoint ([see above](#requests)).
426426
427427
Args:
428428
certificate_id: Identifier

src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py

+26-18
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ def create(
100100
101101
validity_days: Validity Days selected for the order.
102102
103-
cloudflare_branding: Whether or not to add Cloudflare Branding for the order. This will add
104-
sni.cloudflaressl.com as the Common Name if set true.
103+
cloudflare_branding: Whether or not to add Cloudflare Branding for the order. This will add a
104+
subdomain of sni.cloudflaressl.com as the Common Name if set to true.
105105
106106
extra_headers: Send extra headers
107107
@@ -230,25 +230,27 @@ def edit(
230230
certificate_pack_id: str,
231231
*,
232232
zone_id: str,
233-
body: object,
233+
cloudflare_branding: bool | NotGiven = NOT_GIVEN,
234234
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
235235
# The extra values given here take precedence over values defined on the client or passed to this method.
236236
extra_headers: Headers | None = None,
237237
extra_query: Query | None = None,
238238
extra_body: Body | None = None,
239239
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
240240
) -> Optional[CertificatePackEditResponse]:
241-
"""For a given zone, restart validation for an advanced certificate pack.
242-
243-
This is
244-
only a validation operation for a Certificate Pack in a validation_timed_out
245-
status.
241+
"""
242+
For a given zone, restart validation or add cloudflare branding for an advanced
243+
certificate pack. The former is only a validation operation for a Certificate
244+
Pack in a validation_timed_out status.
246245
247246
Args:
248247
zone_id: Identifier
249248
250249
certificate_pack_id: Identifier
251250
251+
cloudflare_branding: Whether or not to add Cloudflare Branding for the order. This will add a
252+
subdomain of sni.cloudflaressl.com as the Common Name if set to true.
253+
252254
extra_headers: Send extra headers
253255
254256
extra_query: Add additional query parameters to the request
@@ -265,7 +267,9 @@ def edit(
265267
)
266268
return self._patch(
267269
f"/zones/{zone_id}/ssl/certificate_packs/{certificate_pack_id}",
268-
body=maybe_transform(body, certificate_pack_edit_params.CertificatePackEditParams),
270+
body=maybe_transform(
271+
{"cloudflare_branding": cloudflare_branding}, certificate_pack_edit_params.CertificatePackEditParams
272+
),
269273
options=make_request_options(
270274
extra_headers=extra_headers,
271275
extra_query=extra_query,
@@ -383,8 +387,8 @@ async def create(
383387
384388
validity_days: Validity Days selected for the order.
385389
386-
cloudflare_branding: Whether or not to add Cloudflare Branding for the order. This will add
387-
sni.cloudflaressl.com as the Common Name if set true.
390+
cloudflare_branding: Whether or not to add Cloudflare Branding for the order. This will add a
391+
subdomain of sni.cloudflaressl.com as the Common Name if set to true.
388392
389393
extra_headers: Send extra headers
390394
@@ -513,25 +517,27 @@ async def edit(
513517
certificate_pack_id: str,
514518
*,
515519
zone_id: str,
516-
body: object,
520+
cloudflare_branding: bool | NotGiven = NOT_GIVEN,
517521
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
518522
# The extra values given here take precedence over values defined on the client or passed to this method.
519523
extra_headers: Headers | None = None,
520524
extra_query: Query | None = None,
521525
extra_body: Body | None = None,
522526
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
523527
) -> Optional[CertificatePackEditResponse]:
524-
"""For a given zone, restart validation for an advanced certificate pack.
525-
526-
This is
527-
only a validation operation for a Certificate Pack in a validation_timed_out
528-
status.
528+
"""
529+
For a given zone, restart validation or add cloudflare branding for an advanced
530+
certificate pack. The former is only a validation operation for a Certificate
531+
Pack in a validation_timed_out status.
529532
530533
Args:
531534
zone_id: Identifier
532535
533536
certificate_pack_id: Identifier
534537
538+
cloudflare_branding: Whether or not to add Cloudflare Branding for the order. This will add a
539+
subdomain of sni.cloudflaressl.com as the Common Name if set to true.
540+
535541
extra_headers: Send extra headers
536542
537543
extra_query: Add additional query parameters to the request
@@ -548,7 +554,9 @@ async def edit(
548554
)
549555
return await self._patch(
550556
f"/zones/{zone_id}/ssl/certificate_packs/{certificate_pack_id}",
551-
body=await async_maybe_transform(body, certificate_pack_edit_params.CertificatePackEditParams),
557+
body=await async_maybe_transform(
558+
{"cloudflare_branding": cloudflare_branding}, certificate_pack_edit_params.CertificatePackEditParams
559+
),
552560
options=make_request_options(
553561
extra_headers=extra_headers,
554562
extra_query=extra_query,

src/cloudflare/types/custom_hostnames/custom_hostname_create_params.py

+7
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ class SSL(TypedDict, total=False):
6262
certificate_authority: CertificateCA
6363
"""The Certificate Authority that will issue the certificate"""
6464

65+
cloudflare_branding: bool
66+
"""Whether or not to add Cloudflare Branding for the order.
67+
68+
This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to
69+
true
70+
"""
71+
6572
custom_certificate: str
6673
"""If a custom uploaded certificate is used."""
6774

src/cloudflare/types/custom_hostnames/custom_hostname_edit_params.py

+7
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ class SSL(TypedDict, total=False):
7474
certificate_authority: CertificateCA
7575
"""The Certificate Authority that will issue the certificate"""
7676

77+
cloudflare_branding: bool
78+
"""Whether or not to add Cloudflare Branding for the order.
79+
80+
This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to
81+
true
82+
"""
83+
7784
custom_certificate: str
7885
"""If a custom uploaded certificate is used."""
7986

src/cloudflare/types/ssl/certificate_pack_create_params.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,6 @@ class CertificatePackCreateParams(TypedDict, total=False):
4040
cloudflare_branding: bool
4141
"""Whether or not to add Cloudflare Branding for the order.
4242
43-
This will add sni.cloudflaressl.com as the Common Name if set true.
43+
This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to
44+
true.
4445
"""

src/cloudflare/types/ssl/certificate_pack_create_response.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ class CertificatePackCreateResponse(BaseModel):
2424
cloudflare_branding: Optional[bool] = None
2525
"""Whether or not to add Cloudflare Branding for the order.
2626
27-
This will add sni.cloudflaressl.com as the Common Name if set true.
27+
This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to
28+
true.
2829
"""
2930

3031
hosts: Optional[List[Host]] = None

src/cloudflare/types/ssl/certificate_pack_edit_params.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,9 @@ class CertificatePackEditParams(TypedDict, total=False):
1111
zone_id: Required[str]
1212
"""Identifier"""
1313

14-
body: Required[object]
14+
cloudflare_branding: bool
15+
"""Whether or not to add Cloudflare Branding for the order.
16+
17+
This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to
18+
true.
19+
"""

src/cloudflare/types/ssl/certificate_pack_edit_response.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ class CertificatePackEditResponse(BaseModel):
2424
cloudflare_branding: Optional[bool] = None
2525
"""Whether or not to add Cloudflare Branding for the order.
2626
27-
This will add sni.cloudflaressl.com as the Common Name if set true.
27+
This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to
28+
true.
2829
"""
2930

3031
hosts: Optional[List[Host]] = None

tests/api_resources/ssl/test_certificate_packs.py

+18-10
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,15 @@ def test_method_edit(self, client: Cloudflare) -> None:
192192
certificate_pack = client.ssl.certificate_packs.edit(
193193
certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353",
194194
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
195-
body={},
195+
)
196+
assert_matches_type(Optional[CertificatePackEditResponse], certificate_pack, path=["response"])
197+
198+
@parametrize
199+
def test_method_edit_with_all_params(self, client: Cloudflare) -> None:
200+
certificate_pack = client.ssl.certificate_packs.edit(
201+
certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353",
202+
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
203+
cloudflare_branding=False,
196204
)
197205
assert_matches_type(Optional[CertificatePackEditResponse], certificate_pack, path=["response"])
198206

@@ -201,7 +209,6 @@ def test_raw_response_edit(self, client: Cloudflare) -> None:
201209
response = client.ssl.certificate_packs.with_raw_response.edit(
202210
certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353",
203211
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
204-
body={},
205212
)
206213

207214
assert response.is_closed is True
@@ -214,7 +221,6 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None:
214221
with client.ssl.certificate_packs.with_streaming_response.edit(
215222
certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353",
216223
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
217-
body={},
218224
) as response:
219225
assert not response.is_closed
220226
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -230,14 +236,12 @@ def test_path_params_edit(self, client: Cloudflare) -> None:
230236
client.ssl.certificate_packs.with_raw_response.edit(
231237
certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353",
232238
zone_id="",
233-
body={},
234239
)
235240

236241
with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_pack_id` but received ''"):
237242
client.ssl.certificate_packs.with_raw_response.edit(
238243
certificate_pack_id="",
239244
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
240-
body={},
241245
)
242246

243247
@parametrize
@@ -462,7 +466,15 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None:
462466
certificate_pack = await async_client.ssl.certificate_packs.edit(
463467
certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353",
464468
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
465-
body={},
469+
)
470+
assert_matches_type(Optional[CertificatePackEditResponse], certificate_pack, path=["response"])
471+
472+
@parametrize
473+
async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None:
474+
certificate_pack = await async_client.ssl.certificate_packs.edit(
475+
certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353",
476+
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
477+
cloudflare_branding=False,
466478
)
467479
assert_matches_type(Optional[CertificatePackEditResponse], certificate_pack, path=["response"])
468480

@@ -471,7 +483,6 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None:
471483
response = await async_client.ssl.certificate_packs.with_raw_response.edit(
472484
certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353",
473485
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
474-
body={},
475486
)
476487

477488
assert response.is_closed is True
@@ -484,7 +495,6 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N
484495
async with async_client.ssl.certificate_packs.with_streaming_response.edit(
485496
certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353",
486497
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
487-
body={},
488498
) as response:
489499
assert not response.is_closed
490500
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -500,14 +510,12 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None:
500510
await async_client.ssl.certificate_packs.with_raw_response.edit(
501511
certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353",
502512
zone_id="",
503-
body={},
504513
)
505514

506515
with pytest.raises(ValueError, match=r"Expected a non-empty value for `certificate_pack_id` but received ''"):
507516
await async_client.ssl.certificate_packs.with_raw_response.edit(
508517
certificate_pack_id="",
509518
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
510-
body={},
511519
)
512520

513521
@parametrize

0 commit comments

Comments
 (0)