shopline-sdk-python 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (638) hide show
  1. shopline_sdk/__init__.py +17 -0
  2. shopline_sdk/apis/__init__.py +0 -0
  3. shopline_sdk/apis/addon_products/__init__.py +0 -0
  4. shopline_sdk/apis/addon_products/bulk_update_addon_product_quantity_by_sku.py +72 -0
  5. shopline_sdk/apis/addon_products/create_addon_product.py +69 -0
  6. shopline_sdk/apis/addon_products/get_addon_product.py +42 -0
  7. shopline_sdk/apis/addon_products/get_addon_product_stocks.py +66 -0
  8. shopline_sdk/apis/addon_products/get_addon_products.py +84 -0
  9. shopline_sdk/apis/addon_products/search_addon_products.py +113 -0
  10. shopline_sdk/apis/addon_products/update_addon_product.py +54 -0
  11. shopline_sdk/apis/addon_products/update_addon_product_quantity.py +96 -0
  12. shopline_sdk/apis/addon_products/update_addon_product_stock.py +86 -0
  13. shopline_sdk/apis/affiliate_campaigns/__init__.py +0 -0
  14. shopline_sdk/apis/affiliate_campaigns/create_affiliate_campaign.py +109 -0
  15. shopline_sdk/apis/affiliate_campaigns/delete_affiliate_campaign.py +44 -0
  16. shopline_sdk/apis/affiliate_campaigns/export_affiliate_campaign_report_to_partner.py +60 -0
  17. shopline_sdk/apis/affiliate_campaigns/get_affiliate_campaign.py +59 -0
  18. shopline_sdk/apis/affiliate_campaigns/get_affiliate_campaign_orders.py +75 -0
  19. shopline_sdk/apis/affiliate_campaigns/get_affiliate_campaign_summary.py +49 -0
  20. shopline_sdk/apis/affiliate_campaigns/get_affiliate_campaigns.py +84 -0
  21. shopline_sdk/apis/affiliate_campaigns/get_products_sales_ranking_of_campaign.py +73 -0
  22. shopline_sdk/apis/affiliate_campaigns/update_affiliate_campaign.py +96 -0
  23. shopline_sdk/apis/agents/__init__.py +0 -0
  24. shopline_sdk/apis/agents/get_agent.py +59 -0
  25. shopline_sdk/apis/agents/get_agents.py +77 -0
  26. shopline_sdk/apis/bulk_operations/__init__.py +0 -0
  27. shopline_sdk/apis/bulk_operations/get_a_bulk_operation.py +43 -0
  28. shopline_sdk/apis/bulk_operations/get_bulk_operations.py +57 -0
  29. shopline_sdk/apis/cart_item_app_metafields/__init__.py +0 -0
  30. shopline_sdk/apis/cart_item_app_metafields/bulk_create_app_metafield.py +52 -0
  31. shopline_sdk/apis/cart_item_app_metafields/bulk_delete_app_metafield.py +61 -0
  32. shopline_sdk/apis/cart_item_app_metafields/bulk_update_app_metafield.py +62 -0
  33. shopline_sdk/apis/cart_item_app_metafields/get_app_metafields_attached_to_cart_items_of_specific_cart.py +61 -0
  34. shopline_sdk/apis/cart_item_metafields/__init__.py +0 -0
  35. shopline_sdk/apis/cart_item_metafields/bulk_create_metafield.py +52 -0
  36. shopline_sdk/apis/cart_item_metafields/bulk_delete_metafield.py +62 -0
  37. shopline_sdk/apis/cart_item_metafields/bulk_update_metafield.py +62 -0
  38. shopline_sdk/apis/cart_item_metafields/get_metafields_attached_to_cart_items_of_specific_cart.py +62 -0
  39. shopline_sdk/apis/carts/__init__.py +0 -0
  40. shopline_sdk/apis/carts/bulk_add_items_to_cart.py +80 -0
  41. shopline_sdk/apis/carts/bulk_delete_cart_items.py +59 -0
  42. shopline_sdk/apis/carts/bulk_patch_cart_items.py +61 -0
  43. shopline_sdk/apis/carts/get_cart.py +63 -0
  44. shopline_sdk/apis/carts/get_cart_id.py +74 -0
  45. shopline_sdk/apis/categories/__init__.py +0 -0
  46. shopline_sdk/apis/categories/bulk_assign.py +75 -0
  47. shopline_sdk/apis/categories/bulk_update_category_product_sorting.py +84 -0
  48. shopline_sdk/apis/categories/create_category.py +62 -0
  49. shopline_sdk/apis/categories/delete_category.py +62 -0
  50. shopline_sdk/apis/categories/get_categories.py +104 -0
  51. shopline_sdk/apis/categories/get_category.py +76 -0
  52. shopline_sdk/apis/categories/update_category.py +70 -0
  53. shopline_sdk/apis/channels/__init__.py +0 -0
  54. shopline_sdk/apis/channels/create_product_channel_price.py +45 -0
  55. shopline_sdk/apis/channels/get_channel.py +76 -0
  56. shopline_sdk/apis/channels/get_channels.py +83 -0
  57. shopline_sdk/apis/channels/get_product_channel_price.py +75 -0
  58. shopline_sdk/apis/channels/update_product_channel_price.py +45 -0
  59. shopline_sdk/apis/conversations/__init__.py +0 -0
  60. shopline_sdk/apis/conversations/create_order_message.py +91 -0
  61. shopline_sdk/apis/conversations/create_return_order_message.py +90 -0
  62. shopline_sdk/apis/conversations/create_shop_message.py +81 -0
  63. shopline_sdk/apis/conversations/get_conversations.py +76 -0
  64. shopline_sdk/apis/conversations/get_messages.py +76 -0
  65. shopline_sdk/apis/custom_fields/__init__.py +0 -0
  66. shopline_sdk/apis/custom_fields/get_custom_fields.py +42 -0
  67. shopline_sdk/apis/customer_app_metafields/__init__.py +0 -0
  68. shopline_sdk/apis/customer_app_metafields/create_specific_app_metafield.py +44 -0
  69. shopline_sdk/apis/customer_app_metafields/delete_specific_app_metafield.py +42 -0
  70. shopline_sdk/apis/customer_app_metafields/get_app_metafields_attached_to_specific_customer.py +61 -0
  71. shopline_sdk/apis/customer_app_metafields/get_specific_app_metafield.py +41 -0
  72. shopline_sdk/apis/customer_app_metafields/update_specific_app_metafield.py +44 -0
  73. shopline_sdk/apis/customer_group_children/__init__.py +0 -0
  74. shopline_sdk/apis/customer_group_children/get_children_group_of_the_customer_group.py +89 -0
  75. shopline_sdk/apis/customer_groups/__init__.py +0 -0
  76. shopline_sdk/apis/customer_groups/get_customer_group.py +65 -0
  77. shopline_sdk/apis/customer_groups/get_customer_groups.py +108 -0
  78. shopline_sdk/apis/customer_groups/get_customer_ids_of_the_specific_customer_group.py +84 -0
  79. shopline_sdk/apis/customer_groups/search_customer_groups.py +92 -0
  80. shopline_sdk/apis/customer_metafields/__init__.py +0 -0
  81. shopline_sdk/apis/customer_metafields/create_specific_metafield.py +44 -0
  82. shopline_sdk/apis/customer_metafields/delete_specific_metafield.py +42 -0
  83. shopline_sdk/apis/customer_metafields/get_metafields_attached_to_specific_customer.py +62 -0
  84. shopline_sdk/apis/customer_metafields/get_specific_metafield.py +41 -0
  85. shopline_sdk/apis/customer_metafields/update_specific_metafield.py +44 -0
  86. shopline_sdk/apis/customers/__init__.py +0 -0
  87. shopline_sdk/apis/customers/add_or_remove_customer_tags.py +93 -0
  88. shopline_sdk/apis/customers/create_customer.py +87 -0
  89. shopline_sdk/apis/customers/delete_customer.py +62 -0
  90. shopline_sdk/apis/customers/get_customer.py +94 -0
  91. shopline_sdk/apis/customers/get_customer_member_points_history.py +92 -0
  92. shopline_sdk/apis/customers/get_customer_store_credit_history.py +98 -0
  93. shopline_sdk/apis/customers/get_customers.py +127 -0
  94. shopline_sdk/apis/customers/get_line_customer.py +67 -0
  95. shopline_sdk/apis/customers/getcustomers_smembershipinfo.py +93 -0
  96. shopline_sdk/apis/customers/search_customers.py +216 -0
  97. shopline_sdk/apis/customers/update_customer.py +87 -0
  98. shopline_sdk/apis/customers/update_customer_member_points.py +113 -0
  99. shopline_sdk/apis/customers/update_customer_store_credits.py +172 -0
  100. shopline_sdk/apis/customers/update_customer_subscriptions.py +64 -0
  101. shopline_sdk/apis/customers/update_customer_tags.py +88 -0
  102. shopline_sdk/apis/delivery_options/__init__.py +0 -0
  103. shopline_sdk/apis/delivery_options/get_delivery_config.py +52 -0
  104. shopline_sdk/apis/delivery_options/get_delivery_option.py +42 -0
  105. shopline_sdk/apis/delivery_options/get_delivery_options.py +65 -0
  106. shopline_sdk/apis/delivery_options/get_delivery_time_slots.py +64 -0
  107. shopline_sdk/apis/delivery_options/updatedeliveryoption_sstoreinformation.py +67 -0
  108. shopline_sdk/apis/event_trackers/__init__.py +0 -0
  109. shopline_sdk/apis/event_trackers/create_an_event_tracker.py +83 -0
  110. shopline_sdk/apis/event_trackers/delete_an_event_tracker.py +57 -0
  111. shopline_sdk/apis/event_trackers/get_an_event_tracker.py +64 -0
  112. shopline_sdk/apis/event_trackers/get_event_trackers.py +97 -0
  113. shopline_sdk/apis/event_trackers/update_event_tracker.py +91 -0
  114. shopline_sdk/apis/flash_price_campaigns/__init__.py +0 -0
  115. shopline_sdk/apis/flash_price_campaigns/create_flash_price_campaign.py +45 -0
  116. shopline_sdk/apis/flash_price_campaigns/delete_flash_price_campaign.py +44 -0
  117. shopline_sdk/apis/flash_price_campaigns/get_a_flash_price_campaign.py +43 -0
  118. shopline_sdk/apis/flash_price_campaigns/get_flash_price_campaigns.py +72 -0
  119. shopline_sdk/apis/flash_price_campaigns/update_flash_price_campaign.py +46 -0
  120. shopline_sdk/apis/gifts/__init__.py +0 -0
  121. shopline_sdk/apis/gifts/bulk_update_quantity_by_sku.py +106 -0
  122. shopline_sdk/apis/gifts/create_gift.py +57 -0
  123. shopline_sdk/apis/gifts/get_gift_stocks.py +66 -0
  124. shopline_sdk/apis/gifts/get_gifts.py +86 -0
  125. shopline_sdk/apis/gifts/search_gifts.py +110 -0
  126. shopline_sdk/apis/gifts/update_gift.py +54 -0
  127. shopline_sdk/apis/gifts/update_gift_quantity.py +100 -0
  128. shopline_sdk/apis/gifts/update_gift_stock.py +86 -0
  129. shopline_sdk/apis/layouts/__init__.py +0 -0
  130. shopline_sdk/apis/layouts/get_layouts_sections.py +77 -0
  131. shopline_sdk/apis/medias/__init__.py +0 -0
  132. shopline_sdk/apis/medias/create_image.py +52 -0
  133. shopline_sdk/apis/member_point_rules/__init__.py +0 -0
  134. shopline_sdk/apis/member_point_rules/get_member_point_rules.py +55 -0
  135. shopline_sdk/apis/member_points/__init__.py +0 -0
  136. shopline_sdk/apis/member_points/bulk_update_member_points.py +87 -0
  137. shopline_sdk/apis/membership_tiers/__init__.py +0 -0
  138. shopline_sdk/apis/membership_tiers/get_customer_membership_tier_history.py +84 -0
  139. shopline_sdk/apis/membership_tiers/get_membership_tiers.py +65 -0
  140. shopline_sdk/apis/merchant_app_metafields/__init__.py +0 -0
  141. shopline_sdk/apis/merchant_app_metafields/get_app_metafields_attached_to_current_merchant.py +61 -0
  142. shopline_sdk/apis/merchant_metafields/__init__.py +0 -0
  143. shopline_sdk/apis/merchant_metafields/get_metafields_attached_to_current_merchant.py +62 -0
  144. shopline_sdk/apis/merchants/__init__.py +0 -0
  145. shopline_sdk/apis/merchants/generatemerchant_sexpresscartlink.py +66 -0
  146. shopline_sdk/apis/merchants/get_merchant.py +56 -0
  147. shopline_sdk/apis/merchants/get_merchants.py +46 -0
  148. shopline_sdk/apis/metafield_definitions/__init__.py +0 -0
  149. shopline_sdk/apis/metafield_definitions/create_specific_metafield_definition.py +44 -0
  150. shopline_sdk/apis/metafield_definitions/get_an_array_of_metafield_definitions.py +45 -0
  151. shopline_sdk/apis/metafield_definitions/get_specific_metafield_definition.py +41 -0
  152. shopline_sdk/apis/multipass_linking/__init__.py +0 -0
  153. shopline_sdk/apis/multipass_linking/delete_multipass_linking_for_customer.py +61 -0
  154. shopline_sdk/apis/multipass_linking/get_active_multipass_linkings.py +67 -0
  155. shopline_sdk/apis/multipass_linking/update_multipass_linking_for_customer.py +69 -0
  156. shopline_sdk/apis/multipass_secret/__init__.py +0 -0
  157. shopline_sdk/apis/multipass_secret/create_multipass_secret.py +41 -0
  158. shopline_sdk/apis/multipass_secret/get_multipass_secret.py +50 -0
  159. shopline_sdk/apis/order_app_metafields/__init__.py +0 -0
  160. shopline_sdk/apis/order_app_metafields/get_app_metafields_attached_to_specific_order.py +61 -0
  161. shopline_sdk/apis/order_deliveries/__init__.py +0 -0
  162. shopline_sdk/apis/order_deliveries/get_order_delivery.py +43 -0
  163. shopline_sdk/apis/order_deliveries/update_order_delivery.py +63 -0
  164. shopline_sdk/apis/order_item_app_metafields/__init__.py +0 -0
  165. shopline_sdk/apis/order_item_app_metafields/get_app_metafields_attached_to_order_items_of_specific_order.py +61 -0
  166. shopline_sdk/apis/order_item_metafields/__init__.py +0 -0
  167. shopline_sdk/apis/order_item_metafields/get_metafields_attached_to_order_items_of_specific_order.py +62 -0
  168. shopline_sdk/apis/order_metafields/__init__.py +0 -0
  169. shopline_sdk/apis/order_metafields/get_metafields_attached_to_specific_order.py +62 -0
  170. shopline_sdk/apis/orders/__init__.py +0 -0
  171. shopline_sdk/apis/orders/bulk_execute_shipment.py +70 -0
  172. shopline_sdk/apis/orders/cancel_order.py +70 -0
  173. shopline_sdk/apis/orders/create_archived_orders_report.py +72 -0
  174. shopline_sdk/apis/orders/create_order.py +90 -0
  175. shopline_sdk/apis/orders/execute_shipment.py +63 -0
  176. shopline_sdk/apis/orders/get_all_orders_tags.py +54 -0
  177. shopline_sdk/apis/orders/get_order.py +78 -0
  178. shopline_sdk/apis/orders/get_order_action_logs.py +62 -0
  179. shopline_sdk/apis/orders/get_order_labels_of_delivery.py +94 -0
  180. shopline_sdk/apis/orders/get_order_transaction_by_order_ids.py +58 -0
  181. shopline_sdk/apis/orders/get_orders.py +111 -0
  182. shopline_sdk/apis/orders/search_orders.py +339 -0
  183. shopline_sdk/apis/orders/split_order.py +84 -0
  184. shopline_sdk/apis/orders/update_order.py +123 -0
  185. shopline_sdk/apis/orders/update_order_delivery_status.py +88 -0
  186. shopline_sdk/apis/orders/update_order_payment_status.py +92 -0
  187. shopline_sdk/apis/orders/update_order_status.py +94 -0
  188. shopline_sdk/apis/orders/update_order_tags.py +91 -0
  189. shopline_sdk/apis/payments/__init__.py +0 -0
  190. shopline_sdk/apis/payments/get_payment.py +59 -0
  191. shopline_sdk/apis/payments/get_payments.py +88 -0
  192. shopline_sdk/apis/product_app_metafields/__init__.py +0 -0
  193. shopline_sdk/apis/product_app_metafields/get_app_metafields_attached_to_specific_product.py +61 -0
  194. shopline_sdk/apis/product_metafields/__init__.py +0 -0
  195. shopline_sdk/apis/product_metafields/get_metafields_attached_to_specific_product.py +62 -0
  196. shopline_sdk/apis/product_review_comments/__init__.py +0 -0
  197. shopline_sdk/apis/product_review_comments/bulk_create_product_review_comments.py +66 -0
  198. shopline_sdk/apis/product_review_comments/bulk_delete_product_review_comments.py +46 -0
  199. shopline_sdk/apis/product_review_comments/bulk_update_product_review_comments.py +64 -0
  200. shopline_sdk/apis/product_review_comments/create_product_review_comments.py +45 -0
  201. shopline_sdk/apis/product_review_comments/delete_product_review_comment.py +37 -0
  202. shopline_sdk/apis/product_review_comments/get_product_review_comment.py +42 -0
  203. shopline_sdk/apis/product_review_comments/get_product_review_comments.py +91 -0
  204. shopline_sdk/apis/product_review_comments/update_product_review_comment.py +45 -0
  205. shopline_sdk/apis/product_subscriptions/__init__.py +0 -0
  206. shopline_sdk/apis/product_subscriptions/get_a_list_of_product_subscriptions.py +71 -0
  207. shopline_sdk/apis/product_subscriptions/get_product_subscription.py +42 -0
  208. shopline_sdk/apis/products/__init__.py +0 -0
  209. shopline_sdk/apis/products/add_product_images.py +84 -0
  210. shopline_sdk/apis/products/batch_update_current_product_labels.py +73 -0
  211. shopline_sdk/apis/products/bulk_delete_product.py +77 -0
  212. shopline_sdk/apis/products/bulk_update_stock.py +81 -0
  213. shopline_sdk/apis/products/bulkpublish_unpublishproductinonlinestore.py +64 -0
  214. shopline_sdk/apis/products/bulkpublish_unpublishproductinretailstore.py +64 -0
  215. shopline_sdk/apis/products/create_product.py +54 -0
  216. shopline_sdk/apis/products/create_product_variation.py +70 -0
  217. shopline_sdk/apis/products/delete_product.py +70 -0
  218. shopline_sdk/apis/products/delete_product_images.py +54 -0
  219. shopline_sdk/apis/products/delete_product_variation.py +70 -0
  220. shopline_sdk/apis/products/get_locked_inventory_count.py +53 -0
  221. shopline_sdk/apis/products/get_product.py +79 -0
  222. shopline_sdk/apis/products/get_product_stocks.py +66 -0
  223. shopline_sdk/apis/products/get_products.py +112 -0
  224. shopline_sdk/apis/products/search_products.py +58 -0
  225. shopline_sdk/apis/products/update_current_product_tags.py +80 -0
  226. shopline_sdk/apis/products/update_product.py +54 -0
  227. shopline_sdk/apis/products/update_product_price.py +94 -0
  228. shopline_sdk/apis/products/update_product_quantity.py +102 -0
  229. shopline_sdk/apis/products/update_product_variation.py +46 -0
  230. shopline_sdk/apis/products/update_product_variation_price.py +92 -0
  231. shopline_sdk/apis/products/update_product_variation_quantity.py +111 -0
  232. shopline_sdk/apis/products/update_quantity_by_sku.py +114 -0
  233. shopline_sdk/apis/products/update_stock.py +89 -0
  234. shopline_sdk/apis/promotions/__init__.py +0 -0
  235. shopline_sdk/apis/promotions/create_promotion.py +45 -0
  236. shopline_sdk/apis/promotions/delete_promotion.py +44 -0
  237. shopline_sdk/apis/promotions/get_customer_coupon_promotions.py +61 -0
  238. shopline_sdk/apis/promotions/get_customer_promotions.py +63 -0
  239. shopline_sdk/apis/promotions/get_promotion.py +60 -0
  240. shopline_sdk/apis/promotions/get_promotions.py +106 -0
  241. shopline_sdk/apis/promotions/search_promotions.py +108 -0
  242. shopline_sdk/apis/promotions/update_promotion.py +54 -0
  243. shopline_sdk/apis/purchase_orders/__init__.py +0 -0
  244. shopline_sdk/apis/purchase_orders/create_child_purchase_order.py +66 -0
  245. shopline_sdk/apis/purchase_orders/create_purchase_order.py +66 -0
  246. shopline_sdk/apis/purchase_orders/delete_the_specified_purchase_orders.py +60 -0
  247. shopline_sdk/apis/purchase_orders/get_purchase_orders.py +89 -0
  248. shopline_sdk/apis/purchase_orders/get_the_specified_purchase_order.py +59 -0
  249. shopline_sdk/apis/purchase_orders/update_purchase_order.py +66 -0
  250. shopline_sdk/apis/return_orders/__init__.py +0 -0
  251. shopline_sdk/apis/return_orders/create_return_order.py +62 -0
  252. shopline_sdk/apis/return_orders/get_return_order.py +42 -0
  253. shopline_sdk/apis/return_orders/get_return_orders.py +95 -0
  254. shopline_sdk/apis/return_orders/update_return_order.py +70 -0
  255. shopline_sdk/apis/sales/__init__.py +0 -0
  256. shopline_sdk/apis/sales/create_sale_products.py +78 -0
  257. shopline_sdk/apis/sales/delete_sale_products.py +44 -0
  258. shopline_sdk/apis/sales/get_sale_comments.py +77 -0
  259. shopline_sdk/apis/sales/get_sale_customers.py +69 -0
  260. shopline_sdk/apis/sales/get_sale_products.py +74 -0
  261. shopline_sdk/apis/sales/update_sale_product_status.py +71 -0
  262. shopline_sdk/apis/sales/update_sale_products.py +78 -0
  263. shopline_sdk/apis/settings/__init__.py +0 -0
  264. shopline_sdk/apis/settings/get_checkout_setting.py +51 -0
  265. shopline_sdk/apis/settings/get_domains_setting.py +51 -0
  266. shopline_sdk/apis/settings/get_layouts_draft_setting.py +59 -0
  267. shopline_sdk/apis/settings/get_layouts_setting.py +59 -0
  268. shopline_sdk/apis/settings/get_orders_setting.py +51 -0
  269. shopline_sdk/apis/settings/get_payments_setting.py +51 -0
  270. shopline_sdk/apis/settings/get_pos_setting.py +51 -0
  271. shopline_sdk/apis/settings/get_product_review_setting.py +51 -0
  272. shopline_sdk/apis/settings/get_products_setting.py +51 -0
  273. shopline_sdk/apis/settings/get_promotions_setting.py +51 -0
  274. shopline_sdk/apis/settings/get_setting.py +42 -0
  275. shopline_sdk/apis/settings/get_shop_setting.py +51 -0
  276. shopline_sdk/apis/settings/get_tax_setting.py +51 -0
  277. shopline_sdk/apis/settings/get_theme_draft_setting.py +59 -0
  278. shopline_sdk/apis/settings/get_theme_setting.py +59 -0
  279. shopline_sdk/apis/settings/get_third_party_ads_setting.py +42 -0
  280. shopline_sdk/apis/settings/get_users_setting.py +65 -0
  281. shopline_sdk/apis/settings/publish_layouts_setting.py +73 -0
  282. shopline_sdk/apis/settings/publish_theme_setting.py +59 -0
  283. shopline_sdk/apis/settings/save_layouts_draft_setting.py +67 -0
  284. shopline_sdk/apis/settings/save_theme_setting.py +59 -0
  285. shopline_sdk/apis/settings/update_domains_setting.py +85 -0
  286. shopline_sdk/apis/staffs/__init__.py +0 -0
  287. shopline_sdk/apis/staffs/get_all_staff.py +62 -0
  288. shopline_sdk/apis/staffs/get_staff.py +59 -0
  289. shopline_sdk/apis/staffs/get_staff_permissions.py +62 -0
  290. shopline_sdk/apis/store_credits/__init__.py +0 -0
  291. shopline_sdk/apis/store_credits/bulk_update_store_credits.py +90 -0
  292. shopline_sdk/apis/store_credits/get_store_credits.py +87 -0
  293. shopline_sdk/apis/storefront_oauth_applications/__init__.py +0 -0
  294. shopline_sdk/apis/storefront_oauth_applications/create_storefront_o_auth_application.py +52 -0
  295. shopline_sdk/apis/storefront_oauth_applications/delete_storefront_oauth_application_by_id.py +47 -0
  296. shopline_sdk/apis/storefront_oauth_applications/get_storefront_o_auth_application.py +41 -0
  297. shopline_sdk/apis/storefront_oauth_applications/get_storefront_o_auth_application_by_id.py +50 -0
  298. shopline_sdk/apis/storefront_tokens/__init__.py +0 -0
  299. shopline_sdk/apis/storefront_tokens/create_storefront_token.py +60 -0
  300. shopline_sdk/apis/storefront_tokens/delete_storefront_token_by_id.py +54 -0
  301. shopline_sdk/apis/storefront_tokens/get_storefront_token_by_id.py +51 -0
  302. shopline_sdk/apis/storefront_tokens/list_all_storefront_tokens.py +46 -0
  303. shopline_sdk/apis/taxes/__init__.py +0 -0
  304. shopline_sdk/apis/taxes/get_taxes.py +65 -0
  305. shopline_sdk/apis/themes/__init__.py +0 -0
  306. shopline_sdk/apis/themes/get_theme_by_theme_key.py +63 -0
  307. shopline_sdk/apis/themes/getthethemesectionsbytheme_key.py +76 -0
  308. shopline_sdk/apis/token/__init__.py +0 -0
  309. shopline_sdk/apis/token/get_token_info.py +44 -0
  310. shopline_sdk/apis/user_coupons/__init__.py +0 -0
  311. shopline_sdk/apis/user_coupons/claim_user_coupon.py +45 -0
  312. shopline_sdk/apis/user_coupons/create_user_coupon.py +40 -0
  313. shopline_sdk/apis/user_coupons/get_user_coupons.py +55 -0
  314. shopline_sdk/apis/user_coupons/get_user_coupons_with_cursor.py +57 -0
  315. shopline_sdk/apis/user_coupons/redeem_user_coupon.py +45 -0
  316. shopline_sdk/apis/warehouses/__init__.py +0 -0
  317. shopline_sdk/apis/warehouses/get_warehouses.py +92 -0
  318. shopline_sdk/apis/webhooks/__init__.py +0 -0
  319. shopline_sdk/apis/webhooks/create_webhook.py +45 -0
  320. shopline_sdk/apis/webhooks/delete_webhook.py +37 -0
  321. shopline_sdk/apis/webhooks/get_webhook.py +42 -0
  322. shopline_sdk/apis/webhooks/get_webhooks.py +59 -0
  323. shopline_sdk/apis/webhooks/update_webhook.py +45 -0
  324. shopline_sdk/apis/wish_list_items/__init__.py +0 -0
  325. shopline_sdk/apis/wish_list_items/create_wish_list_item.py +68 -0
  326. shopline_sdk/apis/wish_list_items/delete_wish_list_item.py +89 -0
  327. shopline_sdk/apis/wish_list_items/get_wish_list_items.py +88 -0
  328. shopline_sdk/client.py +15 -0
  329. shopline_sdk/exceptions.py +48 -0
  330. shopline_sdk/helper.py +84 -0
  331. shopline_sdk/models/__init__.py +610 -0
  332. shopline_sdk/models/addon_product.py +50 -0
  333. shopline_sdk/models/addon_products.py +14 -0
  334. shopline_sdk/models/addon_products_cursor_based.py +15 -0
  335. shopline_sdk/models/address_node.py +27 -0
  336. shopline_sdk/models/address_nodes.py +20 -0
  337. shopline_sdk/models/address_preference.py +46 -0
  338. shopline_sdk/models/address_preference_layout_data.py +15 -0
  339. shopline_sdk/models/address_preferences.py +16 -0
  340. shopline_sdk/models/affiliate.py +32 -0
  341. shopline_sdk/models/affiliate_campaign.py +53 -0
  342. shopline_sdk/models/affiliate_campaign_order.py +75 -0
  343. shopline_sdk/models/affiliate_campaign_orders.py +16 -0
  344. shopline_sdk/models/affiliate_campaigns.py +20 -0
  345. shopline_sdk/models/agent.py +20 -0
  346. shopline_sdk/models/agent_work_log.py +30 -0
  347. shopline_sdk/models/agent_work_logs.py +12 -0
  348. shopline_sdk/models/agents.py +14 -0
  349. shopline_sdk/models/analytics.py +12 -0
  350. shopline_sdk/models/app_metafield_value.py +26 -0
  351. shopline_sdk/models/app_setting.py +9 -0
  352. shopline_sdk/models/bad_request_error.py +14 -0
  353. shopline_sdk/models/bearer_auth.py +9 -0
  354. shopline_sdk/models/bulk_delete_metafield_body.py +15 -0
  355. shopline_sdk/models/bulk_update_app_metafield_body.py +16 -0
  356. shopline_sdk/models/bulk_update_metafield_body.py +17 -0
  357. shopline_sdk/models/campaign_product.py +18 -0
  358. shopline_sdk/models/cart.py +128 -0
  359. shopline_sdk/models/cart_delivery.py +24 -0
  360. shopline_sdk/models/cart_item.py +51 -0
  361. shopline_sdk/models/cart_product.py +83 -0
  362. shopline_sdk/models/cart_product_variation.py +36 -0
  363. shopline_sdk/models/cart_promotion.py +19 -0
  364. shopline_sdk/models/categories.py +14 -0
  365. shopline_sdk/models/categories_cursor_based.py +15 -0
  366. shopline_sdk/models/category.py +45 -0
  367. shopline_sdk/models/category_layout.py +23 -0
  368. shopline_sdk/models/change_payment_method_response.py +14 -0
  369. shopline_sdk/models/channel.py +49 -0
  370. shopline_sdk/models/channel_param.py +11 -0
  371. shopline_sdk/models/channels.py +14 -0
  372. shopline_sdk/models/checkout_setting.py +37 -0
  373. shopline_sdk/models/corporate_info.py +34 -0
  374. shopline_sdk/models/coupon_item.py +53 -0
  375. shopline_sdk/models/create_agent_body.py +17 -0
  376. shopline_sdk/models/create_agent_work_log_request_body.py +18 -0
  377. shopline_sdk/models/create_app_metafield_body.py +15 -0
  378. shopline_sdk/models/create_bulk_operation_body.py +22 -0
  379. shopline_sdk/models/create_category_body.py +27 -0
  380. shopline_sdk/models/create_channel_price_body.py +21 -0
  381. shopline_sdk/models/create_customer_body.py +63 -0
  382. shopline_sdk/models/create_customer_group_activity_body.py +24 -0
  383. shopline_sdk/models/create_delivery_option_body.py +38 -0
  384. shopline_sdk/models/create_event_tracker_body.py +23 -0
  385. shopline_sdk/models/create_flash_price_campaign_body.py +22 -0
  386. shopline_sdk/models/create_metafield_body.py +16 -0
  387. shopline_sdk/models/create_metafield_definition_body.py +18 -0
  388. shopline_sdk/models/create_page_body.py +25 -0
  389. shopline_sdk/models/create_product_body.py +84 -0
  390. shopline_sdk/models/create_product_feed_setting_body.py +31 -0
  391. shopline_sdk/models/create_product_review_comment_body.py +21 -0
  392. shopline_sdk/models/create_product_variation_body.py +13 -0
  393. shopline_sdk/models/create_promotion_body.py +56 -0
  394. shopline_sdk/models/create_return_order_body.py +49 -0
  395. shopline_sdk/models/create_sub_res_app_metafield_body.py +16 -0
  396. shopline_sdk/models/create_sub_res_metafield_body.py +17 -0
  397. shopline_sdk/models/create_user_coupon_body.py +18 -0
  398. shopline_sdk/models/create_webhook_body.py +14 -0
  399. shopline_sdk/models/create_wish_list_item_body.py +27 -0
  400. shopline_sdk/models/cursor_based_paginatable.py +12 -0
  401. shopline_sdk/models/custom_field.py +18 -0
  402. shopline_sdk/models/customer.py +200 -0
  403. shopline_sdk/models/customer_coupon_promotions.py +12 -0
  404. shopline_sdk/models/customer_group.py +33 -0
  405. shopline_sdk/models/customer_group_activity.py +28 -0
  406. shopline_sdk/models/customer_groups.py +14 -0
  407. shopline_sdk/models/customer_promotion.py +54 -0
  408. shopline_sdk/models/customer_viewed_categories.py +14 -0
  409. shopline_sdk/models/customer_viewed_category.py +14 -0
  410. shopline_sdk/models/customer_viewed_product.py +14 -0
  411. shopline_sdk/models/customer_viewed_products.py +14 -0
  412. shopline_sdk/models/delivery_option.py +74 -0
  413. shopline_sdk/models/delivery_rate.py +17 -0
  414. shopline_sdk/models/delivery_time_slot.py +27 -0
  415. shopline_sdk/models/domains_setting.py +13 -0
  416. shopline_sdk/models/domains_setting_webmaster.py +20 -0
  417. shopline_sdk/models/end_date_param.py +10 -0
  418. shopline_sdk/models/entity_render_error.py +11 -0
  419. shopline_sdk/models/event_tracker.py +35 -0
  420. shopline_sdk/models/event_trackers.py +14 -0
  421. shopline_sdk/models/extend_promotion.py +25 -0
  422. shopline_sdk/models/facebook_business_extension_domains_entity.py +16 -0
  423. shopline_sdk/models/filter_tag.py +14 -0
  424. shopline_sdk/models/flash_price_campaign.py +39 -0
  425. shopline_sdk/models/flash_price_campaigns.py +16 -0
  426. shopline_sdk/models/forbidden_error.py +14 -0
  427. shopline_sdk/models/gift.py +54 -0
  428. shopline_sdk/models/gifts.py +14 -0
  429. shopline_sdk/models/gifts_cursor_based.py +15 -0
  430. shopline_sdk/models/global_section.py +12 -0
  431. shopline_sdk/models/global_section_settings.py +27 -0
  432. shopline_sdk/models/gross_amount_analytics.py +28 -0
  433. shopline_sdk/models/gross_orders_analytics.py +29 -0
  434. shopline_sdk/models/individual_info.py +14 -0
  435. shopline_sdk/models/interval_param.py +11 -0
  436. shopline_sdk/models/invoice.py +17 -0
  437. shopline_sdk/models/is_real_time_param.py +10 -0
  438. shopline_sdk/models/job.py +48 -0
  439. shopline_sdk/models/jobs.py +14 -0
  440. shopline_sdk/models/layout_sections.py +12 -0
  441. shopline_sdk/models/layouts_setting.py +14 -0
  442. shopline_sdk/models/limit_exceeded_error.py +14 -0
  443. shopline_sdk/models/link.py +39 -0
  444. shopline_sdk/models/lock_inventory.py +9 -0
  445. shopline_sdk/models/lock_inventory_count.py +14 -0
  446. shopline_sdk/models/max_applicable_member_point.py +16 -0
  447. shopline_sdk/models/media.py +16 -0
  448. shopline_sdk/models/media_upload_error.py +10 -0
  449. shopline_sdk/models/member_point.py +28 -0
  450. shopline_sdk/models/member_point_fulfillment.py +23 -0
  451. shopline_sdk/models/member_point_rule.py +40 -0
  452. shopline_sdk/models/member_point_rules.py +12 -0
  453. shopline_sdk/models/member_points.py +14 -0
  454. shopline_sdk/models/member_registration_analytics.py +29 -0
  455. shopline_sdk/models/membership_info.py +56 -0
  456. shopline_sdk/models/membership_tier.py +26 -0
  457. shopline_sdk/models/membership_tier_action_log.py +19 -0
  458. shopline_sdk/models/membership_tier_action_logs.py +14 -0
  459. shopline_sdk/models/membership_tier_rule.py +53 -0
  460. shopline_sdk/models/merchant.py +78 -0
  461. shopline_sdk/models/merchant_kyc.py +24 -0
  462. shopline_sdk/models/merchant_tax.py +50 -0
  463. shopline_sdk/models/metafield_definition.py +28 -0
  464. shopline_sdk/models/metafield_value.py +28 -0
  465. shopline_sdk/models/money.py +13 -0
  466. shopline_sdk/models/multipass_linking.py +22 -0
  467. shopline_sdk/models/multipass_linkings.py +16 -0
  468. shopline_sdk/models/multipass_secret.py +20 -0
  469. shopline_sdk/models/net_amount_analytics.py +28 -0
  470. shopline_sdk/models/net_orders_analytics.py +29 -0
  471. shopline_sdk/models/not_found_error.py +12 -0
  472. shopline_sdk/models/order.py +218 -0
  473. shopline_sdk/models/order_action_log.py +16 -0
  474. shopline_sdk/models/order_action_logs.py +12 -0
  475. shopline_sdk/models/order_agent.py +16 -0
  476. shopline_sdk/models/order_campaign_item.py +27 -0
  477. shopline_sdk/models/order_comment.py +28 -0
  478. shopline_sdk/models/order_conversation.py +39 -0
  479. shopline_sdk/models/order_conversations.py +14 -0
  480. shopline_sdk/models/order_conversations_message.py +32 -0
  481. shopline_sdk/models/order_conversations_messages.py +16 -0
  482. shopline_sdk/models/order_customer_info.py +24 -0
  483. shopline_sdk/models/order_delivery.py +57 -0
  484. shopline_sdk/models/order_delivery_address.py +37 -0
  485. shopline_sdk/models/order_delivery_data.py +28 -0
  486. shopline_sdk/models/order_inspect_item.py +18 -0
  487. shopline_sdk/models/order_invoice.py +32 -0
  488. shopline_sdk/models/order_item.py +93 -0
  489. shopline_sdk/models/order_payment.py +38 -0
  490. shopline_sdk/models/order_promotion_item.py +24 -0
  491. shopline_sdk/models/order_source.py +16 -0
  492. shopline_sdk/models/order_tag.py +10 -0
  493. shopline_sdk/models/order_transaction.py +32 -0
  494. shopline_sdk/models/orders_setting.py +25 -0
  495. shopline_sdk/models/page.py +49 -0
  496. shopline_sdk/models/page_block_settings.py +12 -0
  497. shopline_sdk/models/page_section.py +14 -0
  498. shopline_sdk/models/page_section_schema.py +37 -0
  499. shopline_sdk/models/page_section_settings.py +29 -0
  500. shopline_sdk/models/page_sections.py +12 -0
  501. shopline_sdk/models/paginatable.py +16 -0
  502. shopline_sdk/models/pagination.py +12 -0
  503. shopline_sdk/models/payment.py +33 -0
  504. shopline_sdk/models/payment_config_data.py +14 -0
  505. shopline_sdk/models/payment_fee_item.py +31 -0
  506. shopline_sdk/models/payment_settlement.py +47 -0
  507. shopline_sdk/models/payments_setting.py +17 -0
  508. shopline_sdk/models/pos_payment.py +19 -0
  509. shopline_sdk/models/pos_setting.py +15 -0
  510. shopline_sdk/models/price_detail.py +15 -0
  511. shopline_sdk/models/price_set.py +29 -0
  512. shopline_sdk/models/price_sets.py +12 -0
  513. shopline_sdk/models/product.py +201 -0
  514. shopline_sdk/models/product_feed_setting.py +45 -0
  515. shopline_sdk/models/product_feed_settings.py +14 -0
  516. shopline_sdk/models/product_ids_param.py +10 -0
  517. shopline_sdk/models/product_price_tier.py +26 -0
  518. shopline_sdk/models/product_related_theme_settings.py +23 -0
  519. shopline_sdk/models/product_revenue.py +26 -0
  520. shopline_sdk/models/product_revenues.py +14 -0
  521. shopline_sdk/models/product_review.py +28 -0
  522. shopline_sdk/models/product_review_comment.py +31 -0
  523. shopline_sdk/models/product_review_comments.py +14 -0
  524. shopline_sdk/models/product_review_comments_cursor_based.py +15 -0
  525. shopline_sdk/models/product_review_setting.py +32 -0
  526. shopline_sdk/models/product_reviews.py +14 -0
  527. shopline_sdk/models/product_stock.py +34 -0
  528. shopline_sdk/models/product_subscription.py +34 -0
  529. shopline_sdk/models/product_variation.py +56 -0
  530. shopline_sdk/models/products_cursor_based.py +17 -0
  531. shopline_sdk/models/products_setting.py +28 -0
  532. shopline_sdk/models/promotion.py +104 -0
  533. shopline_sdk/models/promotion_condition.py +27 -0
  534. shopline_sdk/models/promotion_excluded_hints.py +16 -0
  535. shopline_sdk/models/promotions_setting.py +28 -0
  536. shopline_sdk/models/purchase_order.py +63 -0
  537. shopline_sdk/models/purchase_order_item.py +66 -0
  538. shopline_sdk/models/purchase_orders.py +14 -0
  539. shopline_sdk/models/quantity_update_not_allowed_error.py +14 -0
  540. shopline_sdk/models/retail_status.py +11 -0
  541. shopline_sdk/models/return_order.py +75 -0
  542. shopline_sdk/models/return_order_delivery.py +26 -0
  543. shopline_sdk/models/return_order_delivery_address.py +37 -0
  544. shopline_sdk/models/return_order_delivery_data.py +28 -0
  545. shopline_sdk/models/return_order_item.py +33 -0
  546. shopline_sdk/models/return_order_payment.py +28 -0
  547. shopline_sdk/models/return_order_promotion_item.py +22 -0
  548. shopline_sdk/models/return_order_ref_data.py +10 -0
  549. shopline_sdk/models/return_orders.py +14 -0
  550. shopline_sdk/models/sale_comment.py +30 -0
  551. shopline_sdk/models/sale_customer.py +31 -0
  552. shopline_sdk/models/sale_product.py +21 -0
  553. shopline_sdk/models/save_draft_body.py +25 -0
  554. shopline_sdk/models/sc_conversation.py +31 -0
  555. shopline_sdk/models/sc_conversations.py +14 -0
  556. shopline_sdk/models/sc_conversations_message.py +30 -0
  557. shopline_sdk/models/sc_conversations_messages.py +16 -0
  558. shopline_sdk/models/search_products_body.py +71 -0
  559. shopline_sdk/models/server_error.py +12 -0
  560. shopline_sdk/models/service_unavailable_error.py +12 -0
  561. shopline_sdk/models/settings.py +30 -0
  562. shopline_sdk/models/settlement_terminal_list.py +9 -0
  563. shopline_sdk/models/shop_conversation.py +31 -0
  564. shopline_sdk/models/shop_conversations.py +14 -0
  565. shopline_sdk/models/shop_conversations_message.py +30 -0
  566. shopline_sdk/models/shop_conversations_messages.py +16 -0
  567. shopline_sdk/models/shop_crm_setting.py +24 -0
  568. shopline_sdk/models/shop_setting.py +10 -0
  569. shopline_sdk/models/staff.py +61 -0
  570. shopline_sdk/models/staff_performance.py +9 -0
  571. shopline_sdk/models/start_date_param.py +10 -0
  572. shopline_sdk/models/status.py +11 -0
  573. shopline_sdk/models/stock.py +12 -0
  574. shopline_sdk/models/store_credit.py +50 -0
  575. shopline_sdk/models/store_credit_fulfillment.py +27 -0
  576. shopline_sdk/models/storefront_o_auth_application.py +18 -0
  577. shopline_sdk/models/storefront_o_auth_applications.py +12 -0
  578. shopline_sdk/models/storefront_token.py +26 -0
  579. shopline_sdk/models/storefront_token_merchant.py +17 -0
  580. shopline_sdk/models/storefront_token_staff.py +15 -0
  581. shopline_sdk/models/storefront_tokens.py +12 -0
  582. shopline_sdk/models/supplier.py +24 -0
  583. shopline_sdk/models/tag.py +16 -0
  584. shopline_sdk/models/taggable.py +9 -0
  585. shopline_sdk/models/tax.py +57 -0
  586. shopline_sdk/models/tax_info.py +22 -0
  587. shopline_sdk/models/tax_region.py +20 -0
  588. shopline_sdk/models/tax_setting.py +10 -0
  589. shopline_sdk/models/theme.py +44 -0
  590. shopline_sdk/models/theme_schema.py +19 -0
  591. shopline_sdk/models/theme_setting.py +16 -0
  592. shopline_sdk/models/third_party_ads_setting.py +38 -0
  593. shopline_sdk/models/token_scopes.py +10 -0
  594. shopline_sdk/models/top_products_analytics.py +19 -0
  595. shopline_sdk/models/top_products_analytics_record.py +30 -0
  596. shopline_sdk/models/top_products_analytics_record_variation.py +34 -0
  597. shopline_sdk/models/total_sessions_analytics.py +35 -0
  598. shopline_sdk/models/total_views_analytics.py +29 -0
  599. shopline_sdk/models/transaction.py +65 -0
  600. shopline_sdk/models/translatable.py +28 -0
  601. shopline_sdk/models/translatable_array.py +28 -0
  602. shopline_sdk/models/unauthorized_error.py +14 -0
  603. shopline_sdk/models/unprocessable_entity_error.py +16 -0
  604. shopline_sdk/models/update_addon_product_body.py +36 -0
  605. shopline_sdk/models/update_agent_body.py +15 -0
  606. shopline_sdk/models/update_app_metafield_body.py +14 -0
  607. shopline_sdk/models/update_category_body.py +28 -0
  608. shopline_sdk/models/update_channel_price_body.py +21 -0
  609. shopline_sdk/models/update_customer_body.py +62 -0
  610. shopline_sdk/models/update_customer_group_activity_body.py +22 -0
  611. shopline_sdk/models/update_event_tracker_body.py +27 -0
  612. shopline_sdk/models/update_flash_price_campaign_body.py +22 -0
  613. shopline_sdk/models/update_gift_body.py +20 -0
  614. shopline_sdk/models/update_lock_inventory_body.py +21 -0
  615. shopline_sdk/models/update_metafield_body.py +14 -0
  616. shopline_sdk/models/update_product_body.py +66 -0
  617. shopline_sdk/models/update_product_feed_setting_body.py +27 -0
  618. shopline_sdk/models/update_product_review_comment_body.py +18 -0
  619. shopline_sdk/models/update_product_variation_body.py +34 -0
  620. shopline_sdk/models/update_promotion_body.py +71 -0
  621. shopline_sdk/models/update_return_order_body.py +17 -0
  622. shopline_sdk/models/update_webhook_body.py +14 -0
  623. shopline_sdk/models/user_coupon.py +12 -0
  624. shopline_sdk/models/user_coupons.py +14 -0
  625. shopline_sdk/models/user_credit_rule.py +40 -0
  626. shopline_sdk/models/users_setting.py +83 -0
  627. shopline_sdk/models/utm_data.py +20 -0
  628. shopline_sdk/models/warehouse.py +14 -0
  629. shopline_sdk/models/warehouses_cursor_based.py +17 -0
  630. shopline_sdk/models/webhook.py +23 -0
  631. shopline_sdk/models/webhooks.py +14 -0
  632. shopline_sdk/models/wish_list_item.py +41 -0
  633. shopline_sdk/models/wish_list_items.py +15 -0
  634. shopline_sdk_python-0.1.0.dist-info/METADATA +265 -0
  635. shopline_sdk_python-0.1.0.dist-info/RECORD +638 -0
  636. shopline_sdk_python-0.1.0.dist-info/WHEEL +5 -0
  637. shopline_sdk_python-0.1.0.dist-info/licenses/LICENSE +674 -0
  638. shopline_sdk_python-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,62 @@
1
+ from typing import Any, Dict, List, Optional, Union
2
+ import aiohttp
3
+ from pydantic import BaseModel, ValidationError, Field
4
+ from typing_extensions import Literal
5
+
6
+ # 导入异常类
7
+ from ...exceptions import ShoplineAPIError
8
+
9
+ # 导入需要的模型
10
+ from ...models.category import Category
11
+ from ...models.server_error import ServerError
12
+ from ...models.unprocessable_entity_error import UnprocessableEntityError
13
+
14
+ async def call(
15
+ session: aiohttp.ClientSession, data: Optional[Dict[str, Any]] = None
16
+ ) -> Category:
17
+ """
18
+ Create Category
19
+
20
+ To create a new category with open API
21
+ 透過open API創造一個新的分類
22
+
23
+ Path: POST /categories
24
+ """
25
+ # 构建请求 URL
26
+ url = "categories"
27
+
28
+ # 构建请求头
29
+ headers = {"Content-Type": "application/json"}
30
+
31
+ # 构建请求体
32
+ json_data = data if data else None
33
+
34
+ # 发起 HTTP 请求
35
+ async with session.post(
36
+ url, json=json_data, headers=headers
37
+ ) as response:
38
+ if response.status >= 400:
39
+ error_data = await response.json()
40
+ if response.status == 422:
41
+ error_model = UnprocessableEntityError(**error_data)
42
+ raise ShoplineAPIError(
43
+ status_code=422,
44
+ error=error_model,
45
+ **error_data
46
+ )
47
+ if response.status == 500:
48
+ error_model = ServerError(**error_data)
49
+ raise ShoplineAPIError(
50
+ status_code=500,
51
+ error=error_model,
52
+ **error_data
53
+ )
54
+ # 默认错误处理
55
+ raise ShoplineAPIError(
56
+ status_code=response.status,
57
+ **error_data
58
+ )
59
+ response_data = await response.json()
60
+
61
+ # 验证并返回响应数据
62
+ return Category(**response_data)
@@ -0,0 +1,62 @@
1
+ from typing import Any, Dict, List, Optional, Union
2
+ import aiohttp
3
+ from pydantic import BaseModel, ValidationError, Field
4
+ from typing_extensions import Literal
5
+
6
+ # 导入异常类
7
+ from ...exceptions import ShoplineAPIError
8
+
9
+ # 导入需要的模型
10
+ from ...models.not_found_error import NotFoundError
11
+ from ...models.server_error import ServerError
12
+
13
+ class Response(BaseModel):
14
+ """响应体模型"""
15
+ message: Optional[str] = None
16
+
17
+ async def call(
18
+ session: aiohttp.ClientSession, id: str
19
+ ) -> Response:
20
+ """
21
+ Delete Category
22
+
23
+ To delete current categories with open API
24
+ 透過open API刪除分類
25
+
26
+ Path: DELETE /categories/{id}
27
+ """
28
+ # 构建请求 URL
29
+ url = f"categories/{id}"
30
+
31
+ # 构建请求头
32
+ headers = {"Content-Type": "application/json"}
33
+
34
+ # 发起 HTTP 请求
35
+ async with session.delete(
36
+ url, headers=headers
37
+ ) as response:
38
+ if response.status >= 400:
39
+ error_data = await response.json()
40
+ if response.status == 404:
41
+ error_model = NotFoundError(**error_data)
42
+ raise ShoplineAPIError(
43
+ status_code=404,
44
+ error=error_model,
45
+ **error_data
46
+ )
47
+ if response.status == 500:
48
+ error_model = ServerError(**error_data)
49
+ raise ShoplineAPIError(
50
+ status_code=500,
51
+ error=error_model,
52
+ **error_data
53
+ )
54
+ # 默认错误处理
55
+ raise ShoplineAPIError(
56
+ status_code=response.status,
57
+ **error_data
58
+ )
59
+ response_data = await response.json()
60
+
61
+ # 验证并返回响应数据
62
+ return Response(**response_data)
@@ -0,0 +1,104 @@
1
+ from typing import Any, Dict, List, Optional, Union
2
+ import aiohttp
3
+ from pydantic import BaseModel, ValidationError, Field
4
+ from typing_extensions import Literal
5
+
6
+ # 导入异常类
7
+ from ...exceptions import ShoplineAPIError
8
+
9
+ # 导入需要的模型
10
+ from ...models.category import Category
11
+ from ...models.paginatable import Paginatable
12
+ from ...models.server_error import ServerError
13
+
14
+ class Request(BaseModel):
15
+ """查询参数模型"""
16
+ previous_id: Optional[str] = None
17
+ """The last ID of the addon products in the previous request.
18
+ 前一筆分類的 ID
19
+ beta 測試中,僅開放部分店家使用,如無法使用功能請聯絡客服窗口"""
20
+ updated_after: Optional[str] = None
21
+ """Filter categories by those updated after specific time.
22
+ 取得 updated_at 大於指定時間的分類(包含指定時間)
23
+ *Should use UTC time'"""
24
+ updated_before: Optional[str] = None
25
+ """Filter categories by those updated before specific time.
26
+ 取得 updated_at 小於指定時間的分類(包含指定時間)
27
+ *Should use UTC time'"""
28
+ page: Optional[int] = None
29
+ """Page Number
30
+ 頁數"""
31
+ per_page: Optional[int] = None
32
+ """Numbers of Orders per Page
33
+ 每頁顯示 n 筆資料"""
34
+ excludes: Optional[List[str]] = None
35
+ """Could exclude certain parameters in the response
36
+ 結果要排除哪些參數"""
37
+ fields: Optional[List[str]] = None
38
+ """Could only show certain parameters in the response
39
+ 結果只顯示哪些參數"""
40
+ created_by_filter: Optional[Literal['admin', 'pos']] = None
41
+ """Filter categories by those created by. Default 'admin'.
42
+ 取得指定 created_by 的分類。預設為'admin'。"""
43
+ with_product_set: Optional[bool] = None
44
+ """Include product set in response. Default false.
45
+ 是否在回應中包含商品集。預設為false。"""
46
+ include_fields: Optional[List[str]] = None
47
+ """Provide additional attributes in the response
48
+ 結果添加哪些參數"""
49
+ category_ids: Optional[List[str]] = None
50
+ """The category ids to be included in the response
51
+ 結果包含哪些分類"""
52
+
53
+ class Response(BaseModel):
54
+ """响应体模型"""
55
+ items: Optional[List[Category]] = None
56
+ pagination: Optional[Paginatable] = None
57
+
58
+ async def call(
59
+ session: aiohttp.ClientSession, request: Optional[Request] = None
60
+ ) -> Response:
61
+ """
62
+ Get Categories
63
+
64
+ To get detailed information of couple categories sorted by time
65
+ 利用時間範圍選取與排序獲取分類資料
66
+
67
+ Path: GET /categories
68
+ """
69
+ # 构建请求 URL
70
+ url = "categories"
71
+
72
+ # 构建查询参数
73
+ params = {}
74
+ if request:
75
+ request_dict = request.model_dump(exclude_none=True)
76
+ for key, value in request_dict.items():
77
+ if value is not None:
78
+ params[key] = value
79
+
80
+ # 构建请求头
81
+ headers = {"Content-Type": "application/json"}
82
+
83
+ # 发起 HTTP 请求
84
+ async with session.get(
85
+ url, params=params, headers=headers
86
+ ) as response:
87
+ if response.status >= 400:
88
+ error_data = await response.json()
89
+ if response.status == 500:
90
+ error_model = ServerError(**error_data)
91
+ raise ShoplineAPIError(
92
+ status_code=500,
93
+ error=error_model,
94
+ **error_data
95
+ )
96
+ # 默认错误处理
97
+ raise ShoplineAPIError(
98
+ status_code=response.status,
99
+ **error_data
100
+ )
101
+ response_data = await response.json()
102
+
103
+ # 验证并返回响应数据
104
+ return Response(**response_data)
@@ -0,0 +1,76 @@
1
+ from typing import Any, Dict, List, Optional, Union
2
+ import aiohttp
3
+ from pydantic import BaseModel, ValidationError, Field
4
+ from typing_extensions import Literal
5
+
6
+ # 导入异常类
7
+ from ...exceptions import ShoplineAPIError
8
+
9
+ # 导入需要的模型
10
+ from ...models.category import Category
11
+ from ...models.not_found_error import NotFoundError
12
+ from ...models.server_error import ServerError
13
+
14
+ class Request(BaseModel):
15
+ """查询参数模型"""
16
+ fields: Optional[List[str]] = None
17
+ """Could only show certain parameters in the response
18
+ 結果只顯示哪些參數"""
19
+ excludes: Optional[List[str]] = None
20
+ """Could exclude certain parameters in the response
21
+ 結果要排除哪些參數"""
22
+
23
+ async def call(
24
+ session: aiohttp.ClientSession, id: str, request: Optional[Request] = None
25
+ ) -> Category:
26
+ """
27
+ Get Category
28
+
29
+ To get detailed information of couple categories sorted by time
30
+ 獲取分類資料
31
+
32
+ Path: GET /categories/{id}
33
+ """
34
+ # 构建请求 URL
35
+ url = f"categories/{id}"
36
+
37
+ # 构建查询参数
38
+ params = {}
39
+ if request:
40
+ request_dict = request.model_dump(exclude_none=True)
41
+ for key, value in request_dict.items():
42
+ if value is not None:
43
+ params[key] = value
44
+
45
+ # 构建请求头
46
+ headers = {"Content-Type": "application/json"}
47
+
48
+ # 发起 HTTP 请求
49
+ async with session.get(
50
+ url, params=params, headers=headers
51
+ ) as response:
52
+ if response.status >= 400:
53
+ error_data = await response.json()
54
+ if response.status == 404:
55
+ error_model = NotFoundError(**error_data)
56
+ raise ShoplineAPIError(
57
+ status_code=404,
58
+ error=error_model,
59
+ **error_data
60
+ )
61
+ if response.status == 500:
62
+ error_model = ServerError(**error_data)
63
+ raise ShoplineAPIError(
64
+ status_code=500,
65
+ error=error_model,
66
+ **error_data
67
+ )
68
+ # 默认错误处理
69
+ raise ShoplineAPIError(
70
+ status_code=response.status,
71
+ **error_data
72
+ )
73
+ response_data = await response.json()
74
+
75
+ # 验证并返回响应数据
76
+ return Category(**response_data)
@@ -0,0 +1,70 @@
1
+ from typing import Any, Dict, List, Optional, Union
2
+ import aiohttp
3
+ from pydantic import BaseModel, ValidationError, Field
4
+ from typing_extensions import Literal
5
+
6
+ # 导入异常类
7
+ from ...exceptions import ShoplineAPIError
8
+
9
+ # 导入需要的模型
10
+ from ...models.category import Category
11
+ from ...models.not_found_error import NotFoundError
12
+ from ...models.server_error import ServerError
13
+ from ...models.unprocessable_entity_error import UnprocessableEntityError
14
+
15
+ async def call(
16
+ session: aiohttp.ClientSession, id: str, data: Optional[Dict[str, Any]] = None
17
+ ) -> Category:
18
+ """
19
+ Update Category
20
+
21
+ To update current categories information with open API.
22
+ 透過open API更新既有分類資訊
23
+
24
+ Path: PUT /categories/{id}
25
+ """
26
+ # 构建请求 URL
27
+ url = f"categories/{id}"
28
+
29
+ # 构建请求头
30
+ headers = {"Content-Type": "application/json"}
31
+
32
+ # 构建请求体
33
+ json_data = data if data else None
34
+
35
+ # 发起 HTTP 请求
36
+ async with session.put(
37
+ url, json=json_data, headers=headers
38
+ ) as response:
39
+ if response.status >= 400:
40
+ error_data = await response.json()
41
+ if response.status == 404:
42
+ error_model = NotFoundError(**error_data)
43
+ raise ShoplineAPIError(
44
+ status_code=404,
45
+ error=error_model,
46
+ **error_data
47
+ )
48
+ if response.status == 422:
49
+ error_model = UnprocessableEntityError(**error_data)
50
+ raise ShoplineAPIError(
51
+ status_code=422,
52
+ error=error_model,
53
+ **error_data
54
+ )
55
+ if response.status == 500:
56
+ error_model = ServerError(**error_data)
57
+ raise ShoplineAPIError(
58
+ status_code=500,
59
+ error=error_model,
60
+ **error_data
61
+ )
62
+ # 默认错误处理
63
+ raise ShoplineAPIError(
64
+ status_code=response.status,
65
+ **error_data
66
+ )
67
+ response_data = await response.json()
68
+
69
+ # 验证并返回响应数据
70
+ return Category(**response_data)
File without changes
@@ -0,0 +1,45 @@
1
+ from typing import Any, Dict, List, Optional, Union
2
+ import aiohttp
3
+ from pydantic import BaseModel, ValidationError, Field
4
+ from typing_extensions import Literal
5
+
6
+ # 导入异常类
7
+ from ...exceptions import ShoplineAPIError
8
+
9
+ # 导入需要的模型
10
+ from ...models.price_set import PriceSet
11
+
12
+ async def call(
13
+ session: aiohttp.ClientSession, channel_id: str, id: str, data: Optional[Dict[str, Any]] = None
14
+ ) -> PriceSet:
15
+ """
16
+ Create Product Channel Price
17
+
18
+ To create new product channel price
19
+ 創建商品分店價格
20
+
21
+ Path: POST /channels/{channel_id}/products/{id}/prices
22
+ """
23
+ # 构建请求 URL
24
+ url = f"channels/{channel_id}/products/{id}/prices"
25
+
26
+ # 构建请求头
27
+ headers = {"Content-Type": "application/json"}
28
+
29
+ # 构建请求体
30
+ json_data = data if data else None
31
+
32
+ # 发起 HTTP 请求
33
+ async with session.post(
34
+ url, json=json_data, headers=headers
35
+ ) as response:
36
+ if response.status >= 400:
37
+ error_data = await response.json()
38
+ raise ShoplineAPIError(
39
+ status_code=response.status,
40
+ **error_data
41
+ )
42
+ response_data = await response.json()
43
+
44
+ # 验证并返回响应数据
45
+ return PriceSet(**response_data)
@@ -0,0 +1,76 @@
1
+ from typing import Any, Dict, List, Optional, Union
2
+ import aiohttp
3
+ from pydantic import BaseModel, ValidationError, Field
4
+ from typing_extensions import Literal
5
+
6
+ # 导入异常类
7
+ from ...exceptions import ShoplineAPIError
8
+
9
+ # 导入需要的模型
10
+ from ...models.channel import Channel
11
+ from ...models.not_found_error import NotFoundError
12
+ from ...models.server_error import ServerError
13
+
14
+ class Request(BaseModel):
15
+ """查询参数模型"""
16
+ include_fields: Optional[List[Literal['e_invoice_setting', 'pin_codes']]] = None
17
+ """Some fields need to be specified in this parameter. Otherwise, it will not be returned.
18
+ 有些欄位需要定義在此參數內,否則將不會返回這些欄位的值。"""
19
+ fields: Optional[List[Literal['items.mobile_logo_media_url']]] = None
20
+ """For mobile logo media, need to add items.mobile_logo_media_url to this field.
21
+ mobile logo media 必須加入 items.mobile_logo_media_url 到此欄位。"""
22
+
23
+ async def call(
24
+ session: aiohttp.ClientSession, id: str, request: Optional[Request] = None
25
+ ) -> Channel:
26
+ """
27
+ Get Channel
28
+
29
+ To get detailed information for a specific channel with its ID
30
+ 使用通路ID獲取特定一個通路的詳細資料
31
+
32
+ Path: GET /channels/{id}
33
+ """
34
+ # 构建请求 URL
35
+ url = f"channels/{id}"
36
+
37
+ # 构建查询参数
38
+ params = {}
39
+ if request:
40
+ request_dict = request.model_dump(exclude_none=True)
41
+ for key, value in request_dict.items():
42
+ if value is not None:
43
+ params[key] = value
44
+
45
+ # 构建请求头
46
+ headers = {"Content-Type": "application/json"}
47
+
48
+ # 发起 HTTP 请求
49
+ async with session.get(
50
+ url, params=params, headers=headers
51
+ ) as response:
52
+ if response.status >= 400:
53
+ error_data = await response.json()
54
+ if response.status == 404:
55
+ error_model = NotFoundError(**error_data)
56
+ raise ShoplineAPIError(
57
+ status_code=404,
58
+ error=error_model,
59
+ **error_data
60
+ )
61
+ if response.status == 500:
62
+ error_model = ServerError(**error_data)
63
+ raise ShoplineAPIError(
64
+ status_code=500,
65
+ error=error_model,
66
+ **error_data
67
+ )
68
+ # 默认错误处理
69
+ raise ShoplineAPIError(
70
+ status_code=response.status,
71
+ **error_data
72
+ )
73
+ response_data = await response.json()
74
+
75
+ # 验证并返回响应数据
76
+ return Channel(**response_data)
@@ -0,0 +1,83 @@
1
+ from typing import Any, Dict, List, Optional, Union
2
+ import aiohttp
3
+ from pydantic import BaseModel, ValidationError, Field
4
+ from typing_extensions import Literal
5
+
6
+ # 导入异常类
7
+ from ...exceptions import ShoplineAPIError
8
+
9
+ # 导入需要的模型
10
+ from ...models.channels import Channels
11
+ from ...models.server_error import ServerError
12
+
13
+ class Request(BaseModel):
14
+ """查询参数模型"""
15
+ belongs_to: Optional[Literal['staff', 'merchant']] = None
16
+ """Channels belongs to staff or merchant. Default is staff
17
+ 網店通路或是 Staff 的通路,預設為 staff"""
18
+ platform: Optional[Literal['Shopee', 'shop_crm', 'online', 'pos', 'sc']] = None
19
+ """Filter channels by platform. It can only filter channel by sc or shop_crm if belogs_to is staff.
20
+ 過濾通路屬於哪個平台,如果 belongs_to 為 staff 則只能過濾 sc 或是 shop_crm 通路。"""
21
+ platforms: Optional[List[Literal['Shopee', 'shop_crm', 'online', 'pos', 'sc']]] = None
22
+ """Filter multiple channels by platforms. It can only filter channel by sc or shop_crm if belogs_to is staff.
23
+ 過濾通路屬於哪些平台,如果 belongs_to 為 staff 則只能過濾 sc 或是 shop_crm 通路。"""
24
+ include_fields: Optional[List[Literal['e_invoice_setting', 'pin_codes']]] = None
25
+ """Some fields need to be specified in this parameter. Otherwise, it will not be returned.
26
+ 有些欄位需要定義在此參數內,否則將不會返回這些欄位的值。"""
27
+ fields: Optional[List[Literal['items.mobile_logo_media_url']]] = None
28
+ """For mobile logo media, need to add items.mobile_logo_media_url to this field.
29
+ mobile logo media 必須加入 items.mobile_logo_media_url 到此欄位。"""
30
+ page: Optional[int] = None
31
+ """Page number
32
+ 頁數"""
33
+ per_page: Optional[int] = None
34
+ """Numbers of channels per page
35
+ 每頁顯示資料筆數"""
36
+
37
+ async def call(
38
+ session: aiohttp.ClientSession, request: Optional[Request] = None
39
+ ) -> Channels:
40
+ """
41
+ Get Channels
42
+
43
+ Get Channels
44
+ 獲取 Channel 列表
45
+
46
+ Path: GET /channels
47
+ """
48
+ # 构建请求 URL
49
+ url = "channels"
50
+
51
+ # 构建查询参数
52
+ params = {}
53
+ if request:
54
+ request_dict = request.model_dump(exclude_none=True)
55
+ for key, value in request_dict.items():
56
+ if value is not None:
57
+ params[key] = value
58
+
59
+ # 构建请求头
60
+ headers = {"Content-Type": "application/json"}
61
+
62
+ # 发起 HTTP 请求
63
+ async with session.get(
64
+ url, params=params, headers=headers
65
+ ) as response:
66
+ if response.status >= 400:
67
+ error_data = await response.json()
68
+ if response.status == 500:
69
+ error_model = ServerError(**error_data)
70
+ raise ShoplineAPIError(
71
+ status_code=500,
72
+ error=error_model,
73
+ **error_data
74
+ )
75
+ # 默认错误处理
76
+ raise ShoplineAPIError(
77
+ status_code=response.status,
78
+ **error_data
79
+ )
80
+ response_data = await response.json()
81
+
82
+ # 验证并返回响应数据
83
+ return Channels(**response_data)
@@ -0,0 +1,75 @@
1
+ from typing import Any, Dict, List, Optional, Union
2
+ import aiohttp
3
+ from pydantic import BaseModel, ValidationError, Field
4
+ from typing_extensions import Literal
5
+
6
+ # 导入异常类
7
+ from ...exceptions import ShoplineAPIError
8
+
9
+ # 导入需要的模型
10
+ from ...models.not_found_error import NotFoundError
11
+ from ...models.price_sets import PriceSets
12
+ from ...models.server_error import ServerError
13
+
14
+ class Request(BaseModel):
15
+ """查询参数模型"""
16
+ previous_id: Optional[str] = None
17
+ """The last ID of the channel price in the previous request."""
18
+ limit: Optional[int] = None
19
+ """Numbers of PriceSet
20
+ 顯示 n 筆商品通路價格"""
21
+
22
+ async def call(
23
+ session: aiohttp.ClientSession, id: str, request: Optional[Request] = None
24
+ ) -> PriceSets:
25
+ """
26
+ Get Product Channel Price
27
+
28
+ To get detailed information for product channel price with Channel ID
29
+ 使用通路ID獲取商品通路價格
30
+
31
+ Path: GET /channels/{id}/prices
32
+ """
33
+ # 构建请求 URL
34
+ url = f"channels/{id}/prices"
35
+
36
+ # 构建查询参数
37
+ params = {}
38
+ if request:
39
+ request_dict = request.model_dump(exclude_none=True)
40
+ for key, value in request_dict.items():
41
+ if value is not None:
42
+ params[key] = value
43
+
44
+ # 构建请求头
45
+ headers = {"Content-Type": "application/json"}
46
+
47
+ # 发起 HTTP 请求
48
+ async with session.get(
49
+ url, params=params, headers=headers
50
+ ) as response:
51
+ if response.status >= 400:
52
+ error_data = await response.json()
53
+ if response.status == 404:
54
+ error_model = NotFoundError(**error_data)
55
+ raise ShoplineAPIError(
56
+ status_code=404,
57
+ error=error_model,
58
+ **error_data
59
+ )
60
+ if response.status == 500:
61
+ error_model = ServerError(**error_data)
62
+ raise ShoplineAPIError(
63
+ status_code=500,
64
+ error=error_model,
65
+ **error_data
66
+ )
67
+ # 默认错误处理
68
+ raise ShoplineAPIError(
69
+ status_code=response.status,
70
+ **error_data
71
+ )
72
+ response_data = await response.json()
73
+
74
+ # 验证并返回响应数据
75
+ return PriceSets(**response_data)