Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1436
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-da11321182930ad0deb0691d0e8e6c3bf9cced28dfb452d612590e86ec13a5a3.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2c78a7b2b9c6b823fa3394dedc7537f11ecc9c05b381df6dd2066c378d22b617.yml
40 changes: 20 additions & 20 deletions src/cloudflare/resources/origin_ca_certificates.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ def create(
) -> Optional[OriginCACertificate]:
"""Create an Origin CA certificate.

Use your Origin CA Key as your User Service Key
when calling this endpoint ([see above](#requests)).
You can use an Origin CA Key as your User
Service Key or an API token when calling this endpoint ([see above](#requests)).

Args:
csr: The Certificate Signing Request (CSR). Must be newline-encoded.
Expand Down Expand Up @@ -124,8 +124,8 @@ def list(
) -> SyncSinglePage[OriginCACertificate]:
"""List all existing Origin CA certificates for a given zone.

Use your Origin CA
Key as your User Service Key when calling this endpoint
You can use an Origin
CA Key as your User Service Key or an API token when calling this endpoint
([see above](#requests)).

Args:
Expand Down Expand Up @@ -167,9 +167,9 @@ def delete(
) -> Optional[OriginCACertificateDeleteResponse]:
"""Revoke an existing Origin CA certificate by its serial number.

Use your Origin
CA Key as your User Service Key when calling this endpoint
([see above](#requests)).
You can use an
Origin CA Key as your User Service Key or an API token when calling this
endpoint ([see above](#requests)).

Args:
certificate_id: Identifier
Expand Down Expand Up @@ -211,9 +211,9 @@ def get(
) -> Optional[OriginCACertificate]:
"""Get an existing Origin CA certificate by its serial number.

Use your Origin CA
Key as your User Service Key when calling this endpoint
([see above](#requests)).
You can use an
Origin CA Key as your User Service Key or an API token when calling this
endpoint ([see above](#requests)).

Args:
certificate_id: Identifier
Expand Down Expand Up @@ -277,8 +277,8 @@ async def create(
) -> Optional[OriginCACertificate]:
"""Create an Origin CA certificate.

Use your Origin CA Key as your User Service Key
when calling this endpoint ([see above](#requests)).
You can use an Origin CA Key as your User
Service Key or an API token when calling this endpoint ([see above](#requests)).

Args:
csr: The Certificate Signing Request (CSR). Must be newline-encoded.
Expand Down Expand Up @@ -333,8 +333,8 @@ def list(
) -> AsyncPaginator[OriginCACertificate, AsyncSinglePage[OriginCACertificate]]:
"""List all existing Origin CA certificates for a given zone.

Use your Origin CA
Key as your User Service Key when calling this endpoint
You can use an Origin
CA Key as your User Service Key or an API token when calling this endpoint
([see above](#requests)).

Args:
Expand Down Expand Up @@ -376,9 +376,9 @@ async def delete(
) -> Optional[OriginCACertificateDeleteResponse]:
"""Revoke an existing Origin CA certificate by its serial number.

Use your Origin
CA Key as your User Service Key when calling this endpoint
([see above](#requests)).
You can use an
Origin CA Key as your User Service Key or an API token when calling this
endpoint ([see above](#requests)).

Args:
certificate_id: Identifier
Expand Down Expand Up @@ -420,9 +420,9 @@ async def get(
) -> Optional[OriginCACertificate]:
"""Get an existing Origin CA certificate by its serial number.

Use your Origin CA
Key as your User Service Key when calling this endpoint
([see above](#requests)).
You can use an
Origin CA Key as your User Service Key or an API token when calling this
endpoint ([see above](#requests)).

Args:
certificate_id: Identifier
Expand Down
44 changes: 26 additions & 18 deletions src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ def create(

validity_days: Validity Days selected for the order.

cloudflare_branding: Whether or not to add Cloudflare Branding for the order. This will add
sni.cloudflaressl.com as the Common Name if set true.
cloudflare_branding: Whether or not to add Cloudflare Branding for the order. This will add a
subdomain of sni.cloudflaressl.com as the Common Name if set to true.

extra_headers: Send extra headers

Expand Down Expand Up @@ -230,25 +230,27 @@ def edit(
certificate_pack_id: str,
*,
zone_id: str,
body: object,
cloudflare_branding: bool | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[CertificatePackEditResponse]:
"""For a given zone, restart validation for an advanced certificate pack.

This is
only a validation operation for a Certificate Pack in a validation_timed_out
status.
"""
For a given zone, restart validation or add cloudflare branding for an advanced
certificate pack. The former is only a validation operation for a Certificate
Pack in a validation_timed_out status.

Args:
zone_id: Identifier

certificate_pack_id: Identifier

cloudflare_branding: Whether or not to add Cloudflare Branding for the order. This will add a
subdomain of sni.cloudflaressl.com as the Common Name if set to true.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -265,7 +267,9 @@ def edit(
)
return self._patch(
f"/zones/{zone_id}/ssl/certificate_packs/{certificate_pack_id}",
body=maybe_transform(body, certificate_pack_edit_params.CertificatePackEditParams),
body=maybe_transform(
{"cloudflare_branding": cloudflare_branding}, certificate_pack_edit_params.CertificatePackEditParams
),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand Down Expand Up @@ -383,8 +387,8 @@ async def create(

validity_days: Validity Days selected for the order.

cloudflare_branding: Whether or not to add Cloudflare Branding for the order. This will add
sni.cloudflaressl.com as the Common Name if set true.
cloudflare_branding: Whether or not to add Cloudflare Branding for the order. This will add a
subdomain of sni.cloudflaressl.com as the Common Name if set to true.

extra_headers: Send extra headers

Expand Down Expand Up @@ -513,25 +517,27 @@ async def edit(
certificate_pack_id: str,
*,
zone_id: str,
body: object,
cloudflare_branding: bool | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[CertificatePackEditResponse]:
"""For a given zone, restart validation for an advanced certificate pack.

This is
only a validation operation for a Certificate Pack in a validation_timed_out
status.
"""
For a given zone, restart validation or add cloudflare branding for an advanced
certificate pack. The former is only a validation operation for a Certificate
Pack in a validation_timed_out status.

Args:
zone_id: Identifier

certificate_pack_id: Identifier

cloudflare_branding: Whether or not to add Cloudflare Branding for the order. This will add a
subdomain of sni.cloudflaressl.com as the Common Name if set to true.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -548,7 +554,9 @@ async def edit(
)
return await self._patch(
f"/zones/{zone_id}/ssl/certificate_packs/{certificate_pack_id}",
body=await async_maybe_transform(body, certificate_pack_edit_params.CertificatePackEditParams),
body=await async_maybe_transform(
{"cloudflare_branding": cloudflare_branding}, certificate_pack_edit_params.CertificatePackEditParams
),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ class SSL(TypedDict, total=False):
certificate_authority: CertificateCA
"""The Certificate Authority that will issue the certificate"""

cloudflare_branding: bool
"""Whether or not to add Cloudflare Branding for the order.

This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to
true
"""

custom_certificate: str
"""If a custom uploaded certificate is used."""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ class SSL(TypedDict, total=False):
certificate_authority: CertificateCA
"""The Certificate Authority that will issue the certificate"""

cloudflare_branding: bool
"""Whether or not to add Cloudflare Branding for the order.

This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to
true
"""

custom_certificate: str
"""If a custom uploaded certificate is used."""

Expand Down
3 changes: 2 additions & 1 deletion src/cloudflare/types/ssl/certificate_pack_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ class CertificatePackCreateParams(TypedDict, total=False):
cloudflare_branding: bool
"""Whether or not to add Cloudflare Branding for the order.

This will add sni.cloudflaressl.com as the Common Name if set true.
This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to
true.
"""
3 changes: 2 additions & 1 deletion src/cloudflare/types/ssl/certificate_pack_create_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class CertificatePackCreateResponse(BaseModel):
cloudflare_branding: Optional[bool] = None
"""Whether or not to add Cloudflare Branding for the order.

This will add sni.cloudflaressl.com as the Common Name if set true.
This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to
true.
"""

hosts: Optional[List[Host]] = None
Expand Down
7 changes: 6 additions & 1 deletion src/cloudflare/types/ssl/certificate_pack_edit_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,9 @@ class CertificatePackEditParams(TypedDict, total=False):
zone_id: Required[str]
"""Identifier"""

body: Required[object]
cloudflare_branding: bool
"""Whether or not to add Cloudflare Branding for the order.

This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to
true.
"""
3 changes: 2 additions & 1 deletion src/cloudflare/types/ssl/certificate_pack_edit_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class CertificatePackEditResponse(BaseModel):
cloudflare_branding: Optional[bool] = None
"""Whether or not to add Cloudflare Branding for the order.

This will add sni.cloudflaressl.com as the Common Name if set true.
This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to
true.
"""

hosts: Optional[List[Host]] = None
Expand Down
28 changes: 18 additions & 10 deletions tests/api_resources/ssl/test_certificate_packs.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,15 @@ def test_method_edit(self, client: Cloudflare) -> None:
certificate_pack = client.ssl.certificate_packs.edit(
certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
body={},
)
assert_matches_type(Optional[CertificatePackEditResponse], certificate_pack, path=["response"])

@parametrize
def test_method_edit_with_all_params(self, client: Cloudflare) -> None:
certificate_pack = client.ssl.certificate_packs.edit(
certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
cloudflare_branding=False,
)
assert_matches_type(Optional[CertificatePackEditResponse], certificate_pack, path=["response"])

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

assert response.is_closed is True
Expand All @@ -214,7 +221,6 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None:
with client.ssl.certificate_packs.with_streaming_response.edit(
certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
body={},
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -230,14 +236,12 @@ def test_path_params_edit(self, client: Cloudflare) -> None:
client.ssl.certificate_packs.with_raw_response.edit(
certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353",
zone_id="",
body={},
)

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

@parametrize
Expand Down Expand Up @@ -462,7 +466,15 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None:
certificate_pack = await async_client.ssl.certificate_packs.edit(
certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
body={},
)
assert_matches_type(Optional[CertificatePackEditResponse], certificate_pack, path=["response"])

@parametrize
async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None:
certificate_pack = await async_client.ssl.certificate_packs.edit(
certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
cloudflare_branding=False,
)
assert_matches_type(Optional[CertificatePackEditResponse], certificate_pack, path=["response"])

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

assert response.is_closed is True
Expand All @@ -484,7 +495,6 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N
async with async_client.ssl.certificate_packs.with_streaming_response.edit(
certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
body={},
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand All @@ -500,14 +510,12 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None:
await async_client.ssl.certificate_packs.with_raw_response.edit(
certificate_pack_id="023e105f4ecef8ad9ca31a8372d0c353",
zone_id="",
body={},
)

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

@parametrize
Expand Down
Loading