Beispiel #1
0
 def update(self, id: str, version: int,
            actions: List[types.CartUpdateAction]) -> types.Cart:
     update_action = types.CartUpdate(version=version, actions=actions)
     return self._client._post(
         f"carts/{id}",
         {},
         update_action,
         schemas.CartUpdateSchema,
         schemas.CartSchema,
     )
Beispiel #2
0
 def update_by_id(
     self,
     id: str,
     version: int,
     actions: List[types.CartUpdateAction],
     *,
     force_update: bool = False,
 ) -> types.Cart:
     update_action = types.CartUpdate(version=version, actions=actions)
     return self._client._post(
         endpoint=f"carts/{id}",
         params={},
         data_object=update_action,
         request_schema_cls=schemas.CartUpdateSchema,
         response_schema_cls=schemas.CartSchema,
         force_update=force_update,
     )
Beispiel #3
0
 def update_by_id(
     self,
     id: str,
     version: int,
     actions: List[types.CartUpdateAction],
     expand: OptionalListStr = None,
     *,
     force_update: bool = False,
 ) -> types.Cart:
     query_params = {}
     if expand:
         query_params["expand"] = expand
     update_action = types.CartUpdate(version=version, actions=actions)
     return self._client._post(
         endpoint=f"carts/{id}",
         params=query_params,
         data_object=update_action,
         request_schema_cls=schemas.CartUpdateSchema,
         response_schema_cls=schemas.CartSchema,
         force_update=force_update,
     )