@@ -188,6 +188,59 @@ def create(
188188 raise ApiError (status_code = _response .status_code , headers = dict (_response .headers ), body = _response .text )
189189 raise ApiError (status_code = _response .status_code , headers = dict (_response .headers ), body = _response_json )
190190
191+ def update (
192+ self , inbox_id : InboxId , * , display_name : DisplayName , request_options : typing .Optional [RequestOptions ] = None
193+ ) -> HttpResponse [Inbox ]:
194+ """
195+ Parameters
196+ ----------
197+ inbox_id : InboxId
198+
199+ display_name : DisplayName
200+
201+ request_options : typing.Optional[RequestOptions]
202+ Request-specific configuration.
203+
204+ Returns
205+ -------
206+ HttpResponse[Inbox]
207+ """
208+ _response = self ._client_wrapper .httpx_client .request (
209+ f"v0/inboxes/{ jsonable_encoder (inbox_id )} " ,
210+ base_url = self ._client_wrapper .get_environment ().http ,
211+ method = "PATCH" ,
212+ json = {
213+ "display_name" : display_name ,
214+ },
215+ request_options = request_options ,
216+ omit = OMIT ,
217+ )
218+ try :
219+ if 200 <= _response .status_code < 300 :
220+ _data = typing .cast (
221+ Inbox ,
222+ construct_type (
223+ type_ = Inbox , # type: ignore
224+ object_ = _response .json (),
225+ ),
226+ )
227+ return HttpResponse (response = _response , data = _data )
228+ if _response .status_code == 404 :
229+ raise NotFoundError (
230+ headers = dict (_response .headers ),
231+ body = typing .cast (
232+ ErrorResponse ,
233+ construct_type (
234+ type_ = ErrorResponse , # type: ignore
235+ object_ = _response .json (),
236+ ),
237+ ),
238+ )
239+ _response_json = _response .json ()
240+ except JSONDecodeError :
241+ raise ApiError (status_code = _response .status_code , headers = dict (_response .headers ), body = _response .text )
242+ raise ApiError (status_code = _response .status_code , headers = dict (_response .headers ), body = _response_json )
243+
191244 def delete (
192245 self , inbox_id : InboxId , * , request_options : typing .Optional [RequestOptions ] = None
193246 ) -> HttpResponse [None ]:
@@ -394,6 +447,59 @@ async def create(
394447 raise ApiError (status_code = _response .status_code , headers = dict (_response .headers ), body = _response .text )
395448 raise ApiError (status_code = _response .status_code , headers = dict (_response .headers ), body = _response_json )
396449
450+ async def update (
451+ self , inbox_id : InboxId , * , display_name : DisplayName , request_options : typing .Optional [RequestOptions ] = None
452+ ) -> AsyncHttpResponse [Inbox ]:
453+ """
454+ Parameters
455+ ----------
456+ inbox_id : InboxId
457+
458+ display_name : DisplayName
459+
460+ request_options : typing.Optional[RequestOptions]
461+ Request-specific configuration.
462+
463+ Returns
464+ -------
465+ AsyncHttpResponse[Inbox]
466+ """
467+ _response = await self ._client_wrapper .httpx_client .request (
468+ f"v0/inboxes/{ jsonable_encoder (inbox_id )} " ,
469+ base_url = self ._client_wrapper .get_environment ().http ,
470+ method = "PATCH" ,
471+ json = {
472+ "display_name" : display_name ,
473+ },
474+ request_options = request_options ,
475+ omit = OMIT ,
476+ )
477+ try :
478+ if 200 <= _response .status_code < 300 :
479+ _data = typing .cast (
480+ Inbox ,
481+ construct_type (
482+ type_ = Inbox , # type: ignore
483+ object_ = _response .json (),
484+ ),
485+ )
486+ return AsyncHttpResponse (response = _response , data = _data )
487+ if _response .status_code == 404 :
488+ raise NotFoundError (
489+ headers = dict (_response .headers ),
490+ body = typing .cast (
491+ ErrorResponse ,
492+ construct_type (
493+ type_ = ErrorResponse , # type: ignore
494+ object_ = _response .json (),
495+ ),
496+ ),
497+ )
498+ _response_json = _response .json ()
499+ except JSONDecodeError :
500+ raise ApiError (status_code = _response .status_code , headers = dict (_response .headers ), body = _response .text )
501+ raise ApiError (status_code = _response .status_code , headers = dict (_response .headers ), body = _response_json )
502+
397503 async def delete (
398504 self , inbox_id : InboxId , * , request_options : typing .Optional [RequestOptions ] = None
399505 ) -> AsyncHttpResponse [None ]:
0 commit comments