[docs]@set_service_action_metadata(endpoint=UserCreateEndpoint)defcreate(self,*,first_name:Optional[str]=None,last_name:Optional[str]=None,)->UserCreateResponse:""" Raises: ApiResponseException: In case of a known API error. ApiNetworkException: In case of unhandled network error. """request_body=_UserCreateRequest(first_name=first_name,last_name=last_name).model_dump()self._log_method_execution("User Create",**request_body)withself._get_http_client()asclient:metadata=get_service_action_metadata(self.create)response=client.post(url=self._get_endpoint(metadata.endpoint),json=request_body,params=_UserCreateParametersQuery().model_dump(),)returnUserCreateResponse(**response.json())
[docs]@set_service_action_metadata(endpoint=UserRetrieveEndpoint)defretrieve(self)->UserRetrieveResponse:""" Raises: ApiResponseException: In case of a known API error. ApiNetworkException: In case of unhandled network error. """self._log_method_execution("User Retrieve")withself._get_http_client()asclient:metadata=get_service_action_metadata(self.retrieve)response=client.get(url=self._get_endpoint(metadata.endpoint),params=_UserRetrieveParametersQuery().model_dump())returnUserRetrieveResponse(**response.json())
[docs]@set_service_action_metadata(endpoint=UserPatchEndpoint)defupdate(self,*,tou_accepted:Optional[bool]=None)->UserPatchResponse:""" Raises: ApiResponseException: In case of a known API error. ApiNetworkException: In case of unhandled network error. """request_body=_UserPatchRequest(tou_accepted=tou_accepted).model_dump()self._log_method_execution("User Update",**request_body)withself._get_http_client()asclient:metadata=get_service_action_metadata(self.update)response=client.patch(url=self._get_endpoint(metadata.endpoint),json=request_body,params=_UserPatchParametersQuery().model_dump(),)returnUserPatchResponse(**response.json())
[docs]@set_service_action_metadata(endpoint=UserDeleteEndpoint)defdelete(self)->None:""" Raises: ApiResponseException: In case of a known API error. ApiNetworkException: In case of unhandled network error. """self._log_method_execution("User Delete")withself._get_http_client()asclient:metadata=get_service_action_metadata(self.delete)client.delete(url=self._get_endpoint(metadata.endpoint),params=_UserDeleteParametersQuery().model_dump())