@@ -299,7 +299,8 @@ def get_category_by_name(self, name: str, *, assert_one: bool = False, **kwargs:
299299
300300 return None
301301
302- def update_category (self , category_id : PathId , category_data : Category , ** kwargs : Any ) -> Category :
302+ def update_category (self , category_id : PathId , category_data : Union [Category , Dict [str , Any ]],
303+ ** kwargs : Any ) -> Category :
303304 """Update a category.
304305
305306 :param category_id:
@@ -311,7 +312,7 @@ def update_category(self, category_id: PathId, category_data: Category, **kwargs
311312 ** kwargs )
312313 return category
313314
314- def create_category (self , category : Category , ** kwargs : Any ) -> Category :
315+ def create_category (self , category : Union [ Category , Dict [ str , Any ]] , ** kwargs : Any ) -> Category :
315316 """Create a new category and return it."""
316317 category = self .post_json_api ("/V1/categories" , json = {"category" : category }, ** kwargs )
317318 return category
@@ -939,7 +940,7 @@ def get_product_media(self, sku: Sku, media_id: PathId, **kwargs: Any) -> MediaG
939940 entry : MediaGalleryEntry = self .get_json_api (f"/V1/products/{ escape_path (sku )} /media/{ media_id } " , ** kwargs )
940941 return entry
941942
942- def save_product_media (self , sku : Sku , media_entry : MediaGalleryEntry , ** kwargs : Any ) -> Any :
943+ def save_product_media (self , sku : Sku , media_entry : Union [ MediaGalleryEntry , Dict [ str , Any ]] , ** kwargs : Any ) -> Any :
943944 """Save a product media."""
944945 return self .post_json_api (f"/V1/products/{ escape_path (sku )} /media" , json = {"entry" : media_entry }, ** kwargs )
945946
0 commit comments