2222from ...._wrappers import ResultWrapper
2323from ....pagination import SyncSinglePage , AsyncSinglePage
2424from ...._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+ )
2630from ....types .zero_trust .gateway .certificate_get_response import CertificateGetResponse
2731from ....types .zero_trust .gateway .certificate_list_response import CertificateListResponse
2832from ....types .zero_trust .gateway .certificate_create_response import CertificateCreateResponse
2933from ....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 )
0 commit comments