Skip to content

Commit c780c91

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): update via SDK Studio (#1201)
1 parent 49090bf commit c780c91

File tree

9 files changed

+524
-2
lines changed

9 files changed

+524
-2
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 1258
1+
configured_endpoints: 1260
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-953162af8002c4c5c32732b1849af4ed6ca3e6944830d1cbe289a60171f2adbe.yml

api.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5584,6 +5584,8 @@ from cloudflare.types.zero_trust.gateway import (
55845584
CertificateCreateResponse,
55855585
CertificateListResponse,
55865586
CertificateDeleteResponse,
5587+
CertificateActivateResponse,
5588+
CertificateDeactivateResponse,
55875589
CertificateGetResponse,
55885590
)
55895591
```
@@ -5593,6 +5595,8 @@ Methods:
55935595
- <code title="post /accounts/{account_id}/gateway/certificates">client.zero_trust.gateway.certificates.<a href="./src/cloudflare/resources/zero_trust/gateway/certificates.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/gateway/certificate_create_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/gateway/certificate_create_response.py">Optional</a></code>
55945596
- <code title="get /accounts/{account_id}/gateway/certificates">client.zero_trust.gateway.certificates.<a href="./src/cloudflare/resources/zero_trust/gateway/certificates.py">list</a>(\*, account_id) -> <a href="./src/cloudflare/types/zero_trust/gateway/certificate_list_response.py">SyncSinglePage[CertificateListResponse]</a></code>
55955597
- <code title="delete /accounts/{account_id}/gateway/certificates/{certificate_id}">client.zero_trust.gateway.certificates.<a href="./src/cloudflare/resources/zero_trust/gateway/certificates.py">delete</a>(certificate_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/gateway/certificate_delete_response.py">Optional</a></code>
5598+
- <code title="post /accounts/{account_id}/gateway/certificates/{certificate_id}/activate">client.zero_trust.gateway.certificates.<a href="./src/cloudflare/resources/zero_trust/gateway/certificates.py">activate</a>(certificate_id, \*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/gateway/certificate_activate_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/gateway/certificate_activate_response.py">Optional</a></code>
5599+
- <code title="post /accounts/{account_id}/gateway/certificates/{certificate_id}/deactivate">client.zero_trust.gateway.certificates.<a href="./src/cloudflare/resources/zero_trust/gateway/certificates.py">deactivate</a>(certificate_id, \*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/gateway/certificate_deactivate_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/gateway/certificate_deactivate_response.py">Optional</a></code>
55965600
- <code title="get /accounts/{account_id}/gateway/certificates/{certificate_id}">client.zero_trust.gateway.certificates.<a href="./src/cloudflare/resources/zero_trust/gateway/certificates.py">get</a>(certificate_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/gateway/certificate_get_response.py">Optional</a></code>
55975601

55985602
## Networks

src/cloudflare/resources/zero_trust/gateway/certificates.py

Lines changed: 207 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,17 @@
2222
from ...._wrappers import ResultWrapper
2323
from ....pagination import SyncSinglePage, AsyncSinglePage
2424
from ...._base_client import AsyncPaginator, make_request_options
25-
from ....types.zero_trust.gateway import certificate_create_params
25+
from ....types.zero_trust.gateway import (
26+
certificate_create_params,
27+
certificate_activate_params,
28+
certificate_deactivate_params,
29+
)
2630
from ....types.zero_trust.gateway.certificate_get_response import CertificateGetResponse
2731
from ....types.zero_trust.gateway.certificate_list_response import CertificateListResponse
2832
from ....types.zero_trust.gateway.certificate_create_response import CertificateCreateResponse
2933
from ....types.zero_trust.gateway.certificate_delete_response import CertificateDeleteResponse
34+
from ....types.zero_trust.gateway.certificate_activate_response import CertificateActivateResponse
35+
from ....types.zero_trust.gateway.certificate_deactivate_response import CertificateDeactivateResponse
3036

3137
__all__ = ["CertificatesResource", "AsyncCertificatesResource"]
3238

@@ -162,6 +168,94 @@ def delete(
162168
cast_to=cast(Type[Optional[CertificateDeleteResponse]], ResultWrapper[CertificateDeleteResponse]),
163169
)
164170

171+
def activate(
172+
self,
173+
certificate_id: str,
174+
*,
175+
account_id: str,
176+
body: object,
177+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
178+
# The extra values given here take precedence over values defined on the client or passed to this method.
179+
extra_headers: Headers | None = None,
180+
extra_query: Query | None = None,
181+
extra_body: Body | None = None,
182+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
183+
) -> Optional[CertificateActivateResponse]:
184+
"""
185+
Binds a single Zero Trust certificate to the edge.
186+
187+
Args:
188+
certificate_id: Certificate UUID tag.
189+
190+
extra_headers: Send extra headers
191+
192+
extra_query: Add additional query parameters to the request
193+
194+
extra_body: Add additional JSON properties to the request
195+
196+
timeout: Override the client-level default timeout for this request, in seconds
197+
"""
198+
if not account_id:
199+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
200+
if not certificate_id:
201+
raise ValueError(f"Expected a non-empty value for `certificate_id` but received {certificate_id!r}")
202+
return self._post(
203+
f"/accounts/{account_id}/gateway/certificates/{certificate_id}/activate",
204+
body=maybe_transform(body, certificate_activate_params.CertificateActivateParams),
205+
options=make_request_options(
206+
extra_headers=extra_headers,
207+
extra_query=extra_query,
208+
extra_body=extra_body,
209+
timeout=timeout,
210+
post_parser=ResultWrapper[Optional[CertificateActivateResponse]]._unwrapper,
211+
),
212+
cast_to=cast(Type[Optional[CertificateActivateResponse]], ResultWrapper[CertificateActivateResponse]),
213+
)
214+
215+
def deactivate(
216+
self,
217+
certificate_id: str,
218+
*,
219+
account_id: str,
220+
body: object,
221+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
222+
# The extra values given here take precedence over values defined on the client or passed to this method.
223+
extra_headers: Headers | None = None,
224+
extra_query: Query | None = None,
225+
extra_body: Body | None = None,
226+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
227+
) -> Optional[CertificateDeactivateResponse]:
228+
"""
229+
Unbinds a single Zero Trust certificate from the edge
230+
231+
Args:
232+
certificate_id: Certificate UUID tag.
233+
234+
extra_headers: Send extra headers
235+
236+
extra_query: Add additional query parameters to the request
237+
238+
extra_body: Add additional JSON properties to the request
239+
240+
timeout: Override the client-level default timeout for this request, in seconds
241+
"""
242+
if not account_id:
243+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
244+
if not certificate_id:
245+
raise ValueError(f"Expected a non-empty value for `certificate_id` but received {certificate_id!r}")
246+
return self._post(
247+
f"/accounts/{account_id}/gateway/certificates/{certificate_id}/deactivate",
248+
body=maybe_transform(body, certificate_deactivate_params.CertificateDeactivateParams),
249+
options=make_request_options(
250+
extra_headers=extra_headers,
251+
extra_query=extra_query,
252+
extra_body=extra_body,
253+
timeout=timeout,
254+
post_parser=ResultWrapper[Optional[CertificateDeactivateResponse]]._unwrapper,
255+
),
256+
cast_to=cast(Type[Optional[CertificateDeactivateResponse]], ResultWrapper[CertificateDeactivateResponse]),
257+
)
258+
165259
def get(
166260
self,
167261
certificate_id: str,
@@ -336,6 +430,94 @@ async def delete(
336430
cast_to=cast(Type[Optional[CertificateDeleteResponse]], ResultWrapper[CertificateDeleteResponse]),
337431
)
338432

433+
async def activate(
434+
self,
435+
certificate_id: str,
436+
*,
437+
account_id: str,
438+
body: object,
439+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
440+
# The extra values given here take precedence over values defined on the client or passed to this method.
441+
extra_headers: Headers | None = None,
442+
extra_query: Query | None = None,
443+
extra_body: Body | None = None,
444+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
445+
) -> Optional[CertificateActivateResponse]:
446+
"""
447+
Binds a single Zero Trust certificate to the edge.
448+
449+
Args:
450+
certificate_id: Certificate UUID tag.
451+
452+
extra_headers: Send extra headers
453+
454+
extra_query: Add additional query parameters to the request
455+
456+
extra_body: Add additional JSON properties to the request
457+
458+
timeout: Override the client-level default timeout for this request, in seconds
459+
"""
460+
if not account_id:
461+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
462+
if not certificate_id:
463+
raise ValueError(f"Expected a non-empty value for `certificate_id` but received {certificate_id!r}")
464+
return await self._post(
465+
f"/accounts/{account_id}/gateway/certificates/{certificate_id}/activate",
466+
body=await async_maybe_transform(body, certificate_activate_params.CertificateActivateParams),
467+
options=make_request_options(
468+
extra_headers=extra_headers,
469+
extra_query=extra_query,
470+
extra_body=extra_body,
471+
timeout=timeout,
472+
post_parser=ResultWrapper[Optional[CertificateActivateResponse]]._unwrapper,
473+
),
474+
cast_to=cast(Type[Optional[CertificateActivateResponse]], ResultWrapper[CertificateActivateResponse]),
475+
)
476+
477+
async def deactivate(
478+
self,
479+
certificate_id: str,
480+
*,
481+
account_id: str,
482+
body: object,
483+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
484+
# The extra values given here take precedence over values defined on the client or passed to this method.
485+
extra_headers: Headers | None = None,
486+
extra_query: Query | None = None,
487+
extra_body: Body | None = None,
488+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
489+
) -> Optional[CertificateDeactivateResponse]:
490+
"""
491+
Unbinds a single Zero Trust certificate from the edge
492+
493+
Args:
494+
certificate_id: Certificate UUID tag.
495+
496+
extra_headers: Send extra headers
497+
498+
extra_query: Add additional query parameters to the request
499+
500+
extra_body: Add additional JSON properties to the request
501+
502+
timeout: Override the client-level default timeout for this request, in seconds
503+
"""
504+
if not account_id:
505+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
506+
if not certificate_id:
507+
raise ValueError(f"Expected a non-empty value for `certificate_id` but received {certificate_id!r}")
508+
return await self._post(
509+
f"/accounts/{account_id}/gateway/certificates/{certificate_id}/deactivate",
510+
body=await async_maybe_transform(body, certificate_deactivate_params.CertificateDeactivateParams),
511+
options=make_request_options(
512+
extra_headers=extra_headers,
513+
extra_query=extra_query,
514+
extra_body=extra_body,
515+
timeout=timeout,
516+
post_parser=ResultWrapper[Optional[CertificateDeactivateResponse]]._unwrapper,
517+
),
518+
cast_to=cast(Type[Optional[CertificateDeactivateResponse]], ResultWrapper[CertificateDeactivateResponse]),
519+
)
520+
339521
async def get(
340522
self,
341523
certificate_id: str,
@@ -392,6 +574,12 @@ def __init__(self, certificates: CertificatesResource) -> None:
392574
self.delete = to_raw_response_wrapper(
393575
certificates.delete,
394576
)
577+
self.activate = to_raw_response_wrapper(
578+
certificates.activate,
579+
)
580+
self.deactivate = to_raw_response_wrapper(
581+
certificates.deactivate,
582+
)
395583
self.get = to_raw_response_wrapper(
396584
certificates.get,
397585
)
@@ -410,6 +598,12 @@ def __init__(self, certificates: AsyncCertificatesResource) -> None:
410598
self.delete = async_to_raw_response_wrapper(
411599
certificates.delete,
412600
)
601+
self.activate = async_to_raw_response_wrapper(
602+
certificates.activate,
603+
)
604+
self.deactivate = async_to_raw_response_wrapper(
605+
certificates.deactivate,
606+
)
413607
self.get = async_to_raw_response_wrapper(
414608
certificates.get,
415609
)
@@ -428,6 +622,12 @@ def __init__(self, certificates: CertificatesResource) -> None:
428622
self.delete = to_streamed_response_wrapper(
429623
certificates.delete,
430624
)
625+
self.activate = to_streamed_response_wrapper(
626+
certificates.activate,
627+
)
628+
self.deactivate = to_streamed_response_wrapper(
629+
certificates.deactivate,
630+
)
431631
self.get = to_streamed_response_wrapper(
432632
certificates.get,
433633
)
@@ -446,6 +646,12 @@ def __init__(self, certificates: AsyncCertificatesResource) -> None:
446646
self.delete = async_to_streamed_response_wrapper(
447647
certificates.delete,
448648
)
649+
self.activate = async_to_streamed_response_wrapper(
650+
certificates.activate,
651+
)
652+
self.deactivate = async_to_streamed_response_wrapper(
653+
certificates.deactivate,
654+
)
449655
self.get = async_to_streamed_response_wrapper(
450656
certificates.get,
451657
)

src/cloudflare/types/zero_trust/gateway/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
from .configuration_get_response import ConfigurationGetResponse as ConfigurationGetResponse
5656
from .proxy_endpoint_edit_params import ProxyEndpointEditParams as ProxyEndpointEditParams
5757
from .activity_log_settings_param import ActivityLogSettingsParam as ActivityLogSettingsParam
58+
from .certificate_activate_params import CertificateActivateParams as CertificateActivateParams
5859
from .certificate_create_response import CertificateCreateResponse as CertificateCreateResponse
5960
from .certificate_delete_response import CertificateDeleteResponse as CertificateDeleteResponse
6061
from .configuration_edit_response import ConfigurationEditResponse as ConfigurationEditResponse
@@ -64,13 +65,16 @@
6465
from .proxy_endpoint_get_response import ProxyEndpointGetResponse as ProxyEndpointGetResponse
6566
from .body_scanning_settings_param import BodyScanningSettingsParam as BodyScanningSettingsParam
6667
from .proxy_endpoint_create_params import ProxyEndpointCreateParams as ProxyEndpointCreateParams
68+
from .certificate_activate_response import CertificateActivateResponse as CertificateActivateResponse
69+
from .certificate_deactivate_params import CertificateDeactivateParams as CertificateDeactivateParams
6770
from .configuration_update_response import ConfigurationUpdateResponse as ConfigurationUpdateResponse
6871
from .extended_email_matching_param import ExtendedEmailMatchingParam as ExtendedEmailMatchingParam
6972
from .dns_resolver_settings_v4_param import DNSResolverSettingsV4Param as DNSResolverSettingsV4Param
7073
from .dns_resolver_settings_v6_param import DNSResolverSettingsV6Param as DNSResolverSettingsV6Param
7174
from .gateway_configuration_settings import GatewayConfigurationSettings as GatewayConfigurationSettings
7275
from .proxy_endpoint_delete_response import ProxyEndpointDeleteResponse as ProxyEndpointDeleteResponse
7376
from .audit_ssh_setting_update_params import AuditSSHSettingUpdateParams as AuditSSHSettingUpdateParams
77+
from .certificate_deactivate_response import CertificateDeactivateResponse as CertificateDeactivateResponse
7478
from .browser_isolation_settings_param import BrowserIsolationSettingsParam as BrowserIsolationSettingsParam
7579
from .custom_certificate_settings_param import CustomCertificateSettingsParam as CustomCertificateSettingsParam
7680
from .gateway_configuration_settings_param import GatewayConfigurationSettingsParam as GatewayConfigurationSettingsParam
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Required, TypedDict
6+
7+
__all__ = ["CertificateActivateParams"]
8+
9+
10+
class CertificateActivateParams(TypedDict, total=False):
11+
account_id: Required[str]
12+
13+
body: Required[object]
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import Optional
4+
from datetime import datetime
5+
from typing_extensions import Literal
6+
7+
from ...._models import BaseModel
8+
9+
__all__ = ["CertificateActivateResponse"]
10+
11+
12+
class CertificateActivateResponse(BaseModel):
13+
id: Optional[str] = None
14+
"""Certificate UUID tag."""
15+
16+
binding_status: Optional[Literal["pending_deployment", "active", "pending_deletion", "inactive"]] = None
17+
"""The deployment status of the certificate on Cloudflare's edge.
18+
19+
Certificates in the 'active' state may be used for Gateway TLS interception.
20+
"""
21+
22+
created_at: Optional[datetime] = None
23+
24+
enabled: Optional[bool] = None
25+
"""Use this certificate for Gateway TLS interception"""
26+
27+
expires_on: Optional[datetime] = None
28+
29+
type: Optional[Literal["custom", "gateway_managed"]] = None
30+
"""The type of certificate, either BYO-PKI (custom) or Gateway-managed."""
31+
32+
updated_at: Optional[datetime] = None
33+
34+
uploaded_on: Optional[datetime] = None
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Required, TypedDict
6+
7+
__all__ = ["CertificateDeactivateParams"]
8+
9+
10+
class CertificateDeactivateParams(TypedDict, total=False):
11+
account_id: Required[str]
12+
13+
body: Required[object]

0 commit comments

Comments
 (0)