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.
- shopline_sdk/__init__.py +17 -0
- shopline_sdk/apis/__init__.py +0 -0
- shopline_sdk/apis/addon_products/__init__.py +0 -0
- shopline_sdk/apis/addon_products/bulk_update_addon_product_quantity_by_sku.py +72 -0
- shopline_sdk/apis/addon_products/create_addon_product.py +69 -0
- shopline_sdk/apis/addon_products/get_addon_product.py +42 -0
- shopline_sdk/apis/addon_products/get_addon_product_stocks.py +66 -0
- shopline_sdk/apis/addon_products/get_addon_products.py +84 -0
- shopline_sdk/apis/addon_products/search_addon_products.py +113 -0
- shopline_sdk/apis/addon_products/update_addon_product.py +54 -0
- shopline_sdk/apis/addon_products/update_addon_product_quantity.py +96 -0
- shopline_sdk/apis/addon_products/update_addon_product_stock.py +86 -0
- shopline_sdk/apis/affiliate_campaigns/__init__.py +0 -0
- shopline_sdk/apis/affiliate_campaigns/create_affiliate_campaign.py +109 -0
- shopline_sdk/apis/affiliate_campaigns/delete_affiliate_campaign.py +44 -0
- shopline_sdk/apis/affiliate_campaigns/export_affiliate_campaign_report_to_partner.py +60 -0
- shopline_sdk/apis/affiliate_campaigns/get_affiliate_campaign.py +59 -0
- shopline_sdk/apis/affiliate_campaigns/get_affiliate_campaign_orders.py +75 -0
- shopline_sdk/apis/affiliate_campaigns/get_affiliate_campaign_summary.py +49 -0
- shopline_sdk/apis/affiliate_campaigns/get_affiliate_campaigns.py +84 -0
- shopline_sdk/apis/affiliate_campaigns/get_products_sales_ranking_of_campaign.py +73 -0
- shopline_sdk/apis/affiliate_campaigns/update_affiliate_campaign.py +96 -0
- shopline_sdk/apis/agents/__init__.py +0 -0
- shopline_sdk/apis/agents/get_agent.py +59 -0
- shopline_sdk/apis/agents/get_agents.py +77 -0
- shopline_sdk/apis/bulk_operations/__init__.py +0 -0
- shopline_sdk/apis/bulk_operations/get_a_bulk_operation.py +43 -0
- shopline_sdk/apis/bulk_operations/get_bulk_operations.py +57 -0
- shopline_sdk/apis/cart_item_app_metafields/__init__.py +0 -0
- shopline_sdk/apis/cart_item_app_metafields/bulk_create_app_metafield.py +52 -0
- shopline_sdk/apis/cart_item_app_metafields/bulk_delete_app_metafield.py +61 -0
- shopline_sdk/apis/cart_item_app_metafields/bulk_update_app_metafield.py +62 -0
- shopline_sdk/apis/cart_item_app_metafields/get_app_metafields_attached_to_cart_items_of_specific_cart.py +61 -0
- shopline_sdk/apis/cart_item_metafields/__init__.py +0 -0
- shopline_sdk/apis/cart_item_metafields/bulk_create_metafield.py +52 -0
- shopline_sdk/apis/cart_item_metafields/bulk_delete_metafield.py +62 -0
- shopline_sdk/apis/cart_item_metafields/bulk_update_metafield.py +62 -0
- shopline_sdk/apis/cart_item_metafields/get_metafields_attached_to_cart_items_of_specific_cart.py +62 -0
- shopline_sdk/apis/carts/__init__.py +0 -0
- shopline_sdk/apis/carts/bulk_add_items_to_cart.py +80 -0
- shopline_sdk/apis/carts/bulk_delete_cart_items.py +59 -0
- shopline_sdk/apis/carts/bulk_patch_cart_items.py +61 -0
- shopline_sdk/apis/carts/get_cart.py +63 -0
- shopline_sdk/apis/carts/get_cart_id.py +74 -0
- shopline_sdk/apis/categories/__init__.py +0 -0
- shopline_sdk/apis/categories/bulk_assign.py +75 -0
- shopline_sdk/apis/categories/bulk_update_category_product_sorting.py +84 -0
- shopline_sdk/apis/categories/create_category.py +62 -0
- shopline_sdk/apis/categories/delete_category.py +62 -0
- shopline_sdk/apis/categories/get_categories.py +104 -0
- shopline_sdk/apis/categories/get_category.py +76 -0
- shopline_sdk/apis/categories/update_category.py +70 -0
- shopline_sdk/apis/channels/__init__.py +0 -0
- shopline_sdk/apis/channels/create_product_channel_price.py +45 -0
- shopline_sdk/apis/channels/get_channel.py +76 -0
- shopline_sdk/apis/channels/get_channels.py +83 -0
- shopline_sdk/apis/channels/get_product_channel_price.py +75 -0
- shopline_sdk/apis/channels/update_product_channel_price.py +45 -0
- shopline_sdk/apis/conversations/__init__.py +0 -0
- shopline_sdk/apis/conversations/create_order_message.py +91 -0
- shopline_sdk/apis/conversations/create_return_order_message.py +90 -0
- shopline_sdk/apis/conversations/create_shop_message.py +81 -0
- shopline_sdk/apis/conversations/get_conversations.py +76 -0
- shopline_sdk/apis/conversations/get_messages.py +76 -0
- shopline_sdk/apis/custom_fields/__init__.py +0 -0
- shopline_sdk/apis/custom_fields/get_custom_fields.py +42 -0
- shopline_sdk/apis/customer_app_metafields/__init__.py +0 -0
- shopline_sdk/apis/customer_app_metafields/create_specific_app_metafield.py +44 -0
- shopline_sdk/apis/customer_app_metafields/delete_specific_app_metafield.py +42 -0
- shopline_sdk/apis/customer_app_metafields/get_app_metafields_attached_to_specific_customer.py +61 -0
- shopline_sdk/apis/customer_app_metafields/get_specific_app_metafield.py +41 -0
- shopline_sdk/apis/customer_app_metafields/update_specific_app_metafield.py +44 -0
- shopline_sdk/apis/customer_group_children/__init__.py +0 -0
- shopline_sdk/apis/customer_group_children/get_children_group_of_the_customer_group.py +89 -0
- shopline_sdk/apis/customer_groups/__init__.py +0 -0
- shopline_sdk/apis/customer_groups/get_customer_group.py +65 -0
- shopline_sdk/apis/customer_groups/get_customer_groups.py +108 -0
- shopline_sdk/apis/customer_groups/get_customer_ids_of_the_specific_customer_group.py +84 -0
- shopline_sdk/apis/customer_groups/search_customer_groups.py +92 -0
- shopline_sdk/apis/customer_metafields/__init__.py +0 -0
- shopline_sdk/apis/customer_metafields/create_specific_metafield.py +44 -0
- shopline_sdk/apis/customer_metafields/delete_specific_metafield.py +42 -0
- shopline_sdk/apis/customer_metafields/get_metafields_attached_to_specific_customer.py +62 -0
- shopline_sdk/apis/customer_metafields/get_specific_metafield.py +41 -0
- shopline_sdk/apis/customer_metafields/update_specific_metafield.py +44 -0
- shopline_sdk/apis/customers/__init__.py +0 -0
- shopline_sdk/apis/customers/add_or_remove_customer_tags.py +93 -0
- shopline_sdk/apis/customers/create_customer.py +87 -0
- shopline_sdk/apis/customers/delete_customer.py +62 -0
- shopline_sdk/apis/customers/get_customer.py +94 -0
- shopline_sdk/apis/customers/get_customer_member_points_history.py +92 -0
- shopline_sdk/apis/customers/get_customer_store_credit_history.py +98 -0
- shopline_sdk/apis/customers/get_customers.py +127 -0
- shopline_sdk/apis/customers/get_line_customer.py +67 -0
- shopline_sdk/apis/customers/getcustomers_smembershipinfo.py +93 -0
- shopline_sdk/apis/customers/search_customers.py +216 -0
- shopline_sdk/apis/customers/update_customer.py +87 -0
- shopline_sdk/apis/customers/update_customer_member_points.py +113 -0
- shopline_sdk/apis/customers/update_customer_store_credits.py +172 -0
- shopline_sdk/apis/customers/update_customer_subscriptions.py +64 -0
- shopline_sdk/apis/customers/update_customer_tags.py +88 -0
- shopline_sdk/apis/delivery_options/__init__.py +0 -0
- shopline_sdk/apis/delivery_options/get_delivery_config.py +52 -0
- shopline_sdk/apis/delivery_options/get_delivery_option.py +42 -0
- shopline_sdk/apis/delivery_options/get_delivery_options.py +65 -0
- shopline_sdk/apis/delivery_options/get_delivery_time_slots.py +64 -0
- shopline_sdk/apis/delivery_options/updatedeliveryoption_sstoreinformation.py +67 -0
- shopline_sdk/apis/event_trackers/__init__.py +0 -0
- shopline_sdk/apis/event_trackers/create_an_event_tracker.py +83 -0
- shopline_sdk/apis/event_trackers/delete_an_event_tracker.py +57 -0
- shopline_sdk/apis/event_trackers/get_an_event_tracker.py +64 -0
- shopline_sdk/apis/event_trackers/get_event_trackers.py +97 -0
- shopline_sdk/apis/event_trackers/update_event_tracker.py +91 -0
- shopline_sdk/apis/flash_price_campaigns/__init__.py +0 -0
- shopline_sdk/apis/flash_price_campaigns/create_flash_price_campaign.py +45 -0
- shopline_sdk/apis/flash_price_campaigns/delete_flash_price_campaign.py +44 -0
- shopline_sdk/apis/flash_price_campaigns/get_a_flash_price_campaign.py +43 -0
- shopline_sdk/apis/flash_price_campaigns/get_flash_price_campaigns.py +72 -0
- shopline_sdk/apis/flash_price_campaigns/update_flash_price_campaign.py +46 -0
- shopline_sdk/apis/gifts/__init__.py +0 -0
- shopline_sdk/apis/gifts/bulk_update_quantity_by_sku.py +106 -0
- shopline_sdk/apis/gifts/create_gift.py +57 -0
- shopline_sdk/apis/gifts/get_gift_stocks.py +66 -0
- shopline_sdk/apis/gifts/get_gifts.py +86 -0
- shopline_sdk/apis/gifts/search_gifts.py +110 -0
- shopline_sdk/apis/gifts/update_gift.py +54 -0
- shopline_sdk/apis/gifts/update_gift_quantity.py +100 -0
- shopline_sdk/apis/gifts/update_gift_stock.py +86 -0
- shopline_sdk/apis/layouts/__init__.py +0 -0
- shopline_sdk/apis/layouts/get_layouts_sections.py +77 -0
- shopline_sdk/apis/medias/__init__.py +0 -0
- shopline_sdk/apis/medias/create_image.py +52 -0
- shopline_sdk/apis/member_point_rules/__init__.py +0 -0
- shopline_sdk/apis/member_point_rules/get_member_point_rules.py +55 -0
- shopline_sdk/apis/member_points/__init__.py +0 -0
- shopline_sdk/apis/member_points/bulk_update_member_points.py +87 -0
- shopline_sdk/apis/membership_tiers/__init__.py +0 -0
- shopline_sdk/apis/membership_tiers/get_customer_membership_tier_history.py +84 -0
- shopline_sdk/apis/membership_tiers/get_membership_tiers.py +65 -0
- shopline_sdk/apis/merchant_app_metafields/__init__.py +0 -0
- shopline_sdk/apis/merchant_app_metafields/get_app_metafields_attached_to_current_merchant.py +61 -0
- shopline_sdk/apis/merchant_metafields/__init__.py +0 -0
- shopline_sdk/apis/merchant_metafields/get_metafields_attached_to_current_merchant.py +62 -0
- shopline_sdk/apis/merchants/__init__.py +0 -0
- shopline_sdk/apis/merchants/generatemerchant_sexpresscartlink.py +66 -0
- shopline_sdk/apis/merchants/get_merchant.py +56 -0
- shopline_sdk/apis/merchants/get_merchants.py +46 -0
- shopline_sdk/apis/metafield_definitions/__init__.py +0 -0
- shopline_sdk/apis/metafield_definitions/create_specific_metafield_definition.py +44 -0
- shopline_sdk/apis/metafield_definitions/get_an_array_of_metafield_definitions.py +45 -0
- shopline_sdk/apis/metafield_definitions/get_specific_metafield_definition.py +41 -0
- shopline_sdk/apis/multipass_linking/__init__.py +0 -0
- shopline_sdk/apis/multipass_linking/delete_multipass_linking_for_customer.py +61 -0
- shopline_sdk/apis/multipass_linking/get_active_multipass_linkings.py +67 -0
- shopline_sdk/apis/multipass_linking/update_multipass_linking_for_customer.py +69 -0
- shopline_sdk/apis/multipass_secret/__init__.py +0 -0
- shopline_sdk/apis/multipass_secret/create_multipass_secret.py +41 -0
- shopline_sdk/apis/multipass_secret/get_multipass_secret.py +50 -0
- shopline_sdk/apis/order_app_metafields/__init__.py +0 -0
- shopline_sdk/apis/order_app_metafields/get_app_metafields_attached_to_specific_order.py +61 -0
- shopline_sdk/apis/order_deliveries/__init__.py +0 -0
- shopline_sdk/apis/order_deliveries/get_order_delivery.py +43 -0
- shopline_sdk/apis/order_deliveries/update_order_delivery.py +63 -0
- shopline_sdk/apis/order_item_app_metafields/__init__.py +0 -0
- shopline_sdk/apis/order_item_app_metafields/get_app_metafields_attached_to_order_items_of_specific_order.py +61 -0
- shopline_sdk/apis/order_item_metafields/__init__.py +0 -0
- shopline_sdk/apis/order_item_metafields/get_metafields_attached_to_order_items_of_specific_order.py +62 -0
- shopline_sdk/apis/order_metafields/__init__.py +0 -0
- shopline_sdk/apis/order_metafields/get_metafields_attached_to_specific_order.py +62 -0
- shopline_sdk/apis/orders/__init__.py +0 -0
- shopline_sdk/apis/orders/bulk_execute_shipment.py +70 -0
- shopline_sdk/apis/orders/cancel_order.py +70 -0
- shopline_sdk/apis/orders/create_archived_orders_report.py +72 -0
- shopline_sdk/apis/orders/create_order.py +90 -0
- shopline_sdk/apis/orders/execute_shipment.py +63 -0
- shopline_sdk/apis/orders/get_all_orders_tags.py +54 -0
- shopline_sdk/apis/orders/get_order.py +78 -0
- shopline_sdk/apis/orders/get_order_action_logs.py +62 -0
- shopline_sdk/apis/orders/get_order_labels_of_delivery.py +94 -0
- shopline_sdk/apis/orders/get_order_transaction_by_order_ids.py +58 -0
- shopline_sdk/apis/orders/get_orders.py +111 -0
- shopline_sdk/apis/orders/search_orders.py +339 -0
- shopline_sdk/apis/orders/split_order.py +84 -0
- shopline_sdk/apis/orders/update_order.py +123 -0
- shopline_sdk/apis/orders/update_order_delivery_status.py +88 -0
- shopline_sdk/apis/orders/update_order_payment_status.py +92 -0
- shopline_sdk/apis/orders/update_order_status.py +94 -0
- shopline_sdk/apis/orders/update_order_tags.py +91 -0
- shopline_sdk/apis/payments/__init__.py +0 -0
- shopline_sdk/apis/payments/get_payment.py +59 -0
- shopline_sdk/apis/payments/get_payments.py +88 -0
- shopline_sdk/apis/product_app_metafields/__init__.py +0 -0
- shopline_sdk/apis/product_app_metafields/get_app_metafields_attached_to_specific_product.py +61 -0
- shopline_sdk/apis/product_metafields/__init__.py +0 -0
- shopline_sdk/apis/product_metafields/get_metafields_attached_to_specific_product.py +62 -0
- shopline_sdk/apis/product_review_comments/__init__.py +0 -0
- shopline_sdk/apis/product_review_comments/bulk_create_product_review_comments.py +66 -0
- shopline_sdk/apis/product_review_comments/bulk_delete_product_review_comments.py +46 -0
- shopline_sdk/apis/product_review_comments/bulk_update_product_review_comments.py +64 -0
- shopline_sdk/apis/product_review_comments/create_product_review_comments.py +45 -0
- shopline_sdk/apis/product_review_comments/delete_product_review_comment.py +37 -0
- shopline_sdk/apis/product_review_comments/get_product_review_comment.py +42 -0
- shopline_sdk/apis/product_review_comments/get_product_review_comments.py +91 -0
- shopline_sdk/apis/product_review_comments/update_product_review_comment.py +45 -0
- shopline_sdk/apis/product_subscriptions/__init__.py +0 -0
- shopline_sdk/apis/product_subscriptions/get_a_list_of_product_subscriptions.py +71 -0
- shopline_sdk/apis/product_subscriptions/get_product_subscription.py +42 -0
- shopline_sdk/apis/products/__init__.py +0 -0
- shopline_sdk/apis/products/add_product_images.py +84 -0
- shopline_sdk/apis/products/batch_update_current_product_labels.py +73 -0
- shopline_sdk/apis/products/bulk_delete_product.py +77 -0
- shopline_sdk/apis/products/bulk_update_stock.py +81 -0
- shopline_sdk/apis/products/bulkpublish_unpublishproductinonlinestore.py +64 -0
- shopline_sdk/apis/products/bulkpublish_unpublishproductinretailstore.py +64 -0
- shopline_sdk/apis/products/create_product.py +54 -0
- shopline_sdk/apis/products/create_product_variation.py +70 -0
- shopline_sdk/apis/products/delete_product.py +70 -0
- shopline_sdk/apis/products/delete_product_images.py +54 -0
- shopline_sdk/apis/products/delete_product_variation.py +70 -0
- shopline_sdk/apis/products/get_locked_inventory_count.py +53 -0
- shopline_sdk/apis/products/get_product.py +79 -0
- shopline_sdk/apis/products/get_product_stocks.py +66 -0
- shopline_sdk/apis/products/get_products.py +112 -0
- shopline_sdk/apis/products/search_products.py +58 -0
- shopline_sdk/apis/products/update_current_product_tags.py +80 -0
- shopline_sdk/apis/products/update_product.py +54 -0
- shopline_sdk/apis/products/update_product_price.py +94 -0
- shopline_sdk/apis/products/update_product_quantity.py +102 -0
- shopline_sdk/apis/products/update_product_variation.py +46 -0
- shopline_sdk/apis/products/update_product_variation_price.py +92 -0
- shopline_sdk/apis/products/update_product_variation_quantity.py +111 -0
- shopline_sdk/apis/products/update_quantity_by_sku.py +114 -0
- shopline_sdk/apis/products/update_stock.py +89 -0
- shopline_sdk/apis/promotions/__init__.py +0 -0
- shopline_sdk/apis/promotions/create_promotion.py +45 -0
- shopline_sdk/apis/promotions/delete_promotion.py +44 -0
- shopline_sdk/apis/promotions/get_customer_coupon_promotions.py +61 -0
- shopline_sdk/apis/promotions/get_customer_promotions.py +63 -0
- shopline_sdk/apis/promotions/get_promotion.py +60 -0
- shopline_sdk/apis/promotions/get_promotions.py +106 -0
- shopline_sdk/apis/promotions/search_promotions.py +108 -0
- shopline_sdk/apis/promotions/update_promotion.py +54 -0
- shopline_sdk/apis/purchase_orders/__init__.py +0 -0
- shopline_sdk/apis/purchase_orders/create_child_purchase_order.py +66 -0
- shopline_sdk/apis/purchase_orders/create_purchase_order.py +66 -0
- shopline_sdk/apis/purchase_orders/delete_the_specified_purchase_orders.py +60 -0
- shopline_sdk/apis/purchase_orders/get_purchase_orders.py +89 -0
- shopline_sdk/apis/purchase_orders/get_the_specified_purchase_order.py +59 -0
- shopline_sdk/apis/purchase_orders/update_purchase_order.py +66 -0
- shopline_sdk/apis/return_orders/__init__.py +0 -0
- shopline_sdk/apis/return_orders/create_return_order.py +62 -0
- shopline_sdk/apis/return_orders/get_return_order.py +42 -0
- shopline_sdk/apis/return_orders/get_return_orders.py +95 -0
- shopline_sdk/apis/return_orders/update_return_order.py +70 -0
- shopline_sdk/apis/sales/__init__.py +0 -0
- shopline_sdk/apis/sales/create_sale_products.py +78 -0
- shopline_sdk/apis/sales/delete_sale_products.py +44 -0
- shopline_sdk/apis/sales/get_sale_comments.py +77 -0
- shopline_sdk/apis/sales/get_sale_customers.py +69 -0
- shopline_sdk/apis/sales/get_sale_products.py +74 -0
- shopline_sdk/apis/sales/update_sale_product_status.py +71 -0
- shopline_sdk/apis/sales/update_sale_products.py +78 -0
- shopline_sdk/apis/settings/__init__.py +0 -0
- shopline_sdk/apis/settings/get_checkout_setting.py +51 -0
- shopline_sdk/apis/settings/get_domains_setting.py +51 -0
- shopline_sdk/apis/settings/get_layouts_draft_setting.py +59 -0
- shopline_sdk/apis/settings/get_layouts_setting.py +59 -0
- shopline_sdk/apis/settings/get_orders_setting.py +51 -0
- shopline_sdk/apis/settings/get_payments_setting.py +51 -0
- shopline_sdk/apis/settings/get_pos_setting.py +51 -0
- shopline_sdk/apis/settings/get_product_review_setting.py +51 -0
- shopline_sdk/apis/settings/get_products_setting.py +51 -0
- shopline_sdk/apis/settings/get_promotions_setting.py +51 -0
- shopline_sdk/apis/settings/get_setting.py +42 -0
- shopline_sdk/apis/settings/get_shop_setting.py +51 -0
- shopline_sdk/apis/settings/get_tax_setting.py +51 -0
- shopline_sdk/apis/settings/get_theme_draft_setting.py +59 -0
- shopline_sdk/apis/settings/get_theme_setting.py +59 -0
- shopline_sdk/apis/settings/get_third_party_ads_setting.py +42 -0
- shopline_sdk/apis/settings/get_users_setting.py +65 -0
- shopline_sdk/apis/settings/publish_layouts_setting.py +73 -0
- shopline_sdk/apis/settings/publish_theme_setting.py +59 -0
- shopline_sdk/apis/settings/save_layouts_draft_setting.py +67 -0
- shopline_sdk/apis/settings/save_theme_setting.py +59 -0
- shopline_sdk/apis/settings/update_domains_setting.py +85 -0
- shopline_sdk/apis/staffs/__init__.py +0 -0
- shopline_sdk/apis/staffs/get_all_staff.py +62 -0
- shopline_sdk/apis/staffs/get_staff.py +59 -0
- shopline_sdk/apis/staffs/get_staff_permissions.py +62 -0
- shopline_sdk/apis/store_credits/__init__.py +0 -0
- shopline_sdk/apis/store_credits/bulk_update_store_credits.py +90 -0
- shopline_sdk/apis/store_credits/get_store_credits.py +87 -0
- shopline_sdk/apis/storefront_oauth_applications/__init__.py +0 -0
- shopline_sdk/apis/storefront_oauth_applications/create_storefront_o_auth_application.py +52 -0
- shopline_sdk/apis/storefront_oauth_applications/delete_storefront_oauth_application_by_id.py +47 -0
- shopline_sdk/apis/storefront_oauth_applications/get_storefront_o_auth_application.py +41 -0
- shopline_sdk/apis/storefront_oauth_applications/get_storefront_o_auth_application_by_id.py +50 -0
- shopline_sdk/apis/storefront_tokens/__init__.py +0 -0
- shopline_sdk/apis/storefront_tokens/create_storefront_token.py +60 -0
- shopline_sdk/apis/storefront_tokens/delete_storefront_token_by_id.py +54 -0
- shopline_sdk/apis/storefront_tokens/get_storefront_token_by_id.py +51 -0
- shopline_sdk/apis/storefront_tokens/list_all_storefront_tokens.py +46 -0
- shopline_sdk/apis/taxes/__init__.py +0 -0
- shopline_sdk/apis/taxes/get_taxes.py +65 -0
- shopline_sdk/apis/themes/__init__.py +0 -0
- shopline_sdk/apis/themes/get_theme_by_theme_key.py +63 -0
- shopline_sdk/apis/themes/getthethemesectionsbytheme_key.py +76 -0
- shopline_sdk/apis/token/__init__.py +0 -0
- shopline_sdk/apis/token/get_token_info.py +44 -0
- shopline_sdk/apis/user_coupons/__init__.py +0 -0
- shopline_sdk/apis/user_coupons/claim_user_coupon.py +45 -0
- shopline_sdk/apis/user_coupons/create_user_coupon.py +40 -0
- shopline_sdk/apis/user_coupons/get_user_coupons.py +55 -0
- shopline_sdk/apis/user_coupons/get_user_coupons_with_cursor.py +57 -0
- shopline_sdk/apis/user_coupons/redeem_user_coupon.py +45 -0
- shopline_sdk/apis/warehouses/__init__.py +0 -0
- shopline_sdk/apis/warehouses/get_warehouses.py +92 -0
- shopline_sdk/apis/webhooks/__init__.py +0 -0
- shopline_sdk/apis/webhooks/create_webhook.py +45 -0
- shopline_sdk/apis/webhooks/delete_webhook.py +37 -0
- shopline_sdk/apis/webhooks/get_webhook.py +42 -0
- shopline_sdk/apis/webhooks/get_webhooks.py +59 -0
- shopline_sdk/apis/webhooks/update_webhook.py +45 -0
- shopline_sdk/apis/wish_list_items/__init__.py +0 -0
- shopline_sdk/apis/wish_list_items/create_wish_list_item.py +68 -0
- shopline_sdk/apis/wish_list_items/delete_wish_list_item.py +89 -0
- shopline_sdk/apis/wish_list_items/get_wish_list_items.py +88 -0
- shopline_sdk/client.py +15 -0
- shopline_sdk/exceptions.py +48 -0
- shopline_sdk/helper.py +84 -0
- shopline_sdk/models/__init__.py +610 -0
- shopline_sdk/models/addon_product.py +50 -0
- shopline_sdk/models/addon_products.py +14 -0
- shopline_sdk/models/addon_products_cursor_based.py +15 -0
- shopline_sdk/models/address_node.py +27 -0
- shopline_sdk/models/address_nodes.py +20 -0
- shopline_sdk/models/address_preference.py +46 -0
- shopline_sdk/models/address_preference_layout_data.py +15 -0
- shopline_sdk/models/address_preferences.py +16 -0
- shopline_sdk/models/affiliate.py +32 -0
- shopline_sdk/models/affiliate_campaign.py +53 -0
- shopline_sdk/models/affiliate_campaign_order.py +75 -0
- shopline_sdk/models/affiliate_campaign_orders.py +16 -0
- shopline_sdk/models/affiliate_campaigns.py +20 -0
- shopline_sdk/models/agent.py +20 -0
- shopline_sdk/models/agent_work_log.py +30 -0
- shopline_sdk/models/agent_work_logs.py +12 -0
- shopline_sdk/models/agents.py +14 -0
- shopline_sdk/models/analytics.py +12 -0
- shopline_sdk/models/app_metafield_value.py +26 -0
- shopline_sdk/models/app_setting.py +9 -0
- shopline_sdk/models/bad_request_error.py +14 -0
- shopline_sdk/models/bearer_auth.py +9 -0
- shopline_sdk/models/bulk_delete_metafield_body.py +15 -0
- shopline_sdk/models/bulk_update_app_metafield_body.py +16 -0
- shopline_sdk/models/bulk_update_metafield_body.py +17 -0
- shopline_sdk/models/campaign_product.py +18 -0
- shopline_sdk/models/cart.py +128 -0
- shopline_sdk/models/cart_delivery.py +24 -0
- shopline_sdk/models/cart_item.py +51 -0
- shopline_sdk/models/cart_product.py +83 -0
- shopline_sdk/models/cart_product_variation.py +36 -0
- shopline_sdk/models/cart_promotion.py +19 -0
- shopline_sdk/models/categories.py +14 -0
- shopline_sdk/models/categories_cursor_based.py +15 -0
- shopline_sdk/models/category.py +45 -0
- shopline_sdk/models/category_layout.py +23 -0
- shopline_sdk/models/change_payment_method_response.py +14 -0
- shopline_sdk/models/channel.py +49 -0
- shopline_sdk/models/channel_param.py +11 -0
- shopline_sdk/models/channels.py +14 -0
- shopline_sdk/models/checkout_setting.py +37 -0
- shopline_sdk/models/corporate_info.py +34 -0
- shopline_sdk/models/coupon_item.py +53 -0
- shopline_sdk/models/create_agent_body.py +17 -0
- shopline_sdk/models/create_agent_work_log_request_body.py +18 -0
- shopline_sdk/models/create_app_metafield_body.py +15 -0
- shopline_sdk/models/create_bulk_operation_body.py +22 -0
- shopline_sdk/models/create_category_body.py +27 -0
- shopline_sdk/models/create_channel_price_body.py +21 -0
- shopline_sdk/models/create_customer_body.py +63 -0
- shopline_sdk/models/create_customer_group_activity_body.py +24 -0
- shopline_sdk/models/create_delivery_option_body.py +38 -0
- shopline_sdk/models/create_event_tracker_body.py +23 -0
- shopline_sdk/models/create_flash_price_campaign_body.py +22 -0
- shopline_sdk/models/create_metafield_body.py +16 -0
- shopline_sdk/models/create_metafield_definition_body.py +18 -0
- shopline_sdk/models/create_page_body.py +25 -0
- shopline_sdk/models/create_product_body.py +84 -0
- shopline_sdk/models/create_product_feed_setting_body.py +31 -0
- shopline_sdk/models/create_product_review_comment_body.py +21 -0
- shopline_sdk/models/create_product_variation_body.py +13 -0
- shopline_sdk/models/create_promotion_body.py +56 -0
- shopline_sdk/models/create_return_order_body.py +49 -0
- shopline_sdk/models/create_sub_res_app_metafield_body.py +16 -0
- shopline_sdk/models/create_sub_res_metafield_body.py +17 -0
- shopline_sdk/models/create_user_coupon_body.py +18 -0
- shopline_sdk/models/create_webhook_body.py +14 -0
- shopline_sdk/models/create_wish_list_item_body.py +27 -0
- shopline_sdk/models/cursor_based_paginatable.py +12 -0
- shopline_sdk/models/custom_field.py +18 -0
- shopline_sdk/models/customer.py +200 -0
- shopline_sdk/models/customer_coupon_promotions.py +12 -0
- shopline_sdk/models/customer_group.py +33 -0
- shopline_sdk/models/customer_group_activity.py +28 -0
- shopline_sdk/models/customer_groups.py +14 -0
- shopline_sdk/models/customer_promotion.py +54 -0
- shopline_sdk/models/customer_viewed_categories.py +14 -0
- shopline_sdk/models/customer_viewed_category.py +14 -0
- shopline_sdk/models/customer_viewed_product.py +14 -0
- shopline_sdk/models/customer_viewed_products.py +14 -0
- shopline_sdk/models/delivery_option.py +74 -0
- shopline_sdk/models/delivery_rate.py +17 -0
- shopline_sdk/models/delivery_time_slot.py +27 -0
- shopline_sdk/models/domains_setting.py +13 -0
- shopline_sdk/models/domains_setting_webmaster.py +20 -0
- shopline_sdk/models/end_date_param.py +10 -0
- shopline_sdk/models/entity_render_error.py +11 -0
- shopline_sdk/models/event_tracker.py +35 -0
- shopline_sdk/models/event_trackers.py +14 -0
- shopline_sdk/models/extend_promotion.py +25 -0
- shopline_sdk/models/facebook_business_extension_domains_entity.py +16 -0
- shopline_sdk/models/filter_tag.py +14 -0
- shopline_sdk/models/flash_price_campaign.py +39 -0
- shopline_sdk/models/flash_price_campaigns.py +16 -0
- shopline_sdk/models/forbidden_error.py +14 -0
- shopline_sdk/models/gift.py +54 -0
- shopline_sdk/models/gifts.py +14 -0
- shopline_sdk/models/gifts_cursor_based.py +15 -0
- shopline_sdk/models/global_section.py +12 -0
- shopline_sdk/models/global_section_settings.py +27 -0
- shopline_sdk/models/gross_amount_analytics.py +28 -0
- shopline_sdk/models/gross_orders_analytics.py +29 -0
- shopline_sdk/models/individual_info.py +14 -0
- shopline_sdk/models/interval_param.py +11 -0
- shopline_sdk/models/invoice.py +17 -0
- shopline_sdk/models/is_real_time_param.py +10 -0
- shopline_sdk/models/job.py +48 -0
- shopline_sdk/models/jobs.py +14 -0
- shopline_sdk/models/layout_sections.py +12 -0
- shopline_sdk/models/layouts_setting.py +14 -0
- shopline_sdk/models/limit_exceeded_error.py +14 -0
- shopline_sdk/models/link.py +39 -0
- shopline_sdk/models/lock_inventory.py +9 -0
- shopline_sdk/models/lock_inventory_count.py +14 -0
- shopline_sdk/models/max_applicable_member_point.py +16 -0
- shopline_sdk/models/media.py +16 -0
- shopline_sdk/models/media_upload_error.py +10 -0
- shopline_sdk/models/member_point.py +28 -0
- shopline_sdk/models/member_point_fulfillment.py +23 -0
- shopline_sdk/models/member_point_rule.py +40 -0
- shopline_sdk/models/member_point_rules.py +12 -0
- shopline_sdk/models/member_points.py +14 -0
- shopline_sdk/models/member_registration_analytics.py +29 -0
- shopline_sdk/models/membership_info.py +56 -0
- shopline_sdk/models/membership_tier.py +26 -0
- shopline_sdk/models/membership_tier_action_log.py +19 -0
- shopline_sdk/models/membership_tier_action_logs.py +14 -0
- shopline_sdk/models/membership_tier_rule.py +53 -0
- shopline_sdk/models/merchant.py +78 -0
- shopline_sdk/models/merchant_kyc.py +24 -0
- shopline_sdk/models/merchant_tax.py +50 -0
- shopline_sdk/models/metafield_definition.py +28 -0
- shopline_sdk/models/metafield_value.py +28 -0
- shopline_sdk/models/money.py +13 -0
- shopline_sdk/models/multipass_linking.py +22 -0
- shopline_sdk/models/multipass_linkings.py +16 -0
- shopline_sdk/models/multipass_secret.py +20 -0
- shopline_sdk/models/net_amount_analytics.py +28 -0
- shopline_sdk/models/net_orders_analytics.py +29 -0
- shopline_sdk/models/not_found_error.py +12 -0
- shopline_sdk/models/order.py +218 -0
- shopline_sdk/models/order_action_log.py +16 -0
- shopline_sdk/models/order_action_logs.py +12 -0
- shopline_sdk/models/order_agent.py +16 -0
- shopline_sdk/models/order_campaign_item.py +27 -0
- shopline_sdk/models/order_comment.py +28 -0
- shopline_sdk/models/order_conversation.py +39 -0
- shopline_sdk/models/order_conversations.py +14 -0
- shopline_sdk/models/order_conversations_message.py +32 -0
- shopline_sdk/models/order_conversations_messages.py +16 -0
- shopline_sdk/models/order_customer_info.py +24 -0
- shopline_sdk/models/order_delivery.py +57 -0
- shopline_sdk/models/order_delivery_address.py +37 -0
- shopline_sdk/models/order_delivery_data.py +28 -0
- shopline_sdk/models/order_inspect_item.py +18 -0
- shopline_sdk/models/order_invoice.py +32 -0
- shopline_sdk/models/order_item.py +93 -0
- shopline_sdk/models/order_payment.py +38 -0
- shopline_sdk/models/order_promotion_item.py +24 -0
- shopline_sdk/models/order_source.py +16 -0
- shopline_sdk/models/order_tag.py +10 -0
- shopline_sdk/models/order_transaction.py +32 -0
- shopline_sdk/models/orders_setting.py +25 -0
- shopline_sdk/models/page.py +49 -0
- shopline_sdk/models/page_block_settings.py +12 -0
- shopline_sdk/models/page_section.py +14 -0
- shopline_sdk/models/page_section_schema.py +37 -0
- shopline_sdk/models/page_section_settings.py +29 -0
- shopline_sdk/models/page_sections.py +12 -0
- shopline_sdk/models/paginatable.py +16 -0
- shopline_sdk/models/pagination.py +12 -0
- shopline_sdk/models/payment.py +33 -0
- shopline_sdk/models/payment_config_data.py +14 -0
- shopline_sdk/models/payment_fee_item.py +31 -0
- shopline_sdk/models/payment_settlement.py +47 -0
- shopline_sdk/models/payments_setting.py +17 -0
- shopline_sdk/models/pos_payment.py +19 -0
- shopline_sdk/models/pos_setting.py +15 -0
- shopline_sdk/models/price_detail.py +15 -0
- shopline_sdk/models/price_set.py +29 -0
- shopline_sdk/models/price_sets.py +12 -0
- shopline_sdk/models/product.py +201 -0
- shopline_sdk/models/product_feed_setting.py +45 -0
- shopline_sdk/models/product_feed_settings.py +14 -0
- shopline_sdk/models/product_ids_param.py +10 -0
- shopline_sdk/models/product_price_tier.py +26 -0
- shopline_sdk/models/product_related_theme_settings.py +23 -0
- shopline_sdk/models/product_revenue.py +26 -0
- shopline_sdk/models/product_revenues.py +14 -0
- shopline_sdk/models/product_review.py +28 -0
- shopline_sdk/models/product_review_comment.py +31 -0
- shopline_sdk/models/product_review_comments.py +14 -0
- shopline_sdk/models/product_review_comments_cursor_based.py +15 -0
- shopline_sdk/models/product_review_setting.py +32 -0
- shopline_sdk/models/product_reviews.py +14 -0
- shopline_sdk/models/product_stock.py +34 -0
- shopline_sdk/models/product_subscription.py +34 -0
- shopline_sdk/models/product_variation.py +56 -0
- shopline_sdk/models/products_cursor_based.py +17 -0
- shopline_sdk/models/products_setting.py +28 -0
- shopline_sdk/models/promotion.py +104 -0
- shopline_sdk/models/promotion_condition.py +27 -0
- shopline_sdk/models/promotion_excluded_hints.py +16 -0
- shopline_sdk/models/promotions_setting.py +28 -0
- shopline_sdk/models/purchase_order.py +63 -0
- shopline_sdk/models/purchase_order_item.py +66 -0
- shopline_sdk/models/purchase_orders.py +14 -0
- shopline_sdk/models/quantity_update_not_allowed_error.py +14 -0
- shopline_sdk/models/retail_status.py +11 -0
- shopline_sdk/models/return_order.py +75 -0
- shopline_sdk/models/return_order_delivery.py +26 -0
- shopline_sdk/models/return_order_delivery_address.py +37 -0
- shopline_sdk/models/return_order_delivery_data.py +28 -0
- shopline_sdk/models/return_order_item.py +33 -0
- shopline_sdk/models/return_order_payment.py +28 -0
- shopline_sdk/models/return_order_promotion_item.py +22 -0
- shopline_sdk/models/return_order_ref_data.py +10 -0
- shopline_sdk/models/return_orders.py +14 -0
- shopline_sdk/models/sale_comment.py +30 -0
- shopline_sdk/models/sale_customer.py +31 -0
- shopline_sdk/models/sale_product.py +21 -0
- shopline_sdk/models/save_draft_body.py +25 -0
- shopline_sdk/models/sc_conversation.py +31 -0
- shopline_sdk/models/sc_conversations.py +14 -0
- shopline_sdk/models/sc_conversations_message.py +30 -0
- shopline_sdk/models/sc_conversations_messages.py +16 -0
- shopline_sdk/models/search_products_body.py +71 -0
- shopline_sdk/models/server_error.py +12 -0
- shopline_sdk/models/service_unavailable_error.py +12 -0
- shopline_sdk/models/settings.py +30 -0
- shopline_sdk/models/settlement_terminal_list.py +9 -0
- shopline_sdk/models/shop_conversation.py +31 -0
- shopline_sdk/models/shop_conversations.py +14 -0
- shopline_sdk/models/shop_conversations_message.py +30 -0
- shopline_sdk/models/shop_conversations_messages.py +16 -0
- shopline_sdk/models/shop_crm_setting.py +24 -0
- shopline_sdk/models/shop_setting.py +10 -0
- shopline_sdk/models/staff.py +61 -0
- shopline_sdk/models/staff_performance.py +9 -0
- shopline_sdk/models/start_date_param.py +10 -0
- shopline_sdk/models/status.py +11 -0
- shopline_sdk/models/stock.py +12 -0
- shopline_sdk/models/store_credit.py +50 -0
- shopline_sdk/models/store_credit_fulfillment.py +27 -0
- shopline_sdk/models/storefront_o_auth_application.py +18 -0
- shopline_sdk/models/storefront_o_auth_applications.py +12 -0
- shopline_sdk/models/storefront_token.py +26 -0
- shopline_sdk/models/storefront_token_merchant.py +17 -0
- shopline_sdk/models/storefront_token_staff.py +15 -0
- shopline_sdk/models/storefront_tokens.py +12 -0
- shopline_sdk/models/supplier.py +24 -0
- shopline_sdk/models/tag.py +16 -0
- shopline_sdk/models/taggable.py +9 -0
- shopline_sdk/models/tax.py +57 -0
- shopline_sdk/models/tax_info.py +22 -0
- shopline_sdk/models/tax_region.py +20 -0
- shopline_sdk/models/tax_setting.py +10 -0
- shopline_sdk/models/theme.py +44 -0
- shopline_sdk/models/theme_schema.py +19 -0
- shopline_sdk/models/theme_setting.py +16 -0
- shopline_sdk/models/third_party_ads_setting.py +38 -0
- shopline_sdk/models/token_scopes.py +10 -0
- shopline_sdk/models/top_products_analytics.py +19 -0
- shopline_sdk/models/top_products_analytics_record.py +30 -0
- shopline_sdk/models/top_products_analytics_record_variation.py +34 -0
- shopline_sdk/models/total_sessions_analytics.py +35 -0
- shopline_sdk/models/total_views_analytics.py +29 -0
- shopline_sdk/models/transaction.py +65 -0
- shopline_sdk/models/translatable.py +28 -0
- shopline_sdk/models/translatable_array.py +28 -0
- shopline_sdk/models/unauthorized_error.py +14 -0
- shopline_sdk/models/unprocessable_entity_error.py +16 -0
- shopline_sdk/models/update_addon_product_body.py +36 -0
- shopline_sdk/models/update_agent_body.py +15 -0
- shopline_sdk/models/update_app_metafield_body.py +14 -0
- shopline_sdk/models/update_category_body.py +28 -0
- shopline_sdk/models/update_channel_price_body.py +21 -0
- shopline_sdk/models/update_customer_body.py +62 -0
- shopline_sdk/models/update_customer_group_activity_body.py +22 -0
- shopline_sdk/models/update_event_tracker_body.py +27 -0
- shopline_sdk/models/update_flash_price_campaign_body.py +22 -0
- shopline_sdk/models/update_gift_body.py +20 -0
- shopline_sdk/models/update_lock_inventory_body.py +21 -0
- shopline_sdk/models/update_metafield_body.py +14 -0
- shopline_sdk/models/update_product_body.py +66 -0
- shopline_sdk/models/update_product_feed_setting_body.py +27 -0
- shopline_sdk/models/update_product_review_comment_body.py +18 -0
- shopline_sdk/models/update_product_variation_body.py +34 -0
- shopline_sdk/models/update_promotion_body.py +71 -0
- shopline_sdk/models/update_return_order_body.py +17 -0
- shopline_sdk/models/update_webhook_body.py +14 -0
- shopline_sdk/models/user_coupon.py +12 -0
- shopline_sdk/models/user_coupons.py +14 -0
- shopline_sdk/models/user_credit_rule.py +40 -0
- shopline_sdk/models/users_setting.py +83 -0
- shopline_sdk/models/utm_data.py +20 -0
- shopline_sdk/models/warehouse.py +14 -0
- shopline_sdk/models/warehouses_cursor_based.py +17 -0
- shopline_sdk/models/webhook.py +23 -0
- shopline_sdk/models/webhooks.py +14 -0
- shopline_sdk/models/wish_list_item.py +41 -0
- shopline_sdk/models/wish_list_items.py +15 -0
- shopline_sdk_python-0.1.0.dist-info/METADATA +265 -0
- shopline_sdk_python-0.1.0.dist-info/RECORD +638 -0
- shopline_sdk_python-0.1.0.dist-info/WHEEL +5 -0
- shopline_sdk_python-0.1.0.dist-info/licenses/LICENSE +674 -0
- shopline_sdk_python-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,106 @@
|
|
|
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.paginatable import Paginatable
|
|
11
|
+
from ...models.promotion import Promotion
|
|
12
|
+
|
|
13
|
+
class Request(BaseModel):
|
|
14
|
+
"""查询参数模型"""
|
|
15
|
+
updated_after: Optional[str] = None
|
|
16
|
+
"""Filter data by those updated after specific time.
|
|
17
|
+
取得 updated_at 大於指定時間的優惠活動(包含指定時間)
|
|
18
|
+
*Should use UTC time'"""
|
|
19
|
+
updated_before: Optional[str] = None
|
|
20
|
+
"""Filter data by those updated before specific time.
|
|
21
|
+
取得 updated_at 小於指定時間的優惠活動(包含指定時間)
|
|
22
|
+
*Should use UTC time'"""
|
|
23
|
+
created_after: Optional[str] = None
|
|
24
|
+
"""Filter data by those created after specific time.
|
|
25
|
+
取得 created_at 大於指定時間的優惠活動(包含指定時間)
|
|
26
|
+
*Should use UTC time'"""
|
|
27
|
+
created_before: Optional[str] = None
|
|
28
|
+
"""Filter data by those created before specific time.
|
|
29
|
+
取得 created_at 小於指定時間的優惠活動(包含指定時間)
|
|
30
|
+
*Should use UTC time'"""
|
|
31
|
+
start_after: Optional[str] = None
|
|
32
|
+
"""Filter data by those updated after specific time.
|
|
33
|
+
取得 start_at 大於指定時間的優惠活動(包含指定時間)
|
|
34
|
+
*Should use UTC time'"""
|
|
35
|
+
start_before: Optional[str] = None
|
|
36
|
+
"""Filter data by those updated before specific time.
|
|
37
|
+
取得 start_at 小於指定時間的優惠活動(包含指定時間)
|
|
38
|
+
*Should use UTC time'"""
|
|
39
|
+
end_after: Optional[str] = None
|
|
40
|
+
"""Filter data by those updated after specific time.
|
|
41
|
+
取得 end_at 大於指定時間的優惠活動(包含指定時間)
|
|
42
|
+
*Should use UTC time'"""
|
|
43
|
+
end_before: Optional[str] = None
|
|
44
|
+
"""Filter data by those updated before specific time.
|
|
45
|
+
取得 end_at 小於指定時間的優惠活動(包含指定時間)
|
|
46
|
+
*Should use UTC time'"""
|
|
47
|
+
customer_id: Optional[str] = None
|
|
48
|
+
"""用戶id"""
|
|
49
|
+
scope: Optional[Literal['valid', 'invalid']] = None
|
|
50
|
+
"""promotion是否失效 (搭配customer_id使用)"""
|
|
51
|
+
promotion_ids: Optional[List[str]] = None
|
|
52
|
+
"""Filter promotions by IDs.
|
|
53
|
+
The promotion_ids parameter must be used standalone.
|
|
54
|
+
透過 IDs 獲取相關優惠活動,此參數須單獨使用。"""
|
|
55
|
+
page: Optional[int] = None
|
|
56
|
+
"""Page Number
|
|
57
|
+
頁數"""
|
|
58
|
+
per_page: Optional[int] = None
|
|
59
|
+
"""Numbers of Orders per Page
|
|
60
|
+
每頁顯示 n 筆資料
|
|
61
|
+
上限 100"""
|
|
62
|
+
|
|
63
|
+
class Response(BaseModel):
|
|
64
|
+
"""响应体模型"""
|
|
65
|
+
items: Optional[List[Promotion]] = None
|
|
66
|
+
pagination: Optional[Paginatable] = None
|
|
67
|
+
|
|
68
|
+
async def call(
|
|
69
|
+
session: aiohttp.ClientSession, request: Optional[Request] = None
|
|
70
|
+
) -> Response:
|
|
71
|
+
"""
|
|
72
|
+
Get Promotions
|
|
73
|
+
|
|
74
|
+
To get detailed information of couple promotions sorted by time
|
|
75
|
+
利用時間範圍選取與排序獲取數筆優惠活動
|
|
76
|
+
|
|
77
|
+
Path: GET /promotions
|
|
78
|
+
"""
|
|
79
|
+
# 构建请求 URL
|
|
80
|
+
url = "promotions"
|
|
81
|
+
|
|
82
|
+
# 构建查询参数
|
|
83
|
+
params = {}
|
|
84
|
+
if request:
|
|
85
|
+
request_dict = request.model_dump(exclude_none=True)
|
|
86
|
+
for key, value in request_dict.items():
|
|
87
|
+
if value is not None:
|
|
88
|
+
params[key] = value
|
|
89
|
+
|
|
90
|
+
# 构建请求头
|
|
91
|
+
headers = {"Content-Type": "application/json"}
|
|
92
|
+
|
|
93
|
+
# 发起 HTTP 请求
|
|
94
|
+
async with session.get(
|
|
95
|
+
url, params=params, headers=headers
|
|
96
|
+
) as response:
|
|
97
|
+
if response.status >= 400:
|
|
98
|
+
error_data = await response.json()
|
|
99
|
+
raise ShoplineAPIError(
|
|
100
|
+
status_code=response.status,
|
|
101
|
+
**error_data
|
|
102
|
+
)
|
|
103
|
+
response_data = await response.json()
|
|
104
|
+
|
|
105
|
+
# 验证并返回响应数据
|
|
106
|
+
return Response(**response_data)
|
|
@@ -0,0 +1,108 @@
|
|
|
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.paginatable import Paginatable
|
|
11
|
+
from ...models.promotion import Promotion
|
|
12
|
+
|
|
13
|
+
class Request(BaseModel):
|
|
14
|
+
"""查询参数模型"""
|
|
15
|
+
updated_after: Optional[str] = None
|
|
16
|
+
"""Filter data by those updated after specific time.
|
|
17
|
+
取得 updated_at 大於指定時間的優惠活動(包含指定時間)
|
|
18
|
+
*Should use UTC time'"""
|
|
19
|
+
updated_before: Optional[str] = None
|
|
20
|
+
"""Filter data by those updated before specific time.
|
|
21
|
+
取得 updated_at 小於指定時間的優惠活動(包含指定時間)
|
|
22
|
+
*Should use UTC time'"""
|
|
23
|
+
created_after: Optional[str] = None
|
|
24
|
+
"""Filter data by those created after specific time.
|
|
25
|
+
取得 created_at 大於指定時間的優惠活動(包含指定時間)
|
|
26
|
+
*Should use UTC time'"""
|
|
27
|
+
created_before: Optional[str] = None
|
|
28
|
+
"""Filter data by those created before specific time.
|
|
29
|
+
取得 created_at 小於指定時間的優惠活動(包含指定時間)
|
|
30
|
+
*Should use UTC time'"""
|
|
31
|
+
start_after: Optional[str] = None
|
|
32
|
+
"""Filter data by those updated after specific time.
|
|
33
|
+
取得 start_at 大於指定時間的優惠活動(包含指定時間)
|
|
34
|
+
*Should use UTC time'"""
|
|
35
|
+
start_before: Optional[str] = None
|
|
36
|
+
"""Filter data by those updated before specific time.
|
|
37
|
+
取得 start_at 小於指定時間的優惠活動(包含指定時間)
|
|
38
|
+
*Should use UTC time'"""
|
|
39
|
+
end_after: Optional[str] = None
|
|
40
|
+
"""Filter data by those updated after specific time.
|
|
41
|
+
取得 end_at 大於指定時間的優惠活動(包含指定時間)
|
|
42
|
+
*Should use UTC time'"""
|
|
43
|
+
end_before: Optional[str] = None
|
|
44
|
+
"""Filter data by those updated before specific time.
|
|
45
|
+
取得 end_at 小於指定時間的優惠活動(包含指定時間)
|
|
46
|
+
*Should use UTC time'"""
|
|
47
|
+
apply_method: Optional[Literal['auto_apply', 'coupon', 'affiliate_campaign']] = None
|
|
48
|
+
"""使用方式"""
|
|
49
|
+
coupon_type: Optional[List[Literal['draw', 'single', 'multi']]] = None
|
|
50
|
+
"""優惠券類別"""
|
|
51
|
+
status: Optional[Literal['active', 'draft', 'hidden']] = None
|
|
52
|
+
"""狀態"""
|
|
53
|
+
available_count: Optional[str] = None
|
|
54
|
+
"""剩餘可抽取量"""
|
|
55
|
+
discount_on: Optional[Literal['order', 'item', 'category']] = None
|
|
56
|
+
"""優惠作用範圍"""
|
|
57
|
+
discount_type: Optional[List[Literal['percentage', 'amount', 'free_shipping', 'gift', 'addon', 'bundle_pricing', 'bundle_group', 'bundle_percentage', 'bundle_amount', 'bundle_gift', 'bundle_group_percentage', 'bundle_group_amount', 'bundle_group_gift', 'buyandget_free', 'buyandget_pricing', 'buyandget_percentage', 'subscription_gift', 'subscription_percentage', 'subscription_amount', 'member_point_redeem_gift', 'credit_reward', 'point_reward', 'earn_purchase_points']]] = None
|
|
58
|
+
"""優惠類別"""
|
|
59
|
+
page: Optional[int] = None
|
|
60
|
+
"""Page Number
|
|
61
|
+
頁數"""
|
|
62
|
+
per_page: Optional[int] = None
|
|
63
|
+
"""Numbers of Orders per Page
|
|
64
|
+
每頁顯示 n 筆資料"""
|
|
65
|
+
|
|
66
|
+
class Response(BaseModel):
|
|
67
|
+
"""响应体模型"""
|
|
68
|
+
items: Optional[List[Promotion]] = None
|
|
69
|
+
pagination: Optional[Paginatable] = None
|
|
70
|
+
|
|
71
|
+
async def call(
|
|
72
|
+
session: aiohttp.ClientSession, request: Optional[Request] = None
|
|
73
|
+
) -> Response:
|
|
74
|
+
"""
|
|
75
|
+
Search Promotions
|
|
76
|
+
|
|
77
|
+
Search Promotion
|
|
78
|
+
|
|
79
|
+
Path: GET /promotions/search
|
|
80
|
+
"""
|
|
81
|
+
# 构建请求 URL
|
|
82
|
+
url = "promotions/search"
|
|
83
|
+
|
|
84
|
+
# 构建查询参数
|
|
85
|
+
params = {}
|
|
86
|
+
if request:
|
|
87
|
+
request_dict = request.model_dump(exclude_none=True)
|
|
88
|
+
for key, value in request_dict.items():
|
|
89
|
+
if value is not None:
|
|
90
|
+
params[key] = value
|
|
91
|
+
|
|
92
|
+
# 构建请求头
|
|
93
|
+
headers = {"Content-Type": "application/json"}
|
|
94
|
+
|
|
95
|
+
# 发起 HTTP 请求
|
|
96
|
+
async with session.get(
|
|
97
|
+
url, params=params, headers=headers
|
|
98
|
+
) as response:
|
|
99
|
+
if response.status >= 400:
|
|
100
|
+
error_data = await response.json()
|
|
101
|
+
raise ShoplineAPIError(
|
|
102
|
+
status_code=response.status,
|
|
103
|
+
**error_data
|
|
104
|
+
)
|
|
105
|
+
response_data = await response.json()
|
|
106
|
+
|
|
107
|
+
# 验证并返回响应数据
|
|
108
|
+
return Response(**response_data)
|
|
@@ -0,0 +1,54 @@
|
|
|
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.promotion import Promotion
|
|
11
|
+
|
|
12
|
+
async def call(
|
|
13
|
+
session: aiohttp.ClientSession, id: str, data: Optional[Dict[str, Any]] = None
|
|
14
|
+
) -> Promotion:
|
|
15
|
+
"""
|
|
16
|
+
Update Promotion
|
|
17
|
+
|
|
18
|
+
To update detailed information of couple promotions
|
|
19
|
+
更新優惠活動
|
|
20
|
+
|
|
21
|
+
<strong> * Cannot update the conditions </strong>
|
|
22
|
+
Updating promotion condition requires the condition id .
|
|
23
|
+
Providing the condition id will <strong>NOT</strong> update the condition.
|
|
24
|
+
<strong> Need endpoints for create and update condition.</strong>
|
|
25
|
+
<strong> * 不能更新活動條件 </strong>
|
|
26
|
+
更新活動的條件須要 condition id.
|
|
27
|
+
但提供 condition id <strong>不會</strong> 更新條件的值。
|
|
28
|
+
<strong> 需要建立和更新 條件 的功能。 </strong>
|
|
29
|
+
|
|
30
|
+
Path: PUT /promotions/{id}
|
|
31
|
+
"""
|
|
32
|
+
# 构建请求 URL
|
|
33
|
+
url = f"promotions/{id}"
|
|
34
|
+
|
|
35
|
+
# 构建请求头
|
|
36
|
+
headers = {"Content-Type": "application/json"}
|
|
37
|
+
|
|
38
|
+
# 构建请求体
|
|
39
|
+
json_data = data if data else None
|
|
40
|
+
|
|
41
|
+
# 发起 HTTP 请求
|
|
42
|
+
async with session.put(
|
|
43
|
+
url, json=json_data, headers=headers
|
|
44
|
+
) as response:
|
|
45
|
+
if response.status >= 400:
|
|
46
|
+
error_data = await response.json()
|
|
47
|
+
raise ShoplineAPIError(
|
|
48
|
+
status_code=response.status,
|
|
49
|
+
**error_data
|
|
50
|
+
)
|
|
51
|
+
response_data = await response.json()
|
|
52
|
+
|
|
53
|
+
# 验证并返回响应数据
|
|
54
|
+
return Promotion(**response_data)
|
|
File without changes
|
|
@@ -0,0 +1,66 @@
|
|
|
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.purchase_order import PurchaseOrder
|
|
12
|
+
from ...models.server_error import ServerError
|
|
13
|
+
|
|
14
|
+
class Request(BaseModel):
|
|
15
|
+
"""请求体模型"""
|
|
16
|
+
purchase_order: Optional[Dict[str, Any]] = None
|
|
17
|
+
|
|
18
|
+
async def call(
|
|
19
|
+
session: aiohttp.ClientSession, PurchaseOrderId: str, request: Optional[Request] = None
|
|
20
|
+
) -> PurchaseOrder:
|
|
21
|
+
"""
|
|
22
|
+
Create child purchase order
|
|
23
|
+
|
|
24
|
+
Create child purchase order
|
|
25
|
+
建立子進貨單
|
|
26
|
+
|
|
27
|
+
Path: POST /pos/purchase_orders/{PurchaseOrderId}/child
|
|
28
|
+
"""
|
|
29
|
+
# 构建请求 URL
|
|
30
|
+
url = f"pos/purchase_orders/{PurchaseOrderId}/child"
|
|
31
|
+
|
|
32
|
+
# 构建请求头
|
|
33
|
+
headers = {"Content-Type": "application/json"}
|
|
34
|
+
|
|
35
|
+
# 构建请求体
|
|
36
|
+
json_data = request.model_dump(exclude_none=True) if request else None
|
|
37
|
+
|
|
38
|
+
# 发起 HTTP 请求
|
|
39
|
+
async with session.post(
|
|
40
|
+
url, json=json_data, headers=headers
|
|
41
|
+
) as response:
|
|
42
|
+
if response.status >= 400:
|
|
43
|
+
error_data = await response.json()
|
|
44
|
+
if response.status == 404:
|
|
45
|
+
error_model = NotFoundError(**error_data)
|
|
46
|
+
raise ShoplineAPIError(
|
|
47
|
+
status_code=404,
|
|
48
|
+
error=error_model,
|
|
49
|
+
**error_data
|
|
50
|
+
)
|
|
51
|
+
if response.status == 500:
|
|
52
|
+
error_model = ServerError(**error_data)
|
|
53
|
+
raise ShoplineAPIError(
|
|
54
|
+
status_code=500,
|
|
55
|
+
error=error_model,
|
|
56
|
+
**error_data
|
|
57
|
+
)
|
|
58
|
+
# 默认错误处理
|
|
59
|
+
raise ShoplineAPIError(
|
|
60
|
+
status_code=response.status,
|
|
61
|
+
**error_data
|
|
62
|
+
)
|
|
63
|
+
response_data = await response.json()
|
|
64
|
+
|
|
65
|
+
# 验证并返回响应数据
|
|
66
|
+
return PurchaseOrder(**response_data)
|
|
@@ -0,0 +1,66 @@
|
|
|
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.purchase_order import PurchaseOrder
|
|
12
|
+
from ...models.server_error import ServerError
|
|
13
|
+
|
|
14
|
+
class Request(BaseModel):
|
|
15
|
+
"""请求体模型"""
|
|
16
|
+
purchase_order: Optional[Dict[str, Any]] = None
|
|
17
|
+
|
|
18
|
+
async def call(
|
|
19
|
+
session: aiohttp.ClientSession, request: Optional[Request] = None
|
|
20
|
+
) -> PurchaseOrder:
|
|
21
|
+
"""
|
|
22
|
+
Create purchase order
|
|
23
|
+
|
|
24
|
+
Create purchase order
|
|
25
|
+
創建進貨單
|
|
26
|
+
|
|
27
|
+
Path: POST /pos/purchase_orders
|
|
28
|
+
"""
|
|
29
|
+
# 构建请求 URL
|
|
30
|
+
url = "pos/purchase_orders"
|
|
31
|
+
|
|
32
|
+
# 构建请求头
|
|
33
|
+
headers = {"Content-Type": "application/json"}
|
|
34
|
+
|
|
35
|
+
# 构建请求体
|
|
36
|
+
json_data = request.model_dump(exclude_none=True) if request else None
|
|
37
|
+
|
|
38
|
+
# 发起 HTTP 请求
|
|
39
|
+
async with session.post(
|
|
40
|
+
url, json=json_data, headers=headers
|
|
41
|
+
) as response:
|
|
42
|
+
if response.status >= 400:
|
|
43
|
+
error_data = await response.json()
|
|
44
|
+
if response.status == 404:
|
|
45
|
+
error_model = NotFoundError(**error_data)
|
|
46
|
+
raise ShoplineAPIError(
|
|
47
|
+
status_code=404,
|
|
48
|
+
error=error_model,
|
|
49
|
+
**error_data
|
|
50
|
+
)
|
|
51
|
+
if response.status == 500:
|
|
52
|
+
error_model = ServerError(**error_data)
|
|
53
|
+
raise ShoplineAPIError(
|
|
54
|
+
status_code=500,
|
|
55
|
+
error=error_model,
|
|
56
|
+
**error_data
|
|
57
|
+
)
|
|
58
|
+
# 默认错误处理
|
|
59
|
+
raise ShoplineAPIError(
|
|
60
|
+
status_code=response.status,
|
|
61
|
+
**error_data
|
|
62
|
+
)
|
|
63
|
+
response_data = await response.json()
|
|
64
|
+
|
|
65
|
+
# 验证并返回响应数据
|
|
66
|
+
return PurchaseOrder(**response_data)
|
|
@@ -0,0 +1,60 @@
|
|
|
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.server_error import ServerError
|
|
11
|
+
|
|
12
|
+
class Request(BaseModel):
|
|
13
|
+
"""查询参数模型"""
|
|
14
|
+
ids: Optional[str] = None
|
|
15
|
+
|
|
16
|
+
async def call(
|
|
17
|
+
session: aiohttp.ClientSession, request: Optional[Request] = None
|
|
18
|
+
) -> Dict[str, Any]:
|
|
19
|
+
"""
|
|
20
|
+
Delete the specified purchase orders
|
|
21
|
+
|
|
22
|
+
Delete the specified purchase orders
|
|
23
|
+
批量刪除進貨單
|
|
24
|
+
|
|
25
|
+
Path: PUT /pos/purchase_orders/bulk_delete
|
|
26
|
+
"""
|
|
27
|
+
# 构建请求 URL
|
|
28
|
+
url = "pos/purchase_orders/bulk_delete"
|
|
29
|
+
|
|
30
|
+
# 构建查询参数
|
|
31
|
+
params = {}
|
|
32
|
+
if request:
|
|
33
|
+
request_dict = request.model_dump(exclude_none=True)
|
|
34
|
+
for key, value in request_dict.items():
|
|
35
|
+
if value is not None:
|
|
36
|
+
params[key] = value
|
|
37
|
+
|
|
38
|
+
# 构建请求头
|
|
39
|
+
headers = {"Content-Type": "application/json"}
|
|
40
|
+
|
|
41
|
+
# 发起 HTTP 请求
|
|
42
|
+
async with session.put(
|
|
43
|
+
url, params=params, headers=headers
|
|
44
|
+
) as response:
|
|
45
|
+
if response.status >= 400:
|
|
46
|
+
error_data = await response.json()
|
|
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
|
+
return response_data
|
|
@@ -0,0 +1,89 @@
|
|
|
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.purchase_orders import PurchaseOrders
|
|
11
|
+
from ...models.server_error import ServerError
|
|
12
|
+
|
|
13
|
+
class Request(BaseModel):
|
|
14
|
+
"""查询参数模型"""
|
|
15
|
+
query: Optional[str] = None
|
|
16
|
+
"""PurchaseOrder's number
|
|
17
|
+
進貨單號碼"""
|
|
18
|
+
type: Optional[str] = None
|
|
19
|
+
"""PurchaseOrder's type
|
|
20
|
+
進貨單類型"""
|
|
21
|
+
statuses: Optional[List[str]] = None
|
|
22
|
+
"""PurchaseOrder's statuses
|
|
23
|
+
進貨單狀態"""
|
|
24
|
+
arrival_statuses: Optional[List[str]] = None
|
|
25
|
+
"""PurchaseOrder's arrival statuses
|
|
26
|
+
進貨單到貨狀態"""
|
|
27
|
+
channel_id: Optional[str] = None
|
|
28
|
+
"""PurchaseOrder's channel ID
|
|
29
|
+
進貨單門市ID"""
|
|
30
|
+
start_date: Optional[str] = None
|
|
31
|
+
"""PurchaseOrder's created at after date
|
|
32
|
+
進貨單創建時間起始日"""
|
|
33
|
+
end_date: Optional[str] = None
|
|
34
|
+
"""PurchaseOrder's created at before date
|
|
35
|
+
進貨單創建時間終止日"""
|
|
36
|
+
supplier_id: Optional[str] = None
|
|
37
|
+
"""PurchaseOrder's supplier ID
|
|
38
|
+
進貨單供應商"""
|
|
39
|
+
item_detail: Optional[bool] = None
|
|
40
|
+
"""Is PurchaseOrder's item detail required
|
|
41
|
+
是否顯示進貨單項目細節"""
|
|
42
|
+
|
|
43
|
+
async def call(
|
|
44
|
+
session: aiohttp.ClientSession, request: Optional[Request] = None
|
|
45
|
+
) -> PurchaseOrders:
|
|
46
|
+
"""
|
|
47
|
+
Get purchase orders
|
|
48
|
+
|
|
49
|
+
Get purchase orders
|
|
50
|
+
取得進貨單
|
|
51
|
+
|
|
52
|
+
Path: GET /pos/purchase_orders
|
|
53
|
+
"""
|
|
54
|
+
# 构建请求 URL
|
|
55
|
+
url = "pos/purchase_orders"
|
|
56
|
+
|
|
57
|
+
# 构建查询参数
|
|
58
|
+
params = {}
|
|
59
|
+
if request:
|
|
60
|
+
request_dict = request.model_dump(exclude_none=True)
|
|
61
|
+
for key, value in request_dict.items():
|
|
62
|
+
if value is not None:
|
|
63
|
+
params[key] = value
|
|
64
|
+
|
|
65
|
+
# 构建请求头
|
|
66
|
+
headers = {"Content-Type": "application/json"}
|
|
67
|
+
|
|
68
|
+
# 发起 HTTP 请求
|
|
69
|
+
async with session.get(
|
|
70
|
+
url, params=params, headers=headers
|
|
71
|
+
) as response:
|
|
72
|
+
if response.status >= 400:
|
|
73
|
+
error_data = await response.json()
|
|
74
|
+
if response.status == 500:
|
|
75
|
+
error_model = ServerError(**error_data)
|
|
76
|
+
raise ShoplineAPIError(
|
|
77
|
+
status_code=500,
|
|
78
|
+
error=error_model,
|
|
79
|
+
**error_data
|
|
80
|
+
)
|
|
81
|
+
# 默认错误处理
|
|
82
|
+
raise ShoplineAPIError(
|
|
83
|
+
status_code=response.status,
|
|
84
|
+
**error_data
|
|
85
|
+
)
|
|
86
|
+
response_data = await response.json()
|
|
87
|
+
|
|
88
|
+
# 验证并返回响应数据
|
|
89
|
+
return PurchaseOrders(**response_data)
|
|
@@ -0,0 +1,59 @@
|
|
|
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.purchase_order import PurchaseOrder
|
|
12
|
+
from ...models.server_error import ServerError
|
|
13
|
+
|
|
14
|
+
async def call(
|
|
15
|
+
session: aiohttp.ClientSession, PurchaseOrderId: str
|
|
16
|
+
) -> PurchaseOrder:
|
|
17
|
+
"""
|
|
18
|
+
Get the specified purchase order
|
|
19
|
+
|
|
20
|
+
Get the specified purchase order by PurchaseOrderId
|
|
21
|
+
透過 id 取得進貨單資訊
|
|
22
|
+
|
|
23
|
+
Path: GET /pos/purchase_orders/{PurchaseOrderId}
|
|
24
|
+
"""
|
|
25
|
+
# 构建请求 URL
|
|
26
|
+
url = f"pos/purchase_orders/{PurchaseOrderId}"
|
|
27
|
+
|
|
28
|
+
# 构建请求头
|
|
29
|
+
headers = {"Content-Type": "application/json"}
|
|
30
|
+
|
|
31
|
+
# 发起 HTTP 请求
|
|
32
|
+
async with session.get(
|
|
33
|
+
url, headers=headers
|
|
34
|
+
) as response:
|
|
35
|
+
if response.status >= 400:
|
|
36
|
+
error_data = await response.json()
|
|
37
|
+
if response.status == 404:
|
|
38
|
+
error_model = NotFoundError(**error_data)
|
|
39
|
+
raise ShoplineAPIError(
|
|
40
|
+
status_code=404,
|
|
41
|
+
error=error_model,
|
|
42
|
+
**error_data
|
|
43
|
+
)
|
|
44
|
+
if response.status == 500:
|
|
45
|
+
error_model = ServerError(**error_data)
|
|
46
|
+
raise ShoplineAPIError(
|
|
47
|
+
status_code=500,
|
|
48
|
+
error=error_model,
|
|
49
|
+
**error_data
|
|
50
|
+
)
|
|
51
|
+
# 默认错误处理
|
|
52
|
+
raise ShoplineAPIError(
|
|
53
|
+
status_code=response.status,
|
|
54
|
+
**error_data
|
|
55
|
+
)
|
|
56
|
+
response_data = await response.json()
|
|
57
|
+
|
|
58
|
+
# 验证并返回响应数据
|
|
59
|
+
return PurchaseOrder(**response_data)
|
|
@@ -0,0 +1,66 @@
|
|
|
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.purchase_order import PurchaseOrder
|
|
12
|
+
from ...models.server_error import ServerError
|
|
13
|
+
|
|
14
|
+
class Request(BaseModel):
|
|
15
|
+
"""请求体模型"""
|
|
16
|
+
purchase_order: Optional[Dict[str, Any]] = None
|
|
17
|
+
|
|
18
|
+
async def call(
|
|
19
|
+
session: aiohttp.ClientSession, PurchaseOrderId: str, request: Optional[Request] = None
|
|
20
|
+
) -> PurchaseOrder:
|
|
21
|
+
"""
|
|
22
|
+
Update purchase order
|
|
23
|
+
|
|
24
|
+
Update purchase order
|
|
25
|
+
更新進貨單
|
|
26
|
+
|
|
27
|
+
Path: PUT /pos/purchase_orders/{PurchaseOrderId}
|
|
28
|
+
"""
|
|
29
|
+
# 构建请求 URL
|
|
30
|
+
url = f"pos/purchase_orders/{PurchaseOrderId}"
|
|
31
|
+
|
|
32
|
+
# 构建请求头
|
|
33
|
+
headers = {"Content-Type": "application/json"}
|
|
34
|
+
|
|
35
|
+
# 构建请求体
|
|
36
|
+
json_data = request.model_dump(exclude_none=True) if request else None
|
|
37
|
+
|
|
38
|
+
# 发起 HTTP 请求
|
|
39
|
+
async with session.put(
|
|
40
|
+
url, json=json_data, headers=headers
|
|
41
|
+
) as response:
|
|
42
|
+
if response.status >= 400:
|
|
43
|
+
error_data = await response.json()
|
|
44
|
+
if response.status == 404:
|
|
45
|
+
error_model = NotFoundError(**error_data)
|
|
46
|
+
raise ShoplineAPIError(
|
|
47
|
+
status_code=404,
|
|
48
|
+
error=error_model,
|
|
49
|
+
**error_data
|
|
50
|
+
)
|
|
51
|
+
if response.status == 500:
|
|
52
|
+
error_model = ServerError(**error_data)
|
|
53
|
+
raise ShoplineAPIError(
|
|
54
|
+
status_code=500,
|
|
55
|
+
error=error_model,
|
|
56
|
+
**error_data
|
|
57
|
+
)
|
|
58
|
+
# 默认错误处理
|
|
59
|
+
raise ShoplineAPIError(
|
|
60
|
+
status_code=response.status,
|
|
61
|
+
**error_data
|
|
62
|
+
)
|
|
63
|
+
response_data = await response.json()
|
|
64
|
+
|
|
65
|
+
# 验证并返回响应数据
|
|
66
|
+
return PurchaseOrder(**response_data)
|
|
File without changes
|