1717 async_to_streamed_response_wrapper ,
1818)
1919from ..._wrappers import ResultWrapper
20- from ...types .acm import CertificateAuthority , total_tls_create_params
20+ from ...types .acm import CertificateAuthority , total_tls_edit_params , total_tls_update_params
2121from ..._base_client import make_request_options
2222from ...types .acm .certificate_authority import CertificateAuthority
2323from ...types .acm .total_tls_get_response import TotalTLSGetResponse
24- from ...types .acm .total_tls_create_response import TotalTLSCreateResponse
24+ from ...types .acm .total_tls_edit_response import TotalTLSEditResponse
25+ from ...types .acm .total_tls_update_response import TotalTLSUpdateResponse
2526
2627__all__ = ["TotalTLSResource" , "AsyncTotalTLSResource" ]
2728
@@ -46,7 +47,7 @@ def with_streaming_response(self) -> TotalTLSResourceWithStreamingResponse:
4647 """
4748 return TotalTLSResourceWithStreamingResponse (self )
4849
49- def create (
50+ def update (
5051 self ,
5152 * ,
5253 zone_id : str ,
@@ -58,7 +59,7 @@ def create(
5859 extra_query : Query | None = None ,
5960 extra_body : Body | None = None ,
6061 timeout : float | httpx .Timeout | None | NotGiven = not_given ,
61- ) -> Optional [TotalTLSCreateResponse ]:
62+ ) -> Optional [TotalTLSUpdateResponse ]:
6263 """
6364 Set Total TLS Settings or disable the feature for a Zone.
6465
@@ -87,16 +88,69 @@ def create(
8788 "enabled" : enabled ,
8889 "certificate_authority" : certificate_authority ,
8990 },
90- total_tls_create_params . TotalTLSCreateParams ,
91+ total_tls_update_params . TotalTLSUpdateParams ,
9192 ),
9293 options = make_request_options (
9394 extra_headers = extra_headers ,
9495 extra_query = extra_query ,
9596 extra_body = extra_body ,
9697 timeout = timeout ,
97- post_parser = ResultWrapper [Optional [TotalTLSCreateResponse ]]._unwrapper ,
98+ post_parser = ResultWrapper [Optional [TotalTLSUpdateResponse ]]._unwrapper ,
9899 ),
99- cast_to = cast (Type [Optional [TotalTLSCreateResponse ]], ResultWrapper [TotalTLSCreateResponse ]),
100+ cast_to = cast (Type [Optional [TotalTLSUpdateResponse ]], ResultWrapper [TotalTLSUpdateResponse ]),
101+ )
102+
103+ def edit (
104+ self ,
105+ * ,
106+ zone_id : str ,
107+ enabled : bool ,
108+ certificate_authority : CertificateAuthority | Omit = omit ,
109+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
110+ # The extra values given here take precedence over values defined on the client or passed to this method.
111+ extra_headers : Headers | None = None ,
112+ extra_query : Query | None = None ,
113+ extra_body : Body | None = None ,
114+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
115+ ) -> Optional [TotalTLSEditResponse ]:
116+ """
117+ Set Total TLS Settings or disable the feature for a Zone.
118+
119+ Args:
120+ zone_id: Identifier.
121+
122+ enabled: If enabled, Total TLS will order a hostname specific TLS certificate for any
123+ proxied A, AAAA, or CNAME record in your zone.
124+
125+ certificate_authority: The Certificate Authority that Total TLS certificates will be issued through.
126+
127+ extra_headers: Send extra headers
128+
129+ extra_query: Add additional query parameters to the request
130+
131+ extra_body: Add additional JSON properties to the request
132+
133+ timeout: Override the client-level default timeout for this request, in seconds
134+ """
135+ if not zone_id :
136+ raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
137+ return self ._post (
138+ f"/zones/{ zone_id } /acm/total_tls" ,
139+ body = maybe_transform (
140+ {
141+ "enabled" : enabled ,
142+ "certificate_authority" : certificate_authority ,
143+ },
144+ total_tls_edit_params .TotalTLSEditParams ,
145+ ),
146+ options = make_request_options (
147+ extra_headers = extra_headers ,
148+ extra_query = extra_query ,
149+ extra_body = extra_body ,
150+ timeout = timeout ,
151+ post_parser = ResultWrapper [Optional [TotalTLSEditResponse ]]._unwrapper ,
152+ ),
153+ cast_to = cast (Type [Optional [TotalTLSEditResponse ]], ResultWrapper [TotalTLSEditResponse ]),
100154 )
101155
102156 def get (
@@ -159,7 +213,60 @@ def with_streaming_response(self) -> AsyncTotalTLSResourceWithStreamingResponse:
159213 """
160214 return AsyncTotalTLSResourceWithStreamingResponse (self )
161215
162- async def create (
216+ async def update (
217+ self ,
218+ * ,
219+ zone_id : str ,
220+ enabled : bool ,
221+ certificate_authority : CertificateAuthority | Omit = omit ,
222+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
223+ # The extra values given here take precedence over values defined on the client or passed to this method.
224+ extra_headers : Headers | None = None ,
225+ extra_query : Query | None = None ,
226+ extra_body : Body | None = None ,
227+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
228+ ) -> Optional [TotalTLSUpdateResponse ]:
229+ """
230+ Set Total TLS Settings or disable the feature for a Zone.
231+
232+ Args:
233+ zone_id: Identifier.
234+
235+ enabled: If enabled, Total TLS will order a hostname specific TLS certificate for any
236+ proxied A, AAAA, or CNAME record in your zone.
237+
238+ certificate_authority: The Certificate Authority that Total TLS certificates will be issued through.
239+
240+ extra_headers: Send extra headers
241+
242+ extra_query: Add additional query parameters to the request
243+
244+ extra_body: Add additional JSON properties to the request
245+
246+ timeout: Override the client-level default timeout for this request, in seconds
247+ """
248+ if not zone_id :
249+ raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
250+ return await self ._post (
251+ f"/zones/{ zone_id } /acm/total_tls" ,
252+ body = await async_maybe_transform (
253+ {
254+ "enabled" : enabled ,
255+ "certificate_authority" : certificate_authority ,
256+ },
257+ total_tls_update_params .TotalTLSUpdateParams ,
258+ ),
259+ options = make_request_options (
260+ extra_headers = extra_headers ,
261+ extra_query = extra_query ,
262+ extra_body = extra_body ,
263+ timeout = timeout ,
264+ post_parser = ResultWrapper [Optional [TotalTLSUpdateResponse ]]._unwrapper ,
265+ ),
266+ cast_to = cast (Type [Optional [TotalTLSUpdateResponse ]], ResultWrapper [TotalTLSUpdateResponse ]),
267+ )
268+
269+ async def edit (
163270 self ,
164271 * ,
165272 zone_id : str ,
@@ -171,7 +278,7 @@ async def create(
171278 extra_query : Query | None = None ,
172279 extra_body : Body | None = None ,
173280 timeout : float | httpx .Timeout | None | NotGiven = not_given ,
174- ) -> Optional [TotalTLSCreateResponse ]:
281+ ) -> Optional [TotalTLSEditResponse ]:
175282 """
176283 Set Total TLS Settings or disable the feature for a Zone.
177284
@@ -200,16 +307,16 @@ async def create(
200307 "enabled" : enabled ,
201308 "certificate_authority" : certificate_authority ,
202309 },
203- total_tls_create_params . TotalTLSCreateParams ,
310+ total_tls_edit_params . TotalTLSEditParams ,
204311 ),
205312 options = make_request_options (
206313 extra_headers = extra_headers ,
207314 extra_query = extra_query ,
208315 extra_body = extra_body ,
209316 timeout = timeout ,
210- post_parser = ResultWrapper [Optional [TotalTLSCreateResponse ]]._unwrapper ,
317+ post_parser = ResultWrapper [Optional [TotalTLSEditResponse ]]._unwrapper ,
211318 ),
212- cast_to = cast (Type [Optional [TotalTLSCreateResponse ]], ResultWrapper [TotalTLSCreateResponse ]),
319+ cast_to = cast (Type [Optional [TotalTLSEditResponse ]], ResultWrapper [TotalTLSEditResponse ]),
213320 )
214321
215322 async def get (
@@ -256,8 +363,11 @@ class TotalTLSResourceWithRawResponse:
256363 def __init__ (self , total_tls : TotalTLSResource ) -> None :
257364 self ._total_tls = total_tls
258365
259- self .create = to_raw_response_wrapper (
260- total_tls .create ,
366+ self .update = to_raw_response_wrapper (
367+ total_tls .update ,
368+ )
369+ self .edit = to_raw_response_wrapper (
370+ total_tls .edit ,
261371 )
262372 self .get = to_raw_response_wrapper (
263373 total_tls .get ,
@@ -268,8 +378,11 @@ class AsyncTotalTLSResourceWithRawResponse:
268378 def __init__ (self , total_tls : AsyncTotalTLSResource ) -> None :
269379 self ._total_tls = total_tls
270380
271- self .create = async_to_raw_response_wrapper (
272- total_tls .create ,
381+ self .update = async_to_raw_response_wrapper (
382+ total_tls .update ,
383+ )
384+ self .edit = async_to_raw_response_wrapper (
385+ total_tls .edit ,
273386 )
274387 self .get = async_to_raw_response_wrapper (
275388 total_tls .get ,
@@ -280,8 +393,11 @@ class TotalTLSResourceWithStreamingResponse:
280393 def __init__ (self , total_tls : TotalTLSResource ) -> None :
281394 self ._total_tls = total_tls
282395
283- self .create = to_streamed_response_wrapper (
284- total_tls .create ,
396+ self .update = to_streamed_response_wrapper (
397+ total_tls .update ,
398+ )
399+ self .edit = to_streamed_response_wrapper (
400+ total_tls .edit ,
285401 )
286402 self .get = to_streamed_response_wrapper (
287403 total_tls .get ,
@@ -292,8 +408,11 @@ class AsyncTotalTLSResourceWithStreamingResponse:
292408 def __init__ (self , total_tls : AsyncTotalTLSResource ) -> None :
293409 self ._total_tls = total_tls
294410
295- self .create = async_to_streamed_response_wrapper (
296- total_tls .create ,
411+ self .update = async_to_streamed_response_wrapper (
412+ total_tls .update ,
413+ )
414+ self .edit = async_to_streamed_response_wrapper (
415+ total_tls .edit ,
297416 )
298417 self .get = async_to_streamed_response_wrapper (
299418 total_tls .get ,
0 commit comments