def update_by_key(
         self, key: str, version: int,
         actions: List[types.ProductUpdateAction]) -> types.Product:
     update_action = types.ProductUpdate(version=version, actions=actions)
     return self._client._post(
         f"products/key={key}",
         {},
         update_action,
         schemas.ProductUpdateSchema,
         schemas.ProductSchema,
     )
Beispiel #2
0
 def update_by_key(
     self,
     key: str,
     version: int,
     actions: List[types.ProductUpdateAction],
     *,
     force_update: bool = False,
 ) -> types.Product:
     update_action = types.ProductUpdate(version=version, actions=actions)
     return self._client._post(
         endpoint=f"products/key={key}",
         params={},
         data_object=update_action,
         request_schema_cls=schemas.ProductUpdateSchema,
         response_schema_cls=schemas.ProductSchema,
         force_update=force_update,
     )
Beispiel #3
0
 def update_by_key(
     self,
     key: str,
     version: int,
     actions: List[types.ProductUpdateAction],
     expand: OptionalListStr = None,
     *,
     force_update: bool = False,
 ) -> types.Product:
     query_params = {}
     if expand:
         query_params["expand"] = expand
     update_action = types.ProductUpdate(version=version, actions=actions)
     return self._client._post(
         endpoint=f"products/key={key}",
         params=query_params,
         data_object=update_action,
         request_schema_cls=schemas.ProductUpdateSchema,
         response_schema_cls=schemas.ProductSchema,
         force_update=force_update,
     )