def update_by_id( self, id: str, version: int, actions: typing.List[types.ProductTypeUpdateAction] ) -> types.ProductType: update_action = types.ProductTypeUpdate(version=version, actions=actions) return self._client._post( f"product-types/{id}", {}, update_action, schemas.ProductTypeUpdateSchema, schemas.ProductTypeSchema, )
def update_by_key( self, key: str, version: int, actions: typing.List[types.ProductTypeUpdateAction], *, force_update: bool = False, ) -> types.ProductType: update_action = types.ProductTypeUpdate(version=version, actions=actions) return self._client._post( endpoint=f"product-types/key={key}", params={}, data_object=update_action, request_schema_cls=schemas.ProductTypeUpdateSchema, response_schema_cls=schemas.ProductTypeSchema, force_update=force_update, )
def update_by_id( self, id: str, version: int, actions: typing.List[types.ProductTypeUpdateAction], expand: OptionalListStr = None, *, force_update: bool = False, ) -> types.ProductType: query_params = {} if expand: query_params["expand"] = expand update_action = types.ProductTypeUpdate(version=version, actions=actions) return self._client._post( endpoint=f"product-types/{id}", params=query_params, data_object=update_action, request_schema_cls=schemas.ProductTypeUpdateSchema, response_schema_cls=schemas.ProductTypeSchema, force_update=force_update, )
def post_load(self, data, **kwargs): return types.ProductTypeUpdate(**data)