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.
Files changed (843) hide show
  1. brevo/__init__.py +2253 -0
  2. brevo/account/__init__.py +79 -0
  3. brevo/account/client.py +317 -0
  4. brevo/account/raw_client.py +341 -0
  5. brevo/account/types/__init__.py +77 -0
  6. brevo/account/types/get_account_activity_response.py +24 -0
  7. brevo/account/types/get_account_activity_response_logs_item.py +45 -0
  8. brevo/account/types/get_account_response.py +85 -0
  9. brevo/account/types/get_account_response_address.py +43 -0
  10. brevo/account/types/get_account_response_date_time_preferences.py +38 -0
  11. brevo/account/types/get_account_response_marketing_automation.py +29 -0
  12. brevo/account/types/get_account_response_plan_item.py +53 -0
  13. brevo/account/types/get_account_response_plan_item_type.py +5 -0
  14. brevo/account/types/get_account_response_plan_verticals_item.py +63 -0
  15. brevo/account/types/get_account_response_plan_verticals_item_plan_category.py +5 -0
  16. brevo/account/types/get_account_response_plan_verticals_item_status.py +5 -0
  17. brevo/account/types/get_account_response_plan_verticals_item_users.py +35 -0
  18. brevo/account/types/get_account_response_relay.py +34 -0
  19. brevo/account/types/get_account_response_relay_data.py +40 -0
  20. brevo/balance/__init__.py +139 -0
  21. brevo/balance/client.py +2589 -0
  22. brevo/balance/raw_client.py +4538 -0
  23. brevo/balance/types/__init__.py +169 -0
  24. brevo/balance/types/create_balance_limit_request_constraint_type.py +5 -0
  25. brevo/balance/types/create_balance_limit_request_duration_unit.py +5 -0
  26. brevo/balance/types/create_balance_limit_request_transaction_type.py +5 -0
  27. brevo/balance/types/create_balance_order_response.py +96 -0
  28. brevo/balance/types/get_balance_definition_list_request_sort.py +5 -0
  29. brevo/balance/types/get_balance_definition_list_request_sort_field.py +5 -0
  30. brevo/balance/types/get_balance_definition_list_request_version.py +5 -0
  31. brevo/balance/types/get_balance_definition_list_response.py +24 -0
  32. brevo/balance/types/get_balance_definition_request_version.py +5 -0
  33. brevo/balance/types/get_balance_limit_request_version.py +5 -0
  34. brevo/balance/types/get_contact_balances_response.py +30 -0
  35. brevo/balance/types/get_contact_balances_response_balances_item.py +33 -0
  36. brevo/balance/types/get_loyalty_balance_programs_pid_transaction_history_request_sort.py +5 -0
  37. brevo/balance/types/get_loyalty_balance_programs_pid_transaction_history_request_sort_field.py +7 -0
  38. brevo/balance/types/get_loyalty_balance_programs_pid_transaction_history_response.py +57 -0
  39. brevo/balance/types/get_loyalty_balance_programs_pid_transaction_history_response_transaction_history_item.py +77 -0
  40. brevo/balance/types/get_subscription_balances_response.py +21 -0
  41. brevo/balance/types/get_subscription_balances_response_balance_item.py +30 -0
  42. brevo/balance/types/post_loyalty_balance_programs_pid_balance_definitions_request_balance_availability_duration_modifier.py +7 -0
  43. brevo/balance/types/post_loyalty_balance_programs_pid_balance_definitions_request_balance_availability_duration_unit.py +7 -0
  44. brevo/balance/types/post_loyalty_balance_programs_pid_balance_definitions_request_balance_option_amount_overtaking_strategy.py +7 -0
  45. brevo/balance/types/post_loyalty_balance_programs_pid_balance_definitions_request_balance_option_credit_rounding.py +7 -0
  46. brevo/balance/types/post_loyalty_balance_programs_pid_balance_definitions_request_balance_option_debit_rounding.py +7 -0
  47. brevo/balance/types/post_loyalty_balance_programs_pid_balance_definitions_request_unit.py +26 -0
  48. brevo/balance/types/post_loyalty_balance_programs_pid_subscriptions_cid_balances_response.py +66 -0
  49. brevo/balance/types/update_balance_definition_request_balance_availability_duration_modifier.py +7 -0
  50. brevo/balance/types/update_balance_definition_request_balance_availability_duration_unit.py +7 -0
  51. brevo/balance/types/update_balance_definition_request_balance_option_amount_overtaking_strategy.py +7 -0
  52. brevo/balance/types/update_balance_definition_request_balance_option_credit_rounding.py +7 -0
  53. brevo/balance/types/update_balance_definition_request_balance_option_debit_rounding.py +7 -0
  54. brevo/balance/types/update_balance_definition_request_unit.py +26 -0
  55. brevo/balance/types/update_balance_limit_request_constraint_type.py +5 -0
  56. brevo/balance/types/update_balance_limit_request_duration_unit.py +5 -0
  57. brevo/balance/types/update_balance_limit_request_transaction_type.py +5 -0
  58. brevo/client.py +773 -0
  59. brevo/companies/__init__.py +61 -0
  60. brevo/companies/client.py +994 -0
  61. brevo/companies/raw_client.py +1285 -0
  62. brevo/companies/types/__init__.py +59 -0
  63. brevo/companies/types/get_companies_request_sort.py +5 -0
  64. brevo/companies/types/get_companies_response.py +28 -0
  65. brevo/companies/types/get_crm_attributes_companies_response_item.py +40 -0
  66. brevo/companies/types/post_companies_import_response.py +26 -0
  67. brevo/companies/types/post_companies_response.py +27 -0
  68. brevo/companies/types/post_crm_attributes_request_attribute_type.py +7 -0
  69. brevo/companies/types/post_crm_attributes_request_object_type.py +5 -0
  70. brevo/companies/types/post_crm_attributes_response.py +23 -0
  71. brevo/contacts/__init__.py +289 -0
  72. brevo/contacts/client.py +3298 -0
  73. brevo/contacts/raw_client.py +4614 -0
  74. brevo/contacts/types/__init__.py +309 -0
  75. brevo/contacts/types/add_contact_to_list_request_body.py +11 -0
  76. brevo/contacts/types/add_contact_to_list_request_body_emails.py +23 -0
  77. brevo/contacts/types/add_contact_to_list_request_body_ext_ids.py +29 -0
  78. brevo/contacts/types/add_contact_to_list_request_body_ids.py +23 -0
  79. brevo/contacts/types/create_attribute_request_attribute_category.py +7 -0
  80. brevo/contacts/types/create_attribute_request_enumeration_item.py +28 -0
  81. brevo/contacts/types/create_attribute_request_type.py +7 -0
  82. brevo/contacts/types/create_contact_request_attributes_value.py +5 -0
  83. brevo/contacts/types/create_contact_response.py +23 -0
  84. brevo/contacts/types/create_doi_contact_request_attributes_value.py +5 -0
  85. brevo/contacts/types/create_folder_response.py +23 -0
  86. brevo/contacts/types/create_list_response.py +23 -0
  87. brevo/contacts/types/delete_attribute_request_attribute_category.py +7 -0
  88. brevo/contacts/types/delete_contact_request_identifier.py +5 -0
  89. brevo/contacts/types/delete_contact_request_identifier_type.py +7 -0
  90. brevo/contacts/types/get_attributes_response.py +24 -0
  91. brevo/contacts/types/get_attributes_response_attributes_item.py +57 -0
  92. brevo/contacts/types/get_attributes_response_attributes_item_category.py +7 -0
  93. brevo/contacts/types/get_attributes_response_attributes_item_enumeration_item.py +28 -0
  94. brevo/contacts/types/get_attributes_response_attributes_item_type.py +7 -0
  95. brevo/contacts/types/get_contact_info_request_identifier.py +5 -0
  96. brevo/contacts/types/get_contact_info_request_identifier_type.py +7 -0
  97. brevo/contacts/types/get_contact_info_response.py +80 -0
  98. brevo/contacts/types/get_contact_info_response_attributes.py +22 -0
  99. brevo/contacts/types/get_contact_info_response_statistics.py +86 -0
  100. brevo/contacts/types/get_contact_info_response_statistics_clicked_item.py +33 -0
  101. brevo/contacts/types/get_contact_info_response_statistics_clicked_item_links_item.py +40 -0
  102. brevo/contacts/types/get_contact_info_response_statistics_complaints_item.py +31 -0
  103. brevo/contacts/types/get_contact_info_response_statistics_delivered_item.py +31 -0
  104. brevo/contacts/types/get_contact_info_response_statistics_hard_bounces_item.py +31 -0
  105. brevo/contacts/types/get_contact_info_response_statistics_messages_sent_item.py +31 -0
  106. brevo/contacts/types/get_contact_info_response_statistics_opened_item.py +40 -0
  107. brevo/contacts/types/get_contact_info_response_statistics_soft_bounces_item.py +31 -0
  108. brevo/contacts/types/get_contact_info_response_statistics_transac_attributes_item.py +18 -0
  109. brevo/contacts/types/get_contact_info_response_statistics_unsubscriptions.py +43 -0
  110. brevo/contacts/types/get_contact_info_response_statistics_unsubscriptions_admin_unsubscription_item.py +30 -0
  111. brevo/contacts/types/get_contact_info_response_statistics_unsubscriptions_user_unsubscription_item.py +35 -0
  112. brevo/contacts/types/get_contact_stats_request_identifier.py +5 -0
  113. brevo/contacts/types/get_contact_stats_response.py +59 -0
  114. brevo/contacts/types/get_contact_stats_response_clicked_item.py +28 -0
  115. brevo/contacts/types/get_contact_stats_response_clicked_item_links_item.py +40 -0
  116. brevo/contacts/types/get_contact_stats_response_complaints_item.py +31 -0
  117. brevo/contacts/types/get_contact_stats_response_delivered_item.py +31 -0
  118. brevo/contacts/types/get_contact_stats_response_hard_bounces_item.py +31 -0
  119. brevo/contacts/types/get_contact_stats_response_messages_sent_item.py +31 -0
  120. brevo/contacts/types/get_contact_stats_response_opened_item.py +40 -0
  121. brevo/contacts/types/get_contact_stats_response_soft_bounces_item.py +31 -0
  122. brevo/contacts/types/get_contact_stats_response_transac_attributes_item.py +31 -0
  123. brevo/contacts/types/get_contact_stats_response_unsubscriptions.py +39 -0
  124. brevo/contacts/types/get_contact_stats_response_unsubscriptions_admin_unsubscription_item.py +30 -0
  125. brevo/contacts/types/get_contact_stats_response_unsubscriptions_user_unsubscription_item.py +35 -0
  126. brevo/contacts/types/get_contacts_from_list_request_sort.py +5 -0
  127. brevo/contacts/types/get_contacts_request_sort.py +5 -0
  128. brevo/contacts/types/get_folder_lists_request_sort.py +5 -0
  129. brevo/contacts/types/get_folder_lists_response.py +26 -0
  130. brevo/contacts/types/get_folders_request_sort.py +5 -0
  131. brevo/contacts/types/get_folders_response.py +26 -0
  132. brevo/contacts/types/get_list_response.py +68 -0
  133. brevo/contacts/types/get_list_response_campaign_stats_item.py +26 -0
  134. brevo/contacts/types/get_lists_request_sort.py +5 -0
  135. brevo/contacts/types/get_lists_response.py +29 -0
  136. brevo/contacts/types/get_lists_response_lists_item.py +49 -0
  137. brevo/contacts/types/get_segments_request_sort.py +5 -0
  138. brevo/contacts/types/get_segments_response.py +29 -0
  139. brevo/contacts/types/get_segments_response_segments_item.py +41 -0
  140. brevo/contacts/types/import_contacts_request_json_body_item.py +25 -0
  141. brevo/contacts/types/import_contacts_request_new_list.py +41 -0
  142. brevo/contacts/types/import_contacts_response.py +26 -0
  143. brevo/contacts/types/remove_contact_from_list_request_body.py +15 -0
  144. brevo/contacts/types/remove_contact_from_list_request_body_all.py +29 -0
  145. brevo/contacts/types/remove_contact_from_list_request_body_emails.py +23 -0
  146. brevo/contacts/types/remove_contact_from_list_request_body_ext_ids.py +29 -0
  147. brevo/contacts/types/remove_contact_from_list_request_body_ids.py +23 -0
  148. brevo/contacts/types/request_contact_export_request_custom_contact_filter.py +90 -0
  149. brevo/contacts/types/request_contact_export_request_custom_contact_filter_action_for_contacts.py +7 -0
  150. brevo/contacts/types/request_contact_export_request_custom_contact_filter_action_for_email_campaigns.py +8 -0
  151. brevo/contacts/types/request_contact_export_request_custom_contact_filter_action_for_sms_campaigns.py +7 -0
  152. brevo/contacts/types/request_contact_export_response.py +26 -0
  153. brevo/contacts/types/update_attribute_request_attribute_category.py +7 -0
  154. brevo/contacts/types/update_attribute_request_enumeration_item.py +28 -0
  155. brevo/contacts/types/update_batch_contacts_request_contacts_item.py +80 -0
  156. brevo/contacts/types/update_contact_request_attributes_value.py +5 -0
  157. brevo/contacts/types/update_contact_request_identifier.py +5 -0
  158. brevo/contacts/types/update_contact_request_identifier_type.py +7 -0
  159. brevo/conversations/__init__.py +34 -0
  160. brevo/conversations/client.py +912 -0
  161. brevo/conversations/raw_client.py +1328 -0
  162. brevo/conversations/types/__init__.py +36 -0
  163. brevo/conversations/types/put_conversations_visitor_group_response.py +31 -0
  164. brevo/core/__init__.py +125 -0
  165. brevo/core/api_error.py +23 -0
  166. brevo/core/client_wrapper.py +100 -0
  167. brevo/core/datetime_utils.py +28 -0
  168. brevo/core/file.py +67 -0
  169. brevo/core/force_multipart.py +18 -0
  170. brevo/core/http_client.py +776 -0
  171. brevo/core/http_response.py +59 -0
  172. brevo/core/http_sse/__init__.py +42 -0
  173. brevo/core/http_sse/_api.py +112 -0
  174. brevo/core/http_sse/_decoders.py +61 -0
  175. brevo/core/http_sse/_exceptions.py +7 -0
  176. brevo/core/http_sse/_models.py +17 -0
  177. brevo/core/jsonable_encoder.py +108 -0
  178. brevo/core/logging.py +107 -0
  179. brevo/core/pydantic_utilities.py +577 -0
  180. brevo/core/query_encoder.py +58 -0
  181. brevo/core/remove_none_from_dict.py +11 -0
  182. brevo/core/request_options.py +35 -0
  183. brevo/core/serialization.py +276 -0
  184. brevo/core/unchecked_base_model.py +376 -0
  185. brevo/coupons/__init__.py +49 -0
  186. brevo/coupons/client.py +550 -0
  187. brevo/coupons/raw_client.py +839 -0
  188. brevo/coupons/types/__init__.py +47 -0
  189. brevo/coupons/types/create_coupon_collection_response.py +23 -0
  190. brevo/coupons/types/get_coupon_collections_request_sort.py +5 -0
  191. brevo/coupons/types/get_coupon_collections_request_sort_by.py +7 -0
  192. brevo/coupons/types/update_coupon_collection_response.py +35 -0
  193. brevo/custom_objects/__init__.py +139 -0
  194. brevo/custom_objects/client.py +437 -0
  195. brevo/custom_objects/raw_client.py +711 -0
  196. brevo/custom_objects/types/__init__.py +177 -0
  197. brevo/custom_objects/types/batch_delete_object_records_request_identifiers.py +10 -0
  198. brevo/custom_objects/types/batch_delete_object_records_request_identifiers_ext_ids.py +23 -0
  199. brevo/custom_objects/types/batch_delete_object_records_request_identifiers_ids.py +23 -0
  200. brevo/custom_objects/types/batch_delete_object_records_response.py +27 -0
  201. brevo/custom_objects/types/getrecords_request_association.py +5 -0
  202. brevo/custom_objects/types/getrecords_request_sort.py +5 -0
  203. brevo/custom_objects/types/getrecords_response.py +26 -0
  204. brevo/custom_objects/types/getrecords_response_records_item.py +51 -0
  205. brevo/custom_objects/types/getrecords_response_records_item_associations_item.py +10 -0
  206. brevo/custom_objects/types/getrecords_response_records_item_associations_item_one.py +28 -0
  207. brevo/custom_objects/types/getrecords_response_records_item_associations_item_one_records_item.py +15 -0
  208. brevo/custom_objects/types/getrecords_response_records_item_associations_item_one_records_item_one.py +28 -0
  209. brevo/custom_objects/types/getrecords_response_records_item_associations_item_one_records_item_one_identifiers.py +27 -0
  210. brevo/custom_objects/types/getrecords_response_records_item_associations_item_one_records_item_zero.py +28 -0
  211. brevo/custom_objects/types/getrecords_response_records_item_associations_item_one_records_item_zero_identifiers.py +27 -0
  212. brevo/custom_objects/types/getrecords_response_records_item_associations_item_zero.py +28 -0
  213. brevo/custom_objects/types/getrecords_response_records_item_associations_item_zero_records_item.py +15 -0
  214. brevo/custom_objects/types/getrecords_response_records_item_associations_item_zero_records_item_one.py +28 -0
  215. brevo/custom_objects/types/getrecords_response_records_item_associations_item_zero_records_item_one_identifiers.py +27 -0
  216. brevo/custom_objects/types/getrecords_response_records_item_associations_item_zero_records_item_zero.py +28 -0
  217. brevo/custom_objects/types/getrecords_response_records_item_associations_item_zero_records_item_zero_identifiers.py +27 -0
  218. brevo/custom_objects/types/getrecords_response_records_item_identifiers.py +32 -0
  219. brevo/custom_objects/types/upsertrecords_request_records_item.py +31 -0
  220. brevo/custom_objects/types/upsertrecords_request_records_item_associations_item.py +12 -0
  221. brevo/custom_objects/types/upsertrecords_request_records_item_associations_item_one.py +28 -0
  222. brevo/custom_objects/types/upsertrecords_request_records_item_associations_item_one_records_item.py +15 -0
  223. brevo/custom_objects/types/upsertrecords_request_records_item_associations_item_one_records_item_one.py +20 -0
  224. brevo/custom_objects/types/upsertrecords_request_records_item_associations_item_one_records_item_zero.py +28 -0
  225. brevo/custom_objects/types/upsertrecords_request_records_item_associations_item_one_records_item_zero_identifiers.py +32 -0
  226. brevo/custom_objects/types/upsertrecords_request_records_item_associations_item_zero.py +28 -0
  227. brevo/custom_objects/types/upsertrecords_request_records_item_associations_item_zero_records_item.py +23 -0
  228. brevo/custom_objects/types/upsertrecords_request_records_item_associations_item_zero_records_item_identifiers.py +28 -0
  229. brevo/custom_objects/types/upsertrecords_request_records_item_identifiers.py +32 -0
  230. brevo/custom_objects/types/upsertrecords_response.py +29 -0
  231. brevo/deals/__init__.py +52 -0
  232. brevo/deals/client.py +1013 -0
  233. brevo/deals/raw_client.py +1326 -0
  234. brevo/deals/types/__init__.py +50 -0
  235. brevo/deals/types/get_crm_attributes_deals_response_item.py +40 -0
  236. brevo/deals/types/get_crm_deals_request_sort.py +5 -0
  237. brevo/deals/types/get_crm_deals_response.py +28 -0
  238. brevo/deals/types/post_crm_deals_import_response.py +26 -0
  239. brevo/deals/types/post_crm_deals_response.py +27 -0
  240. brevo/domains/__init__.py +79 -0
  241. brevo/domains/client.py +506 -0
  242. brevo/domains/raw_client.py +698 -0
  243. brevo/domains/types/__init__.py +83 -0
  244. brevo/domains/types/authenticate_domain_response.py +28 -0
  245. brevo/domains/types/create_domain_response.py +44 -0
  246. brevo/domains/types/create_domain_response_dns_records.py +40 -0
  247. brevo/domains/types/create_domain_response_dns_records_brevo_code.py +42 -0
  248. brevo/domains/types/create_domain_response_dns_records_dkim_record.py +42 -0
  249. brevo/domains/types/create_domain_response_dns_records_dmarc_record.py +42 -0
  250. brevo/domains/types/get_domain_configuration_response.py +41 -0
  251. brevo/domains/types/get_domain_configuration_response_dns_records.py +44 -0
  252. brevo/domains/types/get_domain_configuration_response_dns_records_brevo_code.py +42 -0
  253. brevo/domains/types/get_domain_configuration_response_dns_records_dkim_record.py +42 -0
  254. brevo/domains/types/get_domain_configuration_response_dns_records_dmarc_record.py +42 -0
  255. brevo/domains/types/get_domains_response.py +39 -0
  256. brevo/domains/types/get_domains_response_domains_item.py +56 -0
  257. brevo/domains/types/get_domains_response_domains_item_creator.py +41 -0
  258. brevo/ecommerce/__init__.py +112 -0
  259. brevo/ecommerce/client.py +2176 -0
  260. brevo/ecommerce/raw_client.py +2895 -0
  261. brevo/ecommerce/types/__init__.py +124 -0
  262. brevo/ecommerce/types/create_batch_order_response.py +28 -0
  263. brevo/ecommerce/types/create_product_alert_request_contact_identifiers.py +33 -0
  264. brevo/ecommerce/types/create_update_batch_category_request_categories_item.py +48 -0
  265. brevo/ecommerce/types/create_update_batch_category_response.py +31 -0
  266. brevo/ecommerce/types/create_update_batch_products_request_products_item.py +89 -0
  267. brevo/ecommerce/types/create_update_batch_products_request_products_item_meta_info_value.py +5 -0
  268. brevo/ecommerce/types/create_update_batch_products_response.py +31 -0
  269. brevo/ecommerce/types/create_update_category_response.py +23 -0
  270. brevo/ecommerce/types/create_update_product_request_meta_info_value.py +5 -0
  271. brevo/ecommerce/types/create_update_product_response.py +23 -0
  272. brevo/ecommerce/types/get_categories_request_sort.py +5 -0
  273. brevo/ecommerce/types/get_categories_response.py +25 -0
  274. brevo/ecommerce/types/get_ecommerce_attribution_metrics_conversion_source_conversion_source_id_request_conversion_source.py +7 -0
  275. brevo/ecommerce/types/get_ecommerce_attribution_metrics_conversion_source_conversion_source_id_response.py +40 -0
  276. brevo/ecommerce/types/get_ecommerce_attribution_metrics_conversion_source_conversion_source_id_response_conversion_source.py +7 -0
  277. brevo/ecommerce/types/get_ecommerce_attribution_metrics_response.py +30 -0
  278. brevo/ecommerce/types/get_ecommerce_attribution_metrics_response_totals.py +32 -0
  279. brevo/ecommerce/types/get_ecommerce_attribution_products_conversion_source_conversion_source_id_request_conversion_source.py +7 -0
  280. brevo/ecommerce/types/get_ecommerce_attribution_products_conversion_source_conversion_source_id_response.py +28 -0
  281. brevo/ecommerce/types/get_ecommerce_attribution_products_conversion_source_conversion_source_id_response_products_item.py +33 -0
  282. brevo/ecommerce/types/get_ecommerce_config_display_currency_response.py +23 -0
  283. brevo/ecommerce/types/get_orders_request_sort.py +5 -0
  284. brevo/ecommerce/types/get_products_request_sort.py +5 -0
  285. brevo/ecommerce/types/get_products_response.py +26 -0
  286. brevo/ecommerce/types/set_config_display_currency_response.py +23 -0
  287. brevo/email_campaigns/__init__.py +139 -0
  288. brevo/email_campaigns/client.py +1864 -0
  289. brevo/email_campaigns/raw_client.py +2472 -0
  290. brevo/email_campaigns/types/__init__.py +141 -0
  291. brevo/email_campaigns/types/create_email_campaign_request_email_expiration_date.py +33 -0
  292. brevo/email_campaigns/types/create_email_campaign_request_email_expiration_date_unit.py +5 -0
  293. brevo/email_campaigns/types/create_email_campaign_request_recipients.py +52 -0
  294. brevo/email_campaigns/types/create_email_campaign_request_sender.py +37 -0
  295. brevo/email_campaigns/types/create_email_campaign_request_winner_criteria.py +5 -0
  296. brevo/email_campaigns/types/create_email_campaign_response.py +23 -0
  297. brevo/email_campaigns/types/email_export_recipients_request_recipients_type.py +10 -0
  298. brevo/email_campaigns/types/email_export_recipients_response.py +26 -0
  299. brevo/email_campaigns/types/get_ab_test_campaign_result_response.py +64 -0
  300. brevo/email_campaigns/types/get_ab_test_campaign_result_response_clicked_links.py +28 -0
  301. brevo/email_campaigns/types/get_ab_test_campaign_result_response_statistics.py +32 -0
  302. brevo/email_campaigns/types/get_ab_test_campaign_result_response_winning_criteria.py +5 -0
  303. brevo/email_campaigns/types/get_ab_test_campaign_result_response_winning_version.py +7 -0
  304. brevo/email_campaigns/types/get_email_campaign_request_statistics.py +7 -0
  305. brevo/email_campaigns/types/get_email_campaign_response.py +234 -0
  306. brevo/email_campaigns/types/get_email_campaign_response_sender.py +33 -0
  307. brevo/email_campaigns/types/get_email_campaign_response_status.py +7 -0
  308. brevo/email_campaigns/types/get_email_campaign_response_type.py +5 -0
  309. brevo/email_campaigns/types/get_email_campaigns_request_sort.py +5 -0
  310. brevo/email_campaigns/types/get_email_campaigns_request_statistics.py +7 -0
  311. brevo/email_campaigns/types/get_email_campaigns_request_status.py +7 -0
  312. brevo/email_campaigns/types/get_email_campaigns_request_type.py +5 -0
  313. brevo/email_campaigns/types/get_email_campaigns_response.py +25 -0
  314. brevo/email_campaigns/types/get_email_campaigns_response_campaigns_item.py +234 -0
  315. brevo/email_campaigns/types/get_email_campaigns_response_campaigns_item_sender.py +33 -0
  316. brevo/email_campaigns/types/get_email_campaigns_response_campaigns_item_status.py +7 -0
  317. brevo/email_campaigns/types/get_email_campaigns_response_campaigns_item_type.py +5 -0
  318. brevo/email_campaigns/types/get_shared_template_url_response.py +29 -0
  319. brevo/email_campaigns/types/update_email_campaign_request_email_expiration_date.py +33 -0
  320. brevo/email_campaigns/types/update_email_campaign_request_email_expiration_date_unit.py +5 -0
  321. brevo/email_campaigns/types/update_email_campaign_request_recipients.py +53 -0
  322. brevo/email_campaigns/types/update_email_campaign_request_sender.py +37 -0
  323. brevo/email_campaigns/types/update_email_campaign_request_winner_criteria.py +5 -0
  324. brevo/email_campaigns/types/upload_image_to_gallery_response.py +23 -0
  325. brevo/environment.py +7 -0
  326. brevo/errors/__init__.py +80 -0
  327. brevo/errors/bad_request_error.py +10 -0
  328. brevo/errors/conflict_error.py +11 -0
  329. brevo/errors/expectation_failed_error.py +11 -0
  330. brevo/errors/failed_dependency_error.py +10 -0
  331. brevo/errors/forbidden_error.py +10 -0
  332. brevo/errors/internal_server_error.py +10 -0
  333. brevo/errors/method_not_allowed_error.py +11 -0
  334. brevo/errors/not_found_error.py +10 -0
  335. brevo/errors/payment_required_error.py +11 -0
  336. brevo/errors/precondition_failed_error.py +11 -0
  337. brevo/errors/too_early_error.py +11 -0
  338. brevo/errors/too_many_requests_error.py +11 -0
  339. brevo/errors/unauthorized_error.py +10 -0
  340. brevo/errors/unprocessable_entity_error.py +11 -0
  341. brevo/errors/unsupported_media_type_error.py +11 -0
  342. brevo/event/__init__.py +52 -0
  343. brevo/event/client.py +184 -0
  344. brevo/event/raw_client.py +230 -0
  345. brevo/event/types/__init__.py +50 -0
  346. brevo/event/types/create_event_request_contact_properties_value.py +5 -0
  347. brevo/event/types/create_event_request_event_properties_value.py +5 -0
  348. brevo/event/types/create_event_request_identifiers.py +52 -0
  349. brevo/event/types/create_event_request_object.py +33 -0
  350. brevo/event/types/create_event_request_object_identifiers.py +32 -0
  351. brevo/external_feeds/__init__.py +79 -0
  352. brevo/external_feeds/client.py +915 -0
  353. brevo/external_feeds/raw_client.py +1087 -0
  354. brevo/external_feeds/types/__init__.py +77 -0
  355. brevo/external_feeds/types/create_external_feed_request_auth_type.py +5 -0
  356. brevo/external_feeds/types/create_external_feed_request_headers_item.py +28 -0
  357. brevo/external_feeds/types/create_external_feed_response.py +23 -0
  358. brevo/external_feeds/types/get_all_external_feeds_request_auth_type.py +5 -0
  359. brevo/external_feeds/types/get_all_external_feeds_request_sort.py +5 -0
  360. brevo/external_feeds/types/get_all_external_feeds_response.py +29 -0
  361. brevo/external_feeds/types/get_all_external_feeds_response_feeds_item.py +96 -0
  362. brevo/external_feeds/types/get_all_external_feeds_response_feeds_item_auth_type.py +5 -0
  363. brevo/external_feeds/types/get_all_external_feeds_response_feeds_item_headers_item.py +28 -0
  364. brevo/external_feeds/types/get_external_feed_by_uuid_response.py +105 -0
  365. brevo/external_feeds/types/get_external_feed_by_uuid_response_auth_type.py +5 -0
  366. brevo/external_feeds/types/get_external_feed_by_uuid_response_headers_item.py +28 -0
  367. brevo/external_feeds/types/update_external_feed_request_auth_type.py +5 -0
  368. brevo/external_feeds/types/update_external_feed_request_headers_item.py +28 -0
  369. brevo/files/__init__.py +38 -0
  370. brevo/files/client.py +479 -0
  371. brevo/files/raw_client.py +675 -0
  372. brevo/files/types/__init__.py +40 -0
  373. brevo/files/types/get_crm_files_id_response.py +30 -0
  374. brevo/files/types/get_crm_files_request_entity.py +5 -0
  375. brevo/files/types/get_crm_files_request_sort.py +5 -0
  376. brevo/inbound_parsing/__init__.py +58 -0
  377. brevo/inbound_parsing/client.py +323 -0
  378. brevo/inbound_parsing/raw_client.py +420 -0
  379. brevo/inbound_parsing/types/__init__.py +60 -0
  380. brevo/inbound_parsing/types/get_inbound_email_events_by_uuid_response.py +72 -0
  381. brevo/inbound_parsing/types/get_inbound_email_events_by_uuid_response_attachments_item.py +40 -0
  382. brevo/inbound_parsing/types/get_inbound_email_events_by_uuid_response_logs_item.py +30 -0
  383. brevo/inbound_parsing/types/get_inbound_email_events_by_uuid_response_logs_item_type.py +7 -0
  384. brevo/inbound_parsing/types/get_inbound_email_events_request_sort.py +5 -0
  385. brevo/inbound_parsing/types/get_inbound_email_events_response.py +21 -0
  386. brevo/inbound_parsing/types/get_inbound_email_events_response_events_item.py +42 -0
  387. brevo/master_account/__init__.py +202 -0
  388. brevo/master_account/client.py +2757 -0
  389. brevo/master_account/raw_client.py +3351 -0
  390. brevo/master_account/types/__init__.py +244 -0
  391. brevo/master_account/types/get_corporate_group_id_response.py +31 -0
  392. brevo/master_account/types/get_corporate_group_id_response_group.py +35 -0
  393. brevo/master_account/types/get_corporate_group_id_response_sub_accounts_item.py +35 -0
  394. brevo/master_account/types/get_corporate_group_id_response_users_item.py +36 -0
  395. brevo/master_account/types/get_corporate_invited_users_list_response.py +24 -0
  396. brevo/master_account/types/get_corporate_invited_users_list_response_users_item.py +50 -0
  397. brevo/master_account/types/get_corporate_invited_users_list_response_users_item_feature_access.py +69 -0
  398. brevo/master_account/types/get_corporate_invited_users_list_response_users_item_groups.py +32 -0
  399. brevo/master_account/types/get_corporate_ip_response_item.py +22 -0
  400. brevo/master_account/types/get_corporate_master_account_response.py +57 -0
  401. brevo/master_account/types/get_corporate_master_account_response_billing_info.py +48 -0
  402. brevo/master_account/types/get_corporate_master_account_response_billing_info_address.py +50 -0
  403. brevo/master_account/types/get_corporate_master_account_response_billing_info_name.py +35 -0
  404. brevo/master_account/types/get_corporate_master_account_response_plan_info.py +63 -0
  405. brevo/master_account/types/get_corporate_master_account_response_plan_info_features_item.py +62 -0
  406. brevo/master_account/types/get_corporate_master_account_response_plan_info_plan_period.py +5 -0
  407. brevo/master_account/types/get_corporate_sub_account_id_response.py +48 -0
  408. brevo/master_account/types/get_corporate_sub_account_id_response_groups_item.py +28 -0
  409. brevo/master_account/types/get_corporate_sub_account_id_response_plan_info.py +42 -0
  410. brevo/master_account/types/get_corporate_sub_account_id_response_plan_info_credits.py +65 -0
  411. brevo/master_account/types/get_corporate_sub_account_id_response_plan_info_credits_emails.py +32 -0
  412. brevo/master_account/types/get_corporate_sub_account_id_response_plan_info_credits_external_feeds.py +33 -0
  413. brevo/master_account/types/get_corporate_sub_account_id_response_plan_info_credits_sms.py +32 -0
  414. brevo/master_account/types/get_corporate_sub_account_id_response_plan_info_credits_whatsapp.py +32 -0
  415. brevo/master_account/types/get_corporate_sub_account_id_response_plan_info_credits_wp_subscribers.py +32 -0
  416. brevo/master_account/types/get_corporate_sub_account_id_response_plan_info_features.py +58 -0
  417. brevo/master_account/types/get_corporate_sub_account_id_response_plan_info_features_inbox.py +32 -0
  418. brevo/master_account/types/get_corporate_sub_account_id_response_plan_info_features_landing_page.py +32 -0
  419. brevo/master_account/types/get_corporate_sub_account_id_response_plan_info_features_sales_users.py +33 -0
  420. brevo/master_account/types/get_corporate_sub_account_id_response_plan_info_features_users.py +32 -0
  421. brevo/master_account/types/get_corporate_sub_account_response.py +32 -0
  422. brevo/master_account/types/get_corporate_sub_account_response_sub_accounts_item.py +48 -0
  423. brevo/master_account/types/get_corporate_sub_account_response_sub_accounts_item_groups_item.py +28 -0
  424. brevo/master_account/types/get_corporate_user_permission_response.py +40 -0
  425. brevo/master_account/types/get_corporate_user_permission_response_feature_access.py +62 -0
  426. brevo/master_account/types/get_corporate_user_permission_response_groups_item.py +32 -0
  427. brevo/master_account/types/get_sub_account_groups_response_item.py +30 -0
  428. brevo/master_account/types/invite_admin_user_request_privileges_item.py +38 -0
  429. brevo/master_account/types/invite_admin_user_request_privileges_item_feature.py +18 -0
  430. brevo/master_account/types/invite_admin_user_request_privileges_item_permissions_item.py +7 -0
  431. brevo/master_account/types/invite_admin_user_response.py +20 -0
  432. brevo/master_account/types/post_corporate_group_response.py +20 -0
  433. brevo/master_account/types/post_corporate_sub_account_key_response.py +28 -0
  434. brevo/master_account/types/post_corporate_sub_account_request_language.py +5 -0
  435. brevo/master_account/types/post_corporate_sub_account_response.py +23 -0
  436. brevo/master_account/types/post_corporate_sub_account_sso_token_request_target.py +17 -0
  437. brevo/master_account/types/put_corporate_sub_account_id_plan_request_credits.py +59 -0
  438. brevo/master_account/types/put_corporate_sub_account_id_plan_request_features.py +44 -0
  439. brevo/master_account/types/put_corporate_sub_accounts_plan_request_credits.py +59 -0
  440. brevo/master_account/types/put_corporate_sub_accounts_plan_request_features.py +39 -0
  441. brevo/master_account/types/put_corporate_user_email_permissions_request_privileges_item.py +42 -0
  442. brevo/master_account/types/put_corporate_user_email_permissions_request_privileges_item_feature.py +18 -0
  443. brevo/master_account/types/put_corporate_user_email_permissions_request_privileges_item_permissions_item.py +10 -0
  444. brevo/master_account/types/put_corporate_user_invitation_action_email_request_action.py +5 -0
  445. brevo/master_account/types/put_corporate_user_invitation_action_email_response.py +23 -0
  446. brevo/notes/__init__.py +38 -0
  447. brevo/notes/client.py +548 -0
  448. brevo/notes/raw_client.py +766 -0
  449. brevo/notes/types/__init__.py +40 -0
  450. brevo/notes/types/get_crm_notes_request_entity.py +5 -0
  451. brevo/notes/types/get_crm_notes_request_sort.py +5 -0
  452. brevo/notes/types/post_crm_notes_response.py +27 -0
  453. brevo/payments/__init__.py +38 -0
  454. brevo/payments/client.py +315 -0
  455. brevo/payments/raw_client.py +532 -0
  456. brevo/payments/types/__init__.py +40 -0
  457. brevo/payments/types/create_payment_request_response.py +28 -0
  458. brevo/payments/types/get_payment_request_response.py +47 -0
  459. brevo/payments/types/get_payment_request_response_status.py +5 -0
  460. brevo/process/__init__.py +79 -0
  461. brevo/process/client.py +304 -0
  462. brevo/process/raw_client.py +372 -0
  463. brevo/process/types/__init__.py +77 -0
  464. brevo/process/types/get_process_response.py +62 -0
  465. brevo/process/types/get_process_response_info.py +36 -0
  466. brevo/process/types/get_process_response_info_export.py +32 -0
  467. brevo/process/types/get_process_response_info_import.py +57 -0
  468. brevo/process/types/get_process_response_name.py +16 -0
  469. brevo/process/types/get_process_response_status.py +7 -0
  470. brevo/process/types/get_processes_request_sort.py +5 -0
  471. brevo/process/types/get_processes_response.py +29 -0
  472. brevo/process/types/get_processes_response_processes_item.py +62 -0
  473. brevo/process/types/get_processes_response_processes_item_info.py +36 -0
  474. brevo/process/types/get_processes_response_processes_item_info_export.py +32 -0
  475. brevo/process/types/get_processes_response_processes_item_info_import.py +57 -0
  476. brevo/process/types/get_processes_response_processes_item_name.py +16 -0
  477. brevo/process/types/get_processes_response_processes_item_status.py +7 -0
  478. brevo/program/__init__.py +67 -0
  479. brevo/program/client.py +1128 -0
  480. brevo/program/raw_client.py +2526 -0
  481. brevo/program/types/__init__.py +67 -0
  482. brevo/program/types/get_lp_list_request_sort_field.py +5 -0
  483. brevo/program/types/get_lp_list_response.py +24 -0
  484. brevo/program/types/get_parameter_subscription_info_response.py +44 -0
  485. brevo/program/types/get_parameter_subscription_info_response_balance.py +41 -0
  486. brevo/program/types/get_parameter_subscription_info_response_balance_balances_item.py +30 -0
  487. brevo/program/types/get_parameter_subscription_info_response_members_item.py +36 -0
  488. brevo/program/types/get_parameter_subscription_info_response_reward_item.py +66 -0
  489. brevo/program/types/get_parameter_subscription_info_response_tier_item.py +56 -0
  490. brevo/program/types/subscribe_member_to_a_subscription_response.py +46 -0
  491. brevo/program/types/subscribe_to_loyalty_program_response.py +56 -0
  492. brevo/py.typed +0 -0
  493. brevo/reward/__init__.py +115 -0
  494. brevo/reward/client.py +1285 -0
  495. brevo/reward/raw_client.py +2564 -0
  496. brevo/reward/types/__init__.py +139 -0
  497. brevo/reward/types/create_reward_response.py +64 -0
  498. brevo/reward/types/create_voucher_response.py +76 -0
  499. brevo/reward/types/get_code_count_response.py +23 -0
  500. brevo/reward/types/get_loyalty_offer_programs_pid_offers_request_version.py +5 -0
  501. brevo/reward/types/get_loyalty_offer_programs_pid_offers_response.py +34 -0
  502. brevo/reward/types/get_loyalty_offer_programs_pid_offers_response_items_item.py +67 -0
  503. brevo/reward/types/get_loyalty_offer_programs_pid_rewards_rid_request_version.py +5 -0
  504. brevo/reward/types/get_loyalty_offer_programs_pid_rewards_rid_response.py +269 -0
  505. brevo/reward/types/get_loyalty_offer_programs_pid_rewards_rid_response_expiration_modifier.py +7 -0
  506. brevo/reward/types/get_loyalty_offer_programs_pid_rewards_rid_response_generator.py +52 -0
  507. brevo/reward/types/get_loyalty_offer_programs_pid_rewards_rid_response_limits_item.py +68 -0
  508. brevo/reward/types/get_loyalty_offer_programs_pid_rewards_rid_response_products_item.py +40 -0
  509. brevo/reward/types/get_loyalty_offer_programs_pid_rewards_rid_response_reward_configs.py +33 -0
  510. brevo/reward/types/get_loyalty_offer_programs_pid_rewards_rid_response_rule.py +101 -0
  511. brevo/reward/types/get_loyalty_offer_programs_pid_rewards_rid_response_rule_event.py +28 -0
  512. brevo/reward/types/get_loyalty_offer_programs_pid_rewards_rid_response_rule_results_item.py +43 -0
  513. brevo/reward/types/get_loyalty_offer_programs_pid_rewards_rid_response_rule_results_item_parameters_item.py +37 -0
  514. brevo/reward/types/get_loyalty_offer_programs_pid_vouchers_request_sort.py +5 -0
  515. brevo/reward/types/get_loyalty_offer_programs_pid_vouchers_request_sort_field.py +5 -0
  516. brevo/reward/types/get_loyalty_offer_programs_pid_vouchers_response.py +49 -0
  517. brevo/reward/types/get_loyalty_offer_programs_pid_vouchers_response_contact_rewards_item.py +70 -0
  518. brevo/reward/types/redeem_voucher_request_order.py +85 -0
  519. brevo/reward/types/redeem_voucher_request_order_billing.py +55 -0
  520. brevo/reward/types/redeem_voucher_request_order_identifiers.py +28 -0
  521. brevo/reward/types/redeem_voucher_request_order_products_item.py +46 -0
  522. brevo/reward/types/validate_reward_response.py +23 -0
  523. brevo/senders/__init__.py +67 -0
  524. brevo/senders/client.py +808 -0
  525. brevo/senders/raw_client.py +1089 -0
  526. brevo/senders/types/__init__.py +65 -0
  527. brevo/senders/types/create_sender_request_ips_item.py +36 -0
  528. brevo/senders/types/create_sender_response.py +42 -0
  529. brevo/senders/types/get_ips_from_sender_response.py +25 -0
  530. brevo/senders/types/get_ips_from_sender_response_ips_item.py +38 -0
  531. brevo/senders/types/get_ips_response.py +25 -0
  532. brevo/senders/types/get_ips_response_ips_item.py +38 -0
  533. brevo/senders/types/get_senders_response.py +24 -0
  534. brevo/senders/types/get_senders_response_senders_item.py +46 -0
  535. brevo/senders/types/get_senders_response_senders_item_ips_item.py +33 -0
  536. brevo/senders/types/update_sender_request_ips_item.py +36 -0
  537. brevo/sms_campaigns/__init__.py +73 -0
  538. brevo/sms_campaigns/client.py +1078 -0
  539. brevo/sms_campaigns/raw_client.py +1501 -0
  540. brevo/sms_campaigns/types/__init__.py +71 -0
  541. brevo/sms_campaigns/types/create_sms_campaign_request_recipients.py +33 -0
  542. brevo/sms_campaigns/types/create_sms_campaign_response.py +23 -0
  543. brevo/sms_campaigns/types/get_sms_campaign_response.py +74 -0
  544. brevo/sms_campaigns/types/get_sms_campaign_response_status.py +7 -0
  545. brevo/sms_campaigns/types/get_sms_campaigns_request_sort.py +5 -0
  546. brevo/sms_campaigns/types/get_sms_campaigns_request_status.py +7 -0
  547. brevo/sms_campaigns/types/get_sms_campaigns_response.py +25 -0
  548. brevo/sms_campaigns/types/get_sms_campaigns_response_campaigns_item.py +74 -0
  549. brevo/sms_campaigns/types/get_sms_campaigns_response_campaigns_item_status.py +7 -0
  550. brevo/sms_campaigns/types/request_sms_recipient_export_request_recipients_type.py +7 -0
  551. brevo/sms_campaigns/types/request_sms_recipient_export_response.py +26 -0
  552. brevo/sms_campaigns/types/update_sms_campaign_request_recipients.py +33 -0
  553. brevo/sms_templates/__init__.py +49 -0
  554. brevo/sms_templates/client.py +133 -0
  555. brevo/sms_templates/raw_client.py +151 -0
  556. brevo/sms_templates/types/__init__.py +47 -0
  557. brevo/sms_templates/types/get_sms_templates_request_sort.py +5 -0
  558. brevo/sms_templates/types/get_sms_templates_response.py +26 -0
  559. brevo/sms_templates/types/get_sms_templates_response_templates_item.py +86 -0
  560. brevo/sms_templates/types/get_sms_templates_response_templates_item_compliance.py +37 -0
  561. brevo/tasks/__init__.py +55 -0
  562. brevo/tasks/client.py +814 -0
  563. brevo/tasks/raw_client.py +992 -0
  564. brevo/tasks/types/__init__.py +53 -0
  565. brevo/tasks/types/get_crm_tasks_request_filter_date.py +5 -0
  566. brevo/tasks/types/get_crm_tasks_request_filter_status.py +5 -0
  567. brevo/tasks/types/get_crm_tasks_request_sort.py +5 -0
  568. brevo/tasks/types/get_crm_tasks_response.py +28 -0
  569. brevo/tasks/types/get_crm_tasktypes_response.py +32 -0
  570. brevo/tasks/types/post_crm_tasks_response.py +27 -0
  571. brevo/tier/__init__.py +79 -0
  572. brevo/tier/client.py +1144 -0
  573. brevo/tier/raw_client.py +2360 -0
  574. brevo/tier/types/__init__.py +79 -0
  575. brevo/tier/types/add_subscription_to_tier_response.py +53 -0
  576. brevo/tier/types/create_tier_for_tier_group_request_access_conditions_item.py +31 -0
  577. brevo/tier/types/create_tier_for_tier_group_request_tier_rewards_item.py +26 -0
  578. brevo/tier/types/create_tier_group_request_downgrade_strategy.py +7 -0
  579. brevo/tier/types/create_tier_group_request_upgrade_strategy.py +7 -0
  580. brevo/tier/types/get_list_of_tier_groups_request_version.py +5 -0
  581. brevo/tier/types/get_list_of_tier_groups_response.py +21 -0
  582. brevo/tier/types/get_loyalty_program_tier_request_version.py +5 -0
  583. brevo/tier/types/get_loyalty_program_tier_response.py +21 -0
  584. brevo/tier/types/get_tier_group_request_version.py +5 -0
  585. brevo/tier/types/update_tier_group_request_downgrade_strategy.py +7 -0
  586. brevo/tier/types/update_tier_group_request_upgrade_strategy.py +7 -0
  587. brevo/tier/types/update_tier_request_access_conditions_item.py +31 -0
  588. brevo/tier/types/update_tier_request_tier_rewards_item.py +26 -0
  589. brevo/transactional_emails/__init__.py +175 -0
  590. brevo/transactional_emails/client.py +2544 -0
  591. brevo/transactional_emails/raw_client.py +3240 -0
  592. brevo/transactional_emails/types/__init__.py +189 -0
  593. brevo/transactional_emails/types/create_smtp_template_request_sender.py +37 -0
  594. brevo/transactional_emails/types/create_smtp_template_response.py +23 -0
  595. brevo/transactional_emails/types/get_aggregated_smtp_report_response.py +85 -0
  596. brevo/transactional_emails/types/get_blocked_domains_response.py +23 -0
  597. brevo/transactional_emails/types/get_email_event_report_request_event.py +23 -0
  598. brevo/transactional_emails/types/get_email_event_report_request_sort.py +5 -0
  599. brevo/transactional_emails/types/get_email_event_report_response.py +21 -0
  600. brevo/transactional_emails/types/get_email_event_report_response_events_item.py +79 -0
  601. brevo/transactional_emails/types/get_email_event_report_response_events_item_event.py +23 -0
  602. brevo/transactional_emails/types/get_scheduled_email_by_id_request_sort.py +5 -0
  603. brevo/transactional_emails/types/get_scheduled_email_by_id_request_status.py +5 -0
  604. brevo/transactional_emails/types/get_scheduled_email_by_id_response.py +10 -0
  605. brevo/transactional_emails/types/get_scheduled_email_by_id_response_batches.py +25 -0
  606. brevo/transactional_emails/types/get_scheduled_email_by_id_response_batches_batches_item.py +39 -0
  607. brevo/transactional_emails/types/get_scheduled_email_by_id_response_batches_batches_item_status.py +7 -0
  608. brevo/transactional_emails/types/get_scheduled_email_by_id_response_created_at.py +37 -0
  609. brevo/transactional_emails/types/get_scheduled_email_by_id_response_created_at_status.py +7 -0
  610. brevo/transactional_emails/types/get_smtp_report_request_sort.py +5 -0
  611. brevo/transactional_emails/types/get_smtp_report_response.py +21 -0
  612. brevo/transactional_emails/types/get_smtp_report_response_reports_item.py +86 -0
  613. brevo/transactional_emails/types/get_smtp_templates_request_sort.py +5 -0
  614. brevo/transactional_emails/types/get_smtp_templates_response.py +26 -0
  615. brevo/transactional_emails/types/get_transac_blocked_contacts_request_sort.py +5 -0
  616. brevo/transactional_emails/types/get_transac_blocked_contacts_response.py +25 -0
  617. brevo/transactional_emails/types/get_transac_blocked_contacts_response_contacts_item.py +44 -0
  618. brevo/transactional_emails/types/get_transac_blocked_contacts_response_contacts_item_reason.py +35 -0
  619. brevo/transactional_emails/types/get_transac_blocked_contacts_response_contacts_item_reason_code.py +15 -0
  620. brevo/transactional_emails/types/get_transac_email_content_response.py +57 -0
  621. brevo/transactional_emails/types/get_transac_email_content_response_events_item.py +28 -0
  622. brevo/transactional_emails/types/get_transac_emails_list_request_sort.py +5 -0
  623. brevo/transactional_emails/types/get_transac_emails_list_response.py +34 -0
  624. brevo/transactional_emails/types/get_transac_emails_list_response_transactional_emails_item.py +61 -0
  625. brevo/transactional_emails/types/post_preview_smtp_email_templates_response.py +49 -0
  626. brevo/transactional_emails/types/send_transac_email_request_attachment_item.py +33 -0
  627. brevo/transactional_emails/types/send_transac_email_request_bcc_item.py +28 -0
  628. brevo/transactional_emails/types/send_transac_email_request_cc_item.py +28 -0
  629. brevo/transactional_emails/types/send_transac_email_request_message_versions_item.py +73 -0
  630. brevo/transactional_emails/types/send_transac_email_request_message_versions_item_bcc_item.py +28 -0
  631. brevo/transactional_emails/types/send_transac_email_request_message_versions_item_cc_item.py +28 -0
  632. brevo/transactional_emails/types/send_transac_email_request_message_versions_item_reply_to.py +32 -0
  633. brevo/transactional_emails/types/send_transac_email_request_message_versions_item_to_item.py +28 -0
  634. brevo/transactional_emails/types/send_transac_email_request_reply_to.py +32 -0
  635. brevo/transactional_emails/types/send_transac_email_request_sender.py +37 -0
  636. brevo/transactional_emails/types/send_transac_email_request_to_item.py +28 -0
  637. brevo/transactional_emails/types/send_transac_email_response.py +29 -0
  638. brevo/transactional_emails/types/update_smtp_template_request_sender.py +37 -0
  639. brevo/transactional_sms/__init__.py +70 -0
  640. brevo/transactional_sms/client.py +726 -0
  641. brevo/transactional_sms/raw_client.py +913 -0
  642. brevo/transactional_sms/types/__init__.py +68 -0
  643. brevo/transactional_sms/types/get_sms_events_request_event.py +20 -0
  644. brevo/transactional_sms/types/get_sms_events_request_sort.py +5 -0
  645. brevo/transactional_sms/types/get_sms_events_response.py +21 -0
  646. brevo/transactional_sms/types/get_sms_events_response_events_item.py +52 -0
  647. brevo/transactional_sms/types/get_sms_events_response_events_item_event.py +20 -0
  648. brevo/transactional_sms/types/get_transac_aggregated_sms_report_response.py +75 -0
  649. brevo/transactional_sms/types/get_transac_sms_report_request_sort.py +5 -0
  650. brevo/transactional_sms/types/get_transac_sms_report_response.py +21 -0
  651. brevo/transactional_sms/types/get_transac_sms_report_response_reports_item.py +76 -0
  652. brevo/transactional_sms/types/send_async_transactional_sms_response.py +22 -0
  653. brevo/transactional_sms/types/send_transac_sms_response.py +38 -0
  654. brevo/transactional_whats_app/__init__.py +64 -0
  655. brevo/transactional_whats_app/client.py +283 -0
  656. brevo/transactional_whats_app/raw_client.py +326 -0
  657. brevo/transactional_whats_app/types/__init__.py +62 -0
  658. brevo/transactional_whats_app/types/get_whatsapp_event_report_request_event.py +7 -0
  659. brevo/transactional_whats_app/types/get_whatsapp_event_report_request_sort.py +5 -0
  660. brevo/transactional_whats_app/types/get_whatsapp_event_report_response.py +21 -0
  661. brevo/transactional_whats_app/types/get_whatsapp_event_report_response_events_item.py +65 -0
  662. brevo/transactional_whats_app/types/get_whatsapp_event_report_response_events_item_event.py +7 -0
  663. brevo/transactional_whats_app/types/send_whatsapp_message_request.py +8 -0
  664. brevo/transactional_whats_app/types/send_whatsapp_message_request_params.py +41 -0
  665. brevo/transactional_whats_app/types/send_whatsapp_message_request_text.py +35 -0
  666. brevo/transactional_whats_app/types/send_whatsapp_message_response.py +26 -0
  667. brevo/types/__init__.py +373 -0
  668. brevo/types/ab_test_version_clicks.py +7 -0
  669. brevo/types/ab_test_version_clicks_item.py +35 -0
  670. brevo/types/ab_test_version_stats.py +35 -0
  671. brevo/types/bad_request_error_body.py +29 -0
  672. brevo/types/bad_request_error_body_code.py +45 -0
  673. brevo/types/balance_definition.py +139 -0
  674. brevo/types/balance_definition_balance_availability_duration_modifier.py +7 -0
  675. brevo/types/balance_limit.py +78 -0
  676. brevo/types/cart.py +38 -0
  677. brevo/types/company.py +45 -0
  678. brevo/types/configuration.py +30 -0
  679. brevo/types/contact_error_model.py +34 -0
  680. brevo/types/contact_error_model_code.py +16 -0
  681. brevo/types/conversations_message.py +187 -0
  682. brevo/types/conversations_message_attachments_item.py +50 -0
  683. brevo/types/conversations_message_bcc_item.py +21 -0
  684. brevo/types/conversations_message_cc_item.py +21 -0
  685. brevo/types/conversations_message_file.py +46 -0
  686. brevo/types/conversations_message_file_image_info.py +39 -0
  687. brevo/types/conversations_message_forwarded_to_source_status.py +29 -0
  688. brevo/types/conversations_message_from.py +25 -0
  689. brevo/types/conversations_message_reply_to.py +25 -0
  690. brevo/types/conversations_message_to_item.py +21 -0
  691. brevo/types/conversations_message_type.py +5 -0
  692. brevo/types/conversion_source_metrics.py +35 -0
  693. brevo/types/conversion_source_metrics_conversion_source.py +7 -0
  694. brevo/types/create_update_folder.py +23 -0
  695. brevo/types/deal.py +45 -0
  696. brevo/types/error_model.py +28 -0
  697. brevo/types/file_data.py +60 -0
  698. brevo/types/forbidden_error_body.py +29 -0
  699. brevo/types/forbidden_error_body_code.py +45 -0
  700. brevo/types/get_campaign_recipients.py +25 -0
  701. brevo/types/get_campaign_stats.py +130 -0
  702. brevo/types/get_category_details.py +54 -0
  703. brevo/types/get_contact_details.py +75 -0
  704. brevo/types/get_contact_details_attributes.py +22 -0
  705. brevo/types/get_contacts.py +25 -0
  706. brevo/types/get_coupon_collection.py +75 -0
  707. brevo/types/get_device_browser_stats.py +44 -0
  708. brevo/types/get_extended_campaign_overview.py +230 -0
  709. brevo/types/get_extended_campaign_overview_sender.py +33 -0
  710. brevo/types/get_extended_campaign_overview_status.py +7 -0
  711. brevo/types/get_extended_campaign_overview_type.py +5 -0
  712. brevo/types/get_extended_campaign_stats.py +63 -0
  713. brevo/types/get_extended_campaign_stats_links_stats.py +22 -0
  714. brevo/types/get_extended_campaign_stats_stats_by_device.py +39 -0
  715. brevo/types/get_folder.py +46 -0
  716. brevo/types/get_list.py +46 -0
  717. brevo/types/get_product_details.py +115 -0
  718. brevo/types/get_sms_campaign_overview.py +69 -0
  719. brevo/types/get_sms_campaign_overview_status.py +7 -0
  720. brevo/types/get_sms_campaign_stats.py +55 -0
  721. brevo/types/get_smtp_template_overview.py +93 -0
  722. brevo/types/get_smtp_template_overview_sender.py +33 -0
  723. brevo/types/get_sso_token.py +23 -0
  724. brevo/types/get_webhook.py +74 -0
  725. brevo/types/get_webhook_channel.py +5 -0
  726. brevo/types/get_webhook_type.py +5 -0
  727. brevo/types/inviteuser.py +31 -0
  728. brevo/types/inviteuser_privileges_item.py +34 -0
  729. brevo/types/inviteuser_privileges_item_feature.py +24 -0
  730. brevo/types/inviteuser_privileges_item_permissions_item.py +39 -0
  731. brevo/types/loyalty_program.py +82 -0
  732. brevo/types/loyalty_program_state.py +5 -0
  733. brevo/types/node_response.py +63 -0
  734. brevo/types/not_found_error_body.py +29 -0
  735. brevo/types/not_found_error_body_code.py +45 -0
  736. brevo/types/note.py +61 -0
  737. brevo/types/note_data.py +44 -0
  738. brevo/types/notification.py +32 -0
  739. brevo/types/order.py +85 -0
  740. brevo/types/order_billing.py +66 -0
  741. brevo/types/order_identifiers.py +42 -0
  742. brevo/types/order_meta_info_value.py +5 -0
  743. brevo/types/order_products_item.py +43 -0
  744. brevo/types/pipeline.py +38 -0
  745. brevo/types/pipeline_stages_item.py +32 -0
  746. brevo/types/pipelines.py +7 -0
  747. brevo/types/post_contact_info.py +21 -0
  748. brevo/types/post_contact_info_contacts.py +37 -0
  749. brevo/types/post_contact_info_contacts_failure.py +5 -0
  750. brevo/types/post_contact_info_contacts_success.py +5 -0
  751. brevo/types/post_send_failed.py +46 -0
  752. brevo/types/redeem.py +92 -0
  753. brevo/types/rule_condition_response.py +52 -0
  754. brevo/types/send_report.py +30 -0
  755. brevo/types/send_report_email.py +32 -0
  756. brevo/types/send_report_language.py +5 -0
  757. brevo/types/send_test_email.py +29 -0
  758. brevo/types/send_transac_sms.py +66 -0
  759. brevo/types/send_transac_sms_tag.py +28 -0
  760. brevo/types/send_transac_sms_tag_field.py +5 -0
  761. brevo/types/send_transac_sms_type.py +5 -0
  762. brevo/types/task.py +55 -0
  763. brevo/types/task_reminder.py +39 -0
  764. brevo/types/task_reminder_types_item.py +5 -0
  765. brevo/types/task_reminder_unit.py +5 -0
  766. brevo/types/tier.py +63 -0
  767. brevo/types/tier_access_conditions_item.py +38 -0
  768. brevo/types/tier_group.py +70 -0
  769. brevo/types/tier_group_downgrade_strategy.py +7 -0
  770. brevo/types/tier_group_upgrade_strategy.py +7 -0
  771. brevo/types/tier_tier_rewards_item.py +33 -0
  772. brevo/types/transaction.py +110 -0
  773. brevo/types/unauthorized_error_body.py +29 -0
  774. brevo/types/unauthorized_error_body_code.py +45 -0
  775. brevo/types/update_campaign_status.py +28 -0
  776. brevo/types/update_campaign_status_status.py +8 -0
  777. brevo/types/value_response.py +67 -0
  778. brevo/types/variables_items.py +22 -0
  779. brevo/types/whatsapp_camp_stats.py +26 -0
  780. brevo/user/__init__.py +67 -0
  781. brevo/user/client.py +806 -0
  782. brevo/user/raw_client.py +977 -0
  783. brevo/user/types/__init__.py +67 -0
  784. brevo/user/types/edit_user_permission_response.py +33 -0
  785. brevo/user/types/get_invited_users_list_response.py +24 -0
  786. brevo/user/types/get_invited_users_list_response_users_item.py +39 -0
  787. brevo/user/types/get_invited_users_list_response_users_item_feature_access.py +37 -0
  788. brevo/user/types/get_user_permission_response.py +38 -0
  789. brevo/user/types/get_user_permission_response_privileges_item.py +21 -0
  790. brevo/user/types/inviteuser_response.py +28 -0
  791. brevo/user/types/put_revoke_user_permission_response.py +28 -0
  792. brevo/user/types/putresendcancelinvitation_request_action.py +5 -0
  793. brevo/user/types/putresendcancelinvitation_response.py +28 -0
  794. brevo/version.py +3 -0
  795. brevo/webhooks/__init__.py +82 -0
  796. brevo/webhooks/client.py +982 -0
  797. brevo/webhooks/raw_client.py +1211 -0
  798. brevo/webhooks/types/__init__.py +80 -0
  799. brevo/webhooks/types/create_webhook_request_auth.py +32 -0
  800. brevo/webhooks/types/create_webhook_request_channel.py +5 -0
  801. brevo/webhooks/types/create_webhook_request_events_item.py +26 -0
  802. brevo/webhooks/types/create_webhook_request_headers_item.py +28 -0
  803. brevo/webhooks/types/create_webhook_request_type.py +5 -0
  804. brevo/webhooks/types/create_webhook_response.py +23 -0
  805. brevo/webhooks/types/export_webhooks_history_request_event.py +26 -0
  806. brevo/webhooks/types/export_webhooks_history_request_type.py +5 -0
  807. brevo/webhooks/types/export_webhooks_history_response.py +26 -0
  808. brevo/webhooks/types/get_webhooks_request_sort.py +5 -0
  809. brevo/webhooks/types/get_webhooks_request_type.py +5 -0
  810. brevo/webhooks/types/get_webhooks_response.py +21 -0
  811. brevo/webhooks/types/update_webhook_request_auth.py +32 -0
  812. brevo/webhooks/types/update_webhook_request_events_item.py +26 -0
  813. brevo/webhooks/types/update_webhook_request_headers_item.py +28 -0
  814. brevo/whats_app_campaigns/__init__.py +106 -0
  815. brevo/whats_app_campaigns/client.py +1064 -0
  816. brevo/whats_app_campaigns/raw_client.py +1311 -0
  817. brevo/whats_app_campaigns/types/__init__.py +110 -0
  818. brevo/whats_app_campaigns/types/create_whats_app_campaign_request_recipients.py +41 -0
  819. brevo/whats_app_campaigns/types/create_whats_app_campaign_response.py +23 -0
  820. brevo/whats_app_campaigns/types/create_whats_app_template_request_category.py +5 -0
  821. brevo/whats_app_campaigns/types/create_whats_app_template_request_source.py +5 -0
  822. brevo/whats_app_campaigns/types/create_whats_app_template_response.py +23 -0
  823. brevo/whats_app_campaigns/types/get_whats_app_campaign_response.py +69 -0
  824. brevo/whats_app_campaigns/types/get_whats_app_campaign_response_campaign_status.py +7 -0
  825. brevo/whats_app_campaigns/types/get_whats_app_campaign_response_template.py +61 -0
  826. brevo/whats_app_campaigns/types/get_whats_app_campaign_response_template_components_item.py +21 -0
  827. brevo/whats_app_campaigns/types/get_whats_app_campaigns_request_sort.py +5 -0
  828. brevo/whats_app_campaigns/types/get_whats_app_campaigns_response.py +25 -0
  829. brevo/whats_app_campaigns/types/get_whats_app_campaigns_response_campaigns_item.py +84 -0
  830. brevo/whats_app_campaigns/types/get_whats_app_campaigns_response_campaigns_item_campaign_status.py +7 -0
  831. brevo/whats_app_campaigns/types/get_whats_app_config_response.py +63 -0
  832. brevo/whats_app_campaigns/types/get_whats_app_config_response_phone_number_name_status.py +7 -0
  833. brevo/whats_app_campaigns/types/get_whats_app_config_response_phone_number_quality.py +5 -0
  834. brevo/whats_app_campaigns/types/get_whats_app_config_response_whatsapp_business_account_status.py +7 -0
  835. brevo/whats_app_campaigns/types/get_whats_app_templates_request_sort.py +5 -0
  836. brevo/whats_app_campaigns/types/get_whats_app_templates_request_source.py +5 -0
  837. brevo/whats_app_campaigns/types/get_whats_app_templates_response.py +26 -0
  838. brevo/whats_app_campaigns/types/get_whats_app_templates_response_templates_item.py +65 -0
  839. brevo/whats_app_campaigns/types/update_whats_app_campaign_request_campaign_status.py +5 -0
  840. brevo/whats_app_campaigns/types/update_whats_app_campaign_request_recipients.py +41 -0
  841. brevo_python-4.0.1.dist-info/METADATA +1072 -0
  842. brevo_python-4.0.1.dist-info/RECORD +843 -0
  843. brevo_python-4.0.1.dist-info/WHEEL +4 -0
@@ -0,0 +1,2472 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from json.decoder import JSONDecodeError
5
+
6
+ from ..core.api_error import ApiError
7
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8
+ from ..core.http_response import AsyncHttpResponse, HttpResponse
9
+ from ..core.jsonable_encoder import jsonable_encoder
10
+ from ..core.request_options import RequestOptions
11
+ from ..core.serialization import convert_and_respect_annotation_metadata
12
+ from ..core.unchecked_base_model import construct_type
13
+ from ..errors.bad_request_error import BadRequestError
14
+ from ..errors.method_not_allowed_error import MethodNotAllowedError
15
+ from ..errors.not_found_error import NotFoundError
16
+ from ..errors.payment_required_error import PaymentRequiredError
17
+ from ..types.error_model import ErrorModel
18
+ from ..types.send_report_email import SendReportEmail
19
+ from ..types.send_report_language import SendReportLanguage
20
+ from ..types.update_campaign_status_status import UpdateCampaignStatusStatus
21
+ from .types.create_email_campaign_request_email_expiration_date import CreateEmailCampaignRequestEmailExpirationDate
22
+ from .types.create_email_campaign_request_recipients import CreateEmailCampaignRequestRecipients
23
+ from .types.create_email_campaign_request_sender import CreateEmailCampaignRequestSender
24
+ from .types.create_email_campaign_request_winner_criteria import CreateEmailCampaignRequestWinnerCriteria
25
+ from .types.create_email_campaign_response import CreateEmailCampaignResponse
26
+ from .types.email_export_recipients_request_recipients_type import EmailExportRecipientsRequestRecipientsType
27
+ from .types.email_export_recipients_response import EmailExportRecipientsResponse
28
+ from .types.get_ab_test_campaign_result_response import GetAbTestCampaignResultResponse
29
+ from .types.get_email_campaign_request_statistics import GetEmailCampaignRequestStatistics
30
+ from .types.get_email_campaign_response import GetEmailCampaignResponse
31
+ from .types.get_email_campaigns_request_sort import GetEmailCampaignsRequestSort
32
+ from .types.get_email_campaigns_request_statistics import GetEmailCampaignsRequestStatistics
33
+ from .types.get_email_campaigns_request_status import GetEmailCampaignsRequestStatus
34
+ from .types.get_email_campaigns_request_type import GetEmailCampaignsRequestType
35
+ from .types.get_email_campaigns_response import GetEmailCampaignsResponse
36
+ from .types.get_shared_template_url_response import GetSharedTemplateUrlResponse
37
+ from .types.update_email_campaign_request_email_expiration_date import UpdateEmailCampaignRequestEmailExpirationDate
38
+ from .types.update_email_campaign_request_recipients import UpdateEmailCampaignRequestRecipients
39
+ from .types.update_email_campaign_request_sender import UpdateEmailCampaignRequestSender
40
+ from .types.update_email_campaign_request_winner_criteria import UpdateEmailCampaignRequestWinnerCriteria
41
+ from .types.upload_image_to_gallery_response import UploadImageToGalleryResponse
42
+
43
+ # this is used as the default value for optional parameters
44
+ OMIT = typing.cast(typing.Any, ...)
45
+
46
+
47
+ class RawEmailCampaignsClient:
48
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
49
+ self._client_wrapper = client_wrapper
50
+
51
+ def get_email_campaigns(
52
+ self,
53
+ *,
54
+ type: typing.Optional[GetEmailCampaignsRequestType] = None,
55
+ status: typing.Optional[GetEmailCampaignsRequestStatus] = None,
56
+ statistics: typing.Optional[GetEmailCampaignsRequestStatistics] = None,
57
+ start_date: typing.Optional[str] = None,
58
+ end_date: typing.Optional[str] = None,
59
+ limit: typing.Optional[int] = None,
60
+ offset: typing.Optional[int] = None,
61
+ sort: typing.Optional[GetEmailCampaignsRequestSort] = None,
62
+ exclude_html_content: typing.Optional[bool] = None,
63
+ request_options: typing.Optional[RequestOptions] = None,
64
+ ) -> HttpResponse[GetEmailCampaignsResponse]:
65
+ """
66
+ <Note>
67
+ The response payload for this endpoint has changed
68
+
69
+ You now need to specify which type of statistics you would like to retrieve. For more information visit [this page](https://developers.brevo.com/changelog/get-all-marketing-campaigns).
70
+ </Note>
71
+
72
+ Parameters
73
+ ----------
74
+ type : typing.Optional[GetEmailCampaignsRequestType]
75
+ Filter on the type of the campaigns
76
+
77
+ status : typing.Optional[GetEmailCampaignsRequestStatus]
78
+ Filter on the status of the campaign
79
+
80
+ statistics : typing.Optional[GetEmailCampaignsRequestStatistics]
81
+ Filter on type of the statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response.This option only returns data for events occurred in the last 6 months.For older campaigns, it’s advisable to use the **Get Campaign Report** endpoint.
82
+
83
+ start_date : typing.Optional[str]
84
+ **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' )
85
+
86
+ end_date : typing.Optional[str]
87
+ **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' )
88
+
89
+ limit : typing.Optional[int]
90
+ Number of documents per page
91
+
92
+ offset : typing.Optional[int]
93
+ Index of the first document in the page
94
+
95
+ sort : typing.Optional[GetEmailCampaignsRequestSort]
96
+ Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
97
+
98
+ exclude_html_content : typing.Optional[bool]
99
+ Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body
100
+
101
+ request_options : typing.Optional[RequestOptions]
102
+ Request-specific configuration.
103
+
104
+ Returns
105
+ -------
106
+ HttpResponse[GetEmailCampaignsResponse]
107
+ Email campaigns informations
108
+ """
109
+ _response = self._client_wrapper.httpx_client.request(
110
+ "emailCampaigns",
111
+ method="GET",
112
+ params={
113
+ "type": type,
114
+ "status": status,
115
+ "statistics": statistics,
116
+ "startDate": start_date,
117
+ "endDate": end_date,
118
+ "limit": limit,
119
+ "offset": offset,
120
+ "sort": sort,
121
+ "excludeHtmlContent": exclude_html_content,
122
+ },
123
+ request_options=request_options,
124
+ )
125
+ try:
126
+ if 200 <= _response.status_code < 300:
127
+ _data = typing.cast(
128
+ GetEmailCampaignsResponse,
129
+ construct_type(
130
+ type_=GetEmailCampaignsResponse, # type: ignore
131
+ object_=_response.json(),
132
+ ),
133
+ )
134
+ return HttpResponse(response=_response, data=_data)
135
+ if _response.status_code == 400:
136
+ raise BadRequestError(
137
+ headers=dict(_response.headers),
138
+ body=typing.cast(
139
+ typing.Any,
140
+ construct_type(
141
+ type_=typing.Any, # type: ignore
142
+ object_=_response.json(),
143
+ ),
144
+ ),
145
+ )
146
+ _response_json = _response.json()
147
+ except JSONDecodeError:
148
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
149
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
150
+
151
+ def create_email_campaign(
152
+ self,
153
+ *,
154
+ name: str,
155
+ sender: CreateEmailCampaignRequestSender,
156
+ ab_testing: typing.Optional[bool] = OMIT,
157
+ attachment_url: typing.Optional[str] = OMIT,
158
+ email_expiration_date: typing.Optional[CreateEmailCampaignRequestEmailExpirationDate] = OMIT,
159
+ footer: typing.Optional[str] = OMIT,
160
+ header: typing.Optional[str] = OMIT,
161
+ html_content: typing.Optional[str] = OMIT,
162
+ html_url: typing.Optional[str] = OMIT,
163
+ increase_rate: typing.Optional[int] = OMIT,
164
+ initial_quota: typing.Optional[int] = OMIT,
165
+ inline_image_activation: typing.Optional[bool] = OMIT,
166
+ ip_warmup_enable: typing.Optional[bool] = OMIT,
167
+ mirror_active: typing.Optional[bool] = OMIT,
168
+ params: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
169
+ preview_text: typing.Optional[str] = OMIT,
170
+ recipients: typing.Optional[CreateEmailCampaignRequestRecipients] = OMIT,
171
+ reply_to: typing.Optional[str] = OMIT,
172
+ scheduled_at: typing.Optional[str] = OMIT,
173
+ send_at_best_time: typing.Optional[bool] = OMIT,
174
+ split_rule: typing.Optional[int] = OMIT,
175
+ subject: typing.Optional[str] = OMIT,
176
+ subject_a: typing.Optional[str] = OMIT,
177
+ subject_b: typing.Optional[str] = OMIT,
178
+ tag: typing.Optional[str] = OMIT,
179
+ template_id: typing.Optional[int] = OMIT,
180
+ to_field: typing.Optional[str] = OMIT,
181
+ unsubscription_page_id: typing.Optional[str] = OMIT,
182
+ update_form_id: typing.Optional[str] = OMIT,
183
+ utm_campaign: typing.Optional[str] = OMIT,
184
+ winner_criteria: typing.Optional[CreateEmailCampaignRequestWinnerCriteria] = OMIT,
185
+ winner_delay: typing.Optional[int] = OMIT,
186
+ request_options: typing.Optional[RequestOptions] = None,
187
+ ) -> HttpResponse[CreateEmailCampaignResponse]:
188
+ """
189
+ Parameters
190
+ ----------
191
+ name : str
192
+ Name of the campaign
193
+
194
+ sender : CreateEmailCampaignRequestSender
195
+ Sender details including id or email and name (_optional_). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example: **{"name":"xyz", "email":"example@abc.com"}** **{"name":"xyz", "id":123}**
196
+
197
+ ab_testing : typing.Optional[bool]
198
+ Status of A/B Test. abTesting = false means it is disabled & abTesting = true means it is enabled. **subjectA, subjectB, splitRule, winnerCriteria & winnerDelay** will be considered when abTesting is set to true. subjectA & subjectB are mandatory together & subject if passed is ignored. **Can be set to true only if sendAtBestTime is false**. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B
199
+
200
+ attachment_url : typing.Optional[str]
201
+ Absolute url of the attachment (no local file). Extension allowed: #### xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps
202
+
203
+ email_expiration_date : typing.Optional[CreateEmailCampaignRequestEmailExpirationDate]
204
+ To reduce your carbon footprint, set an expiration date for your email. If supported, it will be automatically deleted from the recipient’s inbox, saving storage space and energy. Learn more about setting an email expiration date. For reference , ``https://help.brevo.com/hc/en-us/articles/4413566705298-Create-an-email-campaign``
205
+
206
+ footer : typing.Optional[str]
207
+ Footer of the email campaign
208
+
209
+ header : typing.Optional[str]
210
+ Header of the email campaign
211
+
212
+ html_content : typing.Optional[str]
213
+ Mandatory if htmlUrl and templateId are empty. Body of the message (HTML).
214
+
215
+ html_url : typing.Optional[str]
216
+ **Mandatory if htmlContent and templateId are empty**. Url to the message (HTML). For example: **https://html.domain.com**
217
+
218
+ increase_rate : typing.Optional[int]
219
+ **Mandatory if ipWarmupEnable is set to true**. Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%.
220
+
221
+ initial_quota : typing.Optional[int]
222
+ **Mandatory if ipWarmupEnable is set to true**. Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000.
223
+
224
+ inline_image_activation : typing.Optional[bool]
225
+ Use true to embedded the images in your email. Final size of the email should be less than **4MB**. Campaigns with embedded images can _not be sent to more than 5000 contacts_
226
+
227
+ ip_warmup_enable : typing.Optional[bool]
228
+ **Available for dedicated ip clients**. Set this to true if you wish to warm up your ip.
229
+
230
+ mirror_active : typing.Optional[bool]
231
+ Use true to enable the mirror link
232
+
233
+ params : typing.Optional[typing.Dict[str, typing.Any]]
234
+ Pass the set of attributes to customize the type classic campaign. For example: **{"FNAME":"Joe", "LNAME":"Doe"}**. Only available if **type** is **classic**. It's considered only if campaign is in _New Template Language format_. The New Template Language is dependent on the values of **subject, htmlContent/htmlUrl, sender.name & toField**
235
+
236
+ preview_text : typing.Optional[str]
237
+ Preview text or preheader of the email campaign
238
+
239
+ recipients : typing.Optional[CreateEmailCampaignRequestRecipients]
240
+ Segment ids and List ids to include/exclude from campaign
241
+
242
+ reply_to : typing.Optional[str]
243
+ Email on which the campaign recipients will be able to reply to
244
+
245
+ scheduled_at : typing.Optional[str]
246
+ Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result**. If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part). For example: **2017-06-01T12:30:00+02:00**
247
+
248
+ send_at_best_time : typing.Optional[bool]
249
+ Set this to true if you want to send your campaign at best time.
250
+
251
+ split_rule : typing.Optional[int]
252
+ Add the size of your test groups. **Mandatory if abTesting = true & 'recipients' is passed**. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else
253
+
254
+ subject : typing.Optional[str]
255
+ Subject of the campaign. **Mandatory if abTesting is false**. Ignored if abTesting is true.
256
+
257
+ subject_a : typing.Optional[str]
258
+ Subject A of the campaign. **Mandatory if abTesting = true**. subjectA & subjectB should have unique value
259
+
260
+ subject_b : typing.Optional[str]
261
+ Subject B of the campaign. **Mandatory if abTesting = true**. subjectA & subjectB should have unique value
262
+
263
+ tag : typing.Optional[str]
264
+ Tag of the campaign
265
+
266
+ template_id : typing.Optional[int]
267
+ **Mandatory if htmlContent and htmlUrl are empty**. Id of the transactional email template with status _active_. Used to copy only its content fetched from htmlContent/htmlUrl to an email campaign for RSS feature.
268
+
269
+ to_field : typing.Optional[str]
270
+ To personalize the **To** Field. If you want to include the first name and last name of your recipient, add **{FNAME} {LNAME}**. These contact attributes must already exist in your Brevo account. If input parameter **params** used please use **{{contact.FNAME}} {{contact.LNAME}}** for personalization
271
+
272
+ unsubscription_page_id : typing.Optional[str]
273
+ Enter an unsubscription page id. The page id is a 24 digit alphanumeric id that can be found in the URL when editing the page. If not entered, then the default unsubscription page will be used.
274
+
275
+ update_form_id : typing.Optional[str]
276
+ **Mandatory if templateId is used containing the {{ update_profile }} tag**. Enter an update profile form id. The form id is a 24 digit alphanumeric id that can be found in the URL when editing the form. If not entered, then the default update profile form will be used.
277
+
278
+ utm_campaign : typing.Optional[str]
279
+ Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed
280
+
281
+ winner_criteria : typing.Optional[CreateEmailCampaignRequestWinnerCriteria]
282
+ Choose the metrics that will determinate the winning version. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerCriteria` is ignored if passed
283
+
284
+ winner_delay : typing.Optional[int]
285
+ Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerDelay` is ignored if passed
286
+
287
+ request_options : typing.Optional[RequestOptions]
288
+ Request-specific configuration.
289
+
290
+ Returns
291
+ -------
292
+ HttpResponse[CreateEmailCampaignResponse]
293
+ successfully created
294
+ """
295
+ _response = self._client_wrapper.httpx_client.request(
296
+ "emailCampaigns",
297
+ method="POST",
298
+ json={
299
+ "abTesting": ab_testing,
300
+ "attachmentUrl": attachment_url,
301
+ "emailExpirationDate": convert_and_respect_annotation_metadata(
302
+ object_=email_expiration_date,
303
+ annotation=CreateEmailCampaignRequestEmailExpirationDate,
304
+ direction="write",
305
+ ),
306
+ "footer": footer,
307
+ "header": header,
308
+ "htmlContent": html_content,
309
+ "htmlUrl": html_url,
310
+ "increaseRate": increase_rate,
311
+ "initialQuota": initial_quota,
312
+ "inlineImageActivation": inline_image_activation,
313
+ "ipWarmupEnable": ip_warmup_enable,
314
+ "mirrorActive": mirror_active,
315
+ "name": name,
316
+ "params": params,
317
+ "previewText": preview_text,
318
+ "recipients": convert_and_respect_annotation_metadata(
319
+ object_=recipients, annotation=CreateEmailCampaignRequestRecipients, direction="write"
320
+ ),
321
+ "replyTo": reply_to,
322
+ "scheduledAt": scheduled_at,
323
+ "sendAtBestTime": send_at_best_time,
324
+ "sender": convert_and_respect_annotation_metadata(
325
+ object_=sender, annotation=CreateEmailCampaignRequestSender, direction="write"
326
+ ),
327
+ "splitRule": split_rule,
328
+ "subject": subject,
329
+ "subjectA": subject_a,
330
+ "subjectB": subject_b,
331
+ "tag": tag,
332
+ "templateId": template_id,
333
+ "toField": to_field,
334
+ "unsubscriptionPageId": unsubscription_page_id,
335
+ "updateFormId": update_form_id,
336
+ "utmCampaign": utm_campaign,
337
+ "winnerCriteria": winner_criteria,
338
+ "winnerDelay": winner_delay,
339
+ },
340
+ headers={
341
+ "content-type": "application/json",
342
+ },
343
+ request_options=request_options,
344
+ omit=OMIT,
345
+ )
346
+ try:
347
+ if 200 <= _response.status_code < 300:
348
+ _data = typing.cast(
349
+ CreateEmailCampaignResponse,
350
+ construct_type(
351
+ type_=CreateEmailCampaignResponse, # type: ignore
352
+ object_=_response.json(),
353
+ ),
354
+ )
355
+ return HttpResponse(response=_response, data=_data)
356
+ if _response.status_code == 400:
357
+ raise BadRequestError(
358
+ headers=dict(_response.headers),
359
+ body=typing.cast(
360
+ typing.Any,
361
+ construct_type(
362
+ type_=typing.Any, # type: ignore
363
+ object_=_response.json(),
364
+ ),
365
+ ),
366
+ )
367
+ _response_json = _response.json()
368
+ except JSONDecodeError:
369
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
370
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
371
+
372
+ def upload_image_to_gallery(
373
+ self,
374
+ *,
375
+ image_url: str,
376
+ name: typing.Optional[str] = OMIT,
377
+ request_options: typing.Optional[RequestOptions] = None,
378
+ ) -> HttpResponse[UploadImageToGalleryResponse]:
379
+ """
380
+ Parameters
381
+ ----------
382
+ image_url : str
383
+ The absolute url of the image (**no local file**). Maximum allowed size for image is **2MB**. Allowed extensions for images are: #### jpeg, jpg, png, bmp, gif.
384
+
385
+ name : typing.Optional[str]
386
+ Name of the image.
387
+
388
+ request_options : typing.Optional[RequestOptions]
389
+ Request-specific configuration.
390
+
391
+ Returns
392
+ -------
393
+ HttpResponse[UploadImageToGalleryResponse]
394
+ Image has been successfully uploaded
395
+ """
396
+ _response = self._client_wrapper.httpx_client.request(
397
+ "emailCampaigns/images",
398
+ method="POST",
399
+ json={
400
+ "imageUrl": image_url,
401
+ "name": name,
402
+ },
403
+ headers={
404
+ "content-type": "application/json",
405
+ },
406
+ request_options=request_options,
407
+ omit=OMIT,
408
+ )
409
+ try:
410
+ if 200 <= _response.status_code < 300:
411
+ _data = typing.cast(
412
+ UploadImageToGalleryResponse,
413
+ construct_type(
414
+ type_=UploadImageToGalleryResponse, # type: ignore
415
+ object_=_response.json(),
416
+ ),
417
+ )
418
+ return HttpResponse(response=_response, data=_data)
419
+ if _response.status_code == 400:
420
+ raise BadRequestError(
421
+ headers=dict(_response.headers),
422
+ body=typing.cast(
423
+ typing.Any,
424
+ construct_type(
425
+ type_=typing.Any, # type: ignore
426
+ object_=_response.json(),
427
+ ),
428
+ ),
429
+ )
430
+ _response_json = _response.json()
431
+ except JSONDecodeError:
432
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
433
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
434
+
435
+ def get_email_campaign(
436
+ self,
437
+ campaign_id: int,
438
+ *,
439
+ statistics: typing.Optional[GetEmailCampaignRequestStatistics] = None,
440
+ request_options: typing.Optional[RequestOptions] = None,
441
+ ) -> HttpResponse[GetEmailCampaignResponse]:
442
+ """
443
+ Parameters
444
+ ----------
445
+ campaign_id : int
446
+ Id of the campaign
447
+
448
+ statistics : typing.Optional[GetEmailCampaignRequestStatistics]
449
+ Filter on type of the statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response.
450
+
451
+ request_options : typing.Optional[RequestOptions]
452
+ Request-specific configuration.
453
+
454
+ Returns
455
+ -------
456
+ HttpResponse[GetEmailCampaignResponse]
457
+ Email campaign informations
458
+ """
459
+ _response = self._client_wrapper.httpx_client.request(
460
+ f"emailCampaigns/{jsonable_encoder(campaign_id)}",
461
+ method="GET",
462
+ params={
463
+ "statistics": statistics,
464
+ },
465
+ request_options=request_options,
466
+ )
467
+ try:
468
+ if 200 <= _response.status_code < 300:
469
+ _data = typing.cast(
470
+ GetEmailCampaignResponse,
471
+ construct_type(
472
+ type_=GetEmailCampaignResponse, # 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
+ if _response.status_code == 404:
489
+ raise NotFoundError(
490
+ headers=dict(_response.headers),
491
+ body=typing.cast(
492
+ typing.Any,
493
+ construct_type(
494
+ type_=typing.Any, # type: ignore
495
+ object_=_response.json(),
496
+ ),
497
+ ),
498
+ )
499
+ _response_json = _response.json()
500
+ except JSONDecodeError:
501
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
502
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
503
+
504
+ def update_email_campaign(
505
+ self,
506
+ campaign_id: int,
507
+ *,
508
+ ab_testing: typing.Optional[bool] = OMIT,
509
+ attachment_url: typing.Optional[str] = OMIT,
510
+ email_expiration_date: typing.Optional[UpdateEmailCampaignRequestEmailExpirationDate] = OMIT,
511
+ footer: typing.Optional[str] = OMIT,
512
+ header: typing.Optional[str] = OMIT,
513
+ html_content: typing.Optional[str] = OMIT,
514
+ html_url: typing.Optional[str] = OMIT,
515
+ increase_rate: typing.Optional[int] = OMIT,
516
+ initial_quota: typing.Optional[int] = OMIT,
517
+ inline_image_activation: typing.Optional[bool] = OMIT,
518
+ ip_warmup_enable: typing.Optional[bool] = OMIT,
519
+ mirror_active: typing.Optional[bool] = OMIT,
520
+ name: typing.Optional[str] = OMIT,
521
+ params: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
522
+ preview_text: typing.Optional[str] = OMIT,
523
+ recipients: typing.Optional[UpdateEmailCampaignRequestRecipients] = OMIT,
524
+ recurring: typing.Optional[bool] = OMIT,
525
+ reply_to: typing.Optional[str] = OMIT,
526
+ scheduled_at: typing.Optional[str] = OMIT,
527
+ send_at_best_time: typing.Optional[bool] = OMIT,
528
+ sender: typing.Optional[UpdateEmailCampaignRequestSender] = OMIT,
529
+ split_rule: typing.Optional[int] = OMIT,
530
+ subject: typing.Optional[str] = OMIT,
531
+ subject_a: typing.Optional[str] = OMIT,
532
+ subject_b: typing.Optional[str] = OMIT,
533
+ tag: typing.Optional[str] = OMIT,
534
+ to_field: typing.Optional[str] = OMIT,
535
+ unsubscription_page_id: typing.Optional[str] = OMIT,
536
+ update_form_id: typing.Optional[str] = OMIT,
537
+ utm_campaign: typing.Optional[str] = OMIT,
538
+ winner_criteria: typing.Optional[UpdateEmailCampaignRequestWinnerCriteria] = OMIT,
539
+ winner_delay: typing.Optional[int] = OMIT,
540
+ request_options: typing.Optional[RequestOptions] = None,
541
+ ) -> HttpResponse[None]:
542
+ """
543
+ Parameters
544
+ ----------
545
+ campaign_id : int
546
+ Id of the campaign
547
+
548
+ ab_testing : typing.Optional[bool]
549
+ Status of A/B Test. abTesting = false means it is disabled & abTesting = true means it is enabled. **subjectA, subjectB, splitRule, winnerCriteria & winnerDelay** will be considered when abTesting is set to true. subjectA & subjectB are mandatory together & subject if passed is ignored. **Can be set to true only if sendAtBestTime is false**. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B
550
+
551
+ attachment_url : typing.Optional[str]
552
+ Absolute url of the attachment (no local file). Extension allowed: #### xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps'
553
+
554
+ email_expiration_date : typing.Optional[UpdateEmailCampaignRequestEmailExpirationDate]
555
+ To reduce your carbon footprint, set an expiration date for your email. If supported, it will be automatically deleted from the recipient’s inbox, saving storage space and energy.
556
+
557
+ footer : typing.Optional[str]
558
+ Footer of the email campaign
559
+
560
+ header : typing.Optional[str]
561
+ Header of the email campaign
562
+
563
+ html_content : typing.Optional[str]
564
+ Body of the message (HTML version). If the campaign is designed using Drag & Drop editor via HTML content, then the design page will not have Drag & Drop editor access for that campaign. **REQUIRED if htmlUrl is empty**
565
+
566
+ html_url : typing.Optional[str]
567
+ Url which contents the body of the email message. **REQUIRED if htmlContent is empty**
568
+
569
+ increase_rate : typing.Optional[int]
570
+ Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%.
571
+
572
+ initial_quota : typing.Optional[int]
573
+ Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000.
574
+
575
+ inline_image_activation : typing.Optional[bool]
576
+ Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. You cannot send a campaign of more than **4MB** with images embedded in the email. Campaigns with the images embedded in the email _must be sent to less than 5000 contacts_.
577
+
578
+ ip_warmup_enable : typing.Optional[bool]
579
+ **Available for dedicated ip clients**. Set this to true if you wish to warm up your ip.
580
+
581
+ mirror_active : typing.Optional[bool]
582
+ Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign
583
+
584
+ name : typing.Optional[str]
585
+ Name of the campaign
586
+
587
+ params : typing.Optional[typing.Dict[str, typing.Any]]
588
+ Pass the set of attributes to customize the type classic campaign. For example: **{"FNAME":"Joe", "LNAME":"Doe"}**. Only available if **type** is **classic**. It's considered only if campaign is in _New Template Language format_. The New Template Language is dependent on the values of **subject, htmlContent/htmlUrl, sender.name & toField**
589
+
590
+ preview_text : typing.Optional[str]
591
+ Preview text or preheader of the email campaign
592
+
593
+ recipients : typing.Optional[UpdateEmailCampaignRequestRecipients]
594
+ Segment ids and List ids to include/exclude from campaign
595
+
596
+ recurring : typing.Optional[bool]
597
+ **FOR TRIGGER ONLY !** Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times
598
+
599
+ reply_to : typing.Optional[str]
600
+ Email on which campaign recipients will be able to reply to
601
+
602
+ scheduled_at : typing.Optional[str]
603
+ UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part).
604
+
605
+ send_at_best_time : typing.Optional[bool]
606
+ Set this to true if you want to send your campaign at best time. Note:- **if true, warmup ip will be disabled.**
607
+
608
+ sender : typing.Optional[UpdateEmailCampaignRequestSender]
609
+ Sender details including id or email and name (optional). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example: **{"name":"xyz", "email":"example@abc.com"}** **{"name":"xyz", "id":123}**
610
+
611
+ split_rule : typing.Optional[int]
612
+ Add the size of your test groups. **Mandatory if abTesting = true & 'recipients' is passed**. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else
613
+
614
+ subject : typing.Optional[str]
615
+ Subject of the campaign
616
+
617
+ subject_a : typing.Optional[str]
618
+ Subject A of the campaign. **Mandatory if abTesting = true**. subjectA & subjectB should have unique value
619
+
620
+ subject_b : typing.Optional[str]
621
+ Subject B of the campaign. **Mandatory if abTesting = true**. subjectA & subjectB should have unique value
622
+
623
+ tag : typing.Optional[str]
624
+ Tag of the campaign
625
+
626
+ to_field : typing.Optional[str]
627
+ To personalize the **To** Field. If you want to include the first name and last name of your recipient, add **{FNAME} {LNAME}**. These contact attributes must already exist in your Brevo account. If input parameter **params** used please use **{{contact.FNAME}} {{contact.LNAME}}** for personalization
628
+
629
+ unsubscription_page_id : typing.Optional[str]
630
+ Enter an unsubscription page id. The page id is a 24 digit alphanumeric id that can be found in the URL when editing the page.
631
+
632
+ update_form_id : typing.Optional[str]
633
+ **Mandatory if templateId is used containing the {{ update_profile }} tag**. Enter an update profile form id. The form id is a 24 digit alphanumeric id that can be found in the URL when editing the form.
634
+
635
+ utm_campaign : typing.Optional[str]
636
+ Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed
637
+
638
+ winner_criteria : typing.Optional[UpdateEmailCampaignRequestWinnerCriteria]
639
+ Choose the metrics that will determinate the winning version. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerCriteria` is ignored if passed
640
+
641
+ winner_delay : typing.Optional[int]
642
+ Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerDelay` is ignored if passed
643
+
644
+ request_options : typing.Optional[RequestOptions]
645
+ Request-specific configuration.
646
+
647
+ Returns
648
+ -------
649
+ HttpResponse[None]
650
+ """
651
+ _response = self._client_wrapper.httpx_client.request(
652
+ f"emailCampaigns/{jsonable_encoder(campaign_id)}",
653
+ method="PUT",
654
+ json={
655
+ "abTesting": ab_testing,
656
+ "attachmentUrl": attachment_url,
657
+ "emailExpirationDate": convert_and_respect_annotation_metadata(
658
+ object_=email_expiration_date,
659
+ annotation=UpdateEmailCampaignRequestEmailExpirationDate,
660
+ direction="write",
661
+ ),
662
+ "footer": footer,
663
+ "header": header,
664
+ "htmlContent": html_content,
665
+ "htmlUrl": html_url,
666
+ "increaseRate": increase_rate,
667
+ "initialQuota": initial_quota,
668
+ "inlineImageActivation": inline_image_activation,
669
+ "ipWarmupEnable": ip_warmup_enable,
670
+ "mirrorActive": mirror_active,
671
+ "name": name,
672
+ "params": params,
673
+ "previewText": preview_text,
674
+ "recipients": convert_and_respect_annotation_metadata(
675
+ object_=recipients, annotation=UpdateEmailCampaignRequestRecipients, direction="write"
676
+ ),
677
+ "recurring": recurring,
678
+ "replyTo": reply_to,
679
+ "scheduledAt": scheduled_at,
680
+ "sendAtBestTime": send_at_best_time,
681
+ "sender": convert_and_respect_annotation_metadata(
682
+ object_=sender, annotation=UpdateEmailCampaignRequestSender, direction="write"
683
+ ),
684
+ "splitRule": split_rule,
685
+ "subject": subject,
686
+ "subjectA": subject_a,
687
+ "subjectB": subject_b,
688
+ "tag": tag,
689
+ "toField": to_field,
690
+ "unsubscriptionPageId": unsubscription_page_id,
691
+ "updateFormId": update_form_id,
692
+ "utmCampaign": utm_campaign,
693
+ "winnerCriteria": winner_criteria,
694
+ "winnerDelay": winner_delay,
695
+ },
696
+ headers={
697
+ "content-type": "application/json",
698
+ },
699
+ request_options=request_options,
700
+ omit=OMIT,
701
+ )
702
+ try:
703
+ if 200 <= _response.status_code < 300:
704
+ return HttpResponse(response=_response, data=None)
705
+ if _response.status_code == 400:
706
+ raise BadRequestError(
707
+ headers=dict(_response.headers),
708
+ body=typing.cast(
709
+ typing.Any,
710
+ construct_type(
711
+ type_=typing.Any, # type: ignore
712
+ object_=_response.json(),
713
+ ),
714
+ ),
715
+ )
716
+ if _response.status_code == 404:
717
+ raise NotFoundError(
718
+ headers=dict(_response.headers),
719
+ body=typing.cast(
720
+ typing.Any,
721
+ construct_type(
722
+ type_=typing.Any, # type: ignore
723
+ object_=_response.json(),
724
+ ),
725
+ ),
726
+ )
727
+ _response_json = _response.json()
728
+ except JSONDecodeError:
729
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
730
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
731
+
732
+ def delete_email_campaign(
733
+ self, campaign_id: int, *, request_options: typing.Optional[RequestOptions] = None
734
+ ) -> HttpResponse[None]:
735
+ """
736
+ Parameters
737
+ ----------
738
+ campaign_id : int
739
+ id of the campaign
740
+
741
+ request_options : typing.Optional[RequestOptions]
742
+ Request-specific configuration.
743
+
744
+ Returns
745
+ -------
746
+ HttpResponse[None]
747
+ """
748
+ _response = self._client_wrapper.httpx_client.request(
749
+ f"emailCampaigns/{jsonable_encoder(campaign_id)}",
750
+ method="DELETE",
751
+ request_options=request_options,
752
+ )
753
+ try:
754
+ if 200 <= _response.status_code < 300:
755
+ return HttpResponse(response=_response, data=None)
756
+ if _response.status_code == 400:
757
+ raise BadRequestError(
758
+ headers=dict(_response.headers),
759
+ body=typing.cast(
760
+ typing.Any,
761
+ construct_type(
762
+ type_=typing.Any, # type: ignore
763
+ object_=_response.json(),
764
+ ),
765
+ ),
766
+ )
767
+ if _response.status_code == 404:
768
+ raise NotFoundError(
769
+ headers=dict(_response.headers),
770
+ body=typing.cast(
771
+ typing.Any,
772
+ construct_type(
773
+ type_=typing.Any, # type: ignore
774
+ object_=_response.json(),
775
+ ),
776
+ ),
777
+ )
778
+ _response_json = _response.json()
779
+ except JSONDecodeError:
780
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
781
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
782
+
783
+ def get_ab_test_campaign_result(
784
+ self, campaign_id: int, *, request_options: typing.Optional[RequestOptions] = None
785
+ ) -> HttpResponse[GetAbTestCampaignResultResponse]:
786
+ """
787
+ Obtain winning version of an A/B test email campaign
788
+
789
+ Parameters
790
+ ----------
791
+ campaign_id : int
792
+ Id of the A/B test campaign
793
+
794
+ request_options : typing.Optional[RequestOptions]
795
+ Request-specific configuration.
796
+
797
+ Returns
798
+ -------
799
+ HttpResponse[GetAbTestCampaignResultResponse]
800
+ A/B test email campaign Result
801
+ """
802
+ _response = self._client_wrapper.httpx_client.request(
803
+ f"emailCampaigns/{jsonable_encoder(campaign_id)}/abTestCampaignResult",
804
+ method="GET",
805
+ request_options=request_options,
806
+ )
807
+ try:
808
+ if 200 <= _response.status_code < 300:
809
+ _data = typing.cast(
810
+ GetAbTestCampaignResultResponse,
811
+ construct_type(
812
+ type_=GetAbTestCampaignResultResponse, # type: ignore
813
+ object_=_response.json(),
814
+ ),
815
+ )
816
+ return HttpResponse(response=_response, data=_data)
817
+ if _response.status_code == 400:
818
+ raise BadRequestError(
819
+ headers=dict(_response.headers),
820
+ body=typing.cast(
821
+ typing.Any,
822
+ construct_type(
823
+ type_=typing.Any, # type: ignore
824
+ object_=_response.json(),
825
+ ),
826
+ ),
827
+ )
828
+ if _response.status_code == 404:
829
+ raise NotFoundError(
830
+ headers=dict(_response.headers),
831
+ body=typing.cast(
832
+ typing.Any,
833
+ construct_type(
834
+ type_=typing.Any, # type: ignore
835
+ object_=_response.json(),
836
+ ),
837
+ ),
838
+ )
839
+ _response_json = _response.json()
840
+ except JSONDecodeError:
841
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
842
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
843
+
844
+ def email_export_recipients(
845
+ self,
846
+ campaign_id: int,
847
+ *,
848
+ recipients_type: EmailExportRecipientsRequestRecipientsType,
849
+ notify_url: typing.Optional[str] = OMIT,
850
+ request_options: typing.Optional[RequestOptions] = None,
851
+ ) -> HttpResponse[EmailExportRecipientsResponse]:
852
+ """
853
+ Parameters
854
+ ----------
855
+ campaign_id : int
856
+ Id of the campaign
857
+
858
+ recipients_type : EmailExportRecipientsRequestRecipientsType
859
+ Type of recipients to export for a campaign
860
+
861
+ notify_url : typing.Optional[str]
862
+ Webhook called once the export process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479
863
+
864
+ request_options : typing.Optional[RequestOptions]
865
+ Request-specific configuration.
866
+
867
+ Returns
868
+ -------
869
+ HttpResponse[EmailExportRecipientsResponse]
870
+ process id created
871
+ """
872
+ _response = self._client_wrapper.httpx_client.request(
873
+ f"emailCampaigns/{jsonable_encoder(campaign_id)}/exportRecipients",
874
+ method="POST",
875
+ json={
876
+ "notifyURL": notify_url,
877
+ "recipientsType": recipients_type,
878
+ },
879
+ headers={
880
+ "content-type": "application/json",
881
+ },
882
+ request_options=request_options,
883
+ omit=OMIT,
884
+ )
885
+ try:
886
+ if 200 <= _response.status_code < 300:
887
+ _data = typing.cast(
888
+ EmailExportRecipientsResponse,
889
+ construct_type(
890
+ type_=EmailExportRecipientsResponse, # type: ignore
891
+ object_=_response.json(),
892
+ ),
893
+ )
894
+ return HttpResponse(response=_response, data=_data)
895
+ if _response.status_code == 400:
896
+ raise BadRequestError(
897
+ headers=dict(_response.headers),
898
+ body=typing.cast(
899
+ typing.Any,
900
+ construct_type(
901
+ type_=typing.Any, # type: ignore
902
+ object_=_response.json(),
903
+ ),
904
+ ),
905
+ )
906
+ if _response.status_code == 404:
907
+ raise NotFoundError(
908
+ headers=dict(_response.headers),
909
+ body=typing.cast(
910
+ typing.Any,
911
+ construct_type(
912
+ type_=typing.Any, # type: ignore
913
+ object_=_response.json(),
914
+ ),
915
+ ),
916
+ )
917
+ _response_json = _response.json()
918
+ except JSONDecodeError:
919
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
920
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
921
+
922
+ def send_email_campaign_now(
923
+ self, campaign_id: int, *, request_options: typing.Optional[RequestOptions] = None
924
+ ) -> HttpResponse[None]:
925
+ """
926
+ Parameters
927
+ ----------
928
+ campaign_id : int
929
+ Id of the campaign
930
+
931
+ request_options : typing.Optional[RequestOptions]
932
+ Request-specific configuration.
933
+
934
+ Returns
935
+ -------
936
+ HttpResponse[None]
937
+ """
938
+ _response = self._client_wrapper.httpx_client.request(
939
+ f"emailCampaigns/{jsonable_encoder(campaign_id)}/sendNow",
940
+ method="POST",
941
+ request_options=request_options,
942
+ )
943
+ try:
944
+ if 200 <= _response.status_code < 300:
945
+ return HttpResponse(response=_response, data=None)
946
+ if _response.status_code == 400:
947
+ raise BadRequestError(
948
+ headers=dict(_response.headers),
949
+ body=typing.cast(
950
+ typing.Any,
951
+ construct_type(
952
+ type_=typing.Any, # type: ignore
953
+ object_=_response.json(),
954
+ ),
955
+ ),
956
+ )
957
+ if _response.status_code == 402:
958
+ raise PaymentRequiredError(
959
+ headers=dict(_response.headers),
960
+ body=typing.cast(
961
+ ErrorModel,
962
+ construct_type(
963
+ type_=ErrorModel, # type: ignore
964
+ object_=_response.json(),
965
+ ),
966
+ ),
967
+ )
968
+ if _response.status_code == 404:
969
+ raise NotFoundError(
970
+ headers=dict(_response.headers),
971
+ body=typing.cast(
972
+ typing.Any,
973
+ construct_type(
974
+ type_=typing.Any, # type: ignore
975
+ object_=_response.json(),
976
+ ),
977
+ ),
978
+ )
979
+ _response_json = _response.json()
980
+ except JSONDecodeError:
981
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
982
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
983
+
984
+ def send_report(
985
+ self,
986
+ campaign_id: int,
987
+ *,
988
+ email: SendReportEmail,
989
+ language: typing.Optional[SendReportLanguage] = OMIT,
990
+ request_options: typing.Optional[RequestOptions] = None,
991
+ ) -> HttpResponse[None]:
992
+ """
993
+ A PDF will be sent to the specified email addresses
994
+
995
+ Parameters
996
+ ----------
997
+ campaign_id : int
998
+ Id of the campaign
999
+
1000
+ email : SendReportEmail
1001
+ Custom attributes for the report email.
1002
+
1003
+ language : typing.Optional[SendReportLanguage]
1004
+ Language of email content for campaign report sending.
1005
+
1006
+ request_options : typing.Optional[RequestOptions]
1007
+ Request-specific configuration.
1008
+
1009
+ Returns
1010
+ -------
1011
+ HttpResponse[None]
1012
+ """
1013
+ _response = self._client_wrapper.httpx_client.request(
1014
+ f"emailCampaigns/{jsonable_encoder(campaign_id)}/sendReport",
1015
+ method="POST",
1016
+ json={
1017
+ "email": convert_and_respect_annotation_metadata(
1018
+ object_=email, annotation=SendReportEmail, direction="write"
1019
+ ),
1020
+ "language": language,
1021
+ },
1022
+ headers={
1023
+ "content-type": "application/json",
1024
+ },
1025
+ request_options=request_options,
1026
+ omit=OMIT,
1027
+ )
1028
+ try:
1029
+ if 200 <= _response.status_code < 300:
1030
+ return HttpResponse(response=_response, data=None)
1031
+ if _response.status_code == 400:
1032
+ raise BadRequestError(
1033
+ headers=dict(_response.headers),
1034
+ body=typing.cast(
1035
+ typing.Any,
1036
+ construct_type(
1037
+ type_=typing.Any, # type: ignore
1038
+ object_=_response.json(),
1039
+ ),
1040
+ ),
1041
+ )
1042
+ if _response.status_code == 404:
1043
+ raise NotFoundError(
1044
+ headers=dict(_response.headers),
1045
+ body=typing.cast(
1046
+ typing.Any,
1047
+ construct_type(
1048
+ type_=typing.Any, # type: ignore
1049
+ object_=_response.json(),
1050
+ ),
1051
+ ),
1052
+ )
1053
+ _response_json = _response.json()
1054
+ except JSONDecodeError:
1055
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1056
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1057
+
1058
+ def send_test_email(
1059
+ self,
1060
+ campaign_id: int,
1061
+ *,
1062
+ email_to: typing.Optional[typing.Sequence[str]] = OMIT,
1063
+ request_options: typing.Optional[RequestOptions] = None,
1064
+ ) -> HttpResponse[None]:
1065
+ """
1066
+ Parameters
1067
+ ----------
1068
+ campaign_id : int
1069
+ Id of the campaign
1070
+
1071
+ email_to : typing.Optional[typing.Sequence[str]]
1072
+ List of the email addresses of the recipients whom you wish to send the test mail. _If left empty, the test mail will be sent to your entire test list. You can not send more than 50 test emails per day_.
1073
+
1074
+ request_options : typing.Optional[RequestOptions]
1075
+ Request-specific configuration.
1076
+
1077
+ Returns
1078
+ -------
1079
+ HttpResponse[None]
1080
+ """
1081
+ _response = self._client_wrapper.httpx_client.request(
1082
+ f"emailCampaigns/{jsonable_encoder(campaign_id)}/sendTest",
1083
+ method="POST",
1084
+ json={
1085
+ "emailTo": email_to,
1086
+ },
1087
+ headers={
1088
+ "content-type": "application/json",
1089
+ },
1090
+ request_options=request_options,
1091
+ omit=OMIT,
1092
+ )
1093
+ try:
1094
+ if 200 <= _response.status_code < 300:
1095
+ return HttpResponse(response=_response, data=None)
1096
+ if _response.status_code == 400:
1097
+ raise BadRequestError(
1098
+ headers=dict(_response.headers),
1099
+ body=typing.cast(
1100
+ typing.Any,
1101
+ construct_type(
1102
+ type_=typing.Any, # type: ignore
1103
+ object_=_response.json(),
1104
+ ),
1105
+ ),
1106
+ )
1107
+ if _response.status_code == 404:
1108
+ raise NotFoundError(
1109
+ headers=dict(_response.headers),
1110
+ body=typing.cast(
1111
+ typing.Any,
1112
+ construct_type(
1113
+ type_=typing.Any, # type: ignore
1114
+ object_=_response.json(),
1115
+ ),
1116
+ ),
1117
+ )
1118
+ _response_json = _response.json()
1119
+ except JSONDecodeError:
1120
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1121
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1122
+
1123
+ def get_shared_template_url(
1124
+ self, campaign_id: int, *, request_options: typing.Optional[RequestOptions] = None
1125
+ ) -> HttpResponse[GetSharedTemplateUrlResponse]:
1126
+ """
1127
+ Get a unique URL to share & import an email template from one Brevo account to another.
1128
+
1129
+ Parameters
1130
+ ----------
1131
+ campaign_id : int
1132
+ Id of the campaign or template
1133
+
1134
+ request_options : typing.Optional[RequestOptions]
1135
+ Request-specific configuration.
1136
+
1137
+ Returns
1138
+ -------
1139
+ HttpResponse[GetSharedTemplateUrlResponse]
1140
+ Shared template URL information
1141
+ """
1142
+ _response = self._client_wrapper.httpx_client.request(
1143
+ f"emailCampaigns/{jsonable_encoder(campaign_id)}/sharedUrl",
1144
+ method="GET",
1145
+ request_options=request_options,
1146
+ )
1147
+ try:
1148
+ if 200 <= _response.status_code < 300:
1149
+ _data = typing.cast(
1150
+ GetSharedTemplateUrlResponse,
1151
+ construct_type(
1152
+ type_=GetSharedTemplateUrlResponse, # type: ignore
1153
+ object_=_response.json(),
1154
+ ),
1155
+ )
1156
+ return HttpResponse(response=_response, data=_data)
1157
+ if _response.status_code == 400:
1158
+ raise BadRequestError(
1159
+ headers=dict(_response.headers),
1160
+ body=typing.cast(
1161
+ typing.Any,
1162
+ construct_type(
1163
+ type_=typing.Any, # type: ignore
1164
+ object_=_response.json(),
1165
+ ),
1166
+ ),
1167
+ )
1168
+ if _response.status_code == 404:
1169
+ raise NotFoundError(
1170
+ headers=dict(_response.headers),
1171
+ body=typing.cast(
1172
+ typing.Any,
1173
+ construct_type(
1174
+ type_=typing.Any, # type: ignore
1175
+ object_=_response.json(),
1176
+ ),
1177
+ ),
1178
+ )
1179
+ if _response.status_code == 405:
1180
+ raise MethodNotAllowedError(
1181
+ headers=dict(_response.headers),
1182
+ body=typing.cast(
1183
+ ErrorModel,
1184
+ construct_type(
1185
+ type_=ErrorModel, # type: ignore
1186
+ object_=_response.json(),
1187
+ ),
1188
+ ),
1189
+ )
1190
+ _response_json = _response.json()
1191
+ except JSONDecodeError:
1192
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1193
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1194
+
1195
+ def update_campaign_status(
1196
+ self,
1197
+ campaign_id: int,
1198
+ *,
1199
+ status: typing.Optional[UpdateCampaignStatusStatus] = OMIT,
1200
+ request_options: typing.Optional[RequestOptions] = None,
1201
+ ) -> HttpResponse[None]:
1202
+ """
1203
+ Parameters
1204
+ ----------
1205
+ campaign_id : int
1206
+ Id of the campaign
1207
+
1208
+ status : typing.Optional[UpdateCampaignStatusStatus]
1209
+ Note:- **replicateTemplate** status will be available **only for template type campaigns.**
1210
+
1211
+ request_options : typing.Optional[RequestOptions]
1212
+ Request-specific configuration.
1213
+
1214
+ Returns
1215
+ -------
1216
+ HttpResponse[None]
1217
+ """
1218
+ _response = self._client_wrapper.httpx_client.request(
1219
+ f"emailCampaigns/{jsonable_encoder(campaign_id)}/status",
1220
+ method="PUT",
1221
+ json={
1222
+ "status": status,
1223
+ },
1224
+ headers={
1225
+ "content-type": "application/json",
1226
+ },
1227
+ request_options=request_options,
1228
+ omit=OMIT,
1229
+ )
1230
+ try:
1231
+ if 200 <= _response.status_code < 300:
1232
+ return HttpResponse(response=_response, data=None)
1233
+ if _response.status_code == 400:
1234
+ raise BadRequestError(
1235
+ headers=dict(_response.headers),
1236
+ body=typing.cast(
1237
+ typing.Any,
1238
+ construct_type(
1239
+ type_=typing.Any, # type: ignore
1240
+ object_=_response.json(),
1241
+ ),
1242
+ ),
1243
+ )
1244
+ if _response.status_code == 404:
1245
+ raise NotFoundError(
1246
+ headers=dict(_response.headers),
1247
+ body=typing.cast(
1248
+ typing.Any,
1249
+ construct_type(
1250
+ type_=typing.Any, # type: ignore
1251
+ object_=_response.json(),
1252
+ ),
1253
+ ),
1254
+ )
1255
+ _response_json = _response.json()
1256
+ except JSONDecodeError:
1257
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1258
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1259
+
1260
+
1261
+ class AsyncRawEmailCampaignsClient:
1262
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
1263
+ self._client_wrapper = client_wrapper
1264
+
1265
+ async def get_email_campaigns(
1266
+ self,
1267
+ *,
1268
+ type: typing.Optional[GetEmailCampaignsRequestType] = None,
1269
+ status: typing.Optional[GetEmailCampaignsRequestStatus] = None,
1270
+ statistics: typing.Optional[GetEmailCampaignsRequestStatistics] = None,
1271
+ start_date: typing.Optional[str] = None,
1272
+ end_date: typing.Optional[str] = None,
1273
+ limit: typing.Optional[int] = None,
1274
+ offset: typing.Optional[int] = None,
1275
+ sort: typing.Optional[GetEmailCampaignsRequestSort] = None,
1276
+ exclude_html_content: typing.Optional[bool] = None,
1277
+ request_options: typing.Optional[RequestOptions] = None,
1278
+ ) -> AsyncHttpResponse[GetEmailCampaignsResponse]:
1279
+ """
1280
+ <Note>
1281
+ The response payload for this endpoint has changed
1282
+
1283
+ You now need to specify which type of statistics you would like to retrieve. For more information visit [this page](https://developers.brevo.com/changelog/get-all-marketing-campaigns).
1284
+ </Note>
1285
+
1286
+ Parameters
1287
+ ----------
1288
+ type : typing.Optional[GetEmailCampaignsRequestType]
1289
+ Filter on the type of the campaigns
1290
+
1291
+ status : typing.Optional[GetEmailCampaignsRequestStatus]
1292
+ Filter on the status of the campaign
1293
+
1294
+ statistics : typing.Optional[GetEmailCampaignsRequestStatistics]
1295
+ Filter on type of the statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response.This option only returns data for events occurred in the last 6 months.For older campaigns, it’s advisable to use the **Get Campaign Report** endpoint.
1296
+
1297
+ start_date : typing.Optional[str]
1298
+ **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' )
1299
+
1300
+ end_date : typing.Optional[str]
1301
+ **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either 'status' not passed and if passed is set to 'sent' )
1302
+
1303
+ limit : typing.Optional[int]
1304
+ Number of documents per page
1305
+
1306
+ offset : typing.Optional[int]
1307
+ Index of the first document in the page
1308
+
1309
+ sort : typing.Optional[GetEmailCampaignsRequestSort]
1310
+ Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
1311
+
1312
+ exclude_html_content : typing.Optional[bool]
1313
+ Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body
1314
+
1315
+ request_options : typing.Optional[RequestOptions]
1316
+ Request-specific configuration.
1317
+
1318
+ Returns
1319
+ -------
1320
+ AsyncHttpResponse[GetEmailCampaignsResponse]
1321
+ Email campaigns informations
1322
+ """
1323
+ _response = await self._client_wrapper.httpx_client.request(
1324
+ "emailCampaigns",
1325
+ method="GET",
1326
+ params={
1327
+ "type": type,
1328
+ "status": status,
1329
+ "statistics": statistics,
1330
+ "startDate": start_date,
1331
+ "endDate": end_date,
1332
+ "limit": limit,
1333
+ "offset": offset,
1334
+ "sort": sort,
1335
+ "excludeHtmlContent": exclude_html_content,
1336
+ },
1337
+ request_options=request_options,
1338
+ )
1339
+ try:
1340
+ if 200 <= _response.status_code < 300:
1341
+ _data = typing.cast(
1342
+ GetEmailCampaignsResponse,
1343
+ construct_type(
1344
+ type_=GetEmailCampaignsResponse, # type: ignore
1345
+ object_=_response.json(),
1346
+ ),
1347
+ )
1348
+ return AsyncHttpResponse(response=_response, data=_data)
1349
+ if _response.status_code == 400:
1350
+ raise BadRequestError(
1351
+ headers=dict(_response.headers),
1352
+ body=typing.cast(
1353
+ typing.Any,
1354
+ construct_type(
1355
+ type_=typing.Any, # type: ignore
1356
+ object_=_response.json(),
1357
+ ),
1358
+ ),
1359
+ )
1360
+ _response_json = _response.json()
1361
+ except JSONDecodeError:
1362
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1363
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1364
+
1365
+ async def create_email_campaign(
1366
+ self,
1367
+ *,
1368
+ name: str,
1369
+ sender: CreateEmailCampaignRequestSender,
1370
+ ab_testing: typing.Optional[bool] = OMIT,
1371
+ attachment_url: typing.Optional[str] = OMIT,
1372
+ email_expiration_date: typing.Optional[CreateEmailCampaignRequestEmailExpirationDate] = OMIT,
1373
+ footer: typing.Optional[str] = OMIT,
1374
+ header: typing.Optional[str] = OMIT,
1375
+ html_content: typing.Optional[str] = OMIT,
1376
+ html_url: typing.Optional[str] = OMIT,
1377
+ increase_rate: typing.Optional[int] = OMIT,
1378
+ initial_quota: typing.Optional[int] = OMIT,
1379
+ inline_image_activation: typing.Optional[bool] = OMIT,
1380
+ ip_warmup_enable: typing.Optional[bool] = OMIT,
1381
+ mirror_active: typing.Optional[bool] = OMIT,
1382
+ params: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
1383
+ preview_text: typing.Optional[str] = OMIT,
1384
+ recipients: typing.Optional[CreateEmailCampaignRequestRecipients] = OMIT,
1385
+ reply_to: typing.Optional[str] = OMIT,
1386
+ scheduled_at: typing.Optional[str] = OMIT,
1387
+ send_at_best_time: typing.Optional[bool] = OMIT,
1388
+ split_rule: typing.Optional[int] = OMIT,
1389
+ subject: typing.Optional[str] = OMIT,
1390
+ subject_a: typing.Optional[str] = OMIT,
1391
+ subject_b: typing.Optional[str] = OMIT,
1392
+ tag: typing.Optional[str] = OMIT,
1393
+ template_id: typing.Optional[int] = OMIT,
1394
+ to_field: typing.Optional[str] = OMIT,
1395
+ unsubscription_page_id: typing.Optional[str] = OMIT,
1396
+ update_form_id: typing.Optional[str] = OMIT,
1397
+ utm_campaign: typing.Optional[str] = OMIT,
1398
+ winner_criteria: typing.Optional[CreateEmailCampaignRequestWinnerCriteria] = OMIT,
1399
+ winner_delay: typing.Optional[int] = OMIT,
1400
+ request_options: typing.Optional[RequestOptions] = None,
1401
+ ) -> AsyncHttpResponse[CreateEmailCampaignResponse]:
1402
+ """
1403
+ Parameters
1404
+ ----------
1405
+ name : str
1406
+ Name of the campaign
1407
+
1408
+ sender : CreateEmailCampaignRequestSender
1409
+ Sender details including id or email and name (_optional_). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example: **{"name":"xyz", "email":"example@abc.com"}** **{"name":"xyz", "id":123}**
1410
+
1411
+ ab_testing : typing.Optional[bool]
1412
+ Status of A/B Test. abTesting = false means it is disabled & abTesting = true means it is enabled. **subjectA, subjectB, splitRule, winnerCriteria & winnerDelay** will be considered when abTesting is set to true. subjectA & subjectB are mandatory together & subject if passed is ignored. **Can be set to true only if sendAtBestTime is false**. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B
1413
+
1414
+ attachment_url : typing.Optional[str]
1415
+ Absolute url of the attachment (no local file). Extension allowed: #### xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps
1416
+
1417
+ email_expiration_date : typing.Optional[CreateEmailCampaignRequestEmailExpirationDate]
1418
+ To reduce your carbon footprint, set an expiration date for your email. If supported, it will be automatically deleted from the recipient’s inbox, saving storage space and energy. Learn more about setting an email expiration date. For reference , ``https://help.brevo.com/hc/en-us/articles/4413566705298-Create-an-email-campaign``
1419
+
1420
+ footer : typing.Optional[str]
1421
+ Footer of the email campaign
1422
+
1423
+ header : typing.Optional[str]
1424
+ Header of the email campaign
1425
+
1426
+ html_content : typing.Optional[str]
1427
+ Mandatory if htmlUrl and templateId are empty. Body of the message (HTML).
1428
+
1429
+ html_url : typing.Optional[str]
1430
+ **Mandatory if htmlContent and templateId are empty**. Url to the message (HTML). For example: **https://html.domain.com**
1431
+
1432
+ increase_rate : typing.Optional[int]
1433
+ **Mandatory if ipWarmupEnable is set to true**. Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%.
1434
+
1435
+ initial_quota : typing.Optional[int]
1436
+ **Mandatory if ipWarmupEnable is set to true**. Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000.
1437
+
1438
+ inline_image_activation : typing.Optional[bool]
1439
+ Use true to embedded the images in your email. Final size of the email should be less than **4MB**. Campaigns with embedded images can _not be sent to more than 5000 contacts_
1440
+
1441
+ ip_warmup_enable : typing.Optional[bool]
1442
+ **Available for dedicated ip clients**. Set this to true if you wish to warm up your ip.
1443
+
1444
+ mirror_active : typing.Optional[bool]
1445
+ Use true to enable the mirror link
1446
+
1447
+ params : typing.Optional[typing.Dict[str, typing.Any]]
1448
+ Pass the set of attributes to customize the type classic campaign. For example: **{"FNAME":"Joe", "LNAME":"Doe"}**. Only available if **type** is **classic**. It's considered only if campaign is in _New Template Language format_. The New Template Language is dependent on the values of **subject, htmlContent/htmlUrl, sender.name & toField**
1449
+
1450
+ preview_text : typing.Optional[str]
1451
+ Preview text or preheader of the email campaign
1452
+
1453
+ recipients : typing.Optional[CreateEmailCampaignRequestRecipients]
1454
+ Segment ids and List ids to include/exclude from campaign
1455
+
1456
+ reply_to : typing.Optional[str]
1457
+ Email on which the campaign recipients will be able to reply to
1458
+
1459
+ scheduled_at : typing.Optional[str]
1460
+ Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result**. If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part). For example: **2017-06-01T12:30:00+02:00**
1461
+
1462
+ send_at_best_time : typing.Optional[bool]
1463
+ Set this to true if you want to send your campaign at best time.
1464
+
1465
+ split_rule : typing.Optional[int]
1466
+ Add the size of your test groups. **Mandatory if abTesting = true & 'recipients' is passed**. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else
1467
+
1468
+ subject : typing.Optional[str]
1469
+ Subject of the campaign. **Mandatory if abTesting is false**. Ignored if abTesting is true.
1470
+
1471
+ subject_a : typing.Optional[str]
1472
+ Subject A of the campaign. **Mandatory if abTesting = true**. subjectA & subjectB should have unique value
1473
+
1474
+ subject_b : typing.Optional[str]
1475
+ Subject B of the campaign. **Mandatory if abTesting = true**. subjectA & subjectB should have unique value
1476
+
1477
+ tag : typing.Optional[str]
1478
+ Tag of the campaign
1479
+
1480
+ template_id : typing.Optional[int]
1481
+ **Mandatory if htmlContent and htmlUrl are empty**. Id of the transactional email template with status _active_. Used to copy only its content fetched from htmlContent/htmlUrl to an email campaign for RSS feature.
1482
+
1483
+ to_field : typing.Optional[str]
1484
+ To personalize the **To** Field. If you want to include the first name and last name of your recipient, add **{FNAME} {LNAME}**. These contact attributes must already exist in your Brevo account. If input parameter **params** used please use **{{contact.FNAME}} {{contact.LNAME}}** for personalization
1485
+
1486
+ unsubscription_page_id : typing.Optional[str]
1487
+ Enter an unsubscription page id. The page id is a 24 digit alphanumeric id that can be found in the URL when editing the page. If not entered, then the default unsubscription page will be used.
1488
+
1489
+ update_form_id : typing.Optional[str]
1490
+ **Mandatory if templateId is used containing the {{ update_profile }} tag**. Enter an update profile form id. The form id is a 24 digit alphanumeric id that can be found in the URL when editing the form. If not entered, then the default update profile form will be used.
1491
+
1492
+ utm_campaign : typing.Optional[str]
1493
+ Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed
1494
+
1495
+ winner_criteria : typing.Optional[CreateEmailCampaignRequestWinnerCriteria]
1496
+ Choose the metrics that will determinate the winning version. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerCriteria` is ignored if passed
1497
+
1498
+ winner_delay : typing.Optional[int]
1499
+ Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerDelay` is ignored if passed
1500
+
1501
+ request_options : typing.Optional[RequestOptions]
1502
+ Request-specific configuration.
1503
+
1504
+ Returns
1505
+ -------
1506
+ AsyncHttpResponse[CreateEmailCampaignResponse]
1507
+ successfully created
1508
+ """
1509
+ _response = await self._client_wrapper.httpx_client.request(
1510
+ "emailCampaigns",
1511
+ method="POST",
1512
+ json={
1513
+ "abTesting": ab_testing,
1514
+ "attachmentUrl": attachment_url,
1515
+ "emailExpirationDate": convert_and_respect_annotation_metadata(
1516
+ object_=email_expiration_date,
1517
+ annotation=CreateEmailCampaignRequestEmailExpirationDate,
1518
+ direction="write",
1519
+ ),
1520
+ "footer": footer,
1521
+ "header": header,
1522
+ "htmlContent": html_content,
1523
+ "htmlUrl": html_url,
1524
+ "increaseRate": increase_rate,
1525
+ "initialQuota": initial_quota,
1526
+ "inlineImageActivation": inline_image_activation,
1527
+ "ipWarmupEnable": ip_warmup_enable,
1528
+ "mirrorActive": mirror_active,
1529
+ "name": name,
1530
+ "params": params,
1531
+ "previewText": preview_text,
1532
+ "recipients": convert_and_respect_annotation_metadata(
1533
+ object_=recipients, annotation=CreateEmailCampaignRequestRecipients, direction="write"
1534
+ ),
1535
+ "replyTo": reply_to,
1536
+ "scheduledAt": scheduled_at,
1537
+ "sendAtBestTime": send_at_best_time,
1538
+ "sender": convert_and_respect_annotation_metadata(
1539
+ object_=sender, annotation=CreateEmailCampaignRequestSender, direction="write"
1540
+ ),
1541
+ "splitRule": split_rule,
1542
+ "subject": subject,
1543
+ "subjectA": subject_a,
1544
+ "subjectB": subject_b,
1545
+ "tag": tag,
1546
+ "templateId": template_id,
1547
+ "toField": to_field,
1548
+ "unsubscriptionPageId": unsubscription_page_id,
1549
+ "updateFormId": update_form_id,
1550
+ "utmCampaign": utm_campaign,
1551
+ "winnerCriteria": winner_criteria,
1552
+ "winnerDelay": winner_delay,
1553
+ },
1554
+ headers={
1555
+ "content-type": "application/json",
1556
+ },
1557
+ request_options=request_options,
1558
+ omit=OMIT,
1559
+ )
1560
+ try:
1561
+ if 200 <= _response.status_code < 300:
1562
+ _data = typing.cast(
1563
+ CreateEmailCampaignResponse,
1564
+ construct_type(
1565
+ type_=CreateEmailCampaignResponse, # type: ignore
1566
+ object_=_response.json(),
1567
+ ),
1568
+ )
1569
+ return AsyncHttpResponse(response=_response, data=_data)
1570
+ if _response.status_code == 400:
1571
+ raise BadRequestError(
1572
+ headers=dict(_response.headers),
1573
+ body=typing.cast(
1574
+ typing.Any,
1575
+ construct_type(
1576
+ type_=typing.Any, # type: ignore
1577
+ object_=_response.json(),
1578
+ ),
1579
+ ),
1580
+ )
1581
+ _response_json = _response.json()
1582
+ except JSONDecodeError:
1583
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1584
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1585
+
1586
+ async def upload_image_to_gallery(
1587
+ self,
1588
+ *,
1589
+ image_url: str,
1590
+ name: typing.Optional[str] = OMIT,
1591
+ request_options: typing.Optional[RequestOptions] = None,
1592
+ ) -> AsyncHttpResponse[UploadImageToGalleryResponse]:
1593
+ """
1594
+ Parameters
1595
+ ----------
1596
+ image_url : str
1597
+ The absolute url of the image (**no local file**). Maximum allowed size for image is **2MB**. Allowed extensions for images are: #### jpeg, jpg, png, bmp, gif.
1598
+
1599
+ name : typing.Optional[str]
1600
+ Name of the image.
1601
+
1602
+ request_options : typing.Optional[RequestOptions]
1603
+ Request-specific configuration.
1604
+
1605
+ Returns
1606
+ -------
1607
+ AsyncHttpResponse[UploadImageToGalleryResponse]
1608
+ Image has been successfully uploaded
1609
+ """
1610
+ _response = await self._client_wrapper.httpx_client.request(
1611
+ "emailCampaigns/images",
1612
+ method="POST",
1613
+ json={
1614
+ "imageUrl": image_url,
1615
+ "name": name,
1616
+ },
1617
+ headers={
1618
+ "content-type": "application/json",
1619
+ },
1620
+ request_options=request_options,
1621
+ omit=OMIT,
1622
+ )
1623
+ try:
1624
+ if 200 <= _response.status_code < 300:
1625
+ _data = typing.cast(
1626
+ UploadImageToGalleryResponse,
1627
+ construct_type(
1628
+ type_=UploadImageToGalleryResponse, # type: ignore
1629
+ object_=_response.json(),
1630
+ ),
1631
+ )
1632
+ return AsyncHttpResponse(response=_response, data=_data)
1633
+ if _response.status_code == 400:
1634
+ raise BadRequestError(
1635
+ headers=dict(_response.headers),
1636
+ body=typing.cast(
1637
+ typing.Any,
1638
+ construct_type(
1639
+ type_=typing.Any, # type: ignore
1640
+ object_=_response.json(),
1641
+ ),
1642
+ ),
1643
+ )
1644
+ _response_json = _response.json()
1645
+ except JSONDecodeError:
1646
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1647
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1648
+
1649
+ async def get_email_campaign(
1650
+ self,
1651
+ campaign_id: int,
1652
+ *,
1653
+ statistics: typing.Optional[GetEmailCampaignRequestStatistics] = None,
1654
+ request_options: typing.Optional[RequestOptions] = None,
1655
+ ) -> AsyncHttpResponse[GetEmailCampaignResponse]:
1656
+ """
1657
+ Parameters
1658
+ ----------
1659
+ campaign_id : int
1660
+ Id of the campaign
1661
+
1662
+ statistics : typing.Optional[GetEmailCampaignRequestStatistics]
1663
+ Filter on type of the statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response.
1664
+
1665
+ request_options : typing.Optional[RequestOptions]
1666
+ Request-specific configuration.
1667
+
1668
+ Returns
1669
+ -------
1670
+ AsyncHttpResponse[GetEmailCampaignResponse]
1671
+ Email campaign informations
1672
+ """
1673
+ _response = await self._client_wrapper.httpx_client.request(
1674
+ f"emailCampaigns/{jsonable_encoder(campaign_id)}",
1675
+ method="GET",
1676
+ params={
1677
+ "statistics": statistics,
1678
+ },
1679
+ request_options=request_options,
1680
+ )
1681
+ try:
1682
+ if 200 <= _response.status_code < 300:
1683
+ _data = typing.cast(
1684
+ GetEmailCampaignResponse,
1685
+ construct_type(
1686
+ type_=GetEmailCampaignResponse, # type: ignore
1687
+ object_=_response.json(),
1688
+ ),
1689
+ )
1690
+ return AsyncHttpResponse(response=_response, data=_data)
1691
+ if _response.status_code == 400:
1692
+ raise BadRequestError(
1693
+ headers=dict(_response.headers),
1694
+ body=typing.cast(
1695
+ typing.Any,
1696
+ construct_type(
1697
+ type_=typing.Any, # type: ignore
1698
+ object_=_response.json(),
1699
+ ),
1700
+ ),
1701
+ )
1702
+ if _response.status_code == 404:
1703
+ raise NotFoundError(
1704
+ headers=dict(_response.headers),
1705
+ body=typing.cast(
1706
+ typing.Any,
1707
+ construct_type(
1708
+ type_=typing.Any, # type: ignore
1709
+ object_=_response.json(),
1710
+ ),
1711
+ ),
1712
+ )
1713
+ _response_json = _response.json()
1714
+ except JSONDecodeError:
1715
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1716
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1717
+
1718
+ async def update_email_campaign(
1719
+ self,
1720
+ campaign_id: int,
1721
+ *,
1722
+ ab_testing: typing.Optional[bool] = OMIT,
1723
+ attachment_url: typing.Optional[str] = OMIT,
1724
+ email_expiration_date: typing.Optional[UpdateEmailCampaignRequestEmailExpirationDate] = OMIT,
1725
+ footer: typing.Optional[str] = OMIT,
1726
+ header: typing.Optional[str] = OMIT,
1727
+ html_content: typing.Optional[str] = OMIT,
1728
+ html_url: typing.Optional[str] = OMIT,
1729
+ increase_rate: typing.Optional[int] = OMIT,
1730
+ initial_quota: typing.Optional[int] = OMIT,
1731
+ inline_image_activation: typing.Optional[bool] = OMIT,
1732
+ ip_warmup_enable: typing.Optional[bool] = OMIT,
1733
+ mirror_active: typing.Optional[bool] = OMIT,
1734
+ name: typing.Optional[str] = OMIT,
1735
+ params: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
1736
+ preview_text: typing.Optional[str] = OMIT,
1737
+ recipients: typing.Optional[UpdateEmailCampaignRequestRecipients] = OMIT,
1738
+ recurring: typing.Optional[bool] = OMIT,
1739
+ reply_to: typing.Optional[str] = OMIT,
1740
+ scheduled_at: typing.Optional[str] = OMIT,
1741
+ send_at_best_time: typing.Optional[bool] = OMIT,
1742
+ sender: typing.Optional[UpdateEmailCampaignRequestSender] = OMIT,
1743
+ split_rule: typing.Optional[int] = OMIT,
1744
+ subject: typing.Optional[str] = OMIT,
1745
+ subject_a: typing.Optional[str] = OMIT,
1746
+ subject_b: typing.Optional[str] = OMIT,
1747
+ tag: typing.Optional[str] = OMIT,
1748
+ to_field: typing.Optional[str] = OMIT,
1749
+ unsubscription_page_id: typing.Optional[str] = OMIT,
1750
+ update_form_id: typing.Optional[str] = OMIT,
1751
+ utm_campaign: typing.Optional[str] = OMIT,
1752
+ winner_criteria: typing.Optional[UpdateEmailCampaignRequestWinnerCriteria] = OMIT,
1753
+ winner_delay: typing.Optional[int] = OMIT,
1754
+ request_options: typing.Optional[RequestOptions] = None,
1755
+ ) -> AsyncHttpResponse[None]:
1756
+ """
1757
+ Parameters
1758
+ ----------
1759
+ campaign_id : int
1760
+ Id of the campaign
1761
+
1762
+ ab_testing : typing.Optional[bool]
1763
+ Status of A/B Test. abTesting = false means it is disabled & abTesting = true means it is enabled. **subjectA, subjectB, splitRule, winnerCriteria & winnerDelay** will be considered when abTesting is set to true. subjectA & subjectB are mandatory together & subject if passed is ignored. **Can be set to true only if sendAtBestTime is false**. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B
1764
+
1765
+ attachment_url : typing.Optional[str]
1766
+ Absolute url of the attachment (no local file). Extension allowed: #### xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps'
1767
+
1768
+ email_expiration_date : typing.Optional[UpdateEmailCampaignRequestEmailExpirationDate]
1769
+ To reduce your carbon footprint, set an expiration date for your email. If supported, it will be automatically deleted from the recipient’s inbox, saving storage space and energy.
1770
+
1771
+ footer : typing.Optional[str]
1772
+ Footer of the email campaign
1773
+
1774
+ header : typing.Optional[str]
1775
+ Header of the email campaign
1776
+
1777
+ html_content : typing.Optional[str]
1778
+ Body of the message (HTML version). If the campaign is designed using Drag & Drop editor via HTML content, then the design page will not have Drag & Drop editor access for that campaign. **REQUIRED if htmlUrl is empty**
1779
+
1780
+ html_url : typing.Optional[str]
1781
+ Url which contents the body of the email message. **REQUIRED if htmlContent is empty**
1782
+
1783
+ increase_rate : typing.Optional[int]
1784
+ Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%.
1785
+
1786
+ initial_quota : typing.Optional[int]
1787
+ Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000.
1788
+
1789
+ inline_image_activation : typing.Optional[bool]
1790
+ Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. You cannot send a campaign of more than **4MB** with images embedded in the email. Campaigns with the images embedded in the email _must be sent to less than 5000 contacts_.
1791
+
1792
+ ip_warmup_enable : typing.Optional[bool]
1793
+ **Available for dedicated ip clients**. Set this to true if you wish to warm up your ip.
1794
+
1795
+ mirror_active : typing.Optional[bool]
1796
+ Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign
1797
+
1798
+ name : typing.Optional[str]
1799
+ Name of the campaign
1800
+
1801
+ params : typing.Optional[typing.Dict[str, typing.Any]]
1802
+ Pass the set of attributes to customize the type classic campaign. For example: **{"FNAME":"Joe", "LNAME":"Doe"}**. Only available if **type** is **classic**. It's considered only if campaign is in _New Template Language format_. The New Template Language is dependent on the values of **subject, htmlContent/htmlUrl, sender.name & toField**
1803
+
1804
+ preview_text : typing.Optional[str]
1805
+ Preview text or preheader of the email campaign
1806
+
1807
+ recipients : typing.Optional[UpdateEmailCampaignRequestRecipients]
1808
+ Segment ids and List ids to include/exclude from campaign
1809
+
1810
+ recurring : typing.Optional[bool]
1811
+ **FOR TRIGGER ONLY !** Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times
1812
+
1813
+ reply_to : typing.Optional[str]
1814
+ Email on which campaign recipients will be able to reply to
1815
+
1816
+ scheduled_at : typing.Optional[str]
1817
+ UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part).
1818
+
1819
+ send_at_best_time : typing.Optional[bool]
1820
+ Set this to true if you want to send your campaign at best time. Note:- **if true, warmup ip will be disabled.**
1821
+
1822
+ sender : typing.Optional[UpdateEmailCampaignRequestSender]
1823
+ Sender details including id or email and name (optional). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example: **{"name":"xyz", "email":"example@abc.com"}** **{"name":"xyz", "id":123}**
1824
+
1825
+ split_rule : typing.Optional[int]
1826
+ Add the size of your test groups. **Mandatory if abTesting = true & 'recipients' is passed**. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else
1827
+
1828
+ subject : typing.Optional[str]
1829
+ Subject of the campaign
1830
+
1831
+ subject_a : typing.Optional[str]
1832
+ Subject A of the campaign. **Mandatory if abTesting = true**. subjectA & subjectB should have unique value
1833
+
1834
+ subject_b : typing.Optional[str]
1835
+ Subject B of the campaign. **Mandatory if abTesting = true**. subjectA & subjectB should have unique value
1836
+
1837
+ tag : typing.Optional[str]
1838
+ Tag of the campaign
1839
+
1840
+ to_field : typing.Optional[str]
1841
+ To personalize the **To** Field. If you want to include the first name and last name of your recipient, add **{FNAME} {LNAME}**. These contact attributes must already exist in your Brevo account. If input parameter **params** used please use **{{contact.FNAME}} {{contact.LNAME}}** for personalization
1842
+
1843
+ unsubscription_page_id : typing.Optional[str]
1844
+ Enter an unsubscription page id. The page id is a 24 digit alphanumeric id that can be found in the URL when editing the page.
1845
+
1846
+ update_form_id : typing.Optional[str]
1847
+ **Mandatory if templateId is used containing the {{ update_profile }} tag**. Enter an update profile form id. The form id is a 24 digit alphanumeric id that can be found in the URL when editing the form.
1848
+
1849
+ utm_campaign : typing.Optional[str]
1850
+ Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed
1851
+
1852
+ winner_criteria : typing.Optional[UpdateEmailCampaignRequestWinnerCriteria]
1853
+ Choose the metrics that will determinate the winning version. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerCriteria` is ignored if passed
1854
+
1855
+ winner_delay : typing.Optional[int]
1856
+ Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerDelay` is ignored if passed
1857
+
1858
+ request_options : typing.Optional[RequestOptions]
1859
+ Request-specific configuration.
1860
+
1861
+ Returns
1862
+ -------
1863
+ AsyncHttpResponse[None]
1864
+ """
1865
+ _response = await self._client_wrapper.httpx_client.request(
1866
+ f"emailCampaigns/{jsonable_encoder(campaign_id)}",
1867
+ method="PUT",
1868
+ json={
1869
+ "abTesting": ab_testing,
1870
+ "attachmentUrl": attachment_url,
1871
+ "emailExpirationDate": convert_and_respect_annotation_metadata(
1872
+ object_=email_expiration_date,
1873
+ annotation=UpdateEmailCampaignRequestEmailExpirationDate,
1874
+ direction="write",
1875
+ ),
1876
+ "footer": footer,
1877
+ "header": header,
1878
+ "htmlContent": html_content,
1879
+ "htmlUrl": html_url,
1880
+ "increaseRate": increase_rate,
1881
+ "initialQuota": initial_quota,
1882
+ "inlineImageActivation": inline_image_activation,
1883
+ "ipWarmupEnable": ip_warmup_enable,
1884
+ "mirrorActive": mirror_active,
1885
+ "name": name,
1886
+ "params": params,
1887
+ "previewText": preview_text,
1888
+ "recipients": convert_and_respect_annotation_metadata(
1889
+ object_=recipients, annotation=UpdateEmailCampaignRequestRecipients, direction="write"
1890
+ ),
1891
+ "recurring": recurring,
1892
+ "replyTo": reply_to,
1893
+ "scheduledAt": scheduled_at,
1894
+ "sendAtBestTime": send_at_best_time,
1895
+ "sender": convert_and_respect_annotation_metadata(
1896
+ object_=sender, annotation=UpdateEmailCampaignRequestSender, direction="write"
1897
+ ),
1898
+ "splitRule": split_rule,
1899
+ "subject": subject,
1900
+ "subjectA": subject_a,
1901
+ "subjectB": subject_b,
1902
+ "tag": tag,
1903
+ "toField": to_field,
1904
+ "unsubscriptionPageId": unsubscription_page_id,
1905
+ "updateFormId": update_form_id,
1906
+ "utmCampaign": utm_campaign,
1907
+ "winnerCriteria": winner_criteria,
1908
+ "winnerDelay": winner_delay,
1909
+ },
1910
+ headers={
1911
+ "content-type": "application/json",
1912
+ },
1913
+ request_options=request_options,
1914
+ omit=OMIT,
1915
+ )
1916
+ try:
1917
+ if 200 <= _response.status_code < 300:
1918
+ return AsyncHttpResponse(response=_response, data=None)
1919
+ if _response.status_code == 400:
1920
+ raise BadRequestError(
1921
+ headers=dict(_response.headers),
1922
+ body=typing.cast(
1923
+ typing.Any,
1924
+ construct_type(
1925
+ type_=typing.Any, # type: ignore
1926
+ object_=_response.json(),
1927
+ ),
1928
+ ),
1929
+ )
1930
+ if _response.status_code == 404:
1931
+ raise NotFoundError(
1932
+ headers=dict(_response.headers),
1933
+ body=typing.cast(
1934
+ typing.Any,
1935
+ construct_type(
1936
+ type_=typing.Any, # type: ignore
1937
+ object_=_response.json(),
1938
+ ),
1939
+ ),
1940
+ )
1941
+ _response_json = _response.json()
1942
+ except JSONDecodeError:
1943
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1944
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1945
+
1946
+ async def delete_email_campaign(
1947
+ self, campaign_id: int, *, request_options: typing.Optional[RequestOptions] = None
1948
+ ) -> AsyncHttpResponse[None]:
1949
+ """
1950
+ Parameters
1951
+ ----------
1952
+ campaign_id : int
1953
+ id of the campaign
1954
+
1955
+ request_options : typing.Optional[RequestOptions]
1956
+ Request-specific configuration.
1957
+
1958
+ Returns
1959
+ -------
1960
+ AsyncHttpResponse[None]
1961
+ """
1962
+ _response = await self._client_wrapper.httpx_client.request(
1963
+ f"emailCampaigns/{jsonable_encoder(campaign_id)}",
1964
+ method="DELETE",
1965
+ request_options=request_options,
1966
+ )
1967
+ try:
1968
+ if 200 <= _response.status_code < 300:
1969
+ return AsyncHttpResponse(response=_response, data=None)
1970
+ if _response.status_code == 400:
1971
+ raise BadRequestError(
1972
+ headers=dict(_response.headers),
1973
+ body=typing.cast(
1974
+ typing.Any,
1975
+ construct_type(
1976
+ type_=typing.Any, # type: ignore
1977
+ object_=_response.json(),
1978
+ ),
1979
+ ),
1980
+ )
1981
+ if _response.status_code == 404:
1982
+ raise NotFoundError(
1983
+ headers=dict(_response.headers),
1984
+ body=typing.cast(
1985
+ typing.Any,
1986
+ construct_type(
1987
+ type_=typing.Any, # type: ignore
1988
+ object_=_response.json(),
1989
+ ),
1990
+ ),
1991
+ )
1992
+ _response_json = _response.json()
1993
+ except JSONDecodeError:
1994
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1995
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1996
+
1997
+ async def get_ab_test_campaign_result(
1998
+ self, campaign_id: int, *, request_options: typing.Optional[RequestOptions] = None
1999
+ ) -> AsyncHttpResponse[GetAbTestCampaignResultResponse]:
2000
+ """
2001
+ Obtain winning version of an A/B test email campaign
2002
+
2003
+ Parameters
2004
+ ----------
2005
+ campaign_id : int
2006
+ Id of the A/B test campaign
2007
+
2008
+ request_options : typing.Optional[RequestOptions]
2009
+ Request-specific configuration.
2010
+
2011
+ Returns
2012
+ -------
2013
+ AsyncHttpResponse[GetAbTestCampaignResultResponse]
2014
+ A/B test email campaign Result
2015
+ """
2016
+ _response = await self._client_wrapper.httpx_client.request(
2017
+ f"emailCampaigns/{jsonable_encoder(campaign_id)}/abTestCampaignResult",
2018
+ method="GET",
2019
+ request_options=request_options,
2020
+ )
2021
+ try:
2022
+ if 200 <= _response.status_code < 300:
2023
+ _data = typing.cast(
2024
+ GetAbTestCampaignResultResponse,
2025
+ construct_type(
2026
+ type_=GetAbTestCampaignResultResponse, # type: ignore
2027
+ object_=_response.json(),
2028
+ ),
2029
+ )
2030
+ return AsyncHttpResponse(response=_response, data=_data)
2031
+ if _response.status_code == 400:
2032
+ raise BadRequestError(
2033
+ headers=dict(_response.headers),
2034
+ body=typing.cast(
2035
+ typing.Any,
2036
+ construct_type(
2037
+ type_=typing.Any, # type: ignore
2038
+ object_=_response.json(),
2039
+ ),
2040
+ ),
2041
+ )
2042
+ if _response.status_code == 404:
2043
+ raise NotFoundError(
2044
+ headers=dict(_response.headers),
2045
+ body=typing.cast(
2046
+ typing.Any,
2047
+ construct_type(
2048
+ type_=typing.Any, # type: ignore
2049
+ object_=_response.json(),
2050
+ ),
2051
+ ),
2052
+ )
2053
+ _response_json = _response.json()
2054
+ except JSONDecodeError:
2055
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2056
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2057
+
2058
+ async def email_export_recipients(
2059
+ self,
2060
+ campaign_id: int,
2061
+ *,
2062
+ recipients_type: EmailExportRecipientsRequestRecipientsType,
2063
+ notify_url: typing.Optional[str] = OMIT,
2064
+ request_options: typing.Optional[RequestOptions] = None,
2065
+ ) -> AsyncHttpResponse[EmailExportRecipientsResponse]:
2066
+ """
2067
+ Parameters
2068
+ ----------
2069
+ campaign_id : int
2070
+ Id of the campaign
2071
+
2072
+ recipients_type : EmailExportRecipientsRequestRecipientsType
2073
+ Type of recipients to export for a campaign
2074
+
2075
+ notify_url : typing.Optional[str]
2076
+ Webhook called once the export process is finished. For reference, https://help.brevo.com/hc/en-us/articles/360007666479
2077
+
2078
+ request_options : typing.Optional[RequestOptions]
2079
+ Request-specific configuration.
2080
+
2081
+ Returns
2082
+ -------
2083
+ AsyncHttpResponse[EmailExportRecipientsResponse]
2084
+ process id created
2085
+ """
2086
+ _response = await self._client_wrapper.httpx_client.request(
2087
+ f"emailCampaigns/{jsonable_encoder(campaign_id)}/exportRecipients",
2088
+ method="POST",
2089
+ json={
2090
+ "notifyURL": notify_url,
2091
+ "recipientsType": recipients_type,
2092
+ },
2093
+ headers={
2094
+ "content-type": "application/json",
2095
+ },
2096
+ request_options=request_options,
2097
+ omit=OMIT,
2098
+ )
2099
+ try:
2100
+ if 200 <= _response.status_code < 300:
2101
+ _data = typing.cast(
2102
+ EmailExportRecipientsResponse,
2103
+ construct_type(
2104
+ type_=EmailExportRecipientsResponse, # type: ignore
2105
+ object_=_response.json(),
2106
+ ),
2107
+ )
2108
+ return AsyncHttpResponse(response=_response, data=_data)
2109
+ if _response.status_code == 400:
2110
+ raise BadRequestError(
2111
+ headers=dict(_response.headers),
2112
+ body=typing.cast(
2113
+ typing.Any,
2114
+ construct_type(
2115
+ type_=typing.Any, # type: ignore
2116
+ object_=_response.json(),
2117
+ ),
2118
+ ),
2119
+ )
2120
+ if _response.status_code == 404:
2121
+ raise NotFoundError(
2122
+ headers=dict(_response.headers),
2123
+ body=typing.cast(
2124
+ typing.Any,
2125
+ construct_type(
2126
+ type_=typing.Any, # type: ignore
2127
+ object_=_response.json(),
2128
+ ),
2129
+ ),
2130
+ )
2131
+ _response_json = _response.json()
2132
+ except JSONDecodeError:
2133
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2134
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2135
+
2136
+ async def send_email_campaign_now(
2137
+ self, campaign_id: int, *, request_options: typing.Optional[RequestOptions] = None
2138
+ ) -> AsyncHttpResponse[None]:
2139
+ """
2140
+ Parameters
2141
+ ----------
2142
+ campaign_id : int
2143
+ Id of the campaign
2144
+
2145
+ request_options : typing.Optional[RequestOptions]
2146
+ Request-specific configuration.
2147
+
2148
+ Returns
2149
+ -------
2150
+ AsyncHttpResponse[None]
2151
+ """
2152
+ _response = await self._client_wrapper.httpx_client.request(
2153
+ f"emailCampaigns/{jsonable_encoder(campaign_id)}/sendNow",
2154
+ method="POST",
2155
+ request_options=request_options,
2156
+ )
2157
+ try:
2158
+ if 200 <= _response.status_code < 300:
2159
+ return AsyncHttpResponse(response=_response, data=None)
2160
+ if _response.status_code == 400:
2161
+ raise BadRequestError(
2162
+ headers=dict(_response.headers),
2163
+ body=typing.cast(
2164
+ typing.Any,
2165
+ construct_type(
2166
+ type_=typing.Any, # type: ignore
2167
+ object_=_response.json(),
2168
+ ),
2169
+ ),
2170
+ )
2171
+ if _response.status_code == 402:
2172
+ raise PaymentRequiredError(
2173
+ headers=dict(_response.headers),
2174
+ body=typing.cast(
2175
+ ErrorModel,
2176
+ construct_type(
2177
+ type_=ErrorModel, # type: ignore
2178
+ object_=_response.json(),
2179
+ ),
2180
+ ),
2181
+ )
2182
+ if _response.status_code == 404:
2183
+ raise NotFoundError(
2184
+ headers=dict(_response.headers),
2185
+ body=typing.cast(
2186
+ typing.Any,
2187
+ construct_type(
2188
+ type_=typing.Any, # type: ignore
2189
+ object_=_response.json(),
2190
+ ),
2191
+ ),
2192
+ )
2193
+ _response_json = _response.json()
2194
+ except JSONDecodeError:
2195
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2196
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2197
+
2198
+ async def send_report(
2199
+ self,
2200
+ campaign_id: int,
2201
+ *,
2202
+ email: SendReportEmail,
2203
+ language: typing.Optional[SendReportLanguage] = OMIT,
2204
+ request_options: typing.Optional[RequestOptions] = None,
2205
+ ) -> AsyncHttpResponse[None]:
2206
+ """
2207
+ A PDF will be sent to the specified email addresses
2208
+
2209
+ Parameters
2210
+ ----------
2211
+ campaign_id : int
2212
+ Id of the campaign
2213
+
2214
+ email : SendReportEmail
2215
+ Custom attributes for the report email.
2216
+
2217
+ language : typing.Optional[SendReportLanguage]
2218
+ Language of email content for campaign report sending.
2219
+
2220
+ request_options : typing.Optional[RequestOptions]
2221
+ Request-specific configuration.
2222
+
2223
+ Returns
2224
+ -------
2225
+ AsyncHttpResponse[None]
2226
+ """
2227
+ _response = await self._client_wrapper.httpx_client.request(
2228
+ f"emailCampaigns/{jsonable_encoder(campaign_id)}/sendReport",
2229
+ method="POST",
2230
+ json={
2231
+ "email": convert_and_respect_annotation_metadata(
2232
+ object_=email, annotation=SendReportEmail, direction="write"
2233
+ ),
2234
+ "language": language,
2235
+ },
2236
+ headers={
2237
+ "content-type": "application/json",
2238
+ },
2239
+ request_options=request_options,
2240
+ omit=OMIT,
2241
+ )
2242
+ try:
2243
+ if 200 <= _response.status_code < 300:
2244
+ return AsyncHttpResponse(response=_response, data=None)
2245
+ if _response.status_code == 400:
2246
+ raise BadRequestError(
2247
+ headers=dict(_response.headers),
2248
+ body=typing.cast(
2249
+ typing.Any,
2250
+ construct_type(
2251
+ type_=typing.Any, # type: ignore
2252
+ object_=_response.json(),
2253
+ ),
2254
+ ),
2255
+ )
2256
+ if _response.status_code == 404:
2257
+ raise NotFoundError(
2258
+ headers=dict(_response.headers),
2259
+ body=typing.cast(
2260
+ typing.Any,
2261
+ construct_type(
2262
+ type_=typing.Any, # type: ignore
2263
+ object_=_response.json(),
2264
+ ),
2265
+ ),
2266
+ )
2267
+ _response_json = _response.json()
2268
+ except JSONDecodeError:
2269
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2270
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2271
+
2272
+ async def send_test_email(
2273
+ self,
2274
+ campaign_id: int,
2275
+ *,
2276
+ email_to: typing.Optional[typing.Sequence[str]] = OMIT,
2277
+ request_options: typing.Optional[RequestOptions] = None,
2278
+ ) -> AsyncHttpResponse[None]:
2279
+ """
2280
+ Parameters
2281
+ ----------
2282
+ campaign_id : int
2283
+ Id of the campaign
2284
+
2285
+ email_to : typing.Optional[typing.Sequence[str]]
2286
+ List of the email addresses of the recipients whom you wish to send the test mail. _If left empty, the test mail will be sent to your entire test list. You can not send more than 50 test emails per day_.
2287
+
2288
+ request_options : typing.Optional[RequestOptions]
2289
+ Request-specific configuration.
2290
+
2291
+ Returns
2292
+ -------
2293
+ AsyncHttpResponse[None]
2294
+ """
2295
+ _response = await self._client_wrapper.httpx_client.request(
2296
+ f"emailCampaigns/{jsonable_encoder(campaign_id)}/sendTest",
2297
+ method="POST",
2298
+ json={
2299
+ "emailTo": email_to,
2300
+ },
2301
+ headers={
2302
+ "content-type": "application/json",
2303
+ },
2304
+ request_options=request_options,
2305
+ omit=OMIT,
2306
+ )
2307
+ try:
2308
+ if 200 <= _response.status_code < 300:
2309
+ return AsyncHttpResponse(response=_response, data=None)
2310
+ if _response.status_code == 400:
2311
+ raise BadRequestError(
2312
+ headers=dict(_response.headers),
2313
+ body=typing.cast(
2314
+ typing.Any,
2315
+ construct_type(
2316
+ type_=typing.Any, # type: ignore
2317
+ object_=_response.json(),
2318
+ ),
2319
+ ),
2320
+ )
2321
+ if _response.status_code == 404:
2322
+ raise NotFoundError(
2323
+ headers=dict(_response.headers),
2324
+ body=typing.cast(
2325
+ typing.Any,
2326
+ construct_type(
2327
+ type_=typing.Any, # type: ignore
2328
+ object_=_response.json(),
2329
+ ),
2330
+ ),
2331
+ )
2332
+ _response_json = _response.json()
2333
+ except JSONDecodeError:
2334
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2335
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2336
+
2337
+ async def get_shared_template_url(
2338
+ self, campaign_id: int, *, request_options: typing.Optional[RequestOptions] = None
2339
+ ) -> AsyncHttpResponse[GetSharedTemplateUrlResponse]:
2340
+ """
2341
+ Get a unique URL to share & import an email template from one Brevo account to another.
2342
+
2343
+ Parameters
2344
+ ----------
2345
+ campaign_id : int
2346
+ Id of the campaign or template
2347
+
2348
+ request_options : typing.Optional[RequestOptions]
2349
+ Request-specific configuration.
2350
+
2351
+ Returns
2352
+ -------
2353
+ AsyncHttpResponse[GetSharedTemplateUrlResponse]
2354
+ Shared template URL information
2355
+ """
2356
+ _response = await self._client_wrapper.httpx_client.request(
2357
+ f"emailCampaigns/{jsonable_encoder(campaign_id)}/sharedUrl",
2358
+ method="GET",
2359
+ request_options=request_options,
2360
+ )
2361
+ try:
2362
+ if 200 <= _response.status_code < 300:
2363
+ _data = typing.cast(
2364
+ GetSharedTemplateUrlResponse,
2365
+ construct_type(
2366
+ type_=GetSharedTemplateUrlResponse, # type: ignore
2367
+ object_=_response.json(),
2368
+ ),
2369
+ )
2370
+ return AsyncHttpResponse(response=_response, data=_data)
2371
+ if _response.status_code == 400:
2372
+ raise BadRequestError(
2373
+ headers=dict(_response.headers),
2374
+ body=typing.cast(
2375
+ typing.Any,
2376
+ construct_type(
2377
+ type_=typing.Any, # type: ignore
2378
+ object_=_response.json(),
2379
+ ),
2380
+ ),
2381
+ )
2382
+ if _response.status_code == 404:
2383
+ raise NotFoundError(
2384
+ headers=dict(_response.headers),
2385
+ body=typing.cast(
2386
+ typing.Any,
2387
+ construct_type(
2388
+ type_=typing.Any, # type: ignore
2389
+ object_=_response.json(),
2390
+ ),
2391
+ ),
2392
+ )
2393
+ if _response.status_code == 405:
2394
+ raise MethodNotAllowedError(
2395
+ headers=dict(_response.headers),
2396
+ body=typing.cast(
2397
+ ErrorModel,
2398
+ construct_type(
2399
+ type_=ErrorModel, # type: ignore
2400
+ object_=_response.json(),
2401
+ ),
2402
+ ),
2403
+ )
2404
+ _response_json = _response.json()
2405
+ except JSONDecodeError:
2406
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2407
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2408
+
2409
+ async def update_campaign_status(
2410
+ self,
2411
+ campaign_id: int,
2412
+ *,
2413
+ status: typing.Optional[UpdateCampaignStatusStatus] = OMIT,
2414
+ request_options: typing.Optional[RequestOptions] = None,
2415
+ ) -> AsyncHttpResponse[None]:
2416
+ """
2417
+ Parameters
2418
+ ----------
2419
+ campaign_id : int
2420
+ Id of the campaign
2421
+
2422
+ status : typing.Optional[UpdateCampaignStatusStatus]
2423
+ Note:- **replicateTemplate** status will be available **only for template type campaigns.**
2424
+
2425
+ request_options : typing.Optional[RequestOptions]
2426
+ Request-specific configuration.
2427
+
2428
+ Returns
2429
+ -------
2430
+ AsyncHttpResponse[None]
2431
+ """
2432
+ _response = await self._client_wrapper.httpx_client.request(
2433
+ f"emailCampaigns/{jsonable_encoder(campaign_id)}/status",
2434
+ method="PUT",
2435
+ json={
2436
+ "status": status,
2437
+ },
2438
+ headers={
2439
+ "content-type": "application/json",
2440
+ },
2441
+ request_options=request_options,
2442
+ omit=OMIT,
2443
+ )
2444
+ try:
2445
+ if 200 <= _response.status_code < 300:
2446
+ return AsyncHttpResponse(response=_response, data=None)
2447
+ if _response.status_code == 400:
2448
+ raise BadRequestError(
2449
+ headers=dict(_response.headers),
2450
+ body=typing.cast(
2451
+ typing.Any,
2452
+ construct_type(
2453
+ type_=typing.Any, # type: ignore
2454
+ object_=_response.json(),
2455
+ ),
2456
+ ),
2457
+ )
2458
+ if _response.status_code == 404:
2459
+ raise NotFoundError(
2460
+ headers=dict(_response.headers),
2461
+ body=typing.cast(
2462
+ typing.Any,
2463
+ construct_type(
2464
+ type_=typing.Any, # type: ignore
2465
+ object_=_response.json(),
2466
+ ),
2467
+ ),
2468
+ )
2469
+ _response_json = _response.json()
2470
+ except JSONDecodeError:
2471
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2472
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)