brevo-python 4.0.1__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.
- brevo/__init__.py +2253 -0
- brevo/account/__init__.py +79 -0
- brevo/account/client.py +317 -0
- brevo/account/raw_client.py +341 -0
- brevo/account/types/__init__.py +77 -0
- brevo/account/types/get_account_activity_response.py +24 -0
- brevo/account/types/get_account_activity_response_logs_item.py +45 -0
- brevo/account/types/get_account_response.py +85 -0
- brevo/account/types/get_account_response_address.py +43 -0
- brevo/account/types/get_account_response_date_time_preferences.py +38 -0
- brevo/account/types/get_account_response_marketing_automation.py +29 -0
- brevo/account/types/get_account_response_plan_item.py +53 -0
- brevo/account/types/get_account_response_plan_item_type.py +5 -0
- brevo/account/types/get_account_response_plan_verticals_item.py +63 -0
- brevo/account/types/get_account_response_plan_verticals_item_plan_category.py +5 -0
- brevo/account/types/get_account_response_plan_verticals_item_status.py +5 -0
- brevo/account/types/get_account_response_plan_verticals_item_users.py +35 -0
- brevo/account/types/get_account_response_relay.py +34 -0
- brevo/account/types/get_account_response_relay_data.py +40 -0
- brevo/balance/__init__.py +139 -0
- brevo/balance/client.py +2589 -0
- brevo/balance/raw_client.py +4538 -0
- brevo/balance/types/__init__.py +169 -0
- brevo/balance/types/create_balance_limit_request_constraint_type.py +5 -0
- brevo/balance/types/create_balance_limit_request_duration_unit.py +5 -0
- brevo/balance/types/create_balance_limit_request_transaction_type.py +5 -0
- brevo/balance/types/create_balance_order_response.py +96 -0
- brevo/balance/types/get_balance_definition_list_request_sort.py +5 -0
- brevo/balance/types/get_balance_definition_list_request_sort_field.py +5 -0
- brevo/balance/types/get_balance_definition_list_request_version.py +5 -0
- brevo/balance/types/get_balance_definition_list_response.py +24 -0
- brevo/balance/types/get_balance_definition_request_version.py +5 -0
- brevo/balance/types/get_balance_limit_request_version.py +5 -0
- brevo/balance/types/get_contact_balances_response.py +30 -0
- brevo/balance/types/get_contact_balances_response_balances_item.py +33 -0
- brevo/balance/types/get_loyalty_balance_programs_pid_transaction_history_request_sort.py +5 -0
- brevo/balance/types/get_loyalty_balance_programs_pid_transaction_history_request_sort_field.py +7 -0
- brevo/balance/types/get_loyalty_balance_programs_pid_transaction_history_response.py +57 -0
- brevo/balance/types/get_loyalty_balance_programs_pid_transaction_history_response_transaction_history_item.py +77 -0
- brevo/balance/types/get_subscription_balances_response.py +21 -0
- brevo/balance/types/get_subscription_balances_response_balance_item.py +30 -0
- brevo/balance/types/post_loyalty_balance_programs_pid_balance_definitions_request_balance_availability_duration_modifier.py +7 -0
- brevo/balance/types/post_loyalty_balance_programs_pid_balance_definitions_request_balance_availability_duration_unit.py +7 -0
- brevo/balance/types/post_loyalty_balance_programs_pid_balance_definitions_request_balance_option_amount_overtaking_strategy.py +7 -0
- brevo/balance/types/post_loyalty_balance_programs_pid_balance_definitions_request_balance_option_credit_rounding.py +7 -0
- brevo/balance/types/post_loyalty_balance_programs_pid_balance_definitions_request_balance_option_debit_rounding.py +7 -0
- brevo/balance/types/post_loyalty_balance_programs_pid_balance_definitions_request_unit.py +26 -0
- brevo/balance/types/post_loyalty_balance_programs_pid_subscriptions_cid_balances_response.py +66 -0
- brevo/balance/types/update_balance_definition_request_balance_availability_duration_modifier.py +7 -0
- brevo/balance/types/update_balance_definition_request_balance_availability_duration_unit.py +7 -0
- brevo/balance/types/update_balance_definition_request_balance_option_amount_overtaking_strategy.py +7 -0
- brevo/balance/types/update_balance_definition_request_balance_option_credit_rounding.py +7 -0
- brevo/balance/types/update_balance_definition_request_balance_option_debit_rounding.py +7 -0
- brevo/balance/types/update_balance_definition_request_unit.py +26 -0
- brevo/balance/types/update_balance_limit_request_constraint_type.py +5 -0
- brevo/balance/types/update_balance_limit_request_duration_unit.py +5 -0
- brevo/balance/types/update_balance_limit_request_transaction_type.py +5 -0
- brevo/client.py +773 -0
- brevo/companies/__init__.py +61 -0
- brevo/companies/client.py +994 -0
- brevo/companies/raw_client.py +1285 -0
- brevo/companies/types/__init__.py +59 -0
- brevo/companies/types/get_companies_request_sort.py +5 -0
- brevo/companies/types/get_companies_response.py +28 -0
- brevo/companies/types/get_crm_attributes_companies_response_item.py +40 -0
- brevo/companies/types/post_companies_import_response.py +26 -0
- brevo/companies/types/post_companies_response.py +27 -0
- brevo/companies/types/post_crm_attributes_request_attribute_type.py +7 -0
- brevo/companies/types/post_crm_attributes_request_object_type.py +5 -0
- brevo/companies/types/post_crm_attributes_response.py +23 -0
- brevo/contacts/__init__.py +289 -0
- brevo/contacts/client.py +3298 -0
- brevo/contacts/raw_client.py +4614 -0
- brevo/contacts/types/__init__.py +309 -0
- brevo/contacts/types/add_contact_to_list_request_body.py +11 -0
- brevo/contacts/types/add_contact_to_list_request_body_emails.py +23 -0
- brevo/contacts/types/add_contact_to_list_request_body_ext_ids.py +29 -0
- brevo/contacts/types/add_contact_to_list_request_body_ids.py +23 -0
- brevo/contacts/types/create_attribute_request_attribute_category.py +7 -0
- brevo/contacts/types/create_attribute_request_enumeration_item.py +28 -0
- brevo/contacts/types/create_attribute_request_type.py +7 -0
- brevo/contacts/types/create_contact_request_attributes_value.py +5 -0
- brevo/contacts/types/create_contact_response.py +23 -0
- brevo/contacts/types/create_doi_contact_request_attributes_value.py +5 -0
- brevo/contacts/types/create_folder_response.py +23 -0
- brevo/contacts/types/create_list_response.py +23 -0
- brevo/contacts/types/delete_attribute_request_attribute_category.py +7 -0
- brevo/contacts/types/delete_contact_request_identifier.py +5 -0
- brevo/contacts/types/delete_contact_request_identifier_type.py +7 -0
- brevo/contacts/types/get_attributes_response.py +24 -0
- brevo/contacts/types/get_attributes_response_attributes_item.py +57 -0
- brevo/contacts/types/get_attributes_response_attributes_item_category.py +7 -0
- brevo/contacts/types/get_attributes_response_attributes_item_enumeration_item.py +28 -0
- brevo/contacts/types/get_attributes_response_attributes_item_type.py +7 -0
- brevo/contacts/types/get_contact_info_request_identifier.py +5 -0
- brevo/contacts/types/get_contact_info_request_identifier_type.py +7 -0
- brevo/contacts/types/get_contact_info_response.py +80 -0
- brevo/contacts/types/get_contact_info_response_attributes.py +22 -0
- brevo/contacts/types/get_contact_info_response_statistics.py +86 -0
- brevo/contacts/types/get_contact_info_response_statistics_clicked_item.py +33 -0
- brevo/contacts/types/get_contact_info_response_statistics_clicked_item_links_item.py +40 -0
- brevo/contacts/types/get_contact_info_response_statistics_complaints_item.py +31 -0
- brevo/contacts/types/get_contact_info_response_statistics_delivered_item.py +31 -0
- brevo/contacts/types/get_contact_info_response_statistics_hard_bounces_item.py +31 -0
- brevo/contacts/types/get_contact_info_response_statistics_messages_sent_item.py +31 -0
- brevo/contacts/types/get_contact_info_response_statistics_opened_item.py +40 -0
- brevo/contacts/types/get_contact_info_response_statistics_soft_bounces_item.py +31 -0
- brevo/contacts/types/get_contact_info_response_statistics_transac_attributes_item.py +18 -0
- brevo/contacts/types/get_contact_info_response_statistics_unsubscriptions.py +43 -0
- brevo/contacts/types/get_contact_info_response_statistics_unsubscriptions_admin_unsubscription_item.py +30 -0
- brevo/contacts/types/get_contact_info_response_statistics_unsubscriptions_user_unsubscription_item.py +35 -0
- brevo/contacts/types/get_contact_stats_request_identifier.py +5 -0
- brevo/contacts/types/get_contact_stats_response.py +59 -0
- brevo/contacts/types/get_contact_stats_response_clicked_item.py +28 -0
- brevo/contacts/types/get_contact_stats_response_clicked_item_links_item.py +40 -0
- brevo/contacts/types/get_contact_stats_response_complaints_item.py +31 -0
- brevo/contacts/types/get_contact_stats_response_delivered_item.py +31 -0
- brevo/contacts/types/get_contact_stats_response_hard_bounces_item.py +31 -0
- brevo/contacts/types/get_contact_stats_response_messages_sent_item.py +31 -0
- brevo/contacts/types/get_contact_stats_response_opened_item.py +40 -0
- brevo/contacts/types/get_contact_stats_response_soft_bounces_item.py +31 -0
- brevo/contacts/types/get_contact_stats_response_transac_attributes_item.py +31 -0
- brevo/contacts/types/get_contact_stats_response_unsubscriptions.py +39 -0
- brevo/contacts/types/get_contact_stats_response_unsubscriptions_admin_unsubscription_item.py +30 -0
- brevo/contacts/types/get_contact_stats_response_unsubscriptions_user_unsubscription_item.py +35 -0
- brevo/contacts/types/get_contacts_from_list_request_sort.py +5 -0
- brevo/contacts/types/get_contacts_request_sort.py +5 -0
- brevo/contacts/types/get_folder_lists_request_sort.py +5 -0
- brevo/contacts/types/get_folder_lists_response.py +26 -0
- brevo/contacts/types/get_folders_request_sort.py +5 -0
- brevo/contacts/types/get_folders_response.py +26 -0
- brevo/contacts/types/get_list_response.py +68 -0
- brevo/contacts/types/get_list_response_campaign_stats_item.py +26 -0
- brevo/contacts/types/get_lists_request_sort.py +5 -0
- brevo/contacts/types/get_lists_response.py +29 -0
- brevo/contacts/types/get_lists_response_lists_item.py +49 -0
- brevo/contacts/types/get_segments_request_sort.py +5 -0
- brevo/contacts/types/get_segments_response.py +29 -0
- brevo/contacts/types/get_segments_response_segments_item.py +41 -0
- brevo/contacts/types/import_contacts_request_json_body_item.py +25 -0
- brevo/contacts/types/import_contacts_request_new_list.py +41 -0
- brevo/contacts/types/import_contacts_response.py +26 -0
- brevo/contacts/types/remove_contact_from_list_request_body.py +15 -0
- brevo/contacts/types/remove_contact_from_list_request_body_all.py +29 -0
- brevo/contacts/types/remove_contact_from_list_request_body_emails.py +23 -0
- brevo/contacts/types/remove_contact_from_list_request_body_ext_ids.py +29 -0
- brevo/contacts/types/remove_contact_from_list_request_body_ids.py +23 -0
- brevo/contacts/types/request_contact_export_request_custom_contact_filter.py +90 -0
- brevo/contacts/types/request_contact_export_request_custom_contact_filter_action_for_contacts.py +7 -0
- brevo/contacts/types/request_contact_export_request_custom_contact_filter_action_for_email_campaigns.py +8 -0
- brevo/contacts/types/request_contact_export_request_custom_contact_filter_action_for_sms_campaigns.py +7 -0
- brevo/contacts/types/request_contact_export_response.py +26 -0
- brevo/contacts/types/update_attribute_request_attribute_category.py +7 -0
- brevo/contacts/types/update_attribute_request_enumeration_item.py +28 -0
- brevo/contacts/types/update_batch_contacts_request_contacts_item.py +80 -0
- brevo/contacts/types/update_contact_request_attributes_value.py +5 -0
- brevo/contacts/types/update_contact_request_identifier.py +5 -0
- brevo/contacts/types/update_contact_request_identifier_type.py +7 -0
- brevo/conversations/__init__.py +34 -0
- brevo/conversations/client.py +912 -0
- brevo/conversations/raw_client.py +1328 -0
- brevo/conversations/types/__init__.py +36 -0
- brevo/conversations/types/put_conversations_visitor_group_response.py +31 -0
- brevo/core/__init__.py +125 -0
- brevo/core/api_error.py +23 -0
- brevo/core/client_wrapper.py +100 -0
- brevo/core/datetime_utils.py +28 -0
- brevo/core/file.py +67 -0
- brevo/core/force_multipart.py +18 -0
- brevo/core/http_client.py +776 -0
- brevo/core/http_response.py +59 -0
- brevo/core/http_sse/__init__.py +42 -0
- brevo/core/http_sse/_api.py +112 -0
- brevo/core/http_sse/_decoders.py +61 -0
- brevo/core/http_sse/_exceptions.py +7 -0
- brevo/core/http_sse/_models.py +17 -0
- brevo/core/jsonable_encoder.py +108 -0
- brevo/core/logging.py +107 -0
- brevo/core/pydantic_utilities.py +577 -0
- brevo/core/query_encoder.py +58 -0
- brevo/core/remove_none_from_dict.py +11 -0
- brevo/core/request_options.py +35 -0
- brevo/core/serialization.py +276 -0
- brevo/core/unchecked_base_model.py +376 -0
- brevo/coupons/__init__.py +49 -0
- brevo/coupons/client.py +550 -0
- brevo/coupons/raw_client.py +839 -0
- brevo/coupons/types/__init__.py +47 -0
- brevo/coupons/types/create_coupon_collection_response.py +23 -0
- brevo/coupons/types/get_coupon_collections_request_sort.py +5 -0
- brevo/coupons/types/get_coupon_collections_request_sort_by.py +7 -0
- brevo/coupons/types/update_coupon_collection_response.py +35 -0
- brevo/custom_objects/__init__.py +139 -0
- brevo/custom_objects/client.py +437 -0
- brevo/custom_objects/raw_client.py +711 -0
- brevo/custom_objects/types/__init__.py +177 -0
- brevo/custom_objects/types/batch_delete_object_records_request_identifiers.py +10 -0
- brevo/custom_objects/types/batch_delete_object_records_request_identifiers_ext_ids.py +23 -0
- brevo/custom_objects/types/batch_delete_object_records_request_identifiers_ids.py +23 -0
- brevo/custom_objects/types/batch_delete_object_records_response.py +27 -0
- brevo/custom_objects/types/getrecords_request_association.py +5 -0
- brevo/custom_objects/types/getrecords_request_sort.py +5 -0
- brevo/custom_objects/types/getrecords_response.py +26 -0
- brevo/custom_objects/types/getrecords_response_records_item.py +51 -0
- brevo/custom_objects/types/getrecords_response_records_item_associations_item.py +10 -0
- brevo/custom_objects/types/getrecords_response_records_item_associations_item_one.py +28 -0
- brevo/custom_objects/types/getrecords_response_records_item_associations_item_one_records_item.py +15 -0
- brevo/custom_objects/types/getrecords_response_records_item_associations_item_one_records_item_one.py +28 -0
- brevo/custom_objects/types/getrecords_response_records_item_associations_item_one_records_item_one_identifiers.py +27 -0
- brevo/custom_objects/types/getrecords_response_records_item_associations_item_one_records_item_zero.py +28 -0
- brevo/custom_objects/types/getrecords_response_records_item_associations_item_one_records_item_zero_identifiers.py +27 -0
- brevo/custom_objects/types/getrecords_response_records_item_associations_item_zero.py +28 -0
- brevo/custom_objects/types/getrecords_response_records_item_associations_item_zero_records_item.py +15 -0
- brevo/custom_objects/types/getrecords_response_records_item_associations_item_zero_records_item_one.py +28 -0
- brevo/custom_objects/types/getrecords_response_records_item_associations_item_zero_records_item_one_identifiers.py +27 -0
- brevo/custom_objects/types/getrecords_response_records_item_associations_item_zero_records_item_zero.py +28 -0
- brevo/custom_objects/types/getrecords_response_records_item_associations_item_zero_records_item_zero_identifiers.py +27 -0
- brevo/custom_objects/types/getrecords_response_records_item_identifiers.py +32 -0
- brevo/custom_objects/types/upsertrecords_request_records_item.py +31 -0
- brevo/custom_objects/types/upsertrecords_request_records_item_associations_item.py +12 -0
- brevo/custom_objects/types/upsertrecords_request_records_item_associations_item_one.py +28 -0
- brevo/custom_objects/types/upsertrecords_request_records_item_associations_item_one_records_item.py +15 -0
- brevo/custom_objects/types/upsertrecords_request_records_item_associations_item_one_records_item_one.py +20 -0
- brevo/custom_objects/types/upsertrecords_request_records_item_associations_item_one_records_item_zero.py +28 -0
- brevo/custom_objects/types/upsertrecords_request_records_item_associations_item_one_records_item_zero_identifiers.py +32 -0
- brevo/custom_objects/types/upsertrecords_request_records_item_associations_item_zero.py +28 -0
- brevo/custom_objects/types/upsertrecords_request_records_item_associations_item_zero_records_item.py +23 -0
- brevo/custom_objects/types/upsertrecords_request_records_item_associations_item_zero_records_item_identifiers.py +28 -0
- brevo/custom_objects/types/upsertrecords_request_records_item_identifiers.py +32 -0
- brevo/custom_objects/types/upsertrecords_response.py +29 -0
- brevo/deals/__init__.py +52 -0
- brevo/deals/client.py +1013 -0
- brevo/deals/raw_client.py +1326 -0
- brevo/deals/types/__init__.py +50 -0
- brevo/deals/types/get_crm_attributes_deals_response_item.py +40 -0
- brevo/deals/types/get_crm_deals_request_sort.py +5 -0
- brevo/deals/types/get_crm_deals_response.py +28 -0
- brevo/deals/types/post_crm_deals_import_response.py +26 -0
- brevo/deals/types/post_crm_deals_response.py +27 -0
- brevo/domains/__init__.py +79 -0
- brevo/domains/client.py +506 -0
- brevo/domains/raw_client.py +698 -0
- brevo/domains/types/__init__.py +83 -0
- brevo/domains/types/authenticate_domain_response.py +28 -0
- brevo/domains/types/create_domain_response.py +44 -0
- brevo/domains/types/create_domain_response_dns_records.py +40 -0
- brevo/domains/types/create_domain_response_dns_records_brevo_code.py +42 -0
- brevo/domains/types/create_domain_response_dns_records_dkim_record.py +42 -0
- brevo/domains/types/create_domain_response_dns_records_dmarc_record.py +42 -0
- brevo/domains/types/get_domain_configuration_response.py +41 -0
- brevo/domains/types/get_domain_configuration_response_dns_records.py +44 -0
- brevo/domains/types/get_domain_configuration_response_dns_records_brevo_code.py +42 -0
- brevo/domains/types/get_domain_configuration_response_dns_records_dkim_record.py +42 -0
- brevo/domains/types/get_domain_configuration_response_dns_records_dmarc_record.py +42 -0
- brevo/domains/types/get_domains_response.py +39 -0
- brevo/domains/types/get_domains_response_domains_item.py +56 -0
- brevo/domains/types/get_domains_response_domains_item_creator.py +41 -0
- brevo/ecommerce/__init__.py +112 -0
- brevo/ecommerce/client.py +2176 -0
- brevo/ecommerce/raw_client.py +2895 -0
- brevo/ecommerce/types/__init__.py +124 -0
- brevo/ecommerce/types/create_batch_order_response.py +28 -0
- brevo/ecommerce/types/create_product_alert_request_contact_identifiers.py +33 -0
- brevo/ecommerce/types/create_update_batch_category_request_categories_item.py +48 -0
- brevo/ecommerce/types/create_update_batch_category_response.py +31 -0
- brevo/ecommerce/types/create_update_batch_products_request_products_item.py +89 -0
- brevo/ecommerce/types/create_update_batch_products_request_products_item_meta_info_value.py +5 -0
- brevo/ecommerce/types/create_update_batch_products_response.py +31 -0
- brevo/ecommerce/types/create_update_category_response.py +23 -0
- brevo/ecommerce/types/create_update_product_request_meta_info_value.py +5 -0
- brevo/ecommerce/types/create_update_product_response.py +23 -0
- brevo/ecommerce/types/get_categories_request_sort.py +5 -0
- brevo/ecommerce/types/get_categories_response.py +25 -0
- brevo/ecommerce/types/get_ecommerce_attribution_metrics_conversion_source_conversion_source_id_request_conversion_source.py +7 -0
- brevo/ecommerce/types/get_ecommerce_attribution_metrics_conversion_source_conversion_source_id_response.py +40 -0
- brevo/ecommerce/types/get_ecommerce_attribution_metrics_conversion_source_conversion_source_id_response_conversion_source.py +7 -0
- brevo/ecommerce/types/get_ecommerce_attribution_metrics_response.py +30 -0
- brevo/ecommerce/types/get_ecommerce_attribution_metrics_response_totals.py +32 -0
- brevo/ecommerce/types/get_ecommerce_attribution_products_conversion_source_conversion_source_id_request_conversion_source.py +7 -0
- brevo/ecommerce/types/get_ecommerce_attribution_products_conversion_source_conversion_source_id_response.py +28 -0
- brevo/ecommerce/types/get_ecommerce_attribution_products_conversion_source_conversion_source_id_response_products_item.py +33 -0
- brevo/ecommerce/types/get_ecommerce_config_display_currency_response.py +23 -0
- brevo/ecommerce/types/get_orders_request_sort.py +5 -0
- brevo/ecommerce/types/get_products_request_sort.py +5 -0
- brevo/ecommerce/types/get_products_response.py +26 -0
- brevo/ecommerce/types/set_config_display_currency_response.py +23 -0
- brevo/email_campaigns/__init__.py +139 -0
- brevo/email_campaigns/client.py +1864 -0
- brevo/email_campaigns/raw_client.py +2472 -0
- brevo/email_campaigns/types/__init__.py +141 -0
- brevo/email_campaigns/types/create_email_campaign_request_email_expiration_date.py +33 -0
- brevo/email_campaigns/types/create_email_campaign_request_email_expiration_date_unit.py +5 -0
- brevo/email_campaigns/types/create_email_campaign_request_recipients.py +52 -0
- brevo/email_campaigns/types/create_email_campaign_request_sender.py +37 -0
- brevo/email_campaigns/types/create_email_campaign_request_winner_criteria.py +5 -0
- brevo/email_campaigns/types/create_email_campaign_response.py +23 -0
- brevo/email_campaigns/types/email_export_recipients_request_recipients_type.py +10 -0
- brevo/email_campaigns/types/email_export_recipients_response.py +26 -0
- brevo/email_campaigns/types/get_ab_test_campaign_result_response.py +64 -0
- brevo/email_campaigns/types/get_ab_test_campaign_result_response_clicked_links.py +28 -0
- brevo/email_campaigns/types/get_ab_test_campaign_result_response_statistics.py +32 -0
- brevo/email_campaigns/types/get_ab_test_campaign_result_response_winning_criteria.py +5 -0
- brevo/email_campaigns/types/get_ab_test_campaign_result_response_winning_version.py +7 -0
- brevo/email_campaigns/types/get_email_campaign_request_statistics.py +7 -0
- brevo/email_campaigns/types/get_email_campaign_response.py +234 -0
- brevo/email_campaigns/types/get_email_campaign_response_sender.py +33 -0
- brevo/email_campaigns/types/get_email_campaign_response_status.py +7 -0
- brevo/email_campaigns/types/get_email_campaign_response_type.py +5 -0
- brevo/email_campaigns/types/get_email_campaigns_request_sort.py +5 -0
- brevo/email_campaigns/types/get_email_campaigns_request_statistics.py +7 -0
- brevo/email_campaigns/types/get_email_campaigns_request_status.py +7 -0
- brevo/email_campaigns/types/get_email_campaigns_request_type.py +5 -0
- brevo/email_campaigns/types/get_email_campaigns_response.py +25 -0
- brevo/email_campaigns/types/get_email_campaigns_response_campaigns_item.py +234 -0
- brevo/email_campaigns/types/get_email_campaigns_response_campaigns_item_sender.py +33 -0
- brevo/email_campaigns/types/get_email_campaigns_response_campaigns_item_status.py +7 -0
- brevo/email_campaigns/types/get_email_campaigns_response_campaigns_item_type.py +5 -0
- brevo/email_campaigns/types/get_shared_template_url_response.py +29 -0
- brevo/email_campaigns/types/update_email_campaign_request_email_expiration_date.py +33 -0
- brevo/email_campaigns/types/update_email_campaign_request_email_expiration_date_unit.py +5 -0
- brevo/email_campaigns/types/update_email_campaign_request_recipients.py +53 -0
- brevo/email_campaigns/types/update_email_campaign_request_sender.py +37 -0
- brevo/email_campaigns/types/update_email_campaign_request_winner_criteria.py +5 -0
- brevo/email_campaigns/types/upload_image_to_gallery_response.py +23 -0
- brevo/environment.py +7 -0
- brevo/errors/__init__.py +80 -0
- brevo/errors/bad_request_error.py +10 -0
- brevo/errors/conflict_error.py +11 -0
- brevo/errors/expectation_failed_error.py +11 -0
- brevo/errors/failed_dependency_error.py +10 -0
- brevo/errors/forbidden_error.py +10 -0
- brevo/errors/internal_server_error.py +10 -0
- brevo/errors/method_not_allowed_error.py +11 -0
- brevo/errors/not_found_error.py +10 -0
- brevo/errors/payment_required_error.py +11 -0
- brevo/errors/precondition_failed_error.py +11 -0
- brevo/errors/too_early_error.py +11 -0
- brevo/errors/too_many_requests_error.py +11 -0
- brevo/errors/unauthorized_error.py +10 -0
- brevo/errors/unprocessable_entity_error.py +11 -0
- brevo/errors/unsupported_media_type_error.py +11 -0
- brevo/event/__init__.py +52 -0
- brevo/event/client.py +184 -0
- brevo/event/raw_client.py +230 -0
- brevo/event/types/__init__.py +50 -0
- brevo/event/types/create_event_request_contact_properties_value.py +5 -0
- brevo/event/types/create_event_request_event_properties_value.py +5 -0
- brevo/event/types/create_event_request_identifiers.py +52 -0
- brevo/event/types/create_event_request_object.py +33 -0
- brevo/event/types/create_event_request_object_identifiers.py +32 -0
- brevo/external_feeds/__init__.py +79 -0
- brevo/external_feeds/client.py +915 -0
- brevo/external_feeds/raw_client.py +1087 -0
- brevo/external_feeds/types/__init__.py +77 -0
- brevo/external_feeds/types/create_external_feed_request_auth_type.py +5 -0
- brevo/external_feeds/types/create_external_feed_request_headers_item.py +28 -0
- brevo/external_feeds/types/create_external_feed_response.py +23 -0
- brevo/external_feeds/types/get_all_external_feeds_request_auth_type.py +5 -0
- brevo/external_feeds/types/get_all_external_feeds_request_sort.py +5 -0
- brevo/external_feeds/types/get_all_external_feeds_response.py +29 -0
- brevo/external_feeds/types/get_all_external_feeds_response_feeds_item.py +96 -0
- brevo/external_feeds/types/get_all_external_feeds_response_feeds_item_auth_type.py +5 -0
- brevo/external_feeds/types/get_all_external_feeds_response_feeds_item_headers_item.py +28 -0
- brevo/external_feeds/types/get_external_feed_by_uuid_response.py +105 -0
- brevo/external_feeds/types/get_external_feed_by_uuid_response_auth_type.py +5 -0
- brevo/external_feeds/types/get_external_feed_by_uuid_response_headers_item.py +28 -0
- brevo/external_feeds/types/update_external_feed_request_auth_type.py +5 -0
- brevo/external_feeds/types/update_external_feed_request_headers_item.py +28 -0
- brevo/files/__init__.py +38 -0
- brevo/files/client.py +479 -0
- brevo/files/raw_client.py +675 -0
- brevo/files/types/__init__.py +40 -0
- brevo/files/types/get_crm_files_id_response.py +30 -0
- brevo/files/types/get_crm_files_request_entity.py +5 -0
- brevo/files/types/get_crm_files_request_sort.py +5 -0
- brevo/inbound_parsing/__init__.py +58 -0
- brevo/inbound_parsing/client.py +323 -0
- brevo/inbound_parsing/raw_client.py +420 -0
- brevo/inbound_parsing/types/__init__.py +60 -0
- brevo/inbound_parsing/types/get_inbound_email_events_by_uuid_response.py +72 -0
- brevo/inbound_parsing/types/get_inbound_email_events_by_uuid_response_attachments_item.py +40 -0
- brevo/inbound_parsing/types/get_inbound_email_events_by_uuid_response_logs_item.py +30 -0
- brevo/inbound_parsing/types/get_inbound_email_events_by_uuid_response_logs_item_type.py +7 -0
- brevo/inbound_parsing/types/get_inbound_email_events_request_sort.py +5 -0
- brevo/inbound_parsing/types/get_inbound_email_events_response.py +21 -0
- brevo/inbound_parsing/types/get_inbound_email_events_response_events_item.py +42 -0
- brevo/master_account/__init__.py +202 -0
- brevo/master_account/client.py +2757 -0
- brevo/master_account/raw_client.py +3351 -0
- brevo/master_account/types/__init__.py +244 -0
- brevo/master_account/types/get_corporate_group_id_response.py +31 -0
- brevo/master_account/types/get_corporate_group_id_response_group.py +35 -0
- brevo/master_account/types/get_corporate_group_id_response_sub_accounts_item.py +35 -0
- brevo/master_account/types/get_corporate_group_id_response_users_item.py +36 -0
- brevo/master_account/types/get_corporate_invited_users_list_response.py +24 -0
- brevo/master_account/types/get_corporate_invited_users_list_response_users_item.py +50 -0
- brevo/master_account/types/get_corporate_invited_users_list_response_users_item_feature_access.py +69 -0
- brevo/master_account/types/get_corporate_invited_users_list_response_users_item_groups.py +32 -0
- brevo/master_account/types/get_corporate_ip_response_item.py +22 -0
- brevo/master_account/types/get_corporate_master_account_response.py +57 -0
- brevo/master_account/types/get_corporate_master_account_response_billing_info.py +48 -0
- brevo/master_account/types/get_corporate_master_account_response_billing_info_address.py +50 -0
- brevo/master_account/types/get_corporate_master_account_response_billing_info_name.py +35 -0
- brevo/master_account/types/get_corporate_master_account_response_plan_info.py +63 -0
- brevo/master_account/types/get_corporate_master_account_response_plan_info_features_item.py +62 -0
- brevo/master_account/types/get_corporate_master_account_response_plan_info_plan_period.py +5 -0
- brevo/master_account/types/get_corporate_sub_account_id_response.py +48 -0
- brevo/master_account/types/get_corporate_sub_account_id_response_groups_item.py +28 -0
- brevo/master_account/types/get_corporate_sub_account_id_response_plan_info.py +42 -0
- brevo/master_account/types/get_corporate_sub_account_id_response_plan_info_credits.py +65 -0
- brevo/master_account/types/get_corporate_sub_account_id_response_plan_info_credits_emails.py +32 -0
- brevo/master_account/types/get_corporate_sub_account_id_response_plan_info_credits_external_feeds.py +33 -0
- brevo/master_account/types/get_corporate_sub_account_id_response_plan_info_credits_sms.py +32 -0
- brevo/master_account/types/get_corporate_sub_account_id_response_plan_info_credits_whatsapp.py +32 -0
- brevo/master_account/types/get_corporate_sub_account_id_response_plan_info_credits_wp_subscribers.py +32 -0
- brevo/master_account/types/get_corporate_sub_account_id_response_plan_info_features.py +58 -0
- brevo/master_account/types/get_corporate_sub_account_id_response_plan_info_features_inbox.py +32 -0
- brevo/master_account/types/get_corporate_sub_account_id_response_plan_info_features_landing_page.py +32 -0
- brevo/master_account/types/get_corporate_sub_account_id_response_plan_info_features_sales_users.py +33 -0
- brevo/master_account/types/get_corporate_sub_account_id_response_plan_info_features_users.py +32 -0
- brevo/master_account/types/get_corporate_sub_account_response.py +32 -0
- brevo/master_account/types/get_corporate_sub_account_response_sub_accounts_item.py +48 -0
- brevo/master_account/types/get_corporate_sub_account_response_sub_accounts_item_groups_item.py +28 -0
- brevo/master_account/types/get_corporate_user_permission_response.py +40 -0
- brevo/master_account/types/get_corporate_user_permission_response_feature_access.py +62 -0
- brevo/master_account/types/get_corporate_user_permission_response_groups_item.py +32 -0
- brevo/master_account/types/get_sub_account_groups_response_item.py +30 -0
- brevo/master_account/types/invite_admin_user_request_privileges_item.py +38 -0
- brevo/master_account/types/invite_admin_user_request_privileges_item_feature.py +18 -0
- brevo/master_account/types/invite_admin_user_request_privileges_item_permissions_item.py +7 -0
- brevo/master_account/types/invite_admin_user_response.py +20 -0
- brevo/master_account/types/post_corporate_group_response.py +20 -0
- brevo/master_account/types/post_corporate_sub_account_key_response.py +28 -0
- brevo/master_account/types/post_corporate_sub_account_request_language.py +5 -0
- brevo/master_account/types/post_corporate_sub_account_response.py +23 -0
- brevo/master_account/types/post_corporate_sub_account_sso_token_request_target.py +17 -0
- brevo/master_account/types/put_corporate_sub_account_id_plan_request_credits.py +59 -0
- brevo/master_account/types/put_corporate_sub_account_id_plan_request_features.py +44 -0
- brevo/master_account/types/put_corporate_sub_accounts_plan_request_credits.py +59 -0
- brevo/master_account/types/put_corporate_sub_accounts_plan_request_features.py +39 -0
- brevo/master_account/types/put_corporate_user_email_permissions_request_privileges_item.py +42 -0
- brevo/master_account/types/put_corporate_user_email_permissions_request_privileges_item_feature.py +18 -0
- brevo/master_account/types/put_corporate_user_email_permissions_request_privileges_item_permissions_item.py +10 -0
- brevo/master_account/types/put_corporate_user_invitation_action_email_request_action.py +5 -0
- brevo/master_account/types/put_corporate_user_invitation_action_email_response.py +23 -0
- brevo/notes/__init__.py +38 -0
- brevo/notes/client.py +548 -0
- brevo/notes/raw_client.py +766 -0
- brevo/notes/types/__init__.py +40 -0
- brevo/notes/types/get_crm_notes_request_entity.py +5 -0
- brevo/notes/types/get_crm_notes_request_sort.py +5 -0
- brevo/notes/types/post_crm_notes_response.py +27 -0
- brevo/payments/__init__.py +38 -0
- brevo/payments/client.py +315 -0
- brevo/payments/raw_client.py +532 -0
- brevo/payments/types/__init__.py +40 -0
- brevo/payments/types/create_payment_request_response.py +28 -0
- brevo/payments/types/get_payment_request_response.py +47 -0
- brevo/payments/types/get_payment_request_response_status.py +5 -0
- brevo/process/__init__.py +79 -0
- brevo/process/client.py +304 -0
- brevo/process/raw_client.py +372 -0
- brevo/process/types/__init__.py +77 -0
- brevo/process/types/get_process_response.py +62 -0
- brevo/process/types/get_process_response_info.py +36 -0
- brevo/process/types/get_process_response_info_export.py +32 -0
- brevo/process/types/get_process_response_info_import.py +57 -0
- brevo/process/types/get_process_response_name.py +16 -0
- brevo/process/types/get_process_response_status.py +7 -0
- brevo/process/types/get_processes_request_sort.py +5 -0
- brevo/process/types/get_processes_response.py +29 -0
- brevo/process/types/get_processes_response_processes_item.py +62 -0
- brevo/process/types/get_processes_response_processes_item_info.py +36 -0
- brevo/process/types/get_processes_response_processes_item_info_export.py +32 -0
- brevo/process/types/get_processes_response_processes_item_info_import.py +57 -0
- brevo/process/types/get_processes_response_processes_item_name.py +16 -0
- brevo/process/types/get_processes_response_processes_item_status.py +7 -0
- brevo/program/__init__.py +67 -0
- brevo/program/client.py +1128 -0
- brevo/program/raw_client.py +2526 -0
- brevo/program/types/__init__.py +67 -0
- brevo/program/types/get_lp_list_request_sort_field.py +5 -0
- brevo/program/types/get_lp_list_response.py +24 -0
- brevo/program/types/get_parameter_subscription_info_response.py +44 -0
- brevo/program/types/get_parameter_subscription_info_response_balance.py +41 -0
- brevo/program/types/get_parameter_subscription_info_response_balance_balances_item.py +30 -0
- brevo/program/types/get_parameter_subscription_info_response_members_item.py +36 -0
- brevo/program/types/get_parameter_subscription_info_response_reward_item.py +66 -0
- brevo/program/types/get_parameter_subscription_info_response_tier_item.py +56 -0
- brevo/program/types/subscribe_member_to_a_subscription_response.py +46 -0
- brevo/program/types/subscribe_to_loyalty_program_response.py +56 -0
- brevo/py.typed +0 -0
- brevo/reward/__init__.py +115 -0
- brevo/reward/client.py +1285 -0
- brevo/reward/raw_client.py +2564 -0
- brevo/reward/types/__init__.py +139 -0
- brevo/reward/types/create_reward_response.py +64 -0
- brevo/reward/types/create_voucher_response.py +76 -0
- brevo/reward/types/get_code_count_response.py +23 -0
- brevo/reward/types/get_loyalty_offer_programs_pid_offers_request_version.py +5 -0
- brevo/reward/types/get_loyalty_offer_programs_pid_offers_response.py +34 -0
- brevo/reward/types/get_loyalty_offer_programs_pid_offers_response_items_item.py +67 -0
- brevo/reward/types/get_loyalty_offer_programs_pid_rewards_rid_request_version.py +5 -0
- brevo/reward/types/get_loyalty_offer_programs_pid_rewards_rid_response.py +269 -0
- brevo/reward/types/get_loyalty_offer_programs_pid_rewards_rid_response_expiration_modifier.py +7 -0
- brevo/reward/types/get_loyalty_offer_programs_pid_rewards_rid_response_generator.py +52 -0
- brevo/reward/types/get_loyalty_offer_programs_pid_rewards_rid_response_limits_item.py +68 -0
- brevo/reward/types/get_loyalty_offer_programs_pid_rewards_rid_response_products_item.py +40 -0
- brevo/reward/types/get_loyalty_offer_programs_pid_rewards_rid_response_reward_configs.py +33 -0
- brevo/reward/types/get_loyalty_offer_programs_pid_rewards_rid_response_rule.py +101 -0
- brevo/reward/types/get_loyalty_offer_programs_pid_rewards_rid_response_rule_event.py +28 -0
- brevo/reward/types/get_loyalty_offer_programs_pid_rewards_rid_response_rule_results_item.py +43 -0
- brevo/reward/types/get_loyalty_offer_programs_pid_rewards_rid_response_rule_results_item_parameters_item.py +37 -0
- brevo/reward/types/get_loyalty_offer_programs_pid_vouchers_request_sort.py +5 -0
- brevo/reward/types/get_loyalty_offer_programs_pid_vouchers_request_sort_field.py +5 -0
- brevo/reward/types/get_loyalty_offer_programs_pid_vouchers_response.py +49 -0
- brevo/reward/types/get_loyalty_offer_programs_pid_vouchers_response_contact_rewards_item.py +70 -0
- brevo/reward/types/redeem_voucher_request_order.py +85 -0
- brevo/reward/types/redeem_voucher_request_order_billing.py +55 -0
- brevo/reward/types/redeem_voucher_request_order_identifiers.py +28 -0
- brevo/reward/types/redeem_voucher_request_order_products_item.py +46 -0
- brevo/reward/types/validate_reward_response.py +23 -0
- brevo/senders/__init__.py +67 -0
- brevo/senders/client.py +808 -0
- brevo/senders/raw_client.py +1089 -0
- brevo/senders/types/__init__.py +65 -0
- brevo/senders/types/create_sender_request_ips_item.py +36 -0
- brevo/senders/types/create_sender_response.py +42 -0
- brevo/senders/types/get_ips_from_sender_response.py +25 -0
- brevo/senders/types/get_ips_from_sender_response_ips_item.py +38 -0
- brevo/senders/types/get_ips_response.py +25 -0
- brevo/senders/types/get_ips_response_ips_item.py +38 -0
- brevo/senders/types/get_senders_response.py +24 -0
- brevo/senders/types/get_senders_response_senders_item.py +46 -0
- brevo/senders/types/get_senders_response_senders_item_ips_item.py +33 -0
- brevo/senders/types/update_sender_request_ips_item.py +36 -0
- brevo/sms_campaigns/__init__.py +73 -0
- brevo/sms_campaigns/client.py +1078 -0
- brevo/sms_campaigns/raw_client.py +1501 -0
- brevo/sms_campaigns/types/__init__.py +71 -0
- brevo/sms_campaigns/types/create_sms_campaign_request_recipients.py +33 -0
- brevo/sms_campaigns/types/create_sms_campaign_response.py +23 -0
- brevo/sms_campaigns/types/get_sms_campaign_response.py +74 -0
- brevo/sms_campaigns/types/get_sms_campaign_response_status.py +7 -0
- brevo/sms_campaigns/types/get_sms_campaigns_request_sort.py +5 -0
- brevo/sms_campaigns/types/get_sms_campaigns_request_status.py +7 -0
- brevo/sms_campaigns/types/get_sms_campaigns_response.py +25 -0
- brevo/sms_campaigns/types/get_sms_campaigns_response_campaigns_item.py +74 -0
- brevo/sms_campaigns/types/get_sms_campaigns_response_campaigns_item_status.py +7 -0
- brevo/sms_campaigns/types/request_sms_recipient_export_request_recipients_type.py +7 -0
- brevo/sms_campaigns/types/request_sms_recipient_export_response.py +26 -0
- brevo/sms_campaigns/types/update_sms_campaign_request_recipients.py +33 -0
- brevo/sms_templates/__init__.py +49 -0
- brevo/sms_templates/client.py +133 -0
- brevo/sms_templates/raw_client.py +151 -0
- brevo/sms_templates/types/__init__.py +47 -0
- brevo/sms_templates/types/get_sms_templates_request_sort.py +5 -0
- brevo/sms_templates/types/get_sms_templates_response.py +26 -0
- brevo/sms_templates/types/get_sms_templates_response_templates_item.py +86 -0
- brevo/sms_templates/types/get_sms_templates_response_templates_item_compliance.py +37 -0
- brevo/tasks/__init__.py +55 -0
- brevo/tasks/client.py +814 -0
- brevo/tasks/raw_client.py +992 -0
- brevo/tasks/types/__init__.py +53 -0
- brevo/tasks/types/get_crm_tasks_request_filter_date.py +5 -0
- brevo/tasks/types/get_crm_tasks_request_filter_status.py +5 -0
- brevo/tasks/types/get_crm_tasks_request_sort.py +5 -0
- brevo/tasks/types/get_crm_tasks_response.py +28 -0
- brevo/tasks/types/get_crm_tasktypes_response.py +32 -0
- brevo/tasks/types/post_crm_tasks_response.py +27 -0
- brevo/tier/__init__.py +79 -0
- brevo/tier/client.py +1144 -0
- brevo/tier/raw_client.py +2360 -0
- brevo/tier/types/__init__.py +79 -0
- brevo/tier/types/add_subscription_to_tier_response.py +53 -0
- brevo/tier/types/create_tier_for_tier_group_request_access_conditions_item.py +31 -0
- brevo/tier/types/create_tier_for_tier_group_request_tier_rewards_item.py +26 -0
- brevo/tier/types/create_tier_group_request_downgrade_strategy.py +7 -0
- brevo/tier/types/create_tier_group_request_upgrade_strategy.py +7 -0
- brevo/tier/types/get_list_of_tier_groups_request_version.py +5 -0
- brevo/tier/types/get_list_of_tier_groups_response.py +21 -0
- brevo/tier/types/get_loyalty_program_tier_request_version.py +5 -0
- brevo/tier/types/get_loyalty_program_tier_response.py +21 -0
- brevo/tier/types/get_tier_group_request_version.py +5 -0
- brevo/tier/types/update_tier_group_request_downgrade_strategy.py +7 -0
- brevo/tier/types/update_tier_group_request_upgrade_strategy.py +7 -0
- brevo/tier/types/update_tier_request_access_conditions_item.py +31 -0
- brevo/tier/types/update_tier_request_tier_rewards_item.py +26 -0
- brevo/transactional_emails/__init__.py +175 -0
- brevo/transactional_emails/client.py +2544 -0
- brevo/transactional_emails/raw_client.py +3240 -0
- brevo/transactional_emails/types/__init__.py +189 -0
- brevo/transactional_emails/types/create_smtp_template_request_sender.py +37 -0
- brevo/transactional_emails/types/create_smtp_template_response.py +23 -0
- brevo/transactional_emails/types/get_aggregated_smtp_report_response.py +85 -0
- brevo/transactional_emails/types/get_blocked_domains_response.py +23 -0
- brevo/transactional_emails/types/get_email_event_report_request_event.py +23 -0
- brevo/transactional_emails/types/get_email_event_report_request_sort.py +5 -0
- brevo/transactional_emails/types/get_email_event_report_response.py +21 -0
- brevo/transactional_emails/types/get_email_event_report_response_events_item.py +79 -0
- brevo/transactional_emails/types/get_email_event_report_response_events_item_event.py +23 -0
- brevo/transactional_emails/types/get_scheduled_email_by_id_request_sort.py +5 -0
- brevo/transactional_emails/types/get_scheduled_email_by_id_request_status.py +5 -0
- brevo/transactional_emails/types/get_scheduled_email_by_id_response.py +10 -0
- brevo/transactional_emails/types/get_scheduled_email_by_id_response_batches.py +25 -0
- brevo/transactional_emails/types/get_scheduled_email_by_id_response_batches_batches_item.py +39 -0
- brevo/transactional_emails/types/get_scheduled_email_by_id_response_batches_batches_item_status.py +7 -0
- brevo/transactional_emails/types/get_scheduled_email_by_id_response_created_at.py +37 -0
- brevo/transactional_emails/types/get_scheduled_email_by_id_response_created_at_status.py +7 -0
- brevo/transactional_emails/types/get_smtp_report_request_sort.py +5 -0
- brevo/transactional_emails/types/get_smtp_report_response.py +21 -0
- brevo/transactional_emails/types/get_smtp_report_response_reports_item.py +86 -0
- brevo/transactional_emails/types/get_smtp_templates_request_sort.py +5 -0
- brevo/transactional_emails/types/get_smtp_templates_response.py +26 -0
- brevo/transactional_emails/types/get_transac_blocked_contacts_request_sort.py +5 -0
- brevo/transactional_emails/types/get_transac_blocked_contacts_response.py +25 -0
- brevo/transactional_emails/types/get_transac_blocked_contacts_response_contacts_item.py +44 -0
- brevo/transactional_emails/types/get_transac_blocked_contacts_response_contacts_item_reason.py +35 -0
- brevo/transactional_emails/types/get_transac_blocked_contacts_response_contacts_item_reason_code.py +15 -0
- brevo/transactional_emails/types/get_transac_email_content_response.py +57 -0
- brevo/transactional_emails/types/get_transac_email_content_response_events_item.py +28 -0
- brevo/transactional_emails/types/get_transac_emails_list_request_sort.py +5 -0
- brevo/transactional_emails/types/get_transac_emails_list_response.py +34 -0
- brevo/transactional_emails/types/get_transac_emails_list_response_transactional_emails_item.py +61 -0
- brevo/transactional_emails/types/post_preview_smtp_email_templates_response.py +49 -0
- brevo/transactional_emails/types/send_transac_email_request_attachment_item.py +33 -0
- brevo/transactional_emails/types/send_transac_email_request_bcc_item.py +28 -0
- brevo/transactional_emails/types/send_transac_email_request_cc_item.py +28 -0
- brevo/transactional_emails/types/send_transac_email_request_message_versions_item.py +73 -0
- brevo/transactional_emails/types/send_transac_email_request_message_versions_item_bcc_item.py +28 -0
- brevo/transactional_emails/types/send_transac_email_request_message_versions_item_cc_item.py +28 -0
- brevo/transactional_emails/types/send_transac_email_request_message_versions_item_reply_to.py +32 -0
- brevo/transactional_emails/types/send_transac_email_request_message_versions_item_to_item.py +28 -0
- brevo/transactional_emails/types/send_transac_email_request_reply_to.py +32 -0
- brevo/transactional_emails/types/send_transac_email_request_sender.py +37 -0
- brevo/transactional_emails/types/send_transac_email_request_to_item.py +28 -0
- brevo/transactional_emails/types/send_transac_email_response.py +29 -0
- brevo/transactional_emails/types/update_smtp_template_request_sender.py +37 -0
- brevo/transactional_sms/__init__.py +70 -0
- brevo/transactional_sms/client.py +726 -0
- brevo/transactional_sms/raw_client.py +913 -0
- brevo/transactional_sms/types/__init__.py +68 -0
- brevo/transactional_sms/types/get_sms_events_request_event.py +20 -0
- brevo/transactional_sms/types/get_sms_events_request_sort.py +5 -0
- brevo/transactional_sms/types/get_sms_events_response.py +21 -0
- brevo/transactional_sms/types/get_sms_events_response_events_item.py +52 -0
- brevo/transactional_sms/types/get_sms_events_response_events_item_event.py +20 -0
- brevo/transactional_sms/types/get_transac_aggregated_sms_report_response.py +75 -0
- brevo/transactional_sms/types/get_transac_sms_report_request_sort.py +5 -0
- brevo/transactional_sms/types/get_transac_sms_report_response.py +21 -0
- brevo/transactional_sms/types/get_transac_sms_report_response_reports_item.py +76 -0
- brevo/transactional_sms/types/send_async_transactional_sms_response.py +22 -0
- brevo/transactional_sms/types/send_transac_sms_response.py +38 -0
- brevo/transactional_whats_app/__init__.py +64 -0
- brevo/transactional_whats_app/client.py +283 -0
- brevo/transactional_whats_app/raw_client.py +326 -0
- brevo/transactional_whats_app/types/__init__.py +62 -0
- brevo/transactional_whats_app/types/get_whatsapp_event_report_request_event.py +7 -0
- brevo/transactional_whats_app/types/get_whatsapp_event_report_request_sort.py +5 -0
- brevo/transactional_whats_app/types/get_whatsapp_event_report_response.py +21 -0
- brevo/transactional_whats_app/types/get_whatsapp_event_report_response_events_item.py +65 -0
- brevo/transactional_whats_app/types/get_whatsapp_event_report_response_events_item_event.py +7 -0
- brevo/transactional_whats_app/types/send_whatsapp_message_request.py +8 -0
- brevo/transactional_whats_app/types/send_whatsapp_message_request_params.py +41 -0
- brevo/transactional_whats_app/types/send_whatsapp_message_request_text.py +35 -0
- brevo/transactional_whats_app/types/send_whatsapp_message_response.py +26 -0
- brevo/types/__init__.py +373 -0
- brevo/types/ab_test_version_clicks.py +7 -0
- brevo/types/ab_test_version_clicks_item.py +35 -0
- brevo/types/ab_test_version_stats.py +35 -0
- brevo/types/bad_request_error_body.py +29 -0
- brevo/types/bad_request_error_body_code.py +45 -0
- brevo/types/balance_definition.py +139 -0
- brevo/types/balance_definition_balance_availability_duration_modifier.py +7 -0
- brevo/types/balance_limit.py +78 -0
- brevo/types/cart.py +38 -0
- brevo/types/company.py +45 -0
- brevo/types/configuration.py +30 -0
- brevo/types/contact_error_model.py +34 -0
- brevo/types/contact_error_model_code.py +16 -0
- brevo/types/conversations_message.py +187 -0
- brevo/types/conversations_message_attachments_item.py +50 -0
- brevo/types/conversations_message_bcc_item.py +21 -0
- brevo/types/conversations_message_cc_item.py +21 -0
- brevo/types/conversations_message_file.py +46 -0
- brevo/types/conversations_message_file_image_info.py +39 -0
- brevo/types/conversations_message_forwarded_to_source_status.py +29 -0
- brevo/types/conversations_message_from.py +25 -0
- brevo/types/conversations_message_reply_to.py +25 -0
- brevo/types/conversations_message_to_item.py +21 -0
- brevo/types/conversations_message_type.py +5 -0
- brevo/types/conversion_source_metrics.py +35 -0
- brevo/types/conversion_source_metrics_conversion_source.py +7 -0
- brevo/types/create_update_folder.py +23 -0
- brevo/types/deal.py +45 -0
- brevo/types/error_model.py +28 -0
- brevo/types/file_data.py +60 -0
- brevo/types/forbidden_error_body.py +29 -0
- brevo/types/forbidden_error_body_code.py +45 -0
- brevo/types/get_campaign_recipients.py +25 -0
- brevo/types/get_campaign_stats.py +130 -0
- brevo/types/get_category_details.py +54 -0
- brevo/types/get_contact_details.py +75 -0
- brevo/types/get_contact_details_attributes.py +22 -0
- brevo/types/get_contacts.py +25 -0
- brevo/types/get_coupon_collection.py +75 -0
- brevo/types/get_device_browser_stats.py +44 -0
- brevo/types/get_extended_campaign_overview.py +230 -0
- brevo/types/get_extended_campaign_overview_sender.py +33 -0
- brevo/types/get_extended_campaign_overview_status.py +7 -0
- brevo/types/get_extended_campaign_overview_type.py +5 -0
- brevo/types/get_extended_campaign_stats.py +63 -0
- brevo/types/get_extended_campaign_stats_links_stats.py +22 -0
- brevo/types/get_extended_campaign_stats_stats_by_device.py +39 -0
- brevo/types/get_folder.py +46 -0
- brevo/types/get_list.py +46 -0
- brevo/types/get_product_details.py +115 -0
- brevo/types/get_sms_campaign_overview.py +69 -0
- brevo/types/get_sms_campaign_overview_status.py +7 -0
- brevo/types/get_sms_campaign_stats.py +55 -0
- brevo/types/get_smtp_template_overview.py +93 -0
- brevo/types/get_smtp_template_overview_sender.py +33 -0
- brevo/types/get_sso_token.py +23 -0
- brevo/types/get_webhook.py +74 -0
- brevo/types/get_webhook_channel.py +5 -0
- brevo/types/get_webhook_type.py +5 -0
- brevo/types/inviteuser.py +31 -0
- brevo/types/inviteuser_privileges_item.py +34 -0
- brevo/types/inviteuser_privileges_item_feature.py +24 -0
- brevo/types/inviteuser_privileges_item_permissions_item.py +39 -0
- brevo/types/loyalty_program.py +82 -0
- brevo/types/loyalty_program_state.py +5 -0
- brevo/types/node_response.py +63 -0
- brevo/types/not_found_error_body.py +29 -0
- brevo/types/not_found_error_body_code.py +45 -0
- brevo/types/note.py +61 -0
- brevo/types/note_data.py +44 -0
- brevo/types/notification.py +32 -0
- brevo/types/order.py +85 -0
- brevo/types/order_billing.py +66 -0
- brevo/types/order_identifiers.py +42 -0
- brevo/types/order_meta_info_value.py +5 -0
- brevo/types/order_products_item.py +43 -0
- brevo/types/pipeline.py +38 -0
- brevo/types/pipeline_stages_item.py +32 -0
- brevo/types/pipelines.py +7 -0
- brevo/types/post_contact_info.py +21 -0
- brevo/types/post_contact_info_contacts.py +37 -0
- brevo/types/post_contact_info_contacts_failure.py +5 -0
- brevo/types/post_contact_info_contacts_success.py +5 -0
- brevo/types/post_send_failed.py +46 -0
- brevo/types/redeem.py +92 -0
- brevo/types/rule_condition_response.py +52 -0
- brevo/types/send_report.py +30 -0
- brevo/types/send_report_email.py +32 -0
- brevo/types/send_report_language.py +5 -0
- brevo/types/send_test_email.py +29 -0
- brevo/types/send_transac_sms.py +66 -0
- brevo/types/send_transac_sms_tag.py +28 -0
- brevo/types/send_transac_sms_tag_field.py +5 -0
- brevo/types/send_transac_sms_type.py +5 -0
- brevo/types/task.py +55 -0
- brevo/types/task_reminder.py +39 -0
- brevo/types/task_reminder_types_item.py +5 -0
- brevo/types/task_reminder_unit.py +5 -0
- brevo/types/tier.py +63 -0
- brevo/types/tier_access_conditions_item.py +38 -0
- brevo/types/tier_group.py +70 -0
- brevo/types/tier_group_downgrade_strategy.py +7 -0
- brevo/types/tier_group_upgrade_strategy.py +7 -0
- brevo/types/tier_tier_rewards_item.py +33 -0
- brevo/types/transaction.py +110 -0
- brevo/types/unauthorized_error_body.py +29 -0
- brevo/types/unauthorized_error_body_code.py +45 -0
- brevo/types/update_campaign_status.py +28 -0
- brevo/types/update_campaign_status_status.py +8 -0
- brevo/types/value_response.py +67 -0
- brevo/types/variables_items.py +22 -0
- brevo/types/whatsapp_camp_stats.py +26 -0
- brevo/user/__init__.py +67 -0
- brevo/user/client.py +806 -0
- brevo/user/raw_client.py +977 -0
- brevo/user/types/__init__.py +67 -0
- brevo/user/types/edit_user_permission_response.py +33 -0
- brevo/user/types/get_invited_users_list_response.py +24 -0
- brevo/user/types/get_invited_users_list_response_users_item.py +39 -0
- brevo/user/types/get_invited_users_list_response_users_item_feature_access.py +37 -0
- brevo/user/types/get_user_permission_response.py +38 -0
- brevo/user/types/get_user_permission_response_privileges_item.py +21 -0
- brevo/user/types/inviteuser_response.py +28 -0
- brevo/user/types/put_revoke_user_permission_response.py +28 -0
- brevo/user/types/putresendcancelinvitation_request_action.py +5 -0
- brevo/user/types/putresendcancelinvitation_response.py +28 -0
- brevo/version.py +3 -0
- brevo/webhooks/__init__.py +82 -0
- brevo/webhooks/client.py +982 -0
- brevo/webhooks/raw_client.py +1211 -0
- brevo/webhooks/types/__init__.py +80 -0
- brevo/webhooks/types/create_webhook_request_auth.py +32 -0
- brevo/webhooks/types/create_webhook_request_channel.py +5 -0
- brevo/webhooks/types/create_webhook_request_events_item.py +26 -0
- brevo/webhooks/types/create_webhook_request_headers_item.py +28 -0
- brevo/webhooks/types/create_webhook_request_type.py +5 -0
- brevo/webhooks/types/create_webhook_response.py +23 -0
- brevo/webhooks/types/export_webhooks_history_request_event.py +26 -0
- brevo/webhooks/types/export_webhooks_history_request_type.py +5 -0
- brevo/webhooks/types/export_webhooks_history_response.py +26 -0
- brevo/webhooks/types/get_webhooks_request_sort.py +5 -0
- brevo/webhooks/types/get_webhooks_request_type.py +5 -0
- brevo/webhooks/types/get_webhooks_response.py +21 -0
- brevo/webhooks/types/update_webhook_request_auth.py +32 -0
- brevo/webhooks/types/update_webhook_request_events_item.py +26 -0
- brevo/webhooks/types/update_webhook_request_headers_item.py +28 -0
- brevo/whats_app_campaigns/__init__.py +106 -0
- brevo/whats_app_campaigns/client.py +1064 -0
- brevo/whats_app_campaigns/raw_client.py +1311 -0
- brevo/whats_app_campaigns/types/__init__.py +110 -0
- brevo/whats_app_campaigns/types/create_whats_app_campaign_request_recipients.py +41 -0
- brevo/whats_app_campaigns/types/create_whats_app_campaign_response.py +23 -0
- brevo/whats_app_campaigns/types/create_whats_app_template_request_category.py +5 -0
- brevo/whats_app_campaigns/types/create_whats_app_template_request_source.py +5 -0
- brevo/whats_app_campaigns/types/create_whats_app_template_response.py +23 -0
- brevo/whats_app_campaigns/types/get_whats_app_campaign_response.py +69 -0
- brevo/whats_app_campaigns/types/get_whats_app_campaign_response_campaign_status.py +7 -0
- brevo/whats_app_campaigns/types/get_whats_app_campaign_response_template.py +61 -0
- brevo/whats_app_campaigns/types/get_whats_app_campaign_response_template_components_item.py +21 -0
- brevo/whats_app_campaigns/types/get_whats_app_campaigns_request_sort.py +5 -0
- brevo/whats_app_campaigns/types/get_whats_app_campaigns_response.py +25 -0
- brevo/whats_app_campaigns/types/get_whats_app_campaigns_response_campaigns_item.py +84 -0
- brevo/whats_app_campaigns/types/get_whats_app_campaigns_response_campaigns_item_campaign_status.py +7 -0
- brevo/whats_app_campaigns/types/get_whats_app_config_response.py +63 -0
- brevo/whats_app_campaigns/types/get_whats_app_config_response_phone_number_name_status.py +7 -0
- brevo/whats_app_campaigns/types/get_whats_app_config_response_phone_number_quality.py +5 -0
- brevo/whats_app_campaigns/types/get_whats_app_config_response_whatsapp_business_account_status.py +7 -0
- brevo/whats_app_campaigns/types/get_whats_app_templates_request_sort.py +5 -0
- brevo/whats_app_campaigns/types/get_whats_app_templates_request_source.py +5 -0
- brevo/whats_app_campaigns/types/get_whats_app_templates_response.py +26 -0
- brevo/whats_app_campaigns/types/get_whats_app_templates_response_templates_item.py +65 -0
- brevo/whats_app_campaigns/types/update_whats_app_campaign_request_campaign_status.py +5 -0
- brevo/whats_app_campaigns/types/update_whats_app_campaign_request_recipients.py +41 -0
- brevo_python-4.0.1.dist-info/METADATA +1072 -0
- brevo_python-4.0.1.dist-info/RECORD +843 -0
- brevo_python-4.0.1.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,2895 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
from json.decoder import JSONDecodeError
|
|
6
|
+
|
|
7
|
+
from ..core.api_error import ApiError
|
|
8
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
9
|
+
from ..core.datetime_utils import serialize_datetime
|
|
10
|
+
from ..core.http_response import AsyncHttpResponse, HttpResponse
|
|
11
|
+
from ..core.jsonable_encoder import jsonable_encoder
|
|
12
|
+
from ..core.request_options import RequestOptions
|
|
13
|
+
from ..core.serialization import convert_and_respect_annotation_metadata
|
|
14
|
+
from ..core.unchecked_base_model import construct_type
|
|
15
|
+
from ..errors.bad_request_error import BadRequestError
|
|
16
|
+
from ..errors.forbidden_error import ForbiddenError
|
|
17
|
+
from ..errors.not_found_error import NotFoundError
|
|
18
|
+
from ..errors.unauthorized_error import UnauthorizedError
|
|
19
|
+
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
|
20
|
+
from ..types.error_model import ErrorModel
|
|
21
|
+
from ..types.get_category_details import GetCategoryDetails
|
|
22
|
+
from ..types.get_product_details import GetProductDetails
|
|
23
|
+
from ..types.order import Order
|
|
24
|
+
from ..types.order_billing import OrderBilling
|
|
25
|
+
from ..types.order_identifiers import OrderIdentifiers
|
|
26
|
+
from ..types.order_meta_info_value import OrderMetaInfoValue
|
|
27
|
+
from ..types.order_products_item import OrderProductsItem
|
|
28
|
+
from .types.create_batch_order_response import CreateBatchOrderResponse
|
|
29
|
+
from .types.create_product_alert_request_contact_identifiers import CreateProductAlertRequestContactIdentifiers
|
|
30
|
+
from .types.create_update_batch_category_request_categories_item import CreateUpdateBatchCategoryRequestCategoriesItem
|
|
31
|
+
from .types.create_update_batch_category_response import CreateUpdateBatchCategoryResponse
|
|
32
|
+
from .types.create_update_batch_products_request_products_item import CreateUpdateBatchProductsRequestProductsItem
|
|
33
|
+
from .types.create_update_batch_products_response import CreateUpdateBatchProductsResponse
|
|
34
|
+
from .types.create_update_category_response import CreateUpdateCategoryResponse
|
|
35
|
+
from .types.create_update_product_request_meta_info_value import CreateUpdateProductRequestMetaInfoValue
|
|
36
|
+
from .types.create_update_product_response import CreateUpdateProductResponse
|
|
37
|
+
from .types.get_categories_request_sort import GetCategoriesRequestSort
|
|
38
|
+
from .types.get_categories_response import GetCategoriesResponse
|
|
39
|
+
from .types.get_ecommerce_attribution_metrics_conversion_source_conversion_source_id_request_conversion_source import (
|
|
40
|
+
GetEcommerceAttributionMetricsConversionSourceConversionSourceIdRequestConversionSource,
|
|
41
|
+
)
|
|
42
|
+
from .types.get_ecommerce_attribution_metrics_conversion_source_conversion_source_id_response import (
|
|
43
|
+
GetEcommerceAttributionMetricsConversionSourceConversionSourceIdResponse,
|
|
44
|
+
)
|
|
45
|
+
from .types.get_ecommerce_attribution_metrics_response import GetEcommerceAttributionMetricsResponse
|
|
46
|
+
from .types.get_ecommerce_attribution_products_conversion_source_conversion_source_id_request_conversion_source import (
|
|
47
|
+
GetEcommerceAttributionProductsConversionSourceConversionSourceIdRequestConversionSource,
|
|
48
|
+
)
|
|
49
|
+
from .types.get_ecommerce_attribution_products_conversion_source_conversion_source_id_response import (
|
|
50
|
+
GetEcommerceAttributionProductsConversionSourceConversionSourceIdResponse,
|
|
51
|
+
)
|
|
52
|
+
from .types.get_ecommerce_config_display_currency_response import GetEcommerceConfigDisplayCurrencyResponse
|
|
53
|
+
from .types.get_orders_request_sort import GetOrdersRequestSort
|
|
54
|
+
from .types.get_products_request_sort import GetProductsRequestSort
|
|
55
|
+
from .types.get_products_response import GetProductsResponse
|
|
56
|
+
from .types.set_config_display_currency_response import SetConfigDisplayCurrencyResponse
|
|
57
|
+
|
|
58
|
+
# this is used as the default value for optional parameters
|
|
59
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class RawEcommerceClient:
|
|
63
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
64
|
+
self._client_wrapper = client_wrapper
|
|
65
|
+
|
|
66
|
+
def get_categories(
|
|
67
|
+
self,
|
|
68
|
+
*,
|
|
69
|
+
limit: typing.Optional[int] = None,
|
|
70
|
+
offset: typing.Optional[int] = None,
|
|
71
|
+
sort: typing.Optional[GetCategoriesRequestSort] = None,
|
|
72
|
+
ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
73
|
+
name: typing.Optional[str] = None,
|
|
74
|
+
modified_since: typing.Optional[str] = None,
|
|
75
|
+
created_since: typing.Optional[str] = None,
|
|
76
|
+
is_deleted: typing.Optional[str] = None,
|
|
77
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
78
|
+
) -> HttpResponse[GetCategoriesResponse]:
|
|
79
|
+
"""
|
|
80
|
+
Parameters
|
|
81
|
+
----------
|
|
82
|
+
limit : typing.Optional[int]
|
|
83
|
+
Number of documents per page
|
|
84
|
+
|
|
85
|
+
offset : typing.Optional[int]
|
|
86
|
+
Index of the first document in the page
|
|
87
|
+
|
|
88
|
+
sort : typing.Optional[GetCategoriesRequestSort]
|
|
89
|
+
Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
|
|
90
|
+
|
|
91
|
+
ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
92
|
+
Filter by category ids
|
|
93
|
+
|
|
94
|
+
name : typing.Optional[str]
|
|
95
|
+
Filter by category name
|
|
96
|
+
|
|
97
|
+
modified_since : typing.Optional[str]
|
|
98
|
+
Filter (urlencoded) the categories modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
|
|
99
|
+
|
|
100
|
+
created_since : typing.Optional[str]
|
|
101
|
+
Filter (urlencoded) the categories created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
|
|
102
|
+
|
|
103
|
+
is_deleted : typing.Optional[str]
|
|
104
|
+
Filter categories by their deletion status. If `false` is passed, only categories that are not deleted will be returned.
|
|
105
|
+
|
|
106
|
+
request_options : typing.Optional[RequestOptions]
|
|
107
|
+
Request-specific configuration.
|
|
108
|
+
|
|
109
|
+
Returns
|
|
110
|
+
-------
|
|
111
|
+
HttpResponse[GetCategoriesResponse]
|
|
112
|
+
All categories listed
|
|
113
|
+
"""
|
|
114
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
115
|
+
"categories",
|
|
116
|
+
method="GET",
|
|
117
|
+
params={
|
|
118
|
+
"limit": limit,
|
|
119
|
+
"offset": offset,
|
|
120
|
+
"sort": sort,
|
|
121
|
+
"ids": ids,
|
|
122
|
+
"name": name,
|
|
123
|
+
"modifiedSince": modified_since,
|
|
124
|
+
"createdSince": created_since,
|
|
125
|
+
"isDeleted": is_deleted,
|
|
126
|
+
},
|
|
127
|
+
request_options=request_options,
|
|
128
|
+
)
|
|
129
|
+
try:
|
|
130
|
+
if 200 <= _response.status_code < 300:
|
|
131
|
+
_data = typing.cast(
|
|
132
|
+
GetCategoriesResponse,
|
|
133
|
+
construct_type(
|
|
134
|
+
type_=GetCategoriesResponse, # type: ignore
|
|
135
|
+
object_=_response.json(),
|
|
136
|
+
),
|
|
137
|
+
)
|
|
138
|
+
return HttpResponse(response=_response, data=_data)
|
|
139
|
+
if _response.status_code == 400:
|
|
140
|
+
raise BadRequestError(
|
|
141
|
+
headers=dict(_response.headers),
|
|
142
|
+
body=typing.cast(
|
|
143
|
+
typing.Any,
|
|
144
|
+
construct_type(
|
|
145
|
+
type_=typing.Any, # type: ignore
|
|
146
|
+
object_=_response.json(),
|
|
147
|
+
),
|
|
148
|
+
),
|
|
149
|
+
)
|
|
150
|
+
_response_json = _response.json()
|
|
151
|
+
except JSONDecodeError:
|
|
152
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
153
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
154
|
+
|
|
155
|
+
def create_update_category(
|
|
156
|
+
self,
|
|
157
|
+
*,
|
|
158
|
+
id: str,
|
|
159
|
+
deleted_at: typing.Optional[str] = OMIT,
|
|
160
|
+
is_deleted: typing.Optional[bool] = OMIT,
|
|
161
|
+
name: typing.Optional[str] = OMIT,
|
|
162
|
+
update_enabled: typing.Optional[bool] = OMIT,
|
|
163
|
+
url: typing.Optional[str] = OMIT,
|
|
164
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
165
|
+
) -> HttpResponse[CreateUpdateCategoryResponse]:
|
|
166
|
+
"""
|
|
167
|
+
Parameters
|
|
168
|
+
----------
|
|
169
|
+
id : str
|
|
170
|
+
Unique Category ID as saved in the shop
|
|
171
|
+
|
|
172
|
+
deleted_at : typing.Optional[str]
|
|
173
|
+
UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the category deleted from the shop's database
|
|
174
|
+
|
|
175
|
+
is_deleted : typing.Optional[bool]
|
|
176
|
+
category deleted from the shop's database
|
|
177
|
+
|
|
178
|
+
name : typing.Optional[str]
|
|
179
|
+
**Mandatory in case of creation**. Name of the Category, as displayed in the shop
|
|
180
|
+
|
|
181
|
+
update_enabled : typing.Optional[bool]
|
|
182
|
+
Facilitate to update the existing category in the same request (updateEnabled = true)
|
|
183
|
+
|
|
184
|
+
url : typing.Optional[str]
|
|
185
|
+
URL to the category
|
|
186
|
+
|
|
187
|
+
request_options : typing.Optional[RequestOptions]
|
|
188
|
+
Request-specific configuration.
|
|
189
|
+
|
|
190
|
+
Returns
|
|
191
|
+
-------
|
|
192
|
+
HttpResponse[CreateUpdateCategoryResponse]
|
|
193
|
+
Category created
|
|
194
|
+
"""
|
|
195
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
196
|
+
"categories",
|
|
197
|
+
method="POST",
|
|
198
|
+
json={
|
|
199
|
+
"deletedAt": deleted_at,
|
|
200
|
+
"id": id,
|
|
201
|
+
"isDeleted": is_deleted,
|
|
202
|
+
"name": name,
|
|
203
|
+
"updateEnabled": update_enabled,
|
|
204
|
+
"url": url,
|
|
205
|
+
},
|
|
206
|
+
headers={
|
|
207
|
+
"content-type": "application/json",
|
|
208
|
+
},
|
|
209
|
+
request_options=request_options,
|
|
210
|
+
omit=OMIT,
|
|
211
|
+
)
|
|
212
|
+
try:
|
|
213
|
+
if 200 <= _response.status_code < 300:
|
|
214
|
+
_data = typing.cast(
|
|
215
|
+
CreateUpdateCategoryResponse,
|
|
216
|
+
construct_type(
|
|
217
|
+
type_=CreateUpdateCategoryResponse, # type: ignore
|
|
218
|
+
object_=_response.json(),
|
|
219
|
+
),
|
|
220
|
+
)
|
|
221
|
+
return HttpResponse(response=_response, data=_data)
|
|
222
|
+
if _response.status_code == 400:
|
|
223
|
+
raise BadRequestError(
|
|
224
|
+
headers=dict(_response.headers),
|
|
225
|
+
body=typing.cast(
|
|
226
|
+
typing.Any,
|
|
227
|
+
construct_type(
|
|
228
|
+
type_=typing.Any, # type: ignore
|
|
229
|
+
object_=_response.json(),
|
|
230
|
+
),
|
|
231
|
+
),
|
|
232
|
+
)
|
|
233
|
+
_response_json = _response.json()
|
|
234
|
+
except JSONDecodeError:
|
|
235
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
236
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
237
|
+
|
|
238
|
+
def create_update_batch_category(
|
|
239
|
+
self,
|
|
240
|
+
*,
|
|
241
|
+
categories: typing.Sequence[CreateUpdateBatchCategoryRequestCategoriesItem],
|
|
242
|
+
update_enabled: typing.Optional[bool] = OMIT,
|
|
243
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
244
|
+
) -> HttpResponse[CreateUpdateBatchCategoryResponse]:
|
|
245
|
+
"""
|
|
246
|
+
Parameters
|
|
247
|
+
----------
|
|
248
|
+
categories : typing.Sequence[CreateUpdateBatchCategoryRequestCategoriesItem]
|
|
249
|
+
array of categories objects
|
|
250
|
+
|
|
251
|
+
update_enabled : typing.Optional[bool]
|
|
252
|
+
Facilitate to update the existing categories in the same request (updateEnabled = true)
|
|
253
|
+
|
|
254
|
+
request_options : typing.Optional[RequestOptions]
|
|
255
|
+
Request-specific configuration.
|
|
256
|
+
|
|
257
|
+
Returns
|
|
258
|
+
-------
|
|
259
|
+
HttpResponse[CreateUpdateBatchCategoryResponse]
|
|
260
|
+
Category created and updated
|
|
261
|
+
"""
|
|
262
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
263
|
+
"categories/batch",
|
|
264
|
+
method="POST",
|
|
265
|
+
json={
|
|
266
|
+
"categories": convert_and_respect_annotation_metadata(
|
|
267
|
+
object_=categories,
|
|
268
|
+
annotation=typing.Sequence[CreateUpdateBatchCategoryRequestCategoriesItem],
|
|
269
|
+
direction="write",
|
|
270
|
+
),
|
|
271
|
+
"updateEnabled": update_enabled,
|
|
272
|
+
},
|
|
273
|
+
headers={
|
|
274
|
+
"content-type": "application/json",
|
|
275
|
+
},
|
|
276
|
+
request_options=request_options,
|
|
277
|
+
omit=OMIT,
|
|
278
|
+
)
|
|
279
|
+
try:
|
|
280
|
+
if 200 <= _response.status_code < 300:
|
|
281
|
+
_data = typing.cast(
|
|
282
|
+
CreateUpdateBatchCategoryResponse,
|
|
283
|
+
construct_type(
|
|
284
|
+
type_=CreateUpdateBatchCategoryResponse, # type: ignore
|
|
285
|
+
object_=_response.json(),
|
|
286
|
+
),
|
|
287
|
+
)
|
|
288
|
+
return HttpResponse(response=_response, data=_data)
|
|
289
|
+
if _response.status_code == 400:
|
|
290
|
+
raise BadRequestError(
|
|
291
|
+
headers=dict(_response.headers),
|
|
292
|
+
body=typing.cast(
|
|
293
|
+
typing.Any,
|
|
294
|
+
construct_type(
|
|
295
|
+
type_=typing.Any, # type: ignore
|
|
296
|
+
object_=_response.json(),
|
|
297
|
+
),
|
|
298
|
+
),
|
|
299
|
+
)
|
|
300
|
+
_response_json = _response.json()
|
|
301
|
+
except JSONDecodeError:
|
|
302
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
303
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
304
|
+
|
|
305
|
+
def get_category_info(
|
|
306
|
+
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
307
|
+
) -> HttpResponse[GetCategoryDetails]:
|
|
308
|
+
"""
|
|
309
|
+
Parameters
|
|
310
|
+
----------
|
|
311
|
+
id : str
|
|
312
|
+
Category ID
|
|
313
|
+
|
|
314
|
+
request_options : typing.Optional[RequestOptions]
|
|
315
|
+
Request-specific configuration.
|
|
316
|
+
|
|
317
|
+
Returns
|
|
318
|
+
-------
|
|
319
|
+
HttpResponse[GetCategoryDetails]
|
|
320
|
+
Category informations
|
|
321
|
+
"""
|
|
322
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
323
|
+
f"categories/{jsonable_encoder(id)}",
|
|
324
|
+
method="GET",
|
|
325
|
+
request_options=request_options,
|
|
326
|
+
)
|
|
327
|
+
try:
|
|
328
|
+
if 200 <= _response.status_code < 300:
|
|
329
|
+
_data = typing.cast(
|
|
330
|
+
GetCategoryDetails,
|
|
331
|
+
construct_type(
|
|
332
|
+
type_=GetCategoryDetails, # type: ignore
|
|
333
|
+
object_=_response.json(),
|
|
334
|
+
),
|
|
335
|
+
)
|
|
336
|
+
return HttpResponse(response=_response, data=_data)
|
|
337
|
+
if _response.status_code == 400:
|
|
338
|
+
raise BadRequestError(
|
|
339
|
+
headers=dict(_response.headers),
|
|
340
|
+
body=typing.cast(
|
|
341
|
+
typing.Any,
|
|
342
|
+
construct_type(
|
|
343
|
+
type_=typing.Any, # type: ignore
|
|
344
|
+
object_=_response.json(),
|
|
345
|
+
),
|
|
346
|
+
),
|
|
347
|
+
)
|
|
348
|
+
if _response.status_code == 404:
|
|
349
|
+
raise NotFoundError(
|
|
350
|
+
headers=dict(_response.headers),
|
|
351
|
+
body=typing.cast(
|
|
352
|
+
typing.Any,
|
|
353
|
+
construct_type(
|
|
354
|
+
type_=typing.Any, # type: ignore
|
|
355
|
+
object_=_response.json(),
|
|
356
|
+
),
|
|
357
|
+
),
|
|
358
|
+
)
|
|
359
|
+
_response_json = _response.json()
|
|
360
|
+
except JSONDecodeError:
|
|
361
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
362
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
363
|
+
|
|
364
|
+
def activate_the_e_commerce_app(
|
|
365
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
366
|
+
) -> HttpResponse[None]:
|
|
367
|
+
"""
|
|
368
|
+
Getting access to Brevo eCommerce.
|
|
369
|
+
|
|
370
|
+
Parameters
|
|
371
|
+
----------
|
|
372
|
+
request_options : typing.Optional[RequestOptions]
|
|
373
|
+
Request-specific configuration.
|
|
374
|
+
|
|
375
|
+
Returns
|
|
376
|
+
-------
|
|
377
|
+
HttpResponse[None]
|
|
378
|
+
"""
|
|
379
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
380
|
+
"ecommerce/activate",
|
|
381
|
+
method="POST",
|
|
382
|
+
request_options=request_options,
|
|
383
|
+
)
|
|
384
|
+
try:
|
|
385
|
+
if 200 <= _response.status_code < 300:
|
|
386
|
+
return HttpResponse(response=_response, data=None)
|
|
387
|
+
if _response.status_code == 401:
|
|
388
|
+
raise UnauthorizedError(
|
|
389
|
+
headers=dict(_response.headers),
|
|
390
|
+
body=typing.cast(
|
|
391
|
+
typing.Any,
|
|
392
|
+
construct_type(
|
|
393
|
+
type_=typing.Any, # type: ignore
|
|
394
|
+
object_=_response.json(),
|
|
395
|
+
),
|
|
396
|
+
),
|
|
397
|
+
)
|
|
398
|
+
if _response.status_code == 404:
|
|
399
|
+
raise NotFoundError(
|
|
400
|
+
headers=dict(_response.headers),
|
|
401
|
+
body=typing.cast(
|
|
402
|
+
typing.Any,
|
|
403
|
+
construct_type(
|
|
404
|
+
type_=typing.Any, # type: ignore
|
|
405
|
+
object_=_response.json(),
|
|
406
|
+
),
|
|
407
|
+
),
|
|
408
|
+
)
|
|
409
|
+
_response_json = _response.json()
|
|
410
|
+
except JSONDecodeError:
|
|
411
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
412
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
413
|
+
|
|
414
|
+
def get_attribution_metrics_for_one_or_more_brevo_campaigns_or_workflows(
|
|
415
|
+
self,
|
|
416
|
+
*,
|
|
417
|
+
period_from: typing.Optional[dt.datetime] = None,
|
|
418
|
+
period_to: typing.Optional[dt.datetime] = None,
|
|
419
|
+
email_campaign_id_array: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
420
|
+
sms_campaign_id_array: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
421
|
+
automation_workflow_email_id_array: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
422
|
+
automation_workflow_sms_id_array: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
423
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
424
|
+
) -> HttpResponse[GetEcommerceAttributionMetricsResponse]:
|
|
425
|
+
"""
|
|
426
|
+
Parameters
|
|
427
|
+
----------
|
|
428
|
+
period_from : typing.Optional[dt.datetime]
|
|
429
|
+
When getting metrics for a specific period, define the starting datetime in RFC3339 format
|
|
430
|
+
|
|
431
|
+
period_to : typing.Optional[dt.datetime]
|
|
432
|
+
When getting metrics for a specific period, define the end datetime in RFC3339 format
|
|
433
|
+
|
|
434
|
+
email_campaign_id_array : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
435
|
+
The email campaign ID(s) to get metrics for
|
|
436
|
+
|
|
437
|
+
sms_campaign_id_array : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
438
|
+
The SMS campaign ID(s) to get metrics for
|
|
439
|
+
|
|
440
|
+
automation_workflow_email_id_array : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
441
|
+
The automation workflow ID(s) to get email attribution metrics for
|
|
442
|
+
|
|
443
|
+
automation_workflow_sms_id_array : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
444
|
+
The automation workflow ID(s) to get SMS attribution metrics for
|
|
445
|
+
|
|
446
|
+
request_options : typing.Optional[RequestOptions]
|
|
447
|
+
Request-specific configuration.
|
|
448
|
+
|
|
449
|
+
Returns
|
|
450
|
+
-------
|
|
451
|
+
HttpResponse[GetEcommerceAttributionMetricsResponse]
|
|
452
|
+
OK
|
|
453
|
+
"""
|
|
454
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
455
|
+
"ecommerce/attribution/metrics",
|
|
456
|
+
method="GET",
|
|
457
|
+
params={
|
|
458
|
+
"periodFrom": serialize_datetime(period_from) if period_from is not None else None,
|
|
459
|
+
"periodTo": serialize_datetime(period_to) if period_to is not None else None,
|
|
460
|
+
"emailCampaignId[]": email_campaign_id_array,
|
|
461
|
+
"smsCampaignId[]": sms_campaign_id_array,
|
|
462
|
+
"automationWorkflowEmailId[]": automation_workflow_email_id_array,
|
|
463
|
+
"automationWorkflowSmsId[]": automation_workflow_sms_id_array,
|
|
464
|
+
},
|
|
465
|
+
request_options=request_options,
|
|
466
|
+
)
|
|
467
|
+
try:
|
|
468
|
+
if 200 <= _response.status_code < 300:
|
|
469
|
+
_data = typing.cast(
|
|
470
|
+
GetEcommerceAttributionMetricsResponse,
|
|
471
|
+
construct_type(
|
|
472
|
+
type_=GetEcommerceAttributionMetricsResponse, # type: ignore
|
|
473
|
+
object_=_response.json(),
|
|
474
|
+
),
|
|
475
|
+
)
|
|
476
|
+
return HttpResponse(response=_response, data=_data)
|
|
477
|
+
if _response.status_code == 400:
|
|
478
|
+
raise BadRequestError(
|
|
479
|
+
headers=dict(_response.headers),
|
|
480
|
+
body=typing.cast(
|
|
481
|
+
typing.Any,
|
|
482
|
+
construct_type(
|
|
483
|
+
type_=typing.Any, # type: ignore
|
|
484
|
+
object_=_response.json(),
|
|
485
|
+
),
|
|
486
|
+
),
|
|
487
|
+
)
|
|
488
|
+
_response_json = _response.json()
|
|
489
|
+
except JSONDecodeError:
|
|
490
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
491
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
492
|
+
|
|
493
|
+
def get_detailed_attribution_metrics_for_a_single_brevo_campaign_or_workflow(
|
|
494
|
+
self,
|
|
495
|
+
conversion_source: GetEcommerceAttributionMetricsConversionSourceConversionSourceIdRequestConversionSource,
|
|
496
|
+
conversion_source_id: str,
|
|
497
|
+
*,
|
|
498
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
499
|
+
) -> HttpResponse[GetEcommerceAttributionMetricsConversionSourceConversionSourceIdResponse]:
|
|
500
|
+
"""
|
|
501
|
+
Parameters
|
|
502
|
+
----------
|
|
503
|
+
conversion_source : GetEcommerceAttributionMetricsConversionSourceConversionSourceIdRequestConversionSource
|
|
504
|
+
The Brevo campaign type or workflow type for which data will be retrieved
|
|
505
|
+
|
|
506
|
+
conversion_source_id : str
|
|
507
|
+
The Brevo campaign or automation workflow id for which data will be retrieved
|
|
508
|
+
|
|
509
|
+
request_options : typing.Optional[RequestOptions]
|
|
510
|
+
Request-specific configuration.
|
|
511
|
+
|
|
512
|
+
Returns
|
|
513
|
+
-------
|
|
514
|
+
HttpResponse[GetEcommerceAttributionMetricsConversionSourceConversionSourceIdResponse]
|
|
515
|
+
OK
|
|
516
|
+
"""
|
|
517
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
518
|
+
f"ecommerce/attribution/metrics/{jsonable_encoder(conversion_source)}/{jsonable_encoder(conversion_source_id)}",
|
|
519
|
+
method="GET",
|
|
520
|
+
request_options=request_options,
|
|
521
|
+
)
|
|
522
|
+
try:
|
|
523
|
+
if 200 <= _response.status_code < 300:
|
|
524
|
+
_data = typing.cast(
|
|
525
|
+
GetEcommerceAttributionMetricsConversionSourceConversionSourceIdResponse,
|
|
526
|
+
construct_type(
|
|
527
|
+
type_=GetEcommerceAttributionMetricsConversionSourceConversionSourceIdResponse, # type: ignore
|
|
528
|
+
object_=_response.json(),
|
|
529
|
+
),
|
|
530
|
+
)
|
|
531
|
+
return HttpResponse(response=_response, data=_data)
|
|
532
|
+
if _response.status_code == 400:
|
|
533
|
+
raise BadRequestError(
|
|
534
|
+
headers=dict(_response.headers),
|
|
535
|
+
body=typing.cast(
|
|
536
|
+
typing.Any,
|
|
537
|
+
construct_type(
|
|
538
|
+
type_=typing.Any, # type: ignore
|
|
539
|
+
object_=_response.json(),
|
|
540
|
+
),
|
|
541
|
+
),
|
|
542
|
+
)
|
|
543
|
+
_response_json = _response.json()
|
|
544
|
+
except JSONDecodeError:
|
|
545
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
546
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
547
|
+
|
|
548
|
+
def get_attributed_product_sales_for_a_single_brevo_campaign_or_workflow(
|
|
549
|
+
self,
|
|
550
|
+
conversion_source: GetEcommerceAttributionProductsConversionSourceConversionSourceIdRequestConversionSource,
|
|
551
|
+
conversion_source_id: str,
|
|
552
|
+
*,
|
|
553
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
554
|
+
) -> HttpResponse[GetEcommerceAttributionProductsConversionSourceConversionSourceIdResponse]:
|
|
555
|
+
"""
|
|
556
|
+
Parameters
|
|
557
|
+
----------
|
|
558
|
+
conversion_source : GetEcommerceAttributionProductsConversionSourceConversionSourceIdRequestConversionSource
|
|
559
|
+
The Brevo campaign or automation workflow type for which data will be retrieved
|
|
560
|
+
|
|
561
|
+
conversion_source_id : str
|
|
562
|
+
The Brevo campaign or automation workflow id for which data will be retrieved
|
|
563
|
+
|
|
564
|
+
request_options : typing.Optional[RequestOptions]
|
|
565
|
+
Request-specific configuration.
|
|
566
|
+
|
|
567
|
+
Returns
|
|
568
|
+
-------
|
|
569
|
+
HttpResponse[GetEcommerceAttributionProductsConversionSourceConversionSourceIdResponse]
|
|
570
|
+
OK
|
|
571
|
+
"""
|
|
572
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
573
|
+
f"ecommerce/attribution/products/{jsonable_encoder(conversion_source)}/{jsonable_encoder(conversion_source_id)}",
|
|
574
|
+
method="GET",
|
|
575
|
+
request_options=request_options,
|
|
576
|
+
)
|
|
577
|
+
try:
|
|
578
|
+
if 200 <= _response.status_code < 300:
|
|
579
|
+
_data = typing.cast(
|
|
580
|
+
GetEcommerceAttributionProductsConversionSourceConversionSourceIdResponse,
|
|
581
|
+
construct_type(
|
|
582
|
+
type_=GetEcommerceAttributionProductsConversionSourceConversionSourceIdResponse, # type: ignore
|
|
583
|
+
object_=_response.json(),
|
|
584
|
+
),
|
|
585
|
+
)
|
|
586
|
+
return HttpResponse(response=_response, data=_data)
|
|
587
|
+
if _response.status_code == 400:
|
|
588
|
+
raise BadRequestError(
|
|
589
|
+
headers=dict(_response.headers),
|
|
590
|
+
body=typing.cast(
|
|
591
|
+
typing.Any,
|
|
592
|
+
construct_type(
|
|
593
|
+
type_=typing.Any, # type: ignore
|
|
594
|
+
object_=_response.json(),
|
|
595
|
+
),
|
|
596
|
+
),
|
|
597
|
+
)
|
|
598
|
+
_response_json = _response.json()
|
|
599
|
+
except JSONDecodeError:
|
|
600
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
601
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
602
|
+
|
|
603
|
+
def get_the_iso4217compliant_display_currency_code_for_your_brevo_account(
|
|
604
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
605
|
+
) -> HttpResponse[GetEcommerceConfigDisplayCurrencyResponse]:
|
|
606
|
+
"""
|
|
607
|
+
Parameters
|
|
608
|
+
----------
|
|
609
|
+
request_options : typing.Optional[RequestOptions]
|
|
610
|
+
Request-specific configuration.
|
|
611
|
+
|
|
612
|
+
Returns
|
|
613
|
+
-------
|
|
614
|
+
HttpResponse[GetEcommerceConfigDisplayCurrencyResponse]
|
|
615
|
+
OK
|
|
616
|
+
"""
|
|
617
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
618
|
+
"ecommerce/config/displayCurrency",
|
|
619
|
+
method="GET",
|
|
620
|
+
request_options=request_options,
|
|
621
|
+
)
|
|
622
|
+
try:
|
|
623
|
+
if 200 <= _response.status_code < 300:
|
|
624
|
+
_data = typing.cast(
|
|
625
|
+
GetEcommerceConfigDisplayCurrencyResponse,
|
|
626
|
+
construct_type(
|
|
627
|
+
type_=GetEcommerceConfigDisplayCurrencyResponse, # type: ignore
|
|
628
|
+
object_=_response.json(),
|
|
629
|
+
),
|
|
630
|
+
)
|
|
631
|
+
return HttpResponse(response=_response, data=_data)
|
|
632
|
+
if _response.status_code == 400:
|
|
633
|
+
raise BadRequestError(
|
|
634
|
+
headers=dict(_response.headers),
|
|
635
|
+
body=typing.cast(
|
|
636
|
+
typing.Any,
|
|
637
|
+
construct_type(
|
|
638
|
+
type_=typing.Any, # type: ignore
|
|
639
|
+
object_=_response.json(),
|
|
640
|
+
),
|
|
641
|
+
),
|
|
642
|
+
)
|
|
643
|
+
if _response.status_code == 401:
|
|
644
|
+
raise UnauthorizedError(
|
|
645
|
+
headers=dict(_response.headers),
|
|
646
|
+
body=typing.cast(
|
|
647
|
+
typing.Any,
|
|
648
|
+
construct_type(
|
|
649
|
+
type_=typing.Any, # type: ignore
|
|
650
|
+
object_=_response.json(),
|
|
651
|
+
),
|
|
652
|
+
),
|
|
653
|
+
)
|
|
654
|
+
if _response.status_code == 403:
|
|
655
|
+
raise ForbiddenError(
|
|
656
|
+
headers=dict(_response.headers),
|
|
657
|
+
body=typing.cast(
|
|
658
|
+
typing.Any,
|
|
659
|
+
construct_type(
|
|
660
|
+
type_=typing.Any, # type: ignore
|
|
661
|
+
object_=_response.json(),
|
|
662
|
+
),
|
|
663
|
+
),
|
|
664
|
+
)
|
|
665
|
+
_response_json = _response.json()
|
|
666
|
+
except JSONDecodeError:
|
|
667
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
668
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
669
|
+
|
|
670
|
+
def set_config_display_currency(
|
|
671
|
+
self, *, code: str, request_options: typing.Optional[RequestOptions] = None
|
|
672
|
+
) -> HttpResponse[SetConfigDisplayCurrencyResponse]:
|
|
673
|
+
"""
|
|
674
|
+
Parameters
|
|
675
|
+
----------
|
|
676
|
+
code : str
|
|
677
|
+
ISO 4217 compliant display currency code
|
|
678
|
+
|
|
679
|
+
request_options : typing.Optional[RequestOptions]
|
|
680
|
+
Request-specific configuration.
|
|
681
|
+
|
|
682
|
+
Returns
|
|
683
|
+
-------
|
|
684
|
+
HttpResponse[SetConfigDisplayCurrencyResponse]
|
|
685
|
+
OK
|
|
686
|
+
"""
|
|
687
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
688
|
+
"ecommerce/config/displayCurrency",
|
|
689
|
+
method="POST",
|
|
690
|
+
json={
|
|
691
|
+
"code": code,
|
|
692
|
+
},
|
|
693
|
+
headers={
|
|
694
|
+
"content-type": "application/json",
|
|
695
|
+
},
|
|
696
|
+
request_options=request_options,
|
|
697
|
+
omit=OMIT,
|
|
698
|
+
)
|
|
699
|
+
try:
|
|
700
|
+
if 200 <= _response.status_code < 300:
|
|
701
|
+
_data = typing.cast(
|
|
702
|
+
SetConfigDisplayCurrencyResponse,
|
|
703
|
+
construct_type(
|
|
704
|
+
type_=SetConfigDisplayCurrencyResponse, # type: ignore
|
|
705
|
+
object_=_response.json(),
|
|
706
|
+
),
|
|
707
|
+
)
|
|
708
|
+
return HttpResponse(response=_response, data=_data)
|
|
709
|
+
if _response.status_code == 400:
|
|
710
|
+
raise BadRequestError(
|
|
711
|
+
headers=dict(_response.headers),
|
|
712
|
+
body=typing.cast(
|
|
713
|
+
typing.Any,
|
|
714
|
+
construct_type(
|
|
715
|
+
type_=typing.Any, # type: ignore
|
|
716
|
+
object_=_response.json(),
|
|
717
|
+
),
|
|
718
|
+
),
|
|
719
|
+
)
|
|
720
|
+
if _response.status_code == 401:
|
|
721
|
+
raise UnauthorizedError(
|
|
722
|
+
headers=dict(_response.headers),
|
|
723
|
+
body=typing.cast(
|
|
724
|
+
typing.Any,
|
|
725
|
+
construct_type(
|
|
726
|
+
type_=typing.Any, # type: ignore
|
|
727
|
+
object_=_response.json(),
|
|
728
|
+
),
|
|
729
|
+
),
|
|
730
|
+
)
|
|
731
|
+
if _response.status_code == 403:
|
|
732
|
+
raise ForbiddenError(
|
|
733
|
+
headers=dict(_response.headers),
|
|
734
|
+
body=typing.cast(
|
|
735
|
+
typing.Any,
|
|
736
|
+
construct_type(
|
|
737
|
+
type_=typing.Any, # type: ignore
|
|
738
|
+
object_=_response.json(),
|
|
739
|
+
),
|
|
740
|
+
),
|
|
741
|
+
)
|
|
742
|
+
if _response.status_code == 422:
|
|
743
|
+
raise UnprocessableEntityError(
|
|
744
|
+
headers=dict(_response.headers),
|
|
745
|
+
body=typing.cast(
|
|
746
|
+
ErrorModel,
|
|
747
|
+
construct_type(
|
|
748
|
+
type_=ErrorModel, # type: ignore
|
|
749
|
+
object_=_response.json(),
|
|
750
|
+
),
|
|
751
|
+
),
|
|
752
|
+
)
|
|
753
|
+
_response_json = _response.json()
|
|
754
|
+
except JSONDecodeError:
|
|
755
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
756
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
757
|
+
|
|
758
|
+
def get_orders(
|
|
759
|
+
self,
|
|
760
|
+
*,
|
|
761
|
+
limit: typing.Optional[int] = None,
|
|
762
|
+
offset: typing.Optional[int] = None,
|
|
763
|
+
sort: typing.Optional[GetOrdersRequestSort] = None,
|
|
764
|
+
modified_since: typing.Optional[str] = None,
|
|
765
|
+
created_since: typing.Optional[str] = None,
|
|
766
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
767
|
+
) -> HttpResponse[typing.Any]:
|
|
768
|
+
"""
|
|
769
|
+
Get all the orders
|
|
770
|
+
|
|
771
|
+
Parameters
|
|
772
|
+
----------
|
|
773
|
+
limit : typing.Optional[int]
|
|
774
|
+
Number of documents per page
|
|
775
|
+
|
|
776
|
+
offset : typing.Optional[int]
|
|
777
|
+
Index of the first document in the page
|
|
778
|
+
|
|
779
|
+
sort : typing.Optional[GetOrdersRequestSort]
|
|
780
|
+
Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
|
|
781
|
+
|
|
782
|
+
modified_since : typing.Optional[str]
|
|
783
|
+
Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
|
|
784
|
+
|
|
785
|
+
created_since : typing.Optional[str]
|
|
786
|
+
Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
|
|
787
|
+
|
|
788
|
+
request_options : typing.Optional[RequestOptions]
|
|
789
|
+
Request-specific configuration.
|
|
790
|
+
|
|
791
|
+
Returns
|
|
792
|
+
-------
|
|
793
|
+
HttpResponse[typing.Any]
|
|
794
|
+
orders fetched successfully
|
|
795
|
+
"""
|
|
796
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
797
|
+
"orders",
|
|
798
|
+
method="GET",
|
|
799
|
+
params={
|
|
800
|
+
"limit": limit,
|
|
801
|
+
"offset": offset,
|
|
802
|
+
"sort": sort,
|
|
803
|
+
"modifiedSince": modified_since,
|
|
804
|
+
"createdSince": created_since,
|
|
805
|
+
},
|
|
806
|
+
request_options=request_options,
|
|
807
|
+
)
|
|
808
|
+
try:
|
|
809
|
+
if _response is None or not _response.text.strip():
|
|
810
|
+
return HttpResponse(response=_response, data=None)
|
|
811
|
+
if 200 <= _response.status_code < 300:
|
|
812
|
+
_data = typing.cast(
|
|
813
|
+
typing.Any,
|
|
814
|
+
construct_type(
|
|
815
|
+
type_=typing.Any, # type: ignore
|
|
816
|
+
object_=_response.json(),
|
|
817
|
+
),
|
|
818
|
+
)
|
|
819
|
+
return HttpResponse(response=_response, data=_data)
|
|
820
|
+
if _response.status_code == 400:
|
|
821
|
+
raise BadRequestError(
|
|
822
|
+
headers=dict(_response.headers),
|
|
823
|
+
body=typing.cast(
|
|
824
|
+
typing.Any,
|
|
825
|
+
construct_type(
|
|
826
|
+
type_=typing.Any, # type: ignore
|
|
827
|
+
object_=_response.json(),
|
|
828
|
+
),
|
|
829
|
+
),
|
|
830
|
+
)
|
|
831
|
+
_response_json = _response.json()
|
|
832
|
+
except JSONDecodeError:
|
|
833
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
834
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
835
|
+
|
|
836
|
+
def create_order(
|
|
837
|
+
self,
|
|
838
|
+
*,
|
|
839
|
+
amount: float,
|
|
840
|
+
created_at: str,
|
|
841
|
+
id: str,
|
|
842
|
+
products: typing.Sequence[OrderProductsItem],
|
|
843
|
+
status: str,
|
|
844
|
+
updated_at: str,
|
|
845
|
+
billing: typing.Optional[OrderBilling] = OMIT,
|
|
846
|
+
coupons: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
847
|
+
identifiers: typing.Optional[OrderIdentifiers] = OMIT,
|
|
848
|
+
meta_info: typing.Optional[typing.Dict[str, OrderMetaInfoValue]] = OMIT,
|
|
849
|
+
store_id: typing.Optional[str] = OMIT,
|
|
850
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
851
|
+
) -> HttpResponse[None]:
|
|
852
|
+
"""
|
|
853
|
+
Manages the transactional status of the order
|
|
854
|
+
|
|
855
|
+
Parameters
|
|
856
|
+
----------
|
|
857
|
+
amount : float
|
|
858
|
+
Total amount of the order, including all shipping expenses, tax and the price of items.
|
|
859
|
+
|
|
860
|
+
created_at : str
|
|
861
|
+
Event occurrence UTC date-time (YYYY-MM-DDTHH:mm:ssZ), when order is actually created.
|
|
862
|
+
|
|
863
|
+
id : str
|
|
864
|
+
Unique ID of the order.
|
|
865
|
+
|
|
866
|
+
products : typing.Sequence[OrderProductsItem]
|
|
867
|
+
|
|
868
|
+
status : str
|
|
869
|
+
State of the order.
|
|
870
|
+
|
|
871
|
+
updated_at : str
|
|
872
|
+
Event updated UTC date-time (YYYY-MM-DDTHH:mm:ssZ), when the status of the order is actually changed/updated.
|
|
873
|
+
|
|
874
|
+
billing : typing.Optional[OrderBilling]
|
|
875
|
+
Billing details of an order.
|
|
876
|
+
|
|
877
|
+
coupons : typing.Optional[typing.Sequence[str]]
|
|
878
|
+
Coupons applied to the order. Stored case insensitive.
|
|
879
|
+
|
|
880
|
+
identifiers : typing.Optional[OrderIdentifiers]
|
|
881
|
+
Identifies the contact associated with the order.
|
|
882
|
+
|
|
883
|
+
meta_info : typing.Optional[typing.Dict[str, OrderMetaInfoValue]]
|
|
884
|
+
Meta data of order to store additional detal such as custom message, customer type, source.
|
|
885
|
+
|
|
886
|
+
store_id : typing.Optional[str]
|
|
887
|
+
ID of store where the order is placed
|
|
888
|
+
|
|
889
|
+
request_options : typing.Optional[RequestOptions]
|
|
890
|
+
Request-specific configuration.
|
|
891
|
+
|
|
892
|
+
Returns
|
|
893
|
+
-------
|
|
894
|
+
HttpResponse[None]
|
|
895
|
+
"""
|
|
896
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
897
|
+
"orders/status",
|
|
898
|
+
method="POST",
|
|
899
|
+
json={
|
|
900
|
+
"amount": amount,
|
|
901
|
+
"billing": convert_and_respect_annotation_metadata(
|
|
902
|
+
object_=billing, annotation=OrderBilling, direction="write"
|
|
903
|
+
),
|
|
904
|
+
"coupons": coupons,
|
|
905
|
+
"createdAt": created_at,
|
|
906
|
+
"id": id,
|
|
907
|
+
"identifiers": convert_and_respect_annotation_metadata(
|
|
908
|
+
object_=identifiers, annotation=OrderIdentifiers, direction="write"
|
|
909
|
+
),
|
|
910
|
+
"metaInfo": convert_and_respect_annotation_metadata(
|
|
911
|
+
object_=meta_info, annotation=typing.Dict[str, OrderMetaInfoValue], direction="write"
|
|
912
|
+
),
|
|
913
|
+
"products": convert_and_respect_annotation_metadata(
|
|
914
|
+
object_=products, annotation=typing.Sequence[OrderProductsItem], direction="write"
|
|
915
|
+
),
|
|
916
|
+
"status": status,
|
|
917
|
+
"storeId": store_id,
|
|
918
|
+
"updatedAt": updated_at,
|
|
919
|
+
},
|
|
920
|
+
headers={
|
|
921
|
+
"content-type": "application/json",
|
|
922
|
+
},
|
|
923
|
+
request_options=request_options,
|
|
924
|
+
omit=OMIT,
|
|
925
|
+
)
|
|
926
|
+
try:
|
|
927
|
+
if 200 <= _response.status_code < 300:
|
|
928
|
+
return HttpResponse(response=_response, data=None)
|
|
929
|
+
if _response.status_code == 400:
|
|
930
|
+
raise BadRequestError(
|
|
931
|
+
headers=dict(_response.headers),
|
|
932
|
+
body=typing.cast(
|
|
933
|
+
typing.Any,
|
|
934
|
+
construct_type(
|
|
935
|
+
type_=typing.Any, # type: ignore
|
|
936
|
+
object_=_response.json(),
|
|
937
|
+
),
|
|
938
|
+
),
|
|
939
|
+
)
|
|
940
|
+
_response_json = _response.json()
|
|
941
|
+
except JSONDecodeError:
|
|
942
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
943
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
944
|
+
|
|
945
|
+
def create_batch_order(
|
|
946
|
+
self,
|
|
947
|
+
*,
|
|
948
|
+
orders: typing.Sequence[Order],
|
|
949
|
+
historical: typing.Optional[bool] = OMIT,
|
|
950
|
+
notify_url: typing.Optional[str] = OMIT,
|
|
951
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
952
|
+
) -> HttpResponse[CreateBatchOrderResponse]:
|
|
953
|
+
"""
|
|
954
|
+
Create multiple orders at one time instead of one order at a time
|
|
955
|
+
|
|
956
|
+
Parameters
|
|
957
|
+
----------
|
|
958
|
+
orders : typing.Sequence[Order]
|
|
959
|
+
array of order objects
|
|
960
|
+
|
|
961
|
+
historical : typing.Optional[bool]
|
|
962
|
+
Defines wether you want your orders to be considered as live data or as historical data (import of past data, synchronising data). True: orders will not trigger any automation workflows. False: orders will trigger workflows as usual.
|
|
963
|
+
|
|
964
|
+
notify_url : typing.Optional[str]
|
|
965
|
+
Notify Url provided by client_dev to get the status of batch request
|
|
966
|
+
|
|
967
|
+
request_options : typing.Optional[RequestOptions]
|
|
968
|
+
Request-specific configuration.
|
|
969
|
+
|
|
970
|
+
Returns
|
|
971
|
+
-------
|
|
972
|
+
HttpResponse[CreateBatchOrderResponse]
|
|
973
|
+
batch id created
|
|
974
|
+
"""
|
|
975
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
976
|
+
"orders/status/batch",
|
|
977
|
+
method="POST",
|
|
978
|
+
json={
|
|
979
|
+
"historical": historical,
|
|
980
|
+
"notifyUrl": notify_url,
|
|
981
|
+
"orders": convert_and_respect_annotation_metadata(
|
|
982
|
+
object_=orders, annotation=typing.Sequence[Order], direction="write"
|
|
983
|
+
),
|
|
984
|
+
},
|
|
985
|
+
headers={
|
|
986
|
+
"content-type": "application/json",
|
|
987
|
+
},
|
|
988
|
+
request_options=request_options,
|
|
989
|
+
omit=OMIT,
|
|
990
|
+
)
|
|
991
|
+
try:
|
|
992
|
+
if 200 <= _response.status_code < 300:
|
|
993
|
+
_data = typing.cast(
|
|
994
|
+
CreateBatchOrderResponse,
|
|
995
|
+
construct_type(
|
|
996
|
+
type_=CreateBatchOrderResponse, # type: ignore
|
|
997
|
+
object_=_response.json(),
|
|
998
|
+
),
|
|
999
|
+
)
|
|
1000
|
+
return HttpResponse(response=_response, data=_data)
|
|
1001
|
+
if _response.status_code == 400:
|
|
1002
|
+
raise BadRequestError(
|
|
1003
|
+
headers=dict(_response.headers),
|
|
1004
|
+
body=typing.cast(
|
|
1005
|
+
typing.Any,
|
|
1006
|
+
construct_type(
|
|
1007
|
+
type_=typing.Any, # type: ignore
|
|
1008
|
+
object_=_response.json(),
|
|
1009
|
+
),
|
|
1010
|
+
),
|
|
1011
|
+
)
|
|
1012
|
+
_response_json = _response.json()
|
|
1013
|
+
except JSONDecodeError:
|
|
1014
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1015
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1016
|
+
|
|
1017
|
+
def get_products(
|
|
1018
|
+
self,
|
|
1019
|
+
*,
|
|
1020
|
+
limit: typing.Optional[int] = None,
|
|
1021
|
+
offset: typing.Optional[int] = None,
|
|
1022
|
+
sort: typing.Optional[GetProductsRequestSort] = None,
|
|
1023
|
+
ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
1024
|
+
name: typing.Optional[str] = None,
|
|
1025
|
+
price_lte: typing.Optional[float] = None,
|
|
1026
|
+
price_gte: typing.Optional[float] = None,
|
|
1027
|
+
price_lt: typing.Optional[float] = None,
|
|
1028
|
+
price_gt: typing.Optional[float] = None,
|
|
1029
|
+
price_eq: typing.Optional[float] = None,
|
|
1030
|
+
price_ne: typing.Optional[float] = None,
|
|
1031
|
+
categories: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
1032
|
+
modified_since: typing.Optional[str] = None,
|
|
1033
|
+
created_since: typing.Optional[str] = None,
|
|
1034
|
+
is_deleted: typing.Optional[str] = None,
|
|
1035
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1036
|
+
) -> HttpResponse[GetProductsResponse]:
|
|
1037
|
+
"""
|
|
1038
|
+
Parameters
|
|
1039
|
+
----------
|
|
1040
|
+
limit : typing.Optional[int]
|
|
1041
|
+
Number of documents per page
|
|
1042
|
+
|
|
1043
|
+
offset : typing.Optional[int]
|
|
1044
|
+
Index of the first document in the page
|
|
1045
|
+
|
|
1046
|
+
sort : typing.Optional[GetProductsRequestSort]
|
|
1047
|
+
Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
|
|
1048
|
+
|
|
1049
|
+
ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
1050
|
+
Filter by product ids
|
|
1051
|
+
|
|
1052
|
+
name : typing.Optional[str]
|
|
1053
|
+
Filter by product name, minimum 3 characters should be present for search.
|
|
1054
|
+
|
|
1055
|
+
price_lte : typing.Optional[float]
|
|
1056
|
+
Price filter for products less than and equals to particular amount
|
|
1057
|
+
|
|
1058
|
+
price_gte : typing.Optional[float]
|
|
1059
|
+
Price filter for products greater than and equals to particular amount
|
|
1060
|
+
|
|
1061
|
+
price_lt : typing.Optional[float]
|
|
1062
|
+
Price filter for products less than particular amount
|
|
1063
|
+
|
|
1064
|
+
price_gt : typing.Optional[float]
|
|
1065
|
+
Price filter for products greater than particular amount
|
|
1066
|
+
|
|
1067
|
+
price_eq : typing.Optional[float]
|
|
1068
|
+
Price filter for products equals to particular amount
|
|
1069
|
+
|
|
1070
|
+
price_ne : typing.Optional[float]
|
|
1071
|
+
Price filter for products not equals to particular amount
|
|
1072
|
+
|
|
1073
|
+
categories : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
1074
|
+
Filter by categories ids
|
|
1075
|
+
|
|
1076
|
+
modified_since : typing.Optional[str]
|
|
1077
|
+
Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
|
|
1078
|
+
|
|
1079
|
+
created_since : typing.Optional[str]
|
|
1080
|
+
Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
|
|
1081
|
+
|
|
1082
|
+
is_deleted : typing.Optional[str]
|
|
1083
|
+
Filter products by their deletion status. If `false` is passed, only products that are not deleted will be returned.
|
|
1084
|
+
|
|
1085
|
+
request_options : typing.Optional[RequestOptions]
|
|
1086
|
+
Request-specific configuration.
|
|
1087
|
+
|
|
1088
|
+
Returns
|
|
1089
|
+
-------
|
|
1090
|
+
HttpResponse[GetProductsResponse]
|
|
1091
|
+
All products listed
|
|
1092
|
+
"""
|
|
1093
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
1094
|
+
"products",
|
|
1095
|
+
method="GET",
|
|
1096
|
+
params={
|
|
1097
|
+
"limit": limit,
|
|
1098
|
+
"offset": offset,
|
|
1099
|
+
"sort": sort,
|
|
1100
|
+
"ids": ids,
|
|
1101
|
+
"name": name,
|
|
1102
|
+
"price[lte]": price_lte,
|
|
1103
|
+
"price[gte]": price_gte,
|
|
1104
|
+
"price[lt]": price_lt,
|
|
1105
|
+
"price[gt]": price_gt,
|
|
1106
|
+
"price[eq]": price_eq,
|
|
1107
|
+
"price[ne]": price_ne,
|
|
1108
|
+
"categories": categories,
|
|
1109
|
+
"modifiedSince": modified_since,
|
|
1110
|
+
"createdSince": created_since,
|
|
1111
|
+
"isDeleted": is_deleted,
|
|
1112
|
+
},
|
|
1113
|
+
request_options=request_options,
|
|
1114
|
+
)
|
|
1115
|
+
try:
|
|
1116
|
+
if 200 <= _response.status_code < 300:
|
|
1117
|
+
_data = typing.cast(
|
|
1118
|
+
GetProductsResponse,
|
|
1119
|
+
construct_type(
|
|
1120
|
+
type_=GetProductsResponse, # type: ignore
|
|
1121
|
+
object_=_response.json(),
|
|
1122
|
+
),
|
|
1123
|
+
)
|
|
1124
|
+
return HttpResponse(response=_response, data=_data)
|
|
1125
|
+
if _response.status_code == 400:
|
|
1126
|
+
raise BadRequestError(
|
|
1127
|
+
headers=dict(_response.headers),
|
|
1128
|
+
body=typing.cast(
|
|
1129
|
+
typing.Any,
|
|
1130
|
+
construct_type(
|
|
1131
|
+
type_=typing.Any, # type: ignore
|
|
1132
|
+
object_=_response.json(),
|
|
1133
|
+
),
|
|
1134
|
+
),
|
|
1135
|
+
)
|
|
1136
|
+
_response_json = _response.json()
|
|
1137
|
+
except JSONDecodeError:
|
|
1138
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1139
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1140
|
+
|
|
1141
|
+
def create_update_product(
|
|
1142
|
+
self,
|
|
1143
|
+
*,
|
|
1144
|
+
id: str,
|
|
1145
|
+
name: str,
|
|
1146
|
+
categories: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
1147
|
+
deleted_at: typing.Optional[str] = OMIT,
|
|
1148
|
+
image_url: typing.Optional[str] = OMIT,
|
|
1149
|
+
is_deleted: typing.Optional[bool] = OMIT,
|
|
1150
|
+
meta_info: typing.Optional[typing.Dict[str, CreateUpdateProductRequestMetaInfoValue]] = OMIT,
|
|
1151
|
+
parent_id: typing.Optional[str] = OMIT,
|
|
1152
|
+
price: typing.Optional[float] = OMIT,
|
|
1153
|
+
sku: typing.Optional[str] = OMIT,
|
|
1154
|
+
stock: typing.Optional[float] = OMIT,
|
|
1155
|
+
update_enabled: typing.Optional[bool] = OMIT,
|
|
1156
|
+
url: typing.Optional[str] = OMIT,
|
|
1157
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1158
|
+
) -> HttpResponse[CreateUpdateProductResponse]:
|
|
1159
|
+
"""
|
|
1160
|
+
Parameters
|
|
1161
|
+
----------
|
|
1162
|
+
id : str
|
|
1163
|
+
Product ID for which you requested the details
|
|
1164
|
+
|
|
1165
|
+
name : str
|
|
1166
|
+
Mandatory in case of creation**. Name of the product for which you requested the details
|
|
1167
|
+
|
|
1168
|
+
categories : typing.Optional[typing.Sequence[str]]
|
|
1169
|
+
Category ID-s of the product
|
|
1170
|
+
|
|
1171
|
+
deleted_at : typing.Optional[str]
|
|
1172
|
+
UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the product deleted from the shop's database
|
|
1173
|
+
|
|
1174
|
+
image_url : typing.Optional[str]
|
|
1175
|
+
Absolute URL to the cover image of the product
|
|
1176
|
+
|
|
1177
|
+
is_deleted : typing.Optional[bool]
|
|
1178
|
+
product deleted from the shop's database
|
|
1179
|
+
|
|
1180
|
+
meta_info : typing.Optional[typing.Dict[str, CreateUpdateProductRequestMetaInfoValue]]
|
|
1181
|
+
Meta data of product such as description, vendor, producer, stock level. The size of cumulative metaInfo shall not exceed **1000 KB**. Maximum length of metaInfo object can be 20.
|
|
1182
|
+
|
|
1183
|
+
parent_id : typing.Optional[str]
|
|
1184
|
+
Parent product id of the product
|
|
1185
|
+
|
|
1186
|
+
price : typing.Optional[float]
|
|
1187
|
+
Price of the product
|
|
1188
|
+
|
|
1189
|
+
sku : typing.Optional[str]
|
|
1190
|
+
Product identifier from the shop
|
|
1191
|
+
|
|
1192
|
+
stock : typing.Optional[float]
|
|
1193
|
+
Current stock value of the product from the shop's database
|
|
1194
|
+
|
|
1195
|
+
update_enabled : typing.Optional[bool]
|
|
1196
|
+
Facilitate to update the existing category in the same request (updateEnabled = true)
|
|
1197
|
+
|
|
1198
|
+
url : typing.Optional[str]
|
|
1199
|
+
URL to the product
|
|
1200
|
+
|
|
1201
|
+
request_options : typing.Optional[RequestOptions]
|
|
1202
|
+
Request-specific configuration.
|
|
1203
|
+
|
|
1204
|
+
Returns
|
|
1205
|
+
-------
|
|
1206
|
+
HttpResponse[CreateUpdateProductResponse]
|
|
1207
|
+
Product created
|
|
1208
|
+
"""
|
|
1209
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
1210
|
+
"products",
|
|
1211
|
+
method="POST",
|
|
1212
|
+
json={
|
|
1213
|
+
"categories": categories,
|
|
1214
|
+
"deletedAt": deleted_at,
|
|
1215
|
+
"id": id,
|
|
1216
|
+
"imageUrl": image_url,
|
|
1217
|
+
"isDeleted": is_deleted,
|
|
1218
|
+
"metaInfo": convert_and_respect_annotation_metadata(
|
|
1219
|
+
object_=meta_info,
|
|
1220
|
+
annotation=typing.Dict[str, CreateUpdateProductRequestMetaInfoValue],
|
|
1221
|
+
direction="write",
|
|
1222
|
+
),
|
|
1223
|
+
"name": name,
|
|
1224
|
+
"parentId": parent_id,
|
|
1225
|
+
"price": price,
|
|
1226
|
+
"sku": sku,
|
|
1227
|
+
"stock": stock,
|
|
1228
|
+
"updateEnabled": update_enabled,
|
|
1229
|
+
"url": url,
|
|
1230
|
+
},
|
|
1231
|
+
headers={
|
|
1232
|
+
"content-type": "application/json",
|
|
1233
|
+
},
|
|
1234
|
+
request_options=request_options,
|
|
1235
|
+
omit=OMIT,
|
|
1236
|
+
)
|
|
1237
|
+
try:
|
|
1238
|
+
if 200 <= _response.status_code < 300:
|
|
1239
|
+
_data = typing.cast(
|
|
1240
|
+
CreateUpdateProductResponse,
|
|
1241
|
+
construct_type(
|
|
1242
|
+
type_=CreateUpdateProductResponse, # type: ignore
|
|
1243
|
+
object_=_response.json(),
|
|
1244
|
+
),
|
|
1245
|
+
)
|
|
1246
|
+
return HttpResponse(response=_response, data=_data)
|
|
1247
|
+
if _response.status_code == 400:
|
|
1248
|
+
raise BadRequestError(
|
|
1249
|
+
headers=dict(_response.headers),
|
|
1250
|
+
body=typing.cast(
|
|
1251
|
+
typing.Any,
|
|
1252
|
+
construct_type(
|
|
1253
|
+
type_=typing.Any, # type: ignore
|
|
1254
|
+
object_=_response.json(),
|
|
1255
|
+
),
|
|
1256
|
+
),
|
|
1257
|
+
)
|
|
1258
|
+
_response_json = _response.json()
|
|
1259
|
+
except JSONDecodeError:
|
|
1260
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1261
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1262
|
+
|
|
1263
|
+
def create_update_batch_products(
|
|
1264
|
+
self,
|
|
1265
|
+
*,
|
|
1266
|
+
products: typing.Sequence[CreateUpdateBatchProductsRequestProductsItem],
|
|
1267
|
+
update_enabled: typing.Optional[bool] = OMIT,
|
|
1268
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1269
|
+
) -> HttpResponse[CreateUpdateBatchProductsResponse]:
|
|
1270
|
+
"""
|
|
1271
|
+
Parameters
|
|
1272
|
+
----------
|
|
1273
|
+
products : typing.Sequence[CreateUpdateBatchProductsRequestProductsItem]
|
|
1274
|
+
array of products objects
|
|
1275
|
+
|
|
1276
|
+
update_enabled : typing.Optional[bool]
|
|
1277
|
+
Facilitate to update the existing categories in the same request (updateEnabled = true)
|
|
1278
|
+
|
|
1279
|
+
request_options : typing.Optional[RequestOptions]
|
|
1280
|
+
Request-specific configuration.
|
|
1281
|
+
|
|
1282
|
+
Returns
|
|
1283
|
+
-------
|
|
1284
|
+
HttpResponse[CreateUpdateBatchProductsResponse]
|
|
1285
|
+
Products created and updated
|
|
1286
|
+
"""
|
|
1287
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
1288
|
+
"products/batch",
|
|
1289
|
+
method="POST",
|
|
1290
|
+
json={
|
|
1291
|
+
"products": convert_and_respect_annotation_metadata(
|
|
1292
|
+
object_=products,
|
|
1293
|
+
annotation=typing.Sequence[CreateUpdateBatchProductsRequestProductsItem],
|
|
1294
|
+
direction="write",
|
|
1295
|
+
),
|
|
1296
|
+
"updateEnabled": update_enabled,
|
|
1297
|
+
},
|
|
1298
|
+
headers={
|
|
1299
|
+
"content-type": "application/json",
|
|
1300
|
+
},
|
|
1301
|
+
request_options=request_options,
|
|
1302
|
+
omit=OMIT,
|
|
1303
|
+
)
|
|
1304
|
+
try:
|
|
1305
|
+
if 200 <= _response.status_code < 300:
|
|
1306
|
+
_data = typing.cast(
|
|
1307
|
+
CreateUpdateBatchProductsResponse,
|
|
1308
|
+
construct_type(
|
|
1309
|
+
type_=CreateUpdateBatchProductsResponse, # type: ignore
|
|
1310
|
+
object_=_response.json(),
|
|
1311
|
+
),
|
|
1312
|
+
)
|
|
1313
|
+
return HttpResponse(response=_response, data=_data)
|
|
1314
|
+
if _response.status_code == 400:
|
|
1315
|
+
raise BadRequestError(
|
|
1316
|
+
headers=dict(_response.headers),
|
|
1317
|
+
body=typing.cast(
|
|
1318
|
+
typing.Any,
|
|
1319
|
+
construct_type(
|
|
1320
|
+
type_=typing.Any, # type: ignore
|
|
1321
|
+
object_=_response.json(),
|
|
1322
|
+
),
|
|
1323
|
+
),
|
|
1324
|
+
)
|
|
1325
|
+
_response_json = _response.json()
|
|
1326
|
+
except JSONDecodeError:
|
|
1327
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1328
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1329
|
+
|
|
1330
|
+
def get_product_info(
|
|
1331
|
+
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
1332
|
+
) -> HttpResponse[GetProductDetails]:
|
|
1333
|
+
"""
|
|
1334
|
+
Parameters
|
|
1335
|
+
----------
|
|
1336
|
+
id : str
|
|
1337
|
+
Product ID
|
|
1338
|
+
|
|
1339
|
+
request_options : typing.Optional[RequestOptions]
|
|
1340
|
+
Request-specific configuration.
|
|
1341
|
+
|
|
1342
|
+
Returns
|
|
1343
|
+
-------
|
|
1344
|
+
HttpResponse[GetProductDetails]
|
|
1345
|
+
Product informations
|
|
1346
|
+
"""
|
|
1347
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
1348
|
+
f"products/{jsonable_encoder(id)}",
|
|
1349
|
+
method="GET",
|
|
1350
|
+
request_options=request_options,
|
|
1351
|
+
)
|
|
1352
|
+
try:
|
|
1353
|
+
if 200 <= _response.status_code < 300:
|
|
1354
|
+
_data = typing.cast(
|
|
1355
|
+
GetProductDetails,
|
|
1356
|
+
construct_type(
|
|
1357
|
+
type_=GetProductDetails, # type: ignore
|
|
1358
|
+
object_=_response.json(),
|
|
1359
|
+
),
|
|
1360
|
+
)
|
|
1361
|
+
return HttpResponse(response=_response, data=_data)
|
|
1362
|
+
if _response.status_code == 400:
|
|
1363
|
+
raise BadRequestError(
|
|
1364
|
+
headers=dict(_response.headers),
|
|
1365
|
+
body=typing.cast(
|
|
1366
|
+
typing.Any,
|
|
1367
|
+
construct_type(
|
|
1368
|
+
type_=typing.Any, # type: ignore
|
|
1369
|
+
object_=_response.json(),
|
|
1370
|
+
),
|
|
1371
|
+
),
|
|
1372
|
+
)
|
|
1373
|
+
if _response.status_code == 404:
|
|
1374
|
+
raise NotFoundError(
|
|
1375
|
+
headers=dict(_response.headers),
|
|
1376
|
+
body=typing.cast(
|
|
1377
|
+
typing.Any,
|
|
1378
|
+
construct_type(
|
|
1379
|
+
type_=typing.Any, # type: ignore
|
|
1380
|
+
object_=_response.json(),
|
|
1381
|
+
),
|
|
1382
|
+
),
|
|
1383
|
+
)
|
|
1384
|
+
_response_json = _response.json()
|
|
1385
|
+
except JSONDecodeError:
|
|
1386
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1387
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1388
|
+
|
|
1389
|
+
def create_product_alert(
|
|
1390
|
+
self,
|
|
1391
|
+
id: str,
|
|
1392
|
+
*,
|
|
1393
|
+
contact_identifiers: typing.Optional[CreateProductAlertRequestContactIdentifiers] = OMIT,
|
|
1394
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1395
|
+
) -> HttpResponse[None]:
|
|
1396
|
+
"""
|
|
1397
|
+
Parameters
|
|
1398
|
+
----------
|
|
1399
|
+
id : str
|
|
1400
|
+
Product ID
|
|
1401
|
+
|
|
1402
|
+
contact_identifiers : typing.Optional[CreateProductAlertRequestContactIdentifiers]
|
|
1403
|
+
|
|
1404
|
+
request_options : typing.Optional[RequestOptions]
|
|
1405
|
+
Request-specific configuration.
|
|
1406
|
+
|
|
1407
|
+
Returns
|
|
1408
|
+
-------
|
|
1409
|
+
HttpResponse[None]
|
|
1410
|
+
"""
|
|
1411
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
1412
|
+
f"products/{jsonable_encoder(id)}/alerts/back_in_stock",
|
|
1413
|
+
method="POST",
|
|
1414
|
+
json={
|
|
1415
|
+
"contactIdentifiers": convert_and_respect_annotation_metadata(
|
|
1416
|
+
object_=contact_identifiers,
|
|
1417
|
+
annotation=CreateProductAlertRequestContactIdentifiers,
|
|
1418
|
+
direction="write",
|
|
1419
|
+
),
|
|
1420
|
+
},
|
|
1421
|
+
headers={
|
|
1422
|
+
"content-type": "application/json",
|
|
1423
|
+
},
|
|
1424
|
+
request_options=request_options,
|
|
1425
|
+
omit=OMIT,
|
|
1426
|
+
)
|
|
1427
|
+
try:
|
|
1428
|
+
if 200 <= _response.status_code < 300:
|
|
1429
|
+
return HttpResponse(response=_response, data=None)
|
|
1430
|
+
if _response.status_code == 400:
|
|
1431
|
+
raise BadRequestError(
|
|
1432
|
+
headers=dict(_response.headers),
|
|
1433
|
+
body=typing.cast(
|
|
1434
|
+
typing.Any,
|
|
1435
|
+
construct_type(
|
|
1436
|
+
type_=typing.Any, # type: ignore
|
|
1437
|
+
object_=_response.json(),
|
|
1438
|
+
),
|
|
1439
|
+
),
|
|
1440
|
+
)
|
|
1441
|
+
if _response.status_code == 401:
|
|
1442
|
+
raise UnauthorizedError(
|
|
1443
|
+
headers=dict(_response.headers),
|
|
1444
|
+
body=typing.cast(
|
|
1445
|
+
typing.Any,
|
|
1446
|
+
construct_type(
|
|
1447
|
+
type_=typing.Any, # type: ignore
|
|
1448
|
+
object_=_response.json(),
|
|
1449
|
+
),
|
|
1450
|
+
),
|
|
1451
|
+
)
|
|
1452
|
+
if _response.status_code == 403:
|
|
1453
|
+
raise ForbiddenError(
|
|
1454
|
+
headers=dict(_response.headers),
|
|
1455
|
+
body=typing.cast(
|
|
1456
|
+
typing.Any,
|
|
1457
|
+
construct_type(
|
|
1458
|
+
type_=typing.Any, # type: ignore
|
|
1459
|
+
object_=_response.json(),
|
|
1460
|
+
),
|
|
1461
|
+
),
|
|
1462
|
+
)
|
|
1463
|
+
if _response.status_code == 404:
|
|
1464
|
+
raise NotFoundError(
|
|
1465
|
+
headers=dict(_response.headers),
|
|
1466
|
+
body=typing.cast(
|
|
1467
|
+
typing.Any,
|
|
1468
|
+
construct_type(
|
|
1469
|
+
type_=typing.Any, # type: ignore
|
|
1470
|
+
object_=_response.json(),
|
|
1471
|
+
),
|
|
1472
|
+
),
|
|
1473
|
+
)
|
|
1474
|
+
_response_json = _response.json()
|
|
1475
|
+
except JSONDecodeError:
|
|
1476
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1477
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1478
|
+
|
|
1479
|
+
|
|
1480
|
+
class AsyncRawEcommerceClient:
|
|
1481
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
1482
|
+
self._client_wrapper = client_wrapper
|
|
1483
|
+
|
|
1484
|
+
async def get_categories(
|
|
1485
|
+
self,
|
|
1486
|
+
*,
|
|
1487
|
+
limit: typing.Optional[int] = None,
|
|
1488
|
+
offset: typing.Optional[int] = None,
|
|
1489
|
+
sort: typing.Optional[GetCategoriesRequestSort] = None,
|
|
1490
|
+
ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
1491
|
+
name: typing.Optional[str] = None,
|
|
1492
|
+
modified_since: typing.Optional[str] = None,
|
|
1493
|
+
created_since: typing.Optional[str] = None,
|
|
1494
|
+
is_deleted: typing.Optional[str] = None,
|
|
1495
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1496
|
+
) -> AsyncHttpResponse[GetCategoriesResponse]:
|
|
1497
|
+
"""
|
|
1498
|
+
Parameters
|
|
1499
|
+
----------
|
|
1500
|
+
limit : typing.Optional[int]
|
|
1501
|
+
Number of documents per page
|
|
1502
|
+
|
|
1503
|
+
offset : typing.Optional[int]
|
|
1504
|
+
Index of the first document in the page
|
|
1505
|
+
|
|
1506
|
+
sort : typing.Optional[GetCategoriesRequestSort]
|
|
1507
|
+
Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
|
|
1508
|
+
|
|
1509
|
+
ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
1510
|
+
Filter by category ids
|
|
1511
|
+
|
|
1512
|
+
name : typing.Optional[str]
|
|
1513
|
+
Filter by category name
|
|
1514
|
+
|
|
1515
|
+
modified_since : typing.Optional[str]
|
|
1516
|
+
Filter (urlencoded) the categories modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
|
|
1517
|
+
|
|
1518
|
+
created_since : typing.Optional[str]
|
|
1519
|
+
Filter (urlencoded) the categories created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
|
|
1520
|
+
|
|
1521
|
+
is_deleted : typing.Optional[str]
|
|
1522
|
+
Filter categories by their deletion status. If `false` is passed, only categories that are not deleted will be returned.
|
|
1523
|
+
|
|
1524
|
+
request_options : typing.Optional[RequestOptions]
|
|
1525
|
+
Request-specific configuration.
|
|
1526
|
+
|
|
1527
|
+
Returns
|
|
1528
|
+
-------
|
|
1529
|
+
AsyncHttpResponse[GetCategoriesResponse]
|
|
1530
|
+
All categories listed
|
|
1531
|
+
"""
|
|
1532
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1533
|
+
"categories",
|
|
1534
|
+
method="GET",
|
|
1535
|
+
params={
|
|
1536
|
+
"limit": limit,
|
|
1537
|
+
"offset": offset,
|
|
1538
|
+
"sort": sort,
|
|
1539
|
+
"ids": ids,
|
|
1540
|
+
"name": name,
|
|
1541
|
+
"modifiedSince": modified_since,
|
|
1542
|
+
"createdSince": created_since,
|
|
1543
|
+
"isDeleted": is_deleted,
|
|
1544
|
+
},
|
|
1545
|
+
request_options=request_options,
|
|
1546
|
+
)
|
|
1547
|
+
try:
|
|
1548
|
+
if 200 <= _response.status_code < 300:
|
|
1549
|
+
_data = typing.cast(
|
|
1550
|
+
GetCategoriesResponse,
|
|
1551
|
+
construct_type(
|
|
1552
|
+
type_=GetCategoriesResponse, # type: ignore
|
|
1553
|
+
object_=_response.json(),
|
|
1554
|
+
),
|
|
1555
|
+
)
|
|
1556
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
1557
|
+
if _response.status_code == 400:
|
|
1558
|
+
raise BadRequestError(
|
|
1559
|
+
headers=dict(_response.headers),
|
|
1560
|
+
body=typing.cast(
|
|
1561
|
+
typing.Any,
|
|
1562
|
+
construct_type(
|
|
1563
|
+
type_=typing.Any, # type: ignore
|
|
1564
|
+
object_=_response.json(),
|
|
1565
|
+
),
|
|
1566
|
+
),
|
|
1567
|
+
)
|
|
1568
|
+
_response_json = _response.json()
|
|
1569
|
+
except JSONDecodeError:
|
|
1570
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1571
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1572
|
+
|
|
1573
|
+
async def create_update_category(
|
|
1574
|
+
self,
|
|
1575
|
+
*,
|
|
1576
|
+
id: str,
|
|
1577
|
+
deleted_at: typing.Optional[str] = OMIT,
|
|
1578
|
+
is_deleted: typing.Optional[bool] = OMIT,
|
|
1579
|
+
name: typing.Optional[str] = OMIT,
|
|
1580
|
+
update_enabled: typing.Optional[bool] = OMIT,
|
|
1581
|
+
url: typing.Optional[str] = OMIT,
|
|
1582
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1583
|
+
) -> AsyncHttpResponse[CreateUpdateCategoryResponse]:
|
|
1584
|
+
"""
|
|
1585
|
+
Parameters
|
|
1586
|
+
----------
|
|
1587
|
+
id : str
|
|
1588
|
+
Unique Category ID as saved in the shop
|
|
1589
|
+
|
|
1590
|
+
deleted_at : typing.Optional[str]
|
|
1591
|
+
UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the category deleted from the shop's database
|
|
1592
|
+
|
|
1593
|
+
is_deleted : typing.Optional[bool]
|
|
1594
|
+
category deleted from the shop's database
|
|
1595
|
+
|
|
1596
|
+
name : typing.Optional[str]
|
|
1597
|
+
**Mandatory in case of creation**. Name of the Category, as displayed in the shop
|
|
1598
|
+
|
|
1599
|
+
update_enabled : typing.Optional[bool]
|
|
1600
|
+
Facilitate to update the existing category in the same request (updateEnabled = true)
|
|
1601
|
+
|
|
1602
|
+
url : typing.Optional[str]
|
|
1603
|
+
URL to the category
|
|
1604
|
+
|
|
1605
|
+
request_options : typing.Optional[RequestOptions]
|
|
1606
|
+
Request-specific configuration.
|
|
1607
|
+
|
|
1608
|
+
Returns
|
|
1609
|
+
-------
|
|
1610
|
+
AsyncHttpResponse[CreateUpdateCategoryResponse]
|
|
1611
|
+
Category created
|
|
1612
|
+
"""
|
|
1613
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1614
|
+
"categories",
|
|
1615
|
+
method="POST",
|
|
1616
|
+
json={
|
|
1617
|
+
"deletedAt": deleted_at,
|
|
1618
|
+
"id": id,
|
|
1619
|
+
"isDeleted": is_deleted,
|
|
1620
|
+
"name": name,
|
|
1621
|
+
"updateEnabled": update_enabled,
|
|
1622
|
+
"url": url,
|
|
1623
|
+
},
|
|
1624
|
+
headers={
|
|
1625
|
+
"content-type": "application/json",
|
|
1626
|
+
},
|
|
1627
|
+
request_options=request_options,
|
|
1628
|
+
omit=OMIT,
|
|
1629
|
+
)
|
|
1630
|
+
try:
|
|
1631
|
+
if 200 <= _response.status_code < 300:
|
|
1632
|
+
_data = typing.cast(
|
|
1633
|
+
CreateUpdateCategoryResponse,
|
|
1634
|
+
construct_type(
|
|
1635
|
+
type_=CreateUpdateCategoryResponse, # type: ignore
|
|
1636
|
+
object_=_response.json(),
|
|
1637
|
+
),
|
|
1638
|
+
)
|
|
1639
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
1640
|
+
if _response.status_code == 400:
|
|
1641
|
+
raise BadRequestError(
|
|
1642
|
+
headers=dict(_response.headers),
|
|
1643
|
+
body=typing.cast(
|
|
1644
|
+
typing.Any,
|
|
1645
|
+
construct_type(
|
|
1646
|
+
type_=typing.Any, # type: ignore
|
|
1647
|
+
object_=_response.json(),
|
|
1648
|
+
),
|
|
1649
|
+
),
|
|
1650
|
+
)
|
|
1651
|
+
_response_json = _response.json()
|
|
1652
|
+
except JSONDecodeError:
|
|
1653
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1654
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1655
|
+
|
|
1656
|
+
async def create_update_batch_category(
|
|
1657
|
+
self,
|
|
1658
|
+
*,
|
|
1659
|
+
categories: typing.Sequence[CreateUpdateBatchCategoryRequestCategoriesItem],
|
|
1660
|
+
update_enabled: typing.Optional[bool] = OMIT,
|
|
1661
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1662
|
+
) -> AsyncHttpResponse[CreateUpdateBatchCategoryResponse]:
|
|
1663
|
+
"""
|
|
1664
|
+
Parameters
|
|
1665
|
+
----------
|
|
1666
|
+
categories : typing.Sequence[CreateUpdateBatchCategoryRequestCategoriesItem]
|
|
1667
|
+
array of categories objects
|
|
1668
|
+
|
|
1669
|
+
update_enabled : typing.Optional[bool]
|
|
1670
|
+
Facilitate to update the existing categories in the same request (updateEnabled = true)
|
|
1671
|
+
|
|
1672
|
+
request_options : typing.Optional[RequestOptions]
|
|
1673
|
+
Request-specific configuration.
|
|
1674
|
+
|
|
1675
|
+
Returns
|
|
1676
|
+
-------
|
|
1677
|
+
AsyncHttpResponse[CreateUpdateBatchCategoryResponse]
|
|
1678
|
+
Category created and updated
|
|
1679
|
+
"""
|
|
1680
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1681
|
+
"categories/batch",
|
|
1682
|
+
method="POST",
|
|
1683
|
+
json={
|
|
1684
|
+
"categories": convert_and_respect_annotation_metadata(
|
|
1685
|
+
object_=categories,
|
|
1686
|
+
annotation=typing.Sequence[CreateUpdateBatchCategoryRequestCategoriesItem],
|
|
1687
|
+
direction="write",
|
|
1688
|
+
),
|
|
1689
|
+
"updateEnabled": update_enabled,
|
|
1690
|
+
},
|
|
1691
|
+
headers={
|
|
1692
|
+
"content-type": "application/json",
|
|
1693
|
+
},
|
|
1694
|
+
request_options=request_options,
|
|
1695
|
+
omit=OMIT,
|
|
1696
|
+
)
|
|
1697
|
+
try:
|
|
1698
|
+
if 200 <= _response.status_code < 300:
|
|
1699
|
+
_data = typing.cast(
|
|
1700
|
+
CreateUpdateBatchCategoryResponse,
|
|
1701
|
+
construct_type(
|
|
1702
|
+
type_=CreateUpdateBatchCategoryResponse, # type: ignore
|
|
1703
|
+
object_=_response.json(),
|
|
1704
|
+
),
|
|
1705
|
+
)
|
|
1706
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
1707
|
+
if _response.status_code == 400:
|
|
1708
|
+
raise BadRequestError(
|
|
1709
|
+
headers=dict(_response.headers),
|
|
1710
|
+
body=typing.cast(
|
|
1711
|
+
typing.Any,
|
|
1712
|
+
construct_type(
|
|
1713
|
+
type_=typing.Any, # type: ignore
|
|
1714
|
+
object_=_response.json(),
|
|
1715
|
+
),
|
|
1716
|
+
),
|
|
1717
|
+
)
|
|
1718
|
+
_response_json = _response.json()
|
|
1719
|
+
except JSONDecodeError:
|
|
1720
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1721
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1722
|
+
|
|
1723
|
+
async def get_category_info(
|
|
1724
|
+
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
1725
|
+
) -> AsyncHttpResponse[GetCategoryDetails]:
|
|
1726
|
+
"""
|
|
1727
|
+
Parameters
|
|
1728
|
+
----------
|
|
1729
|
+
id : str
|
|
1730
|
+
Category ID
|
|
1731
|
+
|
|
1732
|
+
request_options : typing.Optional[RequestOptions]
|
|
1733
|
+
Request-specific configuration.
|
|
1734
|
+
|
|
1735
|
+
Returns
|
|
1736
|
+
-------
|
|
1737
|
+
AsyncHttpResponse[GetCategoryDetails]
|
|
1738
|
+
Category informations
|
|
1739
|
+
"""
|
|
1740
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1741
|
+
f"categories/{jsonable_encoder(id)}",
|
|
1742
|
+
method="GET",
|
|
1743
|
+
request_options=request_options,
|
|
1744
|
+
)
|
|
1745
|
+
try:
|
|
1746
|
+
if 200 <= _response.status_code < 300:
|
|
1747
|
+
_data = typing.cast(
|
|
1748
|
+
GetCategoryDetails,
|
|
1749
|
+
construct_type(
|
|
1750
|
+
type_=GetCategoryDetails, # type: ignore
|
|
1751
|
+
object_=_response.json(),
|
|
1752
|
+
),
|
|
1753
|
+
)
|
|
1754
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
1755
|
+
if _response.status_code == 400:
|
|
1756
|
+
raise BadRequestError(
|
|
1757
|
+
headers=dict(_response.headers),
|
|
1758
|
+
body=typing.cast(
|
|
1759
|
+
typing.Any,
|
|
1760
|
+
construct_type(
|
|
1761
|
+
type_=typing.Any, # type: ignore
|
|
1762
|
+
object_=_response.json(),
|
|
1763
|
+
),
|
|
1764
|
+
),
|
|
1765
|
+
)
|
|
1766
|
+
if _response.status_code == 404:
|
|
1767
|
+
raise NotFoundError(
|
|
1768
|
+
headers=dict(_response.headers),
|
|
1769
|
+
body=typing.cast(
|
|
1770
|
+
typing.Any,
|
|
1771
|
+
construct_type(
|
|
1772
|
+
type_=typing.Any, # type: ignore
|
|
1773
|
+
object_=_response.json(),
|
|
1774
|
+
),
|
|
1775
|
+
),
|
|
1776
|
+
)
|
|
1777
|
+
_response_json = _response.json()
|
|
1778
|
+
except JSONDecodeError:
|
|
1779
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1780
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1781
|
+
|
|
1782
|
+
async def activate_the_e_commerce_app(
|
|
1783
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
1784
|
+
) -> AsyncHttpResponse[None]:
|
|
1785
|
+
"""
|
|
1786
|
+
Getting access to Brevo eCommerce.
|
|
1787
|
+
|
|
1788
|
+
Parameters
|
|
1789
|
+
----------
|
|
1790
|
+
request_options : typing.Optional[RequestOptions]
|
|
1791
|
+
Request-specific configuration.
|
|
1792
|
+
|
|
1793
|
+
Returns
|
|
1794
|
+
-------
|
|
1795
|
+
AsyncHttpResponse[None]
|
|
1796
|
+
"""
|
|
1797
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1798
|
+
"ecommerce/activate",
|
|
1799
|
+
method="POST",
|
|
1800
|
+
request_options=request_options,
|
|
1801
|
+
)
|
|
1802
|
+
try:
|
|
1803
|
+
if 200 <= _response.status_code < 300:
|
|
1804
|
+
return AsyncHttpResponse(response=_response, data=None)
|
|
1805
|
+
if _response.status_code == 401:
|
|
1806
|
+
raise UnauthorizedError(
|
|
1807
|
+
headers=dict(_response.headers),
|
|
1808
|
+
body=typing.cast(
|
|
1809
|
+
typing.Any,
|
|
1810
|
+
construct_type(
|
|
1811
|
+
type_=typing.Any, # type: ignore
|
|
1812
|
+
object_=_response.json(),
|
|
1813
|
+
),
|
|
1814
|
+
),
|
|
1815
|
+
)
|
|
1816
|
+
if _response.status_code == 404:
|
|
1817
|
+
raise NotFoundError(
|
|
1818
|
+
headers=dict(_response.headers),
|
|
1819
|
+
body=typing.cast(
|
|
1820
|
+
typing.Any,
|
|
1821
|
+
construct_type(
|
|
1822
|
+
type_=typing.Any, # type: ignore
|
|
1823
|
+
object_=_response.json(),
|
|
1824
|
+
),
|
|
1825
|
+
),
|
|
1826
|
+
)
|
|
1827
|
+
_response_json = _response.json()
|
|
1828
|
+
except JSONDecodeError:
|
|
1829
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1830
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1831
|
+
|
|
1832
|
+
async def get_attribution_metrics_for_one_or_more_brevo_campaigns_or_workflows(
|
|
1833
|
+
self,
|
|
1834
|
+
*,
|
|
1835
|
+
period_from: typing.Optional[dt.datetime] = None,
|
|
1836
|
+
period_to: typing.Optional[dt.datetime] = None,
|
|
1837
|
+
email_campaign_id_array: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
1838
|
+
sms_campaign_id_array: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
1839
|
+
automation_workflow_email_id_array: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
1840
|
+
automation_workflow_sms_id_array: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
1841
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1842
|
+
) -> AsyncHttpResponse[GetEcommerceAttributionMetricsResponse]:
|
|
1843
|
+
"""
|
|
1844
|
+
Parameters
|
|
1845
|
+
----------
|
|
1846
|
+
period_from : typing.Optional[dt.datetime]
|
|
1847
|
+
When getting metrics for a specific period, define the starting datetime in RFC3339 format
|
|
1848
|
+
|
|
1849
|
+
period_to : typing.Optional[dt.datetime]
|
|
1850
|
+
When getting metrics for a specific period, define the end datetime in RFC3339 format
|
|
1851
|
+
|
|
1852
|
+
email_campaign_id_array : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
1853
|
+
The email campaign ID(s) to get metrics for
|
|
1854
|
+
|
|
1855
|
+
sms_campaign_id_array : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
1856
|
+
The SMS campaign ID(s) to get metrics for
|
|
1857
|
+
|
|
1858
|
+
automation_workflow_email_id_array : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
1859
|
+
The automation workflow ID(s) to get email attribution metrics for
|
|
1860
|
+
|
|
1861
|
+
automation_workflow_sms_id_array : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
1862
|
+
The automation workflow ID(s) to get SMS attribution metrics for
|
|
1863
|
+
|
|
1864
|
+
request_options : typing.Optional[RequestOptions]
|
|
1865
|
+
Request-specific configuration.
|
|
1866
|
+
|
|
1867
|
+
Returns
|
|
1868
|
+
-------
|
|
1869
|
+
AsyncHttpResponse[GetEcommerceAttributionMetricsResponse]
|
|
1870
|
+
OK
|
|
1871
|
+
"""
|
|
1872
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1873
|
+
"ecommerce/attribution/metrics",
|
|
1874
|
+
method="GET",
|
|
1875
|
+
params={
|
|
1876
|
+
"periodFrom": serialize_datetime(period_from) if period_from is not None else None,
|
|
1877
|
+
"periodTo": serialize_datetime(period_to) if period_to is not None else None,
|
|
1878
|
+
"emailCampaignId[]": email_campaign_id_array,
|
|
1879
|
+
"smsCampaignId[]": sms_campaign_id_array,
|
|
1880
|
+
"automationWorkflowEmailId[]": automation_workflow_email_id_array,
|
|
1881
|
+
"automationWorkflowSmsId[]": automation_workflow_sms_id_array,
|
|
1882
|
+
},
|
|
1883
|
+
request_options=request_options,
|
|
1884
|
+
)
|
|
1885
|
+
try:
|
|
1886
|
+
if 200 <= _response.status_code < 300:
|
|
1887
|
+
_data = typing.cast(
|
|
1888
|
+
GetEcommerceAttributionMetricsResponse,
|
|
1889
|
+
construct_type(
|
|
1890
|
+
type_=GetEcommerceAttributionMetricsResponse, # type: ignore
|
|
1891
|
+
object_=_response.json(),
|
|
1892
|
+
),
|
|
1893
|
+
)
|
|
1894
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
1895
|
+
if _response.status_code == 400:
|
|
1896
|
+
raise BadRequestError(
|
|
1897
|
+
headers=dict(_response.headers),
|
|
1898
|
+
body=typing.cast(
|
|
1899
|
+
typing.Any,
|
|
1900
|
+
construct_type(
|
|
1901
|
+
type_=typing.Any, # type: ignore
|
|
1902
|
+
object_=_response.json(),
|
|
1903
|
+
),
|
|
1904
|
+
),
|
|
1905
|
+
)
|
|
1906
|
+
_response_json = _response.json()
|
|
1907
|
+
except JSONDecodeError:
|
|
1908
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1909
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1910
|
+
|
|
1911
|
+
async def get_detailed_attribution_metrics_for_a_single_brevo_campaign_or_workflow(
|
|
1912
|
+
self,
|
|
1913
|
+
conversion_source: GetEcommerceAttributionMetricsConversionSourceConversionSourceIdRequestConversionSource,
|
|
1914
|
+
conversion_source_id: str,
|
|
1915
|
+
*,
|
|
1916
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1917
|
+
) -> AsyncHttpResponse[GetEcommerceAttributionMetricsConversionSourceConversionSourceIdResponse]:
|
|
1918
|
+
"""
|
|
1919
|
+
Parameters
|
|
1920
|
+
----------
|
|
1921
|
+
conversion_source : GetEcommerceAttributionMetricsConversionSourceConversionSourceIdRequestConversionSource
|
|
1922
|
+
The Brevo campaign type or workflow type for which data will be retrieved
|
|
1923
|
+
|
|
1924
|
+
conversion_source_id : str
|
|
1925
|
+
The Brevo campaign or automation workflow id for which data will be retrieved
|
|
1926
|
+
|
|
1927
|
+
request_options : typing.Optional[RequestOptions]
|
|
1928
|
+
Request-specific configuration.
|
|
1929
|
+
|
|
1930
|
+
Returns
|
|
1931
|
+
-------
|
|
1932
|
+
AsyncHttpResponse[GetEcommerceAttributionMetricsConversionSourceConversionSourceIdResponse]
|
|
1933
|
+
OK
|
|
1934
|
+
"""
|
|
1935
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1936
|
+
f"ecommerce/attribution/metrics/{jsonable_encoder(conversion_source)}/{jsonable_encoder(conversion_source_id)}",
|
|
1937
|
+
method="GET",
|
|
1938
|
+
request_options=request_options,
|
|
1939
|
+
)
|
|
1940
|
+
try:
|
|
1941
|
+
if 200 <= _response.status_code < 300:
|
|
1942
|
+
_data = typing.cast(
|
|
1943
|
+
GetEcommerceAttributionMetricsConversionSourceConversionSourceIdResponse,
|
|
1944
|
+
construct_type(
|
|
1945
|
+
type_=GetEcommerceAttributionMetricsConversionSourceConversionSourceIdResponse, # type: ignore
|
|
1946
|
+
object_=_response.json(),
|
|
1947
|
+
),
|
|
1948
|
+
)
|
|
1949
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
1950
|
+
if _response.status_code == 400:
|
|
1951
|
+
raise BadRequestError(
|
|
1952
|
+
headers=dict(_response.headers),
|
|
1953
|
+
body=typing.cast(
|
|
1954
|
+
typing.Any,
|
|
1955
|
+
construct_type(
|
|
1956
|
+
type_=typing.Any, # type: ignore
|
|
1957
|
+
object_=_response.json(),
|
|
1958
|
+
),
|
|
1959
|
+
),
|
|
1960
|
+
)
|
|
1961
|
+
_response_json = _response.json()
|
|
1962
|
+
except JSONDecodeError:
|
|
1963
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1964
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
1965
|
+
|
|
1966
|
+
async def get_attributed_product_sales_for_a_single_brevo_campaign_or_workflow(
|
|
1967
|
+
self,
|
|
1968
|
+
conversion_source: GetEcommerceAttributionProductsConversionSourceConversionSourceIdRequestConversionSource,
|
|
1969
|
+
conversion_source_id: str,
|
|
1970
|
+
*,
|
|
1971
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
1972
|
+
) -> AsyncHttpResponse[GetEcommerceAttributionProductsConversionSourceConversionSourceIdResponse]:
|
|
1973
|
+
"""
|
|
1974
|
+
Parameters
|
|
1975
|
+
----------
|
|
1976
|
+
conversion_source : GetEcommerceAttributionProductsConversionSourceConversionSourceIdRequestConversionSource
|
|
1977
|
+
The Brevo campaign or automation workflow type for which data will be retrieved
|
|
1978
|
+
|
|
1979
|
+
conversion_source_id : str
|
|
1980
|
+
The Brevo campaign or automation workflow id for which data will be retrieved
|
|
1981
|
+
|
|
1982
|
+
request_options : typing.Optional[RequestOptions]
|
|
1983
|
+
Request-specific configuration.
|
|
1984
|
+
|
|
1985
|
+
Returns
|
|
1986
|
+
-------
|
|
1987
|
+
AsyncHttpResponse[GetEcommerceAttributionProductsConversionSourceConversionSourceIdResponse]
|
|
1988
|
+
OK
|
|
1989
|
+
"""
|
|
1990
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1991
|
+
f"ecommerce/attribution/products/{jsonable_encoder(conversion_source)}/{jsonable_encoder(conversion_source_id)}",
|
|
1992
|
+
method="GET",
|
|
1993
|
+
request_options=request_options,
|
|
1994
|
+
)
|
|
1995
|
+
try:
|
|
1996
|
+
if 200 <= _response.status_code < 300:
|
|
1997
|
+
_data = typing.cast(
|
|
1998
|
+
GetEcommerceAttributionProductsConversionSourceConversionSourceIdResponse,
|
|
1999
|
+
construct_type(
|
|
2000
|
+
type_=GetEcommerceAttributionProductsConversionSourceConversionSourceIdResponse, # type: ignore
|
|
2001
|
+
object_=_response.json(),
|
|
2002
|
+
),
|
|
2003
|
+
)
|
|
2004
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
2005
|
+
if _response.status_code == 400:
|
|
2006
|
+
raise BadRequestError(
|
|
2007
|
+
headers=dict(_response.headers),
|
|
2008
|
+
body=typing.cast(
|
|
2009
|
+
typing.Any,
|
|
2010
|
+
construct_type(
|
|
2011
|
+
type_=typing.Any, # type: ignore
|
|
2012
|
+
object_=_response.json(),
|
|
2013
|
+
),
|
|
2014
|
+
),
|
|
2015
|
+
)
|
|
2016
|
+
_response_json = _response.json()
|
|
2017
|
+
except JSONDecodeError:
|
|
2018
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
2019
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
2020
|
+
|
|
2021
|
+
async def get_the_iso4217compliant_display_currency_code_for_your_brevo_account(
|
|
2022
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
2023
|
+
) -> AsyncHttpResponse[GetEcommerceConfigDisplayCurrencyResponse]:
|
|
2024
|
+
"""
|
|
2025
|
+
Parameters
|
|
2026
|
+
----------
|
|
2027
|
+
request_options : typing.Optional[RequestOptions]
|
|
2028
|
+
Request-specific configuration.
|
|
2029
|
+
|
|
2030
|
+
Returns
|
|
2031
|
+
-------
|
|
2032
|
+
AsyncHttpResponse[GetEcommerceConfigDisplayCurrencyResponse]
|
|
2033
|
+
OK
|
|
2034
|
+
"""
|
|
2035
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
2036
|
+
"ecommerce/config/displayCurrency",
|
|
2037
|
+
method="GET",
|
|
2038
|
+
request_options=request_options,
|
|
2039
|
+
)
|
|
2040
|
+
try:
|
|
2041
|
+
if 200 <= _response.status_code < 300:
|
|
2042
|
+
_data = typing.cast(
|
|
2043
|
+
GetEcommerceConfigDisplayCurrencyResponse,
|
|
2044
|
+
construct_type(
|
|
2045
|
+
type_=GetEcommerceConfigDisplayCurrencyResponse, # type: ignore
|
|
2046
|
+
object_=_response.json(),
|
|
2047
|
+
),
|
|
2048
|
+
)
|
|
2049
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
2050
|
+
if _response.status_code == 400:
|
|
2051
|
+
raise BadRequestError(
|
|
2052
|
+
headers=dict(_response.headers),
|
|
2053
|
+
body=typing.cast(
|
|
2054
|
+
typing.Any,
|
|
2055
|
+
construct_type(
|
|
2056
|
+
type_=typing.Any, # type: ignore
|
|
2057
|
+
object_=_response.json(),
|
|
2058
|
+
),
|
|
2059
|
+
),
|
|
2060
|
+
)
|
|
2061
|
+
if _response.status_code == 401:
|
|
2062
|
+
raise UnauthorizedError(
|
|
2063
|
+
headers=dict(_response.headers),
|
|
2064
|
+
body=typing.cast(
|
|
2065
|
+
typing.Any,
|
|
2066
|
+
construct_type(
|
|
2067
|
+
type_=typing.Any, # type: ignore
|
|
2068
|
+
object_=_response.json(),
|
|
2069
|
+
),
|
|
2070
|
+
),
|
|
2071
|
+
)
|
|
2072
|
+
if _response.status_code == 403:
|
|
2073
|
+
raise ForbiddenError(
|
|
2074
|
+
headers=dict(_response.headers),
|
|
2075
|
+
body=typing.cast(
|
|
2076
|
+
typing.Any,
|
|
2077
|
+
construct_type(
|
|
2078
|
+
type_=typing.Any, # type: ignore
|
|
2079
|
+
object_=_response.json(),
|
|
2080
|
+
),
|
|
2081
|
+
),
|
|
2082
|
+
)
|
|
2083
|
+
_response_json = _response.json()
|
|
2084
|
+
except JSONDecodeError:
|
|
2085
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
2086
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
2087
|
+
|
|
2088
|
+
async def set_config_display_currency(
|
|
2089
|
+
self, *, code: str, request_options: typing.Optional[RequestOptions] = None
|
|
2090
|
+
) -> AsyncHttpResponse[SetConfigDisplayCurrencyResponse]:
|
|
2091
|
+
"""
|
|
2092
|
+
Parameters
|
|
2093
|
+
----------
|
|
2094
|
+
code : str
|
|
2095
|
+
ISO 4217 compliant display currency code
|
|
2096
|
+
|
|
2097
|
+
request_options : typing.Optional[RequestOptions]
|
|
2098
|
+
Request-specific configuration.
|
|
2099
|
+
|
|
2100
|
+
Returns
|
|
2101
|
+
-------
|
|
2102
|
+
AsyncHttpResponse[SetConfigDisplayCurrencyResponse]
|
|
2103
|
+
OK
|
|
2104
|
+
"""
|
|
2105
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
2106
|
+
"ecommerce/config/displayCurrency",
|
|
2107
|
+
method="POST",
|
|
2108
|
+
json={
|
|
2109
|
+
"code": code,
|
|
2110
|
+
},
|
|
2111
|
+
headers={
|
|
2112
|
+
"content-type": "application/json",
|
|
2113
|
+
},
|
|
2114
|
+
request_options=request_options,
|
|
2115
|
+
omit=OMIT,
|
|
2116
|
+
)
|
|
2117
|
+
try:
|
|
2118
|
+
if 200 <= _response.status_code < 300:
|
|
2119
|
+
_data = typing.cast(
|
|
2120
|
+
SetConfigDisplayCurrencyResponse,
|
|
2121
|
+
construct_type(
|
|
2122
|
+
type_=SetConfigDisplayCurrencyResponse, # type: ignore
|
|
2123
|
+
object_=_response.json(),
|
|
2124
|
+
),
|
|
2125
|
+
)
|
|
2126
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
2127
|
+
if _response.status_code == 400:
|
|
2128
|
+
raise BadRequestError(
|
|
2129
|
+
headers=dict(_response.headers),
|
|
2130
|
+
body=typing.cast(
|
|
2131
|
+
typing.Any,
|
|
2132
|
+
construct_type(
|
|
2133
|
+
type_=typing.Any, # type: ignore
|
|
2134
|
+
object_=_response.json(),
|
|
2135
|
+
),
|
|
2136
|
+
),
|
|
2137
|
+
)
|
|
2138
|
+
if _response.status_code == 401:
|
|
2139
|
+
raise UnauthorizedError(
|
|
2140
|
+
headers=dict(_response.headers),
|
|
2141
|
+
body=typing.cast(
|
|
2142
|
+
typing.Any,
|
|
2143
|
+
construct_type(
|
|
2144
|
+
type_=typing.Any, # type: ignore
|
|
2145
|
+
object_=_response.json(),
|
|
2146
|
+
),
|
|
2147
|
+
),
|
|
2148
|
+
)
|
|
2149
|
+
if _response.status_code == 403:
|
|
2150
|
+
raise ForbiddenError(
|
|
2151
|
+
headers=dict(_response.headers),
|
|
2152
|
+
body=typing.cast(
|
|
2153
|
+
typing.Any,
|
|
2154
|
+
construct_type(
|
|
2155
|
+
type_=typing.Any, # type: ignore
|
|
2156
|
+
object_=_response.json(),
|
|
2157
|
+
),
|
|
2158
|
+
),
|
|
2159
|
+
)
|
|
2160
|
+
if _response.status_code == 422:
|
|
2161
|
+
raise UnprocessableEntityError(
|
|
2162
|
+
headers=dict(_response.headers),
|
|
2163
|
+
body=typing.cast(
|
|
2164
|
+
ErrorModel,
|
|
2165
|
+
construct_type(
|
|
2166
|
+
type_=ErrorModel, # type: ignore
|
|
2167
|
+
object_=_response.json(),
|
|
2168
|
+
),
|
|
2169
|
+
),
|
|
2170
|
+
)
|
|
2171
|
+
_response_json = _response.json()
|
|
2172
|
+
except JSONDecodeError:
|
|
2173
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
2174
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
2175
|
+
|
|
2176
|
+
async def get_orders(
|
|
2177
|
+
self,
|
|
2178
|
+
*,
|
|
2179
|
+
limit: typing.Optional[int] = None,
|
|
2180
|
+
offset: typing.Optional[int] = None,
|
|
2181
|
+
sort: typing.Optional[GetOrdersRequestSort] = None,
|
|
2182
|
+
modified_since: typing.Optional[str] = None,
|
|
2183
|
+
created_since: typing.Optional[str] = None,
|
|
2184
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
2185
|
+
) -> AsyncHttpResponse[typing.Any]:
|
|
2186
|
+
"""
|
|
2187
|
+
Get all the orders
|
|
2188
|
+
|
|
2189
|
+
Parameters
|
|
2190
|
+
----------
|
|
2191
|
+
limit : typing.Optional[int]
|
|
2192
|
+
Number of documents per page
|
|
2193
|
+
|
|
2194
|
+
offset : typing.Optional[int]
|
|
2195
|
+
Index of the first document in the page
|
|
2196
|
+
|
|
2197
|
+
sort : typing.Optional[GetOrdersRequestSort]
|
|
2198
|
+
Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
|
|
2199
|
+
|
|
2200
|
+
modified_since : typing.Optional[str]
|
|
2201
|
+
Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
|
|
2202
|
+
|
|
2203
|
+
created_since : typing.Optional[str]
|
|
2204
|
+
Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
|
|
2205
|
+
|
|
2206
|
+
request_options : typing.Optional[RequestOptions]
|
|
2207
|
+
Request-specific configuration.
|
|
2208
|
+
|
|
2209
|
+
Returns
|
|
2210
|
+
-------
|
|
2211
|
+
AsyncHttpResponse[typing.Any]
|
|
2212
|
+
orders fetched successfully
|
|
2213
|
+
"""
|
|
2214
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
2215
|
+
"orders",
|
|
2216
|
+
method="GET",
|
|
2217
|
+
params={
|
|
2218
|
+
"limit": limit,
|
|
2219
|
+
"offset": offset,
|
|
2220
|
+
"sort": sort,
|
|
2221
|
+
"modifiedSince": modified_since,
|
|
2222
|
+
"createdSince": created_since,
|
|
2223
|
+
},
|
|
2224
|
+
request_options=request_options,
|
|
2225
|
+
)
|
|
2226
|
+
try:
|
|
2227
|
+
if _response is None or not _response.text.strip():
|
|
2228
|
+
return AsyncHttpResponse(response=_response, data=None)
|
|
2229
|
+
if 200 <= _response.status_code < 300:
|
|
2230
|
+
_data = typing.cast(
|
|
2231
|
+
typing.Any,
|
|
2232
|
+
construct_type(
|
|
2233
|
+
type_=typing.Any, # type: ignore
|
|
2234
|
+
object_=_response.json(),
|
|
2235
|
+
),
|
|
2236
|
+
)
|
|
2237
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
2238
|
+
if _response.status_code == 400:
|
|
2239
|
+
raise BadRequestError(
|
|
2240
|
+
headers=dict(_response.headers),
|
|
2241
|
+
body=typing.cast(
|
|
2242
|
+
typing.Any,
|
|
2243
|
+
construct_type(
|
|
2244
|
+
type_=typing.Any, # type: ignore
|
|
2245
|
+
object_=_response.json(),
|
|
2246
|
+
),
|
|
2247
|
+
),
|
|
2248
|
+
)
|
|
2249
|
+
_response_json = _response.json()
|
|
2250
|
+
except JSONDecodeError:
|
|
2251
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
2252
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
2253
|
+
|
|
2254
|
+
async def create_order(
|
|
2255
|
+
self,
|
|
2256
|
+
*,
|
|
2257
|
+
amount: float,
|
|
2258
|
+
created_at: str,
|
|
2259
|
+
id: str,
|
|
2260
|
+
products: typing.Sequence[OrderProductsItem],
|
|
2261
|
+
status: str,
|
|
2262
|
+
updated_at: str,
|
|
2263
|
+
billing: typing.Optional[OrderBilling] = OMIT,
|
|
2264
|
+
coupons: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
2265
|
+
identifiers: typing.Optional[OrderIdentifiers] = OMIT,
|
|
2266
|
+
meta_info: typing.Optional[typing.Dict[str, OrderMetaInfoValue]] = OMIT,
|
|
2267
|
+
store_id: typing.Optional[str] = OMIT,
|
|
2268
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
2269
|
+
) -> AsyncHttpResponse[None]:
|
|
2270
|
+
"""
|
|
2271
|
+
Manages the transactional status of the order
|
|
2272
|
+
|
|
2273
|
+
Parameters
|
|
2274
|
+
----------
|
|
2275
|
+
amount : float
|
|
2276
|
+
Total amount of the order, including all shipping expenses, tax and the price of items.
|
|
2277
|
+
|
|
2278
|
+
created_at : str
|
|
2279
|
+
Event occurrence UTC date-time (YYYY-MM-DDTHH:mm:ssZ), when order is actually created.
|
|
2280
|
+
|
|
2281
|
+
id : str
|
|
2282
|
+
Unique ID of the order.
|
|
2283
|
+
|
|
2284
|
+
products : typing.Sequence[OrderProductsItem]
|
|
2285
|
+
|
|
2286
|
+
status : str
|
|
2287
|
+
State of the order.
|
|
2288
|
+
|
|
2289
|
+
updated_at : str
|
|
2290
|
+
Event updated UTC date-time (YYYY-MM-DDTHH:mm:ssZ), when the status of the order is actually changed/updated.
|
|
2291
|
+
|
|
2292
|
+
billing : typing.Optional[OrderBilling]
|
|
2293
|
+
Billing details of an order.
|
|
2294
|
+
|
|
2295
|
+
coupons : typing.Optional[typing.Sequence[str]]
|
|
2296
|
+
Coupons applied to the order. Stored case insensitive.
|
|
2297
|
+
|
|
2298
|
+
identifiers : typing.Optional[OrderIdentifiers]
|
|
2299
|
+
Identifies the contact associated with the order.
|
|
2300
|
+
|
|
2301
|
+
meta_info : typing.Optional[typing.Dict[str, OrderMetaInfoValue]]
|
|
2302
|
+
Meta data of order to store additional detal such as custom message, customer type, source.
|
|
2303
|
+
|
|
2304
|
+
store_id : typing.Optional[str]
|
|
2305
|
+
ID of store where the order is placed
|
|
2306
|
+
|
|
2307
|
+
request_options : typing.Optional[RequestOptions]
|
|
2308
|
+
Request-specific configuration.
|
|
2309
|
+
|
|
2310
|
+
Returns
|
|
2311
|
+
-------
|
|
2312
|
+
AsyncHttpResponse[None]
|
|
2313
|
+
"""
|
|
2314
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
2315
|
+
"orders/status",
|
|
2316
|
+
method="POST",
|
|
2317
|
+
json={
|
|
2318
|
+
"amount": amount,
|
|
2319
|
+
"billing": convert_and_respect_annotation_metadata(
|
|
2320
|
+
object_=billing, annotation=OrderBilling, direction="write"
|
|
2321
|
+
),
|
|
2322
|
+
"coupons": coupons,
|
|
2323
|
+
"createdAt": created_at,
|
|
2324
|
+
"id": id,
|
|
2325
|
+
"identifiers": convert_and_respect_annotation_metadata(
|
|
2326
|
+
object_=identifiers, annotation=OrderIdentifiers, direction="write"
|
|
2327
|
+
),
|
|
2328
|
+
"metaInfo": convert_and_respect_annotation_metadata(
|
|
2329
|
+
object_=meta_info, annotation=typing.Dict[str, OrderMetaInfoValue], direction="write"
|
|
2330
|
+
),
|
|
2331
|
+
"products": convert_and_respect_annotation_metadata(
|
|
2332
|
+
object_=products, annotation=typing.Sequence[OrderProductsItem], direction="write"
|
|
2333
|
+
),
|
|
2334
|
+
"status": status,
|
|
2335
|
+
"storeId": store_id,
|
|
2336
|
+
"updatedAt": updated_at,
|
|
2337
|
+
},
|
|
2338
|
+
headers={
|
|
2339
|
+
"content-type": "application/json",
|
|
2340
|
+
},
|
|
2341
|
+
request_options=request_options,
|
|
2342
|
+
omit=OMIT,
|
|
2343
|
+
)
|
|
2344
|
+
try:
|
|
2345
|
+
if 200 <= _response.status_code < 300:
|
|
2346
|
+
return AsyncHttpResponse(response=_response, data=None)
|
|
2347
|
+
if _response.status_code == 400:
|
|
2348
|
+
raise BadRequestError(
|
|
2349
|
+
headers=dict(_response.headers),
|
|
2350
|
+
body=typing.cast(
|
|
2351
|
+
typing.Any,
|
|
2352
|
+
construct_type(
|
|
2353
|
+
type_=typing.Any, # type: ignore
|
|
2354
|
+
object_=_response.json(),
|
|
2355
|
+
),
|
|
2356
|
+
),
|
|
2357
|
+
)
|
|
2358
|
+
_response_json = _response.json()
|
|
2359
|
+
except JSONDecodeError:
|
|
2360
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
2361
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
2362
|
+
|
|
2363
|
+
async def create_batch_order(
|
|
2364
|
+
self,
|
|
2365
|
+
*,
|
|
2366
|
+
orders: typing.Sequence[Order],
|
|
2367
|
+
historical: typing.Optional[bool] = OMIT,
|
|
2368
|
+
notify_url: typing.Optional[str] = OMIT,
|
|
2369
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
2370
|
+
) -> AsyncHttpResponse[CreateBatchOrderResponse]:
|
|
2371
|
+
"""
|
|
2372
|
+
Create multiple orders at one time instead of one order at a time
|
|
2373
|
+
|
|
2374
|
+
Parameters
|
|
2375
|
+
----------
|
|
2376
|
+
orders : typing.Sequence[Order]
|
|
2377
|
+
array of order objects
|
|
2378
|
+
|
|
2379
|
+
historical : typing.Optional[bool]
|
|
2380
|
+
Defines wether you want your orders to be considered as live data or as historical data (import of past data, synchronising data). True: orders will not trigger any automation workflows. False: orders will trigger workflows as usual.
|
|
2381
|
+
|
|
2382
|
+
notify_url : typing.Optional[str]
|
|
2383
|
+
Notify Url provided by client_dev to get the status of batch request
|
|
2384
|
+
|
|
2385
|
+
request_options : typing.Optional[RequestOptions]
|
|
2386
|
+
Request-specific configuration.
|
|
2387
|
+
|
|
2388
|
+
Returns
|
|
2389
|
+
-------
|
|
2390
|
+
AsyncHttpResponse[CreateBatchOrderResponse]
|
|
2391
|
+
batch id created
|
|
2392
|
+
"""
|
|
2393
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
2394
|
+
"orders/status/batch",
|
|
2395
|
+
method="POST",
|
|
2396
|
+
json={
|
|
2397
|
+
"historical": historical,
|
|
2398
|
+
"notifyUrl": notify_url,
|
|
2399
|
+
"orders": convert_and_respect_annotation_metadata(
|
|
2400
|
+
object_=orders, annotation=typing.Sequence[Order], direction="write"
|
|
2401
|
+
),
|
|
2402
|
+
},
|
|
2403
|
+
headers={
|
|
2404
|
+
"content-type": "application/json",
|
|
2405
|
+
},
|
|
2406
|
+
request_options=request_options,
|
|
2407
|
+
omit=OMIT,
|
|
2408
|
+
)
|
|
2409
|
+
try:
|
|
2410
|
+
if 200 <= _response.status_code < 300:
|
|
2411
|
+
_data = typing.cast(
|
|
2412
|
+
CreateBatchOrderResponse,
|
|
2413
|
+
construct_type(
|
|
2414
|
+
type_=CreateBatchOrderResponse, # type: ignore
|
|
2415
|
+
object_=_response.json(),
|
|
2416
|
+
),
|
|
2417
|
+
)
|
|
2418
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
2419
|
+
if _response.status_code == 400:
|
|
2420
|
+
raise BadRequestError(
|
|
2421
|
+
headers=dict(_response.headers),
|
|
2422
|
+
body=typing.cast(
|
|
2423
|
+
typing.Any,
|
|
2424
|
+
construct_type(
|
|
2425
|
+
type_=typing.Any, # type: ignore
|
|
2426
|
+
object_=_response.json(),
|
|
2427
|
+
),
|
|
2428
|
+
),
|
|
2429
|
+
)
|
|
2430
|
+
_response_json = _response.json()
|
|
2431
|
+
except JSONDecodeError:
|
|
2432
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
2433
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
2434
|
+
|
|
2435
|
+
async def get_products(
|
|
2436
|
+
self,
|
|
2437
|
+
*,
|
|
2438
|
+
limit: typing.Optional[int] = None,
|
|
2439
|
+
offset: typing.Optional[int] = None,
|
|
2440
|
+
sort: typing.Optional[GetProductsRequestSort] = None,
|
|
2441
|
+
ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
2442
|
+
name: typing.Optional[str] = None,
|
|
2443
|
+
price_lte: typing.Optional[float] = None,
|
|
2444
|
+
price_gte: typing.Optional[float] = None,
|
|
2445
|
+
price_lt: typing.Optional[float] = None,
|
|
2446
|
+
price_gt: typing.Optional[float] = None,
|
|
2447
|
+
price_eq: typing.Optional[float] = None,
|
|
2448
|
+
price_ne: typing.Optional[float] = None,
|
|
2449
|
+
categories: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
2450
|
+
modified_since: typing.Optional[str] = None,
|
|
2451
|
+
created_since: typing.Optional[str] = None,
|
|
2452
|
+
is_deleted: typing.Optional[str] = None,
|
|
2453
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
2454
|
+
) -> AsyncHttpResponse[GetProductsResponse]:
|
|
2455
|
+
"""
|
|
2456
|
+
Parameters
|
|
2457
|
+
----------
|
|
2458
|
+
limit : typing.Optional[int]
|
|
2459
|
+
Number of documents per page
|
|
2460
|
+
|
|
2461
|
+
offset : typing.Optional[int]
|
|
2462
|
+
Index of the first document in the page
|
|
2463
|
+
|
|
2464
|
+
sort : typing.Optional[GetProductsRequestSort]
|
|
2465
|
+
Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
|
|
2466
|
+
|
|
2467
|
+
ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
2468
|
+
Filter by product ids
|
|
2469
|
+
|
|
2470
|
+
name : typing.Optional[str]
|
|
2471
|
+
Filter by product name, minimum 3 characters should be present for search.
|
|
2472
|
+
|
|
2473
|
+
price_lte : typing.Optional[float]
|
|
2474
|
+
Price filter for products less than and equals to particular amount
|
|
2475
|
+
|
|
2476
|
+
price_gte : typing.Optional[float]
|
|
2477
|
+
Price filter for products greater than and equals to particular amount
|
|
2478
|
+
|
|
2479
|
+
price_lt : typing.Optional[float]
|
|
2480
|
+
Price filter for products less than particular amount
|
|
2481
|
+
|
|
2482
|
+
price_gt : typing.Optional[float]
|
|
2483
|
+
Price filter for products greater than particular amount
|
|
2484
|
+
|
|
2485
|
+
price_eq : typing.Optional[float]
|
|
2486
|
+
Price filter for products equals to particular amount
|
|
2487
|
+
|
|
2488
|
+
price_ne : typing.Optional[float]
|
|
2489
|
+
Price filter for products not equals to particular amount
|
|
2490
|
+
|
|
2491
|
+
categories : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
2492
|
+
Filter by categories ids
|
|
2493
|
+
|
|
2494
|
+
modified_since : typing.Optional[str]
|
|
2495
|
+
Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
|
|
2496
|
+
|
|
2497
|
+
created_since : typing.Optional[str]
|
|
2498
|
+
Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
|
|
2499
|
+
|
|
2500
|
+
is_deleted : typing.Optional[str]
|
|
2501
|
+
Filter products by their deletion status. If `false` is passed, only products that are not deleted will be returned.
|
|
2502
|
+
|
|
2503
|
+
request_options : typing.Optional[RequestOptions]
|
|
2504
|
+
Request-specific configuration.
|
|
2505
|
+
|
|
2506
|
+
Returns
|
|
2507
|
+
-------
|
|
2508
|
+
AsyncHttpResponse[GetProductsResponse]
|
|
2509
|
+
All products listed
|
|
2510
|
+
"""
|
|
2511
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
2512
|
+
"products",
|
|
2513
|
+
method="GET",
|
|
2514
|
+
params={
|
|
2515
|
+
"limit": limit,
|
|
2516
|
+
"offset": offset,
|
|
2517
|
+
"sort": sort,
|
|
2518
|
+
"ids": ids,
|
|
2519
|
+
"name": name,
|
|
2520
|
+
"price[lte]": price_lte,
|
|
2521
|
+
"price[gte]": price_gte,
|
|
2522
|
+
"price[lt]": price_lt,
|
|
2523
|
+
"price[gt]": price_gt,
|
|
2524
|
+
"price[eq]": price_eq,
|
|
2525
|
+
"price[ne]": price_ne,
|
|
2526
|
+
"categories": categories,
|
|
2527
|
+
"modifiedSince": modified_since,
|
|
2528
|
+
"createdSince": created_since,
|
|
2529
|
+
"isDeleted": is_deleted,
|
|
2530
|
+
},
|
|
2531
|
+
request_options=request_options,
|
|
2532
|
+
)
|
|
2533
|
+
try:
|
|
2534
|
+
if 200 <= _response.status_code < 300:
|
|
2535
|
+
_data = typing.cast(
|
|
2536
|
+
GetProductsResponse,
|
|
2537
|
+
construct_type(
|
|
2538
|
+
type_=GetProductsResponse, # type: ignore
|
|
2539
|
+
object_=_response.json(),
|
|
2540
|
+
),
|
|
2541
|
+
)
|
|
2542
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
2543
|
+
if _response.status_code == 400:
|
|
2544
|
+
raise BadRequestError(
|
|
2545
|
+
headers=dict(_response.headers),
|
|
2546
|
+
body=typing.cast(
|
|
2547
|
+
typing.Any,
|
|
2548
|
+
construct_type(
|
|
2549
|
+
type_=typing.Any, # type: ignore
|
|
2550
|
+
object_=_response.json(),
|
|
2551
|
+
),
|
|
2552
|
+
),
|
|
2553
|
+
)
|
|
2554
|
+
_response_json = _response.json()
|
|
2555
|
+
except JSONDecodeError:
|
|
2556
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
2557
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
2558
|
+
|
|
2559
|
+
async def create_update_product(
|
|
2560
|
+
self,
|
|
2561
|
+
*,
|
|
2562
|
+
id: str,
|
|
2563
|
+
name: str,
|
|
2564
|
+
categories: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
2565
|
+
deleted_at: typing.Optional[str] = OMIT,
|
|
2566
|
+
image_url: typing.Optional[str] = OMIT,
|
|
2567
|
+
is_deleted: typing.Optional[bool] = OMIT,
|
|
2568
|
+
meta_info: typing.Optional[typing.Dict[str, CreateUpdateProductRequestMetaInfoValue]] = OMIT,
|
|
2569
|
+
parent_id: typing.Optional[str] = OMIT,
|
|
2570
|
+
price: typing.Optional[float] = OMIT,
|
|
2571
|
+
sku: typing.Optional[str] = OMIT,
|
|
2572
|
+
stock: typing.Optional[float] = OMIT,
|
|
2573
|
+
update_enabled: typing.Optional[bool] = OMIT,
|
|
2574
|
+
url: typing.Optional[str] = OMIT,
|
|
2575
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
2576
|
+
) -> AsyncHttpResponse[CreateUpdateProductResponse]:
|
|
2577
|
+
"""
|
|
2578
|
+
Parameters
|
|
2579
|
+
----------
|
|
2580
|
+
id : str
|
|
2581
|
+
Product ID for which you requested the details
|
|
2582
|
+
|
|
2583
|
+
name : str
|
|
2584
|
+
Mandatory in case of creation**. Name of the product for which you requested the details
|
|
2585
|
+
|
|
2586
|
+
categories : typing.Optional[typing.Sequence[str]]
|
|
2587
|
+
Category ID-s of the product
|
|
2588
|
+
|
|
2589
|
+
deleted_at : typing.Optional[str]
|
|
2590
|
+
UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) of the product deleted from the shop's database
|
|
2591
|
+
|
|
2592
|
+
image_url : typing.Optional[str]
|
|
2593
|
+
Absolute URL to the cover image of the product
|
|
2594
|
+
|
|
2595
|
+
is_deleted : typing.Optional[bool]
|
|
2596
|
+
product deleted from the shop's database
|
|
2597
|
+
|
|
2598
|
+
meta_info : typing.Optional[typing.Dict[str, CreateUpdateProductRequestMetaInfoValue]]
|
|
2599
|
+
Meta data of product such as description, vendor, producer, stock level. The size of cumulative metaInfo shall not exceed **1000 KB**. Maximum length of metaInfo object can be 20.
|
|
2600
|
+
|
|
2601
|
+
parent_id : typing.Optional[str]
|
|
2602
|
+
Parent product id of the product
|
|
2603
|
+
|
|
2604
|
+
price : typing.Optional[float]
|
|
2605
|
+
Price of the product
|
|
2606
|
+
|
|
2607
|
+
sku : typing.Optional[str]
|
|
2608
|
+
Product identifier from the shop
|
|
2609
|
+
|
|
2610
|
+
stock : typing.Optional[float]
|
|
2611
|
+
Current stock value of the product from the shop's database
|
|
2612
|
+
|
|
2613
|
+
update_enabled : typing.Optional[bool]
|
|
2614
|
+
Facilitate to update the existing category in the same request (updateEnabled = true)
|
|
2615
|
+
|
|
2616
|
+
url : typing.Optional[str]
|
|
2617
|
+
URL to the product
|
|
2618
|
+
|
|
2619
|
+
request_options : typing.Optional[RequestOptions]
|
|
2620
|
+
Request-specific configuration.
|
|
2621
|
+
|
|
2622
|
+
Returns
|
|
2623
|
+
-------
|
|
2624
|
+
AsyncHttpResponse[CreateUpdateProductResponse]
|
|
2625
|
+
Product created
|
|
2626
|
+
"""
|
|
2627
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
2628
|
+
"products",
|
|
2629
|
+
method="POST",
|
|
2630
|
+
json={
|
|
2631
|
+
"categories": categories,
|
|
2632
|
+
"deletedAt": deleted_at,
|
|
2633
|
+
"id": id,
|
|
2634
|
+
"imageUrl": image_url,
|
|
2635
|
+
"isDeleted": is_deleted,
|
|
2636
|
+
"metaInfo": convert_and_respect_annotation_metadata(
|
|
2637
|
+
object_=meta_info,
|
|
2638
|
+
annotation=typing.Dict[str, CreateUpdateProductRequestMetaInfoValue],
|
|
2639
|
+
direction="write",
|
|
2640
|
+
),
|
|
2641
|
+
"name": name,
|
|
2642
|
+
"parentId": parent_id,
|
|
2643
|
+
"price": price,
|
|
2644
|
+
"sku": sku,
|
|
2645
|
+
"stock": stock,
|
|
2646
|
+
"updateEnabled": update_enabled,
|
|
2647
|
+
"url": url,
|
|
2648
|
+
},
|
|
2649
|
+
headers={
|
|
2650
|
+
"content-type": "application/json",
|
|
2651
|
+
},
|
|
2652
|
+
request_options=request_options,
|
|
2653
|
+
omit=OMIT,
|
|
2654
|
+
)
|
|
2655
|
+
try:
|
|
2656
|
+
if 200 <= _response.status_code < 300:
|
|
2657
|
+
_data = typing.cast(
|
|
2658
|
+
CreateUpdateProductResponse,
|
|
2659
|
+
construct_type(
|
|
2660
|
+
type_=CreateUpdateProductResponse, # type: ignore
|
|
2661
|
+
object_=_response.json(),
|
|
2662
|
+
),
|
|
2663
|
+
)
|
|
2664
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
2665
|
+
if _response.status_code == 400:
|
|
2666
|
+
raise BadRequestError(
|
|
2667
|
+
headers=dict(_response.headers),
|
|
2668
|
+
body=typing.cast(
|
|
2669
|
+
typing.Any,
|
|
2670
|
+
construct_type(
|
|
2671
|
+
type_=typing.Any, # type: ignore
|
|
2672
|
+
object_=_response.json(),
|
|
2673
|
+
),
|
|
2674
|
+
),
|
|
2675
|
+
)
|
|
2676
|
+
_response_json = _response.json()
|
|
2677
|
+
except JSONDecodeError:
|
|
2678
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
2679
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
2680
|
+
|
|
2681
|
+
async def create_update_batch_products(
|
|
2682
|
+
self,
|
|
2683
|
+
*,
|
|
2684
|
+
products: typing.Sequence[CreateUpdateBatchProductsRequestProductsItem],
|
|
2685
|
+
update_enabled: typing.Optional[bool] = OMIT,
|
|
2686
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
2687
|
+
) -> AsyncHttpResponse[CreateUpdateBatchProductsResponse]:
|
|
2688
|
+
"""
|
|
2689
|
+
Parameters
|
|
2690
|
+
----------
|
|
2691
|
+
products : typing.Sequence[CreateUpdateBatchProductsRequestProductsItem]
|
|
2692
|
+
array of products objects
|
|
2693
|
+
|
|
2694
|
+
update_enabled : typing.Optional[bool]
|
|
2695
|
+
Facilitate to update the existing categories in the same request (updateEnabled = true)
|
|
2696
|
+
|
|
2697
|
+
request_options : typing.Optional[RequestOptions]
|
|
2698
|
+
Request-specific configuration.
|
|
2699
|
+
|
|
2700
|
+
Returns
|
|
2701
|
+
-------
|
|
2702
|
+
AsyncHttpResponse[CreateUpdateBatchProductsResponse]
|
|
2703
|
+
Products created and updated
|
|
2704
|
+
"""
|
|
2705
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
2706
|
+
"products/batch",
|
|
2707
|
+
method="POST",
|
|
2708
|
+
json={
|
|
2709
|
+
"products": convert_and_respect_annotation_metadata(
|
|
2710
|
+
object_=products,
|
|
2711
|
+
annotation=typing.Sequence[CreateUpdateBatchProductsRequestProductsItem],
|
|
2712
|
+
direction="write",
|
|
2713
|
+
),
|
|
2714
|
+
"updateEnabled": update_enabled,
|
|
2715
|
+
},
|
|
2716
|
+
headers={
|
|
2717
|
+
"content-type": "application/json",
|
|
2718
|
+
},
|
|
2719
|
+
request_options=request_options,
|
|
2720
|
+
omit=OMIT,
|
|
2721
|
+
)
|
|
2722
|
+
try:
|
|
2723
|
+
if 200 <= _response.status_code < 300:
|
|
2724
|
+
_data = typing.cast(
|
|
2725
|
+
CreateUpdateBatchProductsResponse,
|
|
2726
|
+
construct_type(
|
|
2727
|
+
type_=CreateUpdateBatchProductsResponse, # type: ignore
|
|
2728
|
+
object_=_response.json(),
|
|
2729
|
+
),
|
|
2730
|
+
)
|
|
2731
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
2732
|
+
if _response.status_code == 400:
|
|
2733
|
+
raise BadRequestError(
|
|
2734
|
+
headers=dict(_response.headers),
|
|
2735
|
+
body=typing.cast(
|
|
2736
|
+
typing.Any,
|
|
2737
|
+
construct_type(
|
|
2738
|
+
type_=typing.Any, # type: ignore
|
|
2739
|
+
object_=_response.json(),
|
|
2740
|
+
),
|
|
2741
|
+
),
|
|
2742
|
+
)
|
|
2743
|
+
_response_json = _response.json()
|
|
2744
|
+
except JSONDecodeError:
|
|
2745
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
2746
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
2747
|
+
|
|
2748
|
+
async def get_product_info(
|
|
2749
|
+
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
2750
|
+
) -> AsyncHttpResponse[GetProductDetails]:
|
|
2751
|
+
"""
|
|
2752
|
+
Parameters
|
|
2753
|
+
----------
|
|
2754
|
+
id : str
|
|
2755
|
+
Product ID
|
|
2756
|
+
|
|
2757
|
+
request_options : typing.Optional[RequestOptions]
|
|
2758
|
+
Request-specific configuration.
|
|
2759
|
+
|
|
2760
|
+
Returns
|
|
2761
|
+
-------
|
|
2762
|
+
AsyncHttpResponse[GetProductDetails]
|
|
2763
|
+
Product informations
|
|
2764
|
+
"""
|
|
2765
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
2766
|
+
f"products/{jsonable_encoder(id)}",
|
|
2767
|
+
method="GET",
|
|
2768
|
+
request_options=request_options,
|
|
2769
|
+
)
|
|
2770
|
+
try:
|
|
2771
|
+
if 200 <= _response.status_code < 300:
|
|
2772
|
+
_data = typing.cast(
|
|
2773
|
+
GetProductDetails,
|
|
2774
|
+
construct_type(
|
|
2775
|
+
type_=GetProductDetails, # type: ignore
|
|
2776
|
+
object_=_response.json(),
|
|
2777
|
+
),
|
|
2778
|
+
)
|
|
2779
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
2780
|
+
if _response.status_code == 400:
|
|
2781
|
+
raise BadRequestError(
|
|
2782
|
+
headers=dict(_response.headers),
|
|
2783
|
+
body=typing.cast(
|
|
2784
|
+
typing.Any,
|
|
2785
|
+
construct_type(
|
|
2786
|
+
type_=typing.Any, # type: ignore
|
|
2787
|
+
object_=_response.json(),
|
|
2788
|
+
),
|
|
2789
|
+
),
|
|
2790
|
+
)
|
|
2791
|
+
if _response.status_code == 404:
|
|
2792
|
+
raise NotFoundError(
|
|
2793
|
+
headers=dict(_response.headers),
|
|
2794
|
+
body=typing.cast(
|
|
2795
|
+
typing.Any,
|
|
2796
|
+
construct_type(
|
|
2797
|
+
type_=typing.Any, # type: ignore
|
|
2798
|
+
object_=_response.json(),
|
|
2799
|
+
),
|
|
2800
|
+
),
|
|
2801
|
+
)
|
|
2802
|
+
_response_json = _response.json()
|
|
2803
|
+
except JSONDecodeError:
|
|
2804
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
2805
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
2806
|
+
|
|
2807
|
+
async def create_product_alert(
|
|
2808
|
+
self,
|
|
2809
|
+
id: str,
|
|
2810
|
+
*,
|
|
2811
|
+
contact_identifiers: typing.Optional[CreateProductAlertRequestContactIdentifiers] = OMIT,
|
|
2812
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
2813
|
+
) -> AsyncHttpResponse[None]:
|
|
2814
|
+
"""
|
|
2815
|
+
Parameters
|
|
2816
|
+
----------
|
|
2817
|
+
id : str
|
|
2818
|
+
Product ID
|
|
2819
|
+
|
|
2820
|
+
contact_identifiers : typing.Optional[CreateProductAlertRequestContactIdentifiers]
|
|
2821
|
+
|
|
2822
|
+
request_options : typing.Optional[RequestOptions]
|
|
2823
|
+
Request-specific configuration.
|
|
2824
|
+
|
|
2825
|
+
Returns
|
|
2826
|
+
-------
|
|
2827
|
+
AsyncHttpResponse[None]
|
|
2828
|
+
"""
|
|
2829
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
2830
|
+
f"products/{jsonable_encoder(id)}/alerts/back_in_stock",
|
|
2831
|
+
method="POST",
|
|
2832
|
+
json={
|
|
2833
|
+
"contactIdentifiers": convert_and_respect_annotation_metadata(
|
|
2834
|
+
object_=contact_identifiers,
|
|
2835
|
+
annotation=CreateProductAlertRequestContactIdentifiers,
|
|
2836
|
+
direction="write",
|
|
2837
|
+
),
|
|
2838
|
+
},
|
|
2839
|
+
headers={
|
|
2840
|
+
"content-type": "application/json",
|
|
2841
|
+
},
|
|
2842
|
+
request_options=request_options,
|
|
2843
|
+
omit=OMIT,
|
|
2844
|
+
)
|
|
2845
|
+
try:
|
|
2846
|
+
if 200 <= _response.status_code < 300:
|
|
2847
|
+
return AsyncHttpResponse(response=_response, data=None)
|
|
2848
|
+
if _response.status_code == 400:
|
|
2849
|
+
raise BadRequestError(
|
|
2850
|
+
headers=dict(_response.headers),
|
|
2851
|
+
body=typing.cast(
|
|
2852
|
+
typing.Any,
|
|
2853
|
+
construct_type(
|
|
2854
|
+
type_=typing.Any, # type: ignore
|
|
2855
|
+
object_=_response.json(),
|
|
2856
|
+
),
|
|
2857
|
+
),
|
|
2858
|
+
)
|
|
2859
|
+
if _response.status_code == 401:
|
|
2860
|
+
raise UnauthorizedError(
|
|
2861
|
+
headers=dict(_response.headers),
|
|
2862
|
+
body=typing.cast(
|
|
2863
|
+
typing.Any,
|
|
2864
|
+
construct_type(
|
|
2865
|
+
type_=typing.Any, # type: ignore
|
|
2866
|
+
object_=_response.json(),
|
|
2867
|
+
),
|
|
2868
|
+
),
|
|
2869
|
+
)
|
|
2870
|
+
if _response.status_code == 403:
|
|
2871
|
+
raise ForbiddenError(
|
|
2872
|
+
headers=dict(_response.headers),
|
|
2873
|
+
body=typing.cast(
|
|
2874
|
+
typing.Any,
|
|
2875
|
+
construct_type(
|
|
2876
|
+
type_=typing.Any, # type: ignore
|
|
2877
|
+
object_=_response.json(),
|
|
2878
|
+
),
|
|
2879
|
+
),
|
|
2880
|
+
)
|
|
2881
|
+
if _response.status_code == 404:
|
|
2882
|
+
raise NotFoundError(
|
|
2883
|
+
headers=dict(_response.headers),
|
|
2884
|
+
body=typing.cast(
|
|
2885
|
+
typing.Any,
|
|
2886
|
+
construct_type(
|
|
2887
|
+
type_=typing.Any, # type: ignore
|
|
2888
|
+
object_=_response.json(),
|
|
2889
|
+
),
|
|
2890
|
+
),
|
|
2891
|
+
)
|
|
2892
|
+
_response_json = _response.json()
|
|
2893
|
+
except JSONDecodeError:
|
|
2894
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
2895
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|