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,3351 @@
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.forbidden_error import ForbiddenError
15
+ from ..errors.not_found_error import NotFoundError
16
+ from ..types.get_sso_token import GetSsoToken
17
+ from .types.get_corporate_group_id_response import GetCorporateGroupIdResponse
18
+ from .types.get_corporate_invited_users_list_response import GetCorporateInvitedUsersListResponse
19
+ from .types.get_corporate_ip_response_item import GetCorporateIpResponseItem
20
+ from .types.get_corporate_master_account_response import GetCorporateMasterAccountResponse
21
+ from .types.get_corporate_sub_account_id_response import GetCorporateSubAccountIdResponse
22
+ from .types.get_corporate_sub_account_response import GetCorporateSubAccountResponse
23
+ from .types.get_corporate_user_permission_response import GetCorporateUserPermissionResponse
24
+ from .types.get_sub_account_groups_response_item import GetSubAccountGroupsResponseItem
25
+ from .types.invite_admin_user_request_privileges_item import InviteAdminUserRequestPrivilegesItem
26
+ from .types.invite_admin_user_response import InviteAdminUserResponse
27
+ from .types.post_corporate_group_response import PostCorporateGroupResponse
28
+ from .types.post_corporate_sub_account_key_response import PostCorporateSubAccountKeyResponse
29
+ from .types.post_corporate_sub_account_request_language import PostCorporateSubAccountRequestLanguage
30
+ from .types.post_corporate_sub_account_response import PostCorporateSubAccountResponse
31
+ from .types.post_corporate_sub_account_sso_token_request_target import PostCorporateSubAccountSsoTokenRequestTarget
32
+ from .types.put_corporate_sub_account_id_plan_request_credits import PutCorporateSubAccountIdPlanRequestCredits
33
+ from .types.put_corporate_sub_account_id_plan_request_features import PutCorporateSubAccountIdPlanRequestFeatures
34
+ from .types.put_corporate_sub_accounts_plan_request_credits import PutCorporateSubAccountsPlanRequestCredits
35
+ from .types.put_corporate_sub_accounts_plan_request_features import PutCorporateSubAccountsPlanRequestFeatures
36
+ from .types.put_corporate_user_email_permissions_request_privileges_item import (
37
+ PutCorporateUserEmailPermissionsRequestPrivilegesItem,
38
+ )
39
+ from .types.put_corporate_user_invitation_action_email_request_action import (
40
+ PutCorporateUserInvitationActionEmailRequestAction,
41
+ )
42
+ from .types.put_corporate_user_invitation_action_email_response import PutCorporateUserInvitationActionEmailResponse
43
+
44
+ # this is used as the default value for optional parameters
45
+ OMIT = typing.cast(typing.Any, ...)
46
+
47
+
48
+ class RawMasterAccountClient:
49
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
50
+ self._client_wrapper = client_wrapper
51
+
52
+ def create_a_new_group_of_sub_accounts(
53
+ self,
54
+ *,
55
+ group_name: str,
56
+ sub_account_ids: typing.Optional[typing.Sequence[int]] = OMIT,
57
+ request_options: typing.Optional[RequestOptions] = None,
58
+ ) -> HttpResponse[PostCorporateGroupResponse]:
59
+ """
60
+ This endpoint allows to create a group of sub-accounts
61
+
62
+ Parameters
63
+ ----------
64
+ group_name : str
65
+ The name of the group of sub-accounts
66
+
67
+ sub_account_ids : typing.Optional[typing.Sequence[int]]
68
+ Pass the list of sub-account Ids to be included in the group
69
+
70
+ request_options : typing.Optional[RequestOptions]
71
+ Request-specific configuration.
72
+
73
+ Returns
74
+ -------
75
+ HttpResponse[PostCorporateGroupResponse]
76
+ Group ID
77
+ """
78
+ _response = self._client_wrapper.httpx_client.request(
79
+ "corporate/group",
80
+ method="POST",
81
+ json={
82
+ "groupName": group_name,
83
+ "subAccountIds": sub_account_ids,
84
+ },
85
+ headers={
86
+ "content-type": "application/json",
87
+ },
88
+ request_options=request_options,
89
+ omit=OMIT,
90
+ )
91
+ try:
92
+ if 200 <= _response.status_code < 300:
93
+ _data = typing.cast(
94
+ PostCorporateGroupResponse,
95
+ construct_type(
96
+ type_=PostCorporateGroupResponse, # type: ignore
97
+ object_=_response.json(),
98
+ ),
99
+ )
100
+ return HttpResponse(response=_response, data=_data)
101
+ if _response.status_code == 400:
102
+ raise BadRequestError(
103
+ headers=dict(_response.headers),
104
+ body=typing.cast(
105
+ typing.Any,
106
+ construct_type(
107
+ type_=typing.Any, # type: ignore
108
+ object_=_response.json(),
109
+ ),
110
+ ),
111
+ )
112
+ _response_json = _response.json()
113
+ except JSONDecodeError:
114
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
115
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
116
+
117
+ def delete_sub_account_from_group(
118
+ self,
119
+ group_id: str,
120
+ *,
121
+ sub_account_ids: typing.Sequence[int],
122
+ request_options: typing.Optional[RequestOptions] = None,
123
+ ) -> HttpResponse[None]:
124
+ """
125
+ This endpoint allows you to remove a sub-organization from a group.
126
+
127
+ Parameters
128
+ ----------
129
+ group_id : str
130
+ Group id
131
+
132
+ sub_account_ids : typing.Sequence[int]
133
+ List of sub-account ids
134
+
135
+ request_options : typing.Optional[RequestOptions]
136
+ Request-specific configuration.
137
+
138
+ Returns
139
+ -------
140
+ HttpResponse[None]
141
+ """
142
+ _response = self._client_wrapper.httpx_client.request(
143
+ f"corporate/group/unlink/{jsonable_encoder(group_id)}/subAccounts",
144
+ method="PUT",
145
+ json={
146
+ "subAccountIds": sub_account_ids,
147
+ },
148
+ headers={
149
+ "content-type": "application/json",
150
+ },
151
+ request_options=request_options,
152
+ omit=OMIT,
153
+ )
154
+ try:
155
+ if 200 <= _response.status_code < 300:
156
+ return HttpResponse(response=_response, data=None)
157
+ if _response.status_code == 400:
158
+ raise BadRequestError(
159
+ headers=dict(_response.headers),
160
+ body=typing.cast(
161
+ typing.Any,
162
+ construct_type(
163
+ type_=typing.Any, # type: ignore
164
+ object_=_response.json(),
165
+ ),
166
+ ),
167
+ )
168
+ _response_json = _response.json()
169
+ except JSONDecodeError:
170
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
171
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
172
+
173
+ def get_a_group_details(
174
+ self, id: str, *, request_options: typing.Optional[RequestOptions] = None
175
+ ) -> HttpResponse[GetCorporateGroupIdResponse]:
176
+ """
177
+ This endpoint allows you to retrieve a specific group’s information such as
178
+ the list of sub-organizations and the user associated with the group.
179
+
180
+ Parameters
181
+ ----------
182
+ id : str
183
+ Id of the group of sub-organization
184
+
185
+ request_options : typing.Optional[RequestOptions]
186
+ Request-specific configuration.
187
+
188
+ Returns
189
+ -------
190
+ HttpResponse[GetCorporateGroupIdResponse]
191
+ Group details
192
+ """
193
+ _response = self._client_wrapper.httpx_client.request(
194
+ f"corporate/group/{jsonable_encoder(id)}",
195
+ method="GET",
196
+ request_options=request_options,
197
+ )
198
+ try:
199
+ if 200 <= _response.status_code < 300:
200
+ _data = typing.cast(
201
+ GetCorporateGroupIdResponse,
202
+ construct_type(
203
+ type_=GetCorporateGroupIdResponse, # type: ignore
204
+ object_=_response.json(),
205
+ ),
206
+ )
207
+ return HttpResponse(response=_response, data=_data)
208
+ _response_json = _response.json()
209
+ except JSONDecodeError:
210
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
211
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
212
+
213
+ def update_a_group_of_sub_accounts(
214
+ self,
215
+ id: str,
216
+ *,
217
+ group_name: typing.Optional[str] = OMIT,
218
+ sub_account_ids: typing.Optional[typing.Sequence[int]] = OMIT,
219
+ request_options: typing.Optional[RequestOptions] = None,
220
+ ) -> HttpResponse[None]:
221
+ """
222
+ This endpoint allows to update a group of sub-accounts
223
+
224
+ Parameters
225
+ ----------
226
+ id : str
227
+ Id of the group
228
+
229
+ group_name : typing.Optional[str]
230
+ The name of the group of sub-accounts
231
+
232
+ sub_account_ids : typing.Optional[typing.Sequence[int]]
233
+ Pass the list of sub-account Ids to be included in the group
234
+
235
+ request_options : typing.Optional[RequestOptions]
236
+ Request-specific configuration.
237
+
238
+ Returns
239
+ -------
240
+ HttpResponse[None]
241
+ """
242
+ _response = self._client_wrapper.httpx_client.request(
243
+ f"corporate/group/{jsonable_encoder(id)}",
244
+ method="PUT",
245
+ json={
246
+ "groupName": group_name,
247
+ "subAccountIds": sub_account_ids,
248
+ },
249
+ headers={
250
+ "content-type": "application/json",
251
+ },
252
+ request_options=request_options,
253
+ omit=OMIT,
254
+ )
255
+ try:
256
+ if 200 <= _response.status_code < 300:
257
+ return HttpResponse(response=_response, data=None)
258
+ if _response.status_code == 400:
259
+ raise BadRequestError(
260
+ headers=dict(_response.headers),
261
+ body=typing.cast(
262
+ typing.Any,
263
+ construct_type(
264
+ type_=typing.Any, # type: ignore
265
+ object_=_response.json(),
266
+ ),
267
+ ),
268
+ )
269
+ _response_json = _response.json()
270
+ except JSONDecodeError:
271
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
272
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
273
+
274
+ def delete_a_group(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]:
275
+ """
276
+ This endpoint allows you to delete a group of sub-organizations. When a
277
+ group is deleted, the sub-organizations are no longer part of this group.
278
+ The users associated with the group are no longer associated with the group
279
+ once deleted.
280
+
281
+ Parameters
282
+ ----------
283
+ id : str
284
+ Id of the group
285
+
286
+ request_options : typing.Optional[RequestOptions]
287
+ Request-specific configuration.
288
+
289
+ Returns
290
+ -------
291
+ HttpResponse[None]
292
+ """
293
+ _response = self._client_wrapper.httpx_client.request(
294
+ f"corporate/group/{jsonable_encoder(id)}",
295
+ method="DELETE",
296
+ request_options=request_options,
297
+ )
298
+ try:
299
+ if 200 <= _response.status_code < 300:
300
+ return HttpResponse(response=_response, data=None)
301
+ if _response.status_code == 400:
302
+ raise BadRequestError(
303
+ headers=dict(_response.headers),
304
+ body=typing.cast(
305
+ typing.Any,
306
+ construct_type(
307
+ type_=typing.Any, # type: ignore
308
+ object_=_response.json(),
309
+ ),
310
+ ),
311
+ )
312
+ _response_json = _response.json()
313
+ except JSONDecodeError:
314
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
315
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
316
+
317
+ def get_sub_account_groups(
318
+ self, *, request_options: typing.Optional[RequestOptions] = None
319
+ ) -> HttpResponse[typing.List[GetSubAccountGroupsResponseItem]]:
320
+ """
321
+ This endpoint allows you to list all groups created on your Admin account.
322
+
323
+ Parameters
324
+ ----------
325
+ request_options : typing.Optional[RequestOptions]
326
+ Request-specific configuration.
327
+
328
+ Returns
329
+ -------
330
+ HttpResponse[typing.List[GetSubAccountGroupsResponseItem]]
331
+ list of all the sub-account groups
332
+ """
333
+ _response = self._client_wrapper.httpx_client.request(
334
+ "corporate/groups",
335
+ method="GET",
336
+ request_options=request_options,
337
+ )
338
+ try:
339
+ if 200 <= _response.status_code < 300:
340
+ _data = typing.cast(
341
+ typing.List[GetSubAccountGroupsResponseItem],
342
+ construct_type(
343
+ type_=typing.List[GetSubAccountGroupsResponseItem], # type: ignore
344
+ object_=_response.json(),
345
+ ),
346
+ )
347
+ return HttpResponse(response=_response, data=_data)
348
+ _response_json = _response.json()
349
+ except JSONDecodeError:
350
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
351
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
352
+
353
+ def get_corporate_invited_users_list(
354
+ self,
355
+ *,
356
+ type: typing.Optional[str] = None,
357
+ offset: typing.Optional[int] = None,
358
+ limit: typing.Optional[int] = None,
359
+ request_options: typing.Optional[RequestOptions] = None,
360
+ ) -> HttpResponse[GetCorporateInvitedUsersListResponse]:
361
+ """
362
+ This endpoint allows you to list all Admin users of your Admin account. You
363
+ can filter users by type (active or pending) and paginate results using
364
+ offset and limit.
365
+
366
+ Parameters
367
+ ----------
368
+ type : typing.Optional[str]
369
+ User type (active | pending). This is required if offset is provided for
370
+ limited result.
371
+
372
+ offset : typing.Optional[int]
373
+ Page number for the result set. This is optional, default value will be
374
+ the 1st page.
375
+
376
+ limit : typing.Optional[int]
377
+ Number of users to be displayed on each page. This is optional, the
378
+ default limit is 20, but max allowed limit is 100.
379
+
380
+ request_options : typing.Optional[RequestOptions]
381
+ Request-specific configuration.
382
+
383
+ Returns
384
+ -------
385
+ HttpResponse[GetCorporateInvitedUsersListResponse]
386
+ list of all admin users
387
+ """
388
+ _response = self._client_wrapper.httpx_client.request(
389
+ "corporate/invited/users",
390
+ method="GET",
391
+ params={
392
+ "type": type,
393
+ "offset": offset,
394
+ "limit": limit,
395
+ },
396
+ request_options=request_options,
397
+ )
398
+ try:
399
+ if 200 <= _response.status_code < 300:
400
+ _data = typing.cast(
401
+ GetCorporateInvitedUsersListResponse,
402
+ construct_type(
403
+ type_=GetCorporateInvitedUsersListResponse, # type: ignore
404
+ object_=_response.json(),
405
+ ),
406
+ )
407
+ return HttpResponse(response=_response, data=_data)
408
+ _response_json = _response.json()
409
+ except JSONDecodeError:
410
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
411
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
412
+
413
+ def list_of_all_i_ps(
414
+ self, *, request_options: typing.Optional[RequestOptions] = None
415
+ ) -> HttpResponse[typing.List[GetCorporateIpResponseItem]]:
416
+ """
417
+ This endpoint allows you to retrieve the list of active IPs on your Admin
418
+ account
419
+
420
+ Parameters
421
+ ----------
422
+ request_options : typing.Optional[RequestOptions]
423
+ Request-specific configuration.
424
+
425
+ Returns
426
+ -------
427
+ HttpResponse[typing.List[GetCorporateIpResponseItem]]
428
+ List of all IPs
429
+ """
430
+ _response = self._client_wrapper.httpx_client.request(
431
+ "corporate/ip",
432
+ method="GET",
433
+ request_options=request_options,
434
+ )
435
+ try:
436
+ if 200 <= _response.status_code < 300:
437
+ _data = typing.cast(
438
+ typing.List[GetCorporateIpResponseItem],
439
+ construct_type(
440
+ type_=typing.List[GetCorporateIpResponseItem], # type: ignore
441
+ object_=_response.json(),
442
+ ),
443
+ )
444
+ return HttpResponse(response=_response, data=_data)
445
+ _response_json = _response.json()
446
+ except JSONDecodeError:
447
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
448
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
449
+
450
+ def get_the_details_of_requested_master_account(
451
+ self, *, request_options: typing.Optional[RequestOptions] = None
452
+ ) -> HttpResponse[GetCorporateMasterAccountResponse]:
453
+ """
454
+ This endpoint will provide the details of the master account.
455
+
456
+ Parameters
457
+ ----------
458
+ request_options : typing.Optional[RequestOptions]
459
+ Request-specific configuration.
460
+
461
+ Returns
462
+ -------
463
+ HttpResponse[GetCorporateMasterAccountResponse]
464
+ Master account details
465
+ """
466
+ _response = self._client_wrapper.httpx_client.request(
467
+ "corporate/masterAccount",
468
+ method="GET",
469
+ request_options=request_options,
470
+ )
471
+ try:
472
+ if 200 <= _response.status_code < 300:
473
+ _data = typing.cast(
474
+ GetCorporateMasterAccountResponse,
475
+ construct_type(
476
+ type_=GetCorporateMasterAccountResponse, # type: ignore
477
+ object_=_response.json(),
478
+ ),
479
+ )
480
+ return HttpResponse(response=_response, data=_data)
481
+ if _response.status_code == 400:
482
+ raise BadRequestError(
483
+ headers=dict(_response.headers),
484
+ body=typing.cast(
485
+ typing.Any,
486
+ construct_type(
487
+ type_=typing.Any, # type: ignore
488
+ object_=_response.json(),
489
+ ),
490
+ ),
491
+ )
492
+ _response_json = _response.json()
493
+ except JSONDecodeError:
494
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
495
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
496
+
497
+ def generate_sso_token_to_access_admin_account(
498
+ self, *, email: str, request_options: typing.Optional[RequestOptions] = None
499
+ ) -> HttpResponse[GetSsoToken]:
500
+ """
501
+ This endpoint generates an SSO token to authenticate and access the admin
502
+ account using the endpoint
503
+ https://account-app.brevo.com/account/login/corporate/sso/[token], where
504
+ [token] will be replaced by the actual token.
505
+
506
+ Parameters
507
+ ----------
508
+ email : str
509
+ User email of admin account
510
+
511
+ request_options : typing.Optional[RequestOptions]
512
+ Request-specific configuration.
513
+
514
+ Returns
515
+ -------
516
+ HttpResponse[GetSsoToken]
517
+ Session token
518
+ """
519
+ _response = self._client_wrapper.httpx_client.request(
520
+ "corporate/ssoToken",
521
+ method="POST",
522
+ json={
523
+ "email": email,
524
+ },
525
+ headers={
526
+ "content-type": "application/json",
527
+ },
528
+ request_options=request_options,
529
+ omit=OMIT,
530
+ )
531
+ try:
532
+ if 200 <= _response.status_code < 300:
533
+ _data = typing.cast(
534
+ GetSsoToken,
535
+ construct_type(
536
+ type_=GetSsoToken, # type: ignore
537
+ object_=_response.json(),
538
+ ),
539
+ )
540
+ return HttpResponse(response=_response, data=_data)
541
+ if _response.status_code == 400:
542
+ raise BadRequestError(
543
+ headers=dict(_response.headers),
544
+ body=typing.cast(
545
+ typing.Any,
546
+ construct_type(
547
+ type_=typing.Any, # type: ignore
548
+ object_=_response.json(),
549
+ ),
550
+ ),
551
+ )
552
+ if _response.status_code == 403:
553
+ raise ForbiddenError(
554
+ headers=dict(_response.headers),
555
+ body=typing.cast(
556
+ typing.Any,
557
+ construct_type(
558
+ type_=typing.Any, # type: ignore
559
+ object_=_response.json(),
560
+ ),
561
+ ),
562
+ )
563
+ _response_json = _response.json()
564
+ except JSONDecodeError:
565
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
566
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
567
+
568
+ def get_the_list_of_all_the_sub_accounts_of_the_master_account(
569
+ self, *, offset: int, limit: int, request_options: typing.Optional[RequestOptions] = None
570
+ ) -> HttpResponse[GetCorporateSubAccountResponse]:
571
+ """
572
+ This endpoint will provide the list all the sub-accounts of the master
573
+ account.
574
+
575
+ Parameters
576
+ ----------
577
+ offset : int
578
+ Index of the first sub-account in the page
579
+
580
+ limit : int
581
+ Number of sub-accounts to be displayed on each page
582
+
583
+ request_options : typing.Optional[RequestOptions]
584
+ Request-specific configuration.
585
+
586
+ Returns
587
+ -------
588
+ HttpResponse[GetCorporateSubAccountResponse]
589
+ Sub-accounts list
590
+ """
591
+ _response = self._client_wrapper.httpx_client.request(
592
+ "corporate/subAccount",
593
+ method="GET",
594
+ params={
595
+ "offset": offset,
596
+ "limit": limit,
597
+ },
598
+ request_options=request_options,
599
+ )
600
+ try:
601
+ if 200 <= _response.status_code < 300:
602
+ _data = typing.cast(
603
+ GetCorporateSubAccountResponse,
604
+ construct_type(
605
+ type_=GetCorporateSubAccountResponse, # type: ignore
606
+ object_=_response.json(),
607
+ ),
608
+ )
609
+ return HttpResponse(response=_response, data=_data)
610
+ if _response.status_code == 400:
611
+ raise BadRequestError(
612
+ headers=dict(_response.headers),
613
+ body=typing.cast(
614
+ typing.Any,
615
+ construct_type(
616
+ type_=typing.Any, # type: ignore
617
+ object_=_response.json(),
618
+ ),
619
+ ),
620
+ )
621
+ _response_json = _response.json()
622
+ except JSONDecodeError:
623
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
624
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
625
+
626
+ def create_a_new_sub_account_under_a_master_account(
627
+ self,
628
+ *,
629
+ company_name: str,
630
+ email: str,
631
+ group_ids: typing.Optional[typing.Sequence[str]] = OMIT,
632
+ language: typing.Optional[PostCorporateSubAccountRequestLanguage] = OMIT,
633
+ timezone: typing.Optional[str] = OMIT,
634
+ request_options: typing.Optional[RequestOptions] = None,
635
+ ) -> HttpResponse[PostCorporateSubAccountResponse]:
636
+ """
637
+ This endpoint will create a new sub-account under a master account
638
+
639
+ Parameters
640
+ ----------
641
+ company_name : str
642
+ Set the name of the sub-account company
643
+
644
+ email : str
645
+ Email address for the organization
646
+
647
+ group_ids : typing.Optional[typing.Sequence[str]]
648
+ Set the group(s) for the sub-account
649
+
650
+ language : typing.Optional[PostCorporateSubAccountRequestLanguage]
651
+ Set the language of the sub-account
652
+
653
+ timezone : typing.Optional[str]
654
+ Set the timezone of the sub-account
655
+
656
+ request_options : typing.Optional[RequestOptions]
657
+ Request-specific configuration.
658
+
659
+ Returns
660
+ -------
661
+ HttpResponse[PostCorporateSubAccountResponse]
662
+ Created sub-account ID
663
+ """
664
+ _response = self._client_wrapper.httpx_client.request(
665
+ "corporate/subAccount",
666
+ method="POST",
667
+ json={
668
+ "companyName": company_name,
669
+ "email": email,
670
+ "groupIds": group_ids,
671
+ "language": language,
672
+ "timezone": timezone,
673
+ },
674
+ headers={
675
+ "content-type": "application/json",
676
+ },
677
+ request_options=request_options,
678
+ omit=OMIT,
679
+ )
680
+ try:
681
+ if 200 <= _response.status_code < 300:
682
+ _data = typing.cast(
683
+ PostCorporateSubAccountResponse,
684
+ construct_type(
685
+ type_=PostCorporateSubAccountResponse, # type: ignore
686
+ object_=_response.json(),
687
+ ),
688
+ )
689
+ return HttpResponse(response=_response, data=_data)
690
+ if _response.status_code == 400:
691
+ raise BadRequestError(
692
+ headers=dict(_response.headers),
693
+ body=typing.cast(
694
+ typing.Any,
695
+ construct_type(
696
+ type_=typing.Any, # type: ignore
697
+ object_=_response.json(),
698
+ ),
699
+ ),
700
+ )
701
+ _response_json = _response.json()
702
+ except JSONDecodeError:
703
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
704
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
705
+
706
+ def associate_an_ip_to_sub_accounts(
707
+ self, *, ids: typing.Sequence[int], ip: str, request_options: typing.Optional[RequestOptions] = None
708
+ ) -> HttpResponse[typing.Dict[str, typing.Any]]:
709
+ """
710
+ This endpoint allows to associate an IP to sub-accounts
711
+
712
+ Parameters
713
+ ----------
714
+ ids : typing.Sequence[int]
715
+ Pass the list of sub-account Ids to be associated with the IP
716
+ address
717
+
718
+ ip : str
719
+ IP address
720
+
721
+ request_options : typing.Optional[RequestOptions]
722
+ Request-specific configuration.
723
+
724
+ Returns
725
+ -------
726
+ HttpResponse[typing.Dict[str, typing.Any]]
727
+ IP has been associated with sub-accounts successfully
728
+ """
729
+ _response = self._client_wrapper.httpx_client.request(
730
+ "corporate/subAccount/ip/associate",
731
+ method="POST",
732
+ json={
733
+ "ids": ids,
734
+ "ip": ip,
735
+ },
736
+ headers={
737
+ "content-type": "application/json",
738
+ },
739
+ request_options=request_options,
740
+ omit=OMIT,
741
+ )
742
+ try:
743
+ if 200 <= _response.status_code < 300:
744
+ _data = typing.cast(
745
+ typing.Dict[str, typing.Any],
746
+ construct_type(
747
+ type_=typing.Dict[str, typing.Any], # type: ignore
748
+ object_=_response.json(),
749
+ ),
750
+ )
751
+ return HttpResponse(response=_response, data=_data)
752
+ if _response.status_code == 400:
753
+ raise BadRequestError(
754
+ headers=dict(_response.headers),
755
+ body=typing.cast(
756
+ typing.Any,
757
+ construct_type(
758
+ type_=typing.Any, # type: ignore
759
+ object_=_response.json(),
760
+ ),
761
+ ),
762
+ )
763
+ _response_json = _response.json()
764
+ except JSONDecodeError:
765
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
766
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
767
+
768
+ def dissociate_an_ip_to_sub_accounts(
769
+ self, *, ids: typing.Sequence[int], ip: str, request_options: typing.Optional[RequestOptions] = None
770
+ ) -> HttpResponse[None]:
771
+ """
772
+ This endpoint allows to dissociate an IP from sub-accounts
773
+
774
+ Parameters
775
+ ----------
776
+ ids : typing.Sequence[int]
777
+ Pass the list of sub-account Ids to be dissociated from the IP
778
+ address
779
+
780
+ ip : str
781
+ IP address
782
+
783
+ request_options : typing.Optional[RequestOptions]
784
+ Request-specific configuration.
785
+
786
+ Returns
787
+ -------
788
+ HttpResponse[None]
789
+ """
790
+ _response = self._client_wrapper.httpx_client.request(
791
+ "corporate/subAccount/ip/dissociate",
792
+ method="PUT",
793
+ json={
794
+ "ids": ids,
795
+ "ip": ip,
796
+ },
797
+ headers={
798
+ "content-type": "application/json",
799
+ },
800
+ request_options=request_options,
801
+ omit=OMIT,
802
+ )
803
+ try:
804
+ if 200 <= _response.status_code < 300:
805
+ return HttpResponse(response=_response, data=None)
806
+ if _response.status_code == 400:
807
+ raise BadRequestError(
808
+ headers=dict(_response.headers),
809
+ body=typing.cast(
810
+ typing.Any,
811
+ construct_type(
812
+ type_=typing.Any, # type: ignore
813
+ object_=_response.json(),
814
+ ),
815
+ ),
816
+ )
817
+ _response_json = _response.json()
818
+ except JSONDecodeError:
819
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
820
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
821
+
822
+ def create_an_api_key_for_a_sub_account(
823
+ self, *, id: int, name: str, request_options: typing.Optional[RequestOptions] = None
824
+ ) -> HttpResponse[PostCorporateSubAccountKeyResponse]:
825
+ """
826
+ This endpoint will generate an API v3 key for a sub-account
827
+
828
+ Parameters
829
+ ----------
830
+ id : int
831
+ Id of the sub-account organization
832
+
833
+ name : str
834
+ Name of the API key
835
+
836
+ request_options : typing.Optional[RequestOptions]
837
+ Request-specific configuration.
838
+
839
+ Returns
840
+ -------
841
+ HttpResponse[PostCorporateSubAccountKeyResponse]
842
+ API key
843
+ """
844
+ _response = self._client_wrapper.httpx_client.request(
845
+ "corporate/subAccount/key",
846
+ method="POST",
847
+ json={
848
+ "id": id,
849
+ "name": name,
850
+ },
851
+ headers={
852
+ "content-type": "application/json",
853
+ },
854
+ request_options=request_options,
855
+ omit=OMIT,
856
+ )
857
+ try:
858
+ if 200 <= _response.status_code < 300:
859
+ _data = typing.cast(
860
+ PostCorporateSubAccountKeyResponse,
861
+ construct_type(
862
+ type_=PostCorporateSubAccountKeyResponse, # type: ignore
863
+ object_=_response.json(),
864
+ ),
865
+ )
866
+ return HttpResponse(response=_response, data=_data)
867
+ if _response.status_code == 400:
868
+ raise BadRequestError(
869
+ headers=dict(_response.headers),
870
+ body=typing.cast(
871
+ typing.Any,
872
+ construct_type(
873
+ type_=typing.Any, # type: ignore
874
+ object_=_response.json(),
875
+ ),
876
+ ),
877
+ )
878
+ _response_json = _response.json()
879
+ except JSONDecodeError:
880
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
881
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
882
+
883
+ def generate_sso_token_to_access_sub_account(
884
+ self,
885
+ *,
886
+ id: int,
887
+ email: typing.Optional[str] = OMIT,
888
+ target: typing.Optional[PostCorporateSubAccountSsoTokenRequestTarget] = OMIT,
889
+ url: typing.Optional[str] = OMIT,
890
+ request_options: typing.Optional[RequestOptions] = None,
891
+ ) -> HttpResponse[GetSsoToken]:
892
+ """
893
+ This endpoint generates an sso token to authenticate and access a
894
+ sub-account of the master using the account endpoint
895
+ https://account-app.brevo.com/account/login/sub-account/sso/[token], where
896
+ [token] will be replaced by the actual token.
897
+
898
+ Parameters
899
+ ----------
900
+ id : int
901
+ Id of the sub-account organization
902
+
903
+ email : typing.Optional[str]
904
+ User email of sub-account organization
905
+
906
+ target : typing.Optional[PostCorporateSubAccountSsoTokenRequestTarget]
907
+ **Set target after login success** * **automation** - Redirect
908
+ to Automation after login * **email_campaign** - Redirect to
909
+ Email Campaign after login * **contacts** - Redirect to Contacts
910
+ after login * **landing_pages** - Redirect to Landing Pages
911
+ after login * **email_transactional** - Redirect to Email
912
+ Transactional after login * **senders** - Redirect to Senders
913
+ after login * **sms_campaign** - Redirect to Sms Campaign after
914
+ login * **sms_transactional** - Redirect to Sms Transactional
915
+ after login
916
+
917
+ url : typing.Optional[str]
918
+ Set the full target URL after login success. The user will land
919
+ directly on this target URL after login
920
+
921
+ request_options : typing.Optional[RequestOptions]
922
+ Request-specific configuration.
923
+
924
+ Returns
925
+ -------
926
+ HttpResponse[GetSsoToken]
927
+ Session token
928
+ """
929
+ _response = self._client_wrapper.httpx_client.request(
930
+ "corporate/subAccount/ssoToken",
931
+ method="POST",
932
+ json={
933
+ "email": email,
934
+ "id": id,
935
+ "target": target,
936
+ "url": url,
937
+ },
938
+ headers={
939
+ "content-type": "application/json",
940
+ },
941
+ request_options=request_options,
942
+ omit=OMIT,
943
+ )
944
+ try:
945
+ if 200 <= _response.status_code < 300:
946
+ _data = typing.cast(
947
+ GetSsoToken,
948
+ construct_type(
949
+ type_=GetSsoToken, # type: ignore
950
+ object_=_response.json(),
951
+ ),
952
+ )
953
+ return HttpResponse(response=_response, data=_data)
954
+ if _response.status_code == 400:
955
+ raise BadRequestError(
956
+ headers=dict(_response.headers),
957
+ body=typing.cast(
958
+ typing.Any,
959
+ construct_type(
960
+ type_=typing.Any, # type: ignore
961
+ object_=_response.json(),
962
+ ),
963
+ ),
964
+ )
965
+ if _response.status_code == 403:
966
+ raise ForbiddenError(
967
+ headers=dict(_response.headers),
968
+ body=typing.cast(
969
+ typing.Any,
970
+ construct_type(
971
+ type_=typing.Any, # type: ignore
972
+ object_=_response.json(),
973
+ ),
974
+ ),
975
+ )
976
+ _response_json = _response.json()
977
+ except JSONDecodeError:
978
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
979
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
980
+
981
+ def get_sub_account_details(
982
+ self, id: int, *, request_options: typing.Optional[RequestOptions] = None
983
+ ) -> HttpResponse[GetCorporateSubAccountIdResponse]:
984
+ """
985
+ This endpoint will provide the details for the specified sub-account company
986
+
987
+ Parameters
988
+ ----------
989
+ id : int
990
+ Id of the sub-account organization
991
+
992
+ request_options : typing.Optional[RequestOptions]
993
+ Request-specific configuration.
994
+
995
+ Returns
996
+ -------
997
+ HttpResponse[GetCorporateSubAccountIdResponse]
998
+ Sub-account organization details
999
+ """
1000
+ _response = self._client_wrapper.httpx_client.request(
1001
+ f"corporate/subAccount/{jsonable_encoder(id)}",
1002
+ method="GET",
1003
+ request_options=request_options,
1004
+ )
1005
+ try:
1006
+ if 200 <= _response.status_code < 300:
1007
+ _data = typing.cast(
1008
+ GetCorporateSubAccountIdResponse,
1009
+ construct_type(
1010
+ type_=GetCorporateSubAccountIdResponse, # type: ignore
1011
+ object_=_response.json(),
1012
+ ),
1013
+ )
1014
+ return HttpResponse(response=_response, data=_data)
1015
+ if _response.status_code == 400:
1016
+ raise BadRequestError(
1017
+ headers=dict(_response.headers),
1018
+ body=typing.cast(
1019
+ typing.Any,
1020
+ construct_type(
1021
+ type_=typing.Any, # type: ignore
1022
+ object_=_response.json(),
1023
+ ),
1024
+ ),
1025
+ )
1026
+ _response_json = _response.json()
1027
+ except JSONDecodeError:
1028
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1029
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1030
+
1031
+ def delete_a_sub_account(
1032
+ self, id: int, *, request_options: typing.Optional[RequestOptions] = None
1033
+ ) -> HttpResponse[None]:
1034
+ """
1035
+ Parameters
1036
+ ----------
1037
+ id : int
1038
+ Id of the sub-account organization to be deleted
1039
+
1040
+ request_options : typing.Optional[RequestOptions]
1041
+ Request-specific configuration.
1042
+
1043
+ Returns
1044
+ -------
1045
+ HttpResponse[None]
1046
+ """
1047
+ _response = self._client_wrapper.httpx_client.request(
1048
+ f"corporate/subAccount/{jsonable_encoder(id)}",
1049
+ method="DELETE",
1050
+ request_options=request_options,
1051
+ )
1052
+ try:
1053
+ if 200 <= _response.status_code < 300:
1054
+ return HttpResponse(response=_response, data=None)
1055
+ if _response.status_code == 400:
1056
+ raise BadRequestError(
1057
+ headers=dict(_response.headers),
1058
+ body=typing.cast(
1059
+ typing.Any,
1060
+ construct_type(
1061
+ type_=typing.Any, # type: ignore
1062
+ object_=_response.json(),
1063
+ ),
1064
+ ),
1065
+ )
1066
+ if _response.status_code == 404:
1067
+ raise NotFoundError(
1068
+ headers=dict(_response.headers),
1069
+ body=typing.cast(
1070
+ typing.Any,
1071
+ construct_type(
1072
+ type_=typing.Any, # type: ignore
1073
+ object_=_response.json(),
1074
+ ),
1075
+ ),
1076
+ )
1077
+ _response_json = _response.json()
1078
+ except JSONDecodeError:
1079
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1080
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1081
+
1082
+ def enable_disable_sub_account_application_s(
1083
+ self,
1084
+ id: int,
1085
+ *,
1086
+ automation: typing.Optional[bool] = OMIT,
1087
+ conversations: typing.Optional[bool] = OMIT,
1088
+ crm: typing.Optional[bool] = OMIT,
1089
+ email_campaigns: typing.Optional[bool] = OMIT,
1090
+ facebook_ads: typing.Optional[bool] = OMIT,
1091
+ inbox: typing.Optional[bool] = OMIT,
1092
+ landing_pages: typing.Optional[bool] = OMIT,
1093
+ meetings: typing.Optional[bool] = OMIT,
1094
+ sms_campaigns: typing.Optional[bool] = OMIT,
1095
+ transactional_emails: typing.Optional[bool] = OMIT,
1096
+ transactional_sms: typing.Optional[bool] = OMIT,
1097
+ web_push: typing.Optional[bool] = OMIT,
1098
+ whatsapp: typing.Optional[bool] = OMIT,
1099
+ request_options: typing.Optional[RequestOptions] = None,
1100
+ ) -> HttpResponse[None]:
1101
+ """
1102
+ API endpoint for the Corporate owner to enable/disable applications on the
1103
+ sub-account
1104
+
1105
+ Parameters
1106
+ ----------
1107
+ id : int
1108
+ Id of the sub-account organization (mandatory)
1109
+
1110
+ automation : typing.Optional[bool]
1111
+ Set this field to enable or disable Automation on the
1112
+ sub-account
1113
+
1114
+ conversations : typing.Optional[bool]
1115
+ Set this field to enable or disable Conversations on the
1116
+ sub-account
1117
+
1118
+ crm : typing.Optional[bool]
1119
+ Set this field to enable or disable Sales CRM on the sub-account
1120
+
1121
+ email_campaigns : typing.Optional[bool]
1122
+ Set this field to enable or disable Email Campaigns on the
1123
+ sub-account
1124
+
1125
+ facebook_ads : typing.Optional[bool]
1126
+ Set this field to enable or disable Facebook ads on the
1127
+ sub-account
1128
+
1129
+ inbox : typing.Optional[bool]
1130
+ Set this field to enable or disable Inbox on the sub-account /
1131
+ Not applicable on ENTv2
1132
+
1133
+ landing_pages : typing.Optional[bool]
1134
+ Set this field to enable or disable Landing pages on the
1135
+ sub-account
1136
+
1137
+ meetings : typing.Optional[bool]
1138
+ Set this field to enable or disable Meetings on the sub-account
1139
+
1140
+ sms_campaigns : typing.Optional[bool]
1141
+ Set this field to enable or disable SMS Marketing on the
1142
+ sub-account
1143
+
1144
+ transactional_emails : typing.Optional[bool]
1145
+ Set this field to enable or disable Transactional Email on the
1146
+ sub-account
1147
+
1148
+ transactional_sms : typing.Optional[bool]
1149
+ Set this field to enable or disable Transactional SMS on the
1150
+ sub-account
1151
+
1152
+ web_push : typing.Optional[bool]
1153
+ Set this field to enable or disable Web Push on the sub-account
1154
+
1155
+ whatsapp : typing.Optional[bool]
1156
+ Set this field to enable or disable Whatsapp campaigns on the
1157
+ sub-account
1158
+
1159
+ request_options : typing.Optional[RequestOptions]
1160
+ Request-specific configuration.
1161
+
1162
+ Returns
1163
+ -------
1164
+ HttpResponse[None]
1165
+ """
1166
+ _response = self._client_wrapper.httpx_client.request(
1167
+ f"corporate/subAccount/{jsonable_encoder(id)}/applications/toggle",
1168
+ method="PUT",
1169
+ json={
1170
+ "automation": automation,
1171
+ "conversations": conversations,
1172
+ "crm": crm,
1173
+ "email-campaigns": email_campaigns,
1174
+ "facebook-ads": facebook_ads,
1175
+ "inbox": inbox,
1176
+ "landing-pages": landing_pages,
1177
+ "meetings": meetings,
1178
+ "sms-campaigns": sms_campaigns,
1179
+ "transactional-emails": transactional_emails,
1180
+ "transactional-sms": transactional_sms,
1181
+ "web-push": web_push,
1182
+ "whatsapp": whatsapp,
1183
+ },
1184
+ headers={
1185
+ "content-type": "application/json",
1186
+ },
1187
+ request_options=request_options,
1188
+ omit=OMIT,
1189
+ )
1190
+ try:
1191
+ if 200 <= _response.status_code < 300:
1192
+ return HttpResponse(response=_response, data=None)
1193
+ if _response.status_code == 400:
1194
+ raise BadRequestError(
1195
+ headers=dict(_response.headers),
1196
+ body=typing.cast(
1197
+ typing.Any,
1198
+ construct_type(
1199
+ type_=typing.Any, # type: ignore
1200
+ object_=_response.json(),
1201
+ ),
1202
+ ),
1203
+ )
1204
+ if _response.status_code == 403:
1205
+ raise ForbiddenError(
1206
+ headers=dict(_response.headers),
1207
+ body=typing.cast(
1208
+ typing.Any,
1209
+ construct_type(
1210
+ type_=typing.Any, # type: ignore
1211
+ object_=_response.json(),
1212
+ ),
1213
+ ),
1214
+ )
1215
+ _response_json = _response.json()
1216
+ except JSONDecodeError:
1217
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1218
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1219
+
1220
+ def update_sub_account_plan(
1221
+ self,
1222
+ id: int,
1223
+ *,
1224
+ credits: typing.Optional[PutCorporateSubAccountIdPlanRequestCredits] = OMIT,
1225
+ features: typing.Optional[PutCorporateSubAccountIdPlanRequestFeatures] = OMIT,
1226
+ request_options: typing.Optional[RequestOptions] = None,
1227
+ ) -> HttpResponse[None]:
1228
+ """
1229
+ This endpoint will update the sub-account plan. On the Corporate solution
1230
+ new version v2, you can set an unlimited number of credits in your
1231
+ sub-organization. Please pass the value “-1" to set the consumable in
1232
+ unlimited mode.
1233
+
1234
+ Parameters
1235
+ ----------
1236
+ id : int
1237
+ Id of the sub-account organization
1238
+
1239
+ credits : typing.Optional[PutCorporateSubAccountIdPlanRequestCredits]
1240
+ Credit details to update
1241
+
1242
+ features : typing.Optional[PutCorporateSubAccountIdPlanRequestFeatures]
1243
+ Features details to update
1244
+
1245
+ request_options : typing.Optional[RequestOptions]
1246
+ Request-specific configuration.
1247
+
1248
+ Returns
1249
+ -------
1250
+ HttpResponse[None]
1251
+ """
1252
+ _response = self._client_wrapper.httpx_client.request(
1253
+ f"corporate/subAccount/{jsonable_encoder(id)}/plan",
1254
+ method="PUT",
1255
+ json={
1256
+ "credits": convert_and_respect_annotation_metadata(
1257
+ object_=credits, annotation=PutCorporateSubAccountIdPlanRequestCredits, direction="write"
1258
+ ),
1259
+ "features": convert_and_respect_annotation_metadata(
1260
+ object_=features, annotation=PutCorporateSubAccountIdPlanRequestFeatures, direction="write"
1261
+ ),
1262
+ },
1263
+ headers={
1264
+ "content-type": "application/json",
1265
+ },
1266
+ request_options=request_options,
1267
+ omit=OMIT,
1268
+ )
1269
+ try:
1270
+ if 200 <= _response.status_code < 300:
1271
+ return HttpResponse(response=_response, data=None)
1272
+ if _response.status_code == 400:
1273
+ raise BadRequestError(
1274
+ headers=dict(_response.headers),
1275
+ body=typing.cast(
1276
+ typing.Any,
1277
+ construct_type(
1278
+ type_=typing.Any, # type: ignore
1279
+ object_=_response.json(),
1280
+ ),
1281
+ ),
1282
+ )
1283
+ if _response.status_code == 403:
1284
+ raise ForbiddenError(
1285
+ headers=dict(_response.headers),
1286
+ body=typing.cast(
1287
+ typing.Any,
1288
+ construct_type(
1289
+ type_=typing.Any, # type: ignore
1290
+ object_=_response.json(),
1291
+ ),
1292
+ ),
1293
+ )
1294
+ _response_json = _response.json()
1295
+ except JSONDecodeError:
1296
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1297
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1298
+
1299
+ def update_sub_accounts_plan(
1300
+ self,
1301
+ *,
1302
+ credits: typing.Optional[PutCorporateSubAccountsPlanRequestCredits] = OMIT,
1303
+ features: typing.Optional[PutCorporateSubAccountsPlanRequestFeatures] = OMIT,
1304
+ sub_account_ids: typing.Optional[typing.Sequence[int]] = OMIT,
1305
+ request_options: typing.Optional[RequestOptions] = None,
1306
+ ) -> HttpResponse[None]:
1307
+ """
1308
+ This endpoint will update multiple sub-accounts plan. On the Corporate
1309
+ solution new version v2, you can set an unlimited number of credits in your
1310
+ sub-organization. Please pass the value “-1" to set the consumable in
1311
+ unlimited mode.
1312
+
1313
+ Parameters
1314
+ ----------
1315
+ credits : typing.Optional[PutCorporateSubAccountsPlanRequestCredits]
1316
+ Credit details to update
1317
+
1318
+ features : typing.Optional[PutCorporateSubAccountsPlanRequestFeatures]
1319
+ Features details to update
1320
+
1321
+ sub_account_ids : typing.Optional[typing.Sequence[int]]
1322
+ List of sub-account ids
1323
+
1324
+ request_options : typing.Optional[RequestOptions]
1325
+ Request-specific configuration.
1326
+
1327
+ Returns
1328
+ -------
1329
+ HttpResponse[None]
1330
+ """
1331
+ _response = self._client_wrapper.httpx_client.request(
1332
+ "corporate/subAccounts/plan",
1333
+ method="PUT",
1334
+ json={
1335
+ "credits": convert_and_respect_annotation_metadata(
1336
+ object_=credits, annotation=PutCorporateSubAccountsPlanRequestCredits, direction="write"
1337
+ ),
1338
+ "features": convert_and_respect_annotation_metadata(
1339
+ object_=features, annotation=PutCorporateSubAccountsPlanRequestFeatures, direction="write"
1340
+ ),
1341
+ "subAccountIds": sub_account_ids,
1342
+ },
1343
+ headers={
1344
+ "content-type": "application/json",
1345
+ },
1346
+ request_options=request_options,
1347
+ omit=OMIT,
1348
+ )
1349
+ try:
1350
+ if 200 <= _response.status_code < 300:
1351
+ return HttpResponse(response=_response, data=None)
1352
+ if _response.status_code == 400:
1353
+ raise BadRequestError(
1354
+ headers=dict(_response.headers),
1355
+ body=typing.cast(
1356
+ typing.Any,
1357
+ construct_type(
1358
+ type_=typing.Any, # type: ignore
1359
+ object_=_response.json(),
1360
+ ),
1361
+ ),
1362
+ )
1363
+ if _response.status_code == 403:
1364
+ raise ForbiddenError(
1365
+ headers=dict(_response.headers),
1366
+ body=typing.cast(
1367
+ typing.Any,
1368
+ construct_type(
1369
+ type_=typing.Any, # type: ignore
1370
+ object_=_response.json(),
1371
+ ),
1372
+ ),
1373
+ )
1374
+ _response_json = _response.json()
1375
+ except JSONDecodeError:
1376
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1377
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1378
+
1379
+ def invite_admin_user(
1380
+ self,
1381
+ *,
1382
+ all_features_access: bool,
1383
+ email: str,
1384
+ privileges: typing.Sequence[InviteAdminUserRequestPrivilegesItem],
1385
+ group_ids: typing.Optional[typing.Sequence[str]] = OMIT,
1386
+ request_options: typing.Optional[RequestOptions] = None,
1387
+ ) -> HttpResponse[InviteAdminUserResponse]:
1388
+ """
1389
+ `This endpoint allows you to invite a member to manage the Admin account
1390
+ Features and their respective permissions are as below: - `my_plan`:
1391
+ - "all"
1392
+ - `api`:
1393
+ - "none"
1394
+ - `user_management`:
1395
+ - "all"
1396
+ - `app_management` | Not available in ENTv2:
1397
+ - "all"
1398
+ - `sub_organization_groups`
1399
+ - "create"
1400
+ - "edit_delete"
1401
+ - `create_sub_organizations`
1402
+ - "all"
1403
+ - `manage_sub_organizations`
1404
+ - "all"
1405
+ - `analytics`
1406
+ - "download_data"
1407
+ - "create_alerts"
1408
+ - "my_looks"
1409
+ - "explore_create"
1410
+ - `security`
1411
+ - "all"
1412
+ **Note**: - If `all_features_access: false` then only privileges are
1413
+ required otherwise if `true` then it's assumed that all permissions will be
1414
+ there for the invited admin user.
1415
+
1416
+ Parameters
1417
+ ----------
1418
+ all_features_access : bool
1419
+ All access to the features
1420
+
1421
+ email : str
1422
+ Email address for the organization
1423
+
1424
+ privileges : typing.Sequence[InviteAdminUserRequestPrivilegesItem]
1425
+
1426
+ group_ids : typing.Optional[typing.Sequence[str]]
1427
+ Ids of Group
1428
+
1429
+ request_options : typing.Optional[RequestOptions]
1430
+ Request-specific configuration.
1431
+
1432
+ Returns
1433
+ -------
1434
+ HttpResponse[InviteAdminUserResponse]
1435
+ Invitation ID
1436
+ """
1437
+ _response = self._client_wrapper.httpx_client.request(
1438
+ "corporate/user/invitation/send",
1439
+ method="POST",
1440
+ json={
1441
+ "all_features_access": all_features_access,
1442
+ "email": email,
1443
+ "groupIds": group_ids,
1444
+ "privileges": convert_and_respect_annotation_metadata(
1445
+ object_=privileges,
1446
+ annotation=typing.Sequence[InviteAdminUserRequestPrivilegesItem],
1447
+ direction="write",
1448
+ ),
1449
+ },
1450
+ headers={
1451
+ "content-type": "application/json",
1452
+ },
1453
+ request_options=request_options,
1454
+ omit=OMIT,
1455
+ )
1456
+ try:
1457
+ if 200 <= _response.status_code < 300:
1458
+ _data = typing.cast(
1459
+ InviteAdminUserResponse,
1460
+ construct_type(
1461
+ type_=InviteAdminUserResponse, # type: ignore
1462
+ object_=_response.json(),
1463
+ ),
1464
+ )
1465
+ return HttpResponse(response=_response, data=_data)
1466
+ if _response.status_code == 400:
1467
+ raise BadRequestError(
1468
+ headers=dict(_response.headers),
1469
+ body=typing.cast(
1470
+ typing.Any,
1471
+ construct_type(
1472
+ type_=typing.Any, # type: ignore
1473
+ object_=_response.json(),
1474
+ ),
1475
+ ),
1476
+ )
1477
+ _response_json = _response.json()
1478
+ except JSONDecodeError:
1479
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1480
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1481
+
1482
+ def resend_cancel_admin_user_invitation(
1483
+ self,
1484
+ action: PutCorporateUserInvitationActionEmailRequestAction,
1485
+ email: str,
1486
+ *,
1487
+ request_options: typing.Optional[RequestOptions] = None,
1488
+ ) -> HttpResponse[PutCorporateUserInvitationActionEmailResponse]:
1489
+ """
1490
+ This endpoint will allow the user to:
1491
+ - Resend an admin user invitation
1492
+ - Cancel an admin user invitation
1493
+
1494
+ Parameters
1495
+ ----------
1496
+ action : PutCorporateUserInvitationActionEmailRequestAction
1497
+ Action to be performed (cancel / resend)
1498
+
1499
+ email : str
1500
+ Email address of the recipient
1501
+
1502
+ request_options : typing.Optional[RequestOptions]
1503
+ Request-specific configuration.
1504
+
1505
+ Returns
1506
+ -------
1507
+ HttpResponse[PutCorporateUserInvitationActionEmailResponse]
1508
+ Response of the action performed
1509
+ """
1510
+ _response = self._client_wrapper.httpx_client.request(
1511
+ f"corporate/user/invitation/{jsonable_encoder(action)}/{jsonable_encoder(email)}",
1512
+ method="PUT",
1513
+ request_options=request_options,
1514
+ )
1515
+ try:
1516
+ if 200 <= _response.status_code < 300:
1517
+ _data = typing.cast(
1518
+ PutCorporateUserInvitationActionEmailResponse,
1519
+ construct_type(
1520
+ type_=PutCorporateUserInvitationActionEmailResponse, # type: ignore
1521
+ object_=_response.json(),
1522
+ ),
1523
+ )
1524
+ return HttpResponse(response=_response, data=_data)
1525
+ if _response.status_code == 400:
1526
+ raise BadRequestError(
1527
+ headers=dict(_response.headers),
1528
+ body=typing.cast(
1529
+ typing.Any,
1530
+ construct_type(
1531
+ type_=typing.Any, # type: ignore
1532
+ object_=_response.json(),
1533
+ ),
1534
+ ),
1535
+ )
1536
+ _response_json = _response.json()
1537
+ except JSONDecodeError:
1538
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1539
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1540
+
1541
+ def revoke_an_admin_user(
1542
+ self, email: str, *, request_options: typing.Optional[RequestOptions] = None
1543
+ ) -> HttpResponse[None]:
1544
+ """
1545
+ This endpoint allows to revoke/remove an invited member of your Admin
1546
+ account
1547
+
1548
+ Parameters
1549
+ ----------
1550
+ email : str
1551
+ Email of the invited user
1552
+
1553
+ request_options : typing.Optional[RequestOptions]
1554
+ Request-specific configuration.
1555
+
1556
+ Returns
1557
+ -------
1558
+ HttpResponse[None]
1559
+ """
1560
+ _response = self._client_wrapper.httpx_client.request(
1561
+ f"corporate/user/revoke/{jsonable_encoder(email)}",
1562
+ method="DELETE",
1563
+ request_options=request_options,
1564
+ )
1565
+ try:
1566
+ if 200 <= _response.status_code < 300:
1567
+ return HttpResponse(response=_response, data=None)
1568
+ if _response.status_code == 400:
1569
+ raise BadRequestError(
1570
+ headers=dict(_response.headers),
1571
+ body=typing.cast(
1572
+ typing.Any,
1573
+ construct_type(
1574
+ type_=typing.Any, # type: ignore
1575
+ object_=_response.json(),
1576
+ ),
1577
+ ),
1578
+ )
1579
+ _response_json = _response.json()
1580
+ except JSONDecodeError:
1581
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1582
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1583
+
1584
+ def get_corporate_user_permission(
1585
+ self, email: str, *, request_options: typing.Optional[RequestOptions] = None
1586
+ ) -> HttpResponse[GetCorporateUserPermissionResponse]:
1587
+ """
1588
+ This endpoint will provide the list of admin user permissions
1589
+
1590
+ Parameters
1591
+ ----------
1592
+ email : str
1593
+ Email of the invited user.
1594
+
1595
+ request_options : typing.Optional[RequestOptions]
1596
+ Request-specific configuration.
1597
+
1598
+ Returns
1599
+ -------
1600
+ HttpResponse[GetCorporateUserPermissionResponse]
1601
+ List of user's permissions
1602
+ """
1603
+ _response = self._client_wrapper.httpx_client.request(
1604
+ f"corporate/user/{jsonable_encoder(email)}/permissions",
1605
+ method="GET",
1606
+ request_options=request_options,
1607
+ )
1608
+ try:
1609
+ if 200 <= _response.status_code < 300:
1610
+ _data = typing.cast(
1611
+ GetCorporateUserPermissionResponse,
1612
+ construct_type(
1613
+ type_=GetCorporateUserPermissionResponse, # type: ignore
1614
+ object_=_response.json(),
1615
+ ),
1616
+ )
1617
+ return HttpResponse(response=_response, data=_data)
1618
+ if _response.status_code == 400:
1619
+ raise BadRequestError(
1620
+ headers=dict(_response.headers),
1621
+ body=typing.cast(
1622
+ typing.Any,
1623
+ construct_type(
1624
+ type_=typing.Any, # type: ignore
1625
+ object_=_response.json(),
1626
+ ),
1627
+ ),
1628
+ )
1629
+ _response_json = _response.json()
1630
+ except JSONDecodeError:
1631
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1632
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1633
+
1634
+ def change_admin_user_permissions(
1635
+ self,
1636
+ email: str,
1637
+ *,
1638
+ all_features_access: bool,
1639
+ privileges: typing.Sequence[PutCorporateUserEmailPermissionsRequestPrivilegesItem],
1640
+ request_options: typing.Optional[RequestOptions] = None,
1641
+ ) -> HttpResponse[None]:
1642
+ """
1643
+ This endpoint will allow you to change the permissions of Admin users of
1644
+ your Admin account
1645
+
1646
+ Parameters
1647
+ ----------
1648
+ email : str
1649
+ Email address of Admin user
1650
+
1651
+ all_features_access : bool
1652
+ All access to the features
1653
+
1654
+ privileges : typing.Sequence[PutCorporateUserEmailPermissionsRequestPrivilegesItem]
1655
+
1656
+ request_options : typing.Optional[RequestOptions]
1657
+ Request-specific configuration.
1658
+
1659
+ Returns
1660
+ -------
1661
+ HttpResponse[None]
1662
+ """
1663
+ _response = self._client_wrapper.httpx_client.request(
1664
+ f"corporate/user/{jsonable_encoder(email)}/permissions",
1665
+ method="PUT",
1666
+ json={
1667
+ "all_features_access": all_features_access,
1668
+ "privileges": convert_and_respect_annotation_metadata(
1669
+ object_=privileges,
1670
+ annotation=typing.Sequence[PutCorporateUserEmailPermissionsRequestPrivilegesItem],
1671
+ direction="write",
1672
+ ),
1673
+ },
1674
+ headers={
1675
+ "content-type": "application/json",
1676
+ },
1677
+ request_options=request_options,
1678
+ omit=OMIT,
1679
+ )
1680
+ try:
1681
+ if 200 <= _response.status_code < 300:
1682
+ return HttpResponse(response=_response, data=None)
1683
+ if _response.status_code == 400:
1684
+ raise BadRequestError(
1685
+ headers=dict(_response.headers),
1686
+ body=typing.cast(
1687
+ typing.Any,
1688
+ construct_type(
1689
+ type_=typing.Any, # type: ignore
1690
+ object_=_response.json(),
1691
+ ),
1692
+ ),
1693
+ )
1694
+ _response_json = _response.json()
1695
+ except JSONDecodeError:
1696
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1697
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1698
+
1699
+
1700
+ class AsyncRawMasterAccountClient:
1701
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
1702
+ self._client_wrapper = client_wrapper
1703
+
1704
+ async def create_a_new_group_of_sub_accounts(
1705
+ self,
1706
+ *,
1707
+ group_name: str,
1708
+ sub_account_ids: typing.Optional[typing.Sequence[int]] = OMIT,
1709
+ request_options: typing.Optional[RequestOptions] = None,
1710
+ ) -> AsyncHttpResponse[PostCorporateGroupResponse]:
1711
+ """
1712
+ This endpoint allows to create a group of sub-accounts
1713
+
1714
+ Parameters
1715
+ ----------
1716
+ group_name : str
1717
+ The name of the group of sub-accounts
1718
+
1719
+ sub_account_ids : typing.Optional[typing.Sequence[int]]
1720
+ Pass the list of sub-account Ids to be included in the group
1721
+
1722
+ request_options : typing.Optional[RequestOptions]
1723
+ Request-specific configuration.
1724
+
1725
+ Returns
1726
+ -------
1727
+ AsyncHttpResponse[PostCorporateGroupResponse]
1728
+ Group ID
1729
+ """
1730
+ _response = await self._client_wrapper.httpx_client.request(
1731
+ "corporate/group",
1732
+ method="POST",
1733
+ json={
1734
+ "groupName": group_name,
1735
+ "subAccountIds": sub_account_ids,
1736
+ },
1737
+ headers={
1738
+ "content-type": "application/json",
1739
+ },
1740
+ request_options=request_options,
1741
+ omit=OMIT,
1742
+ )
1743
+ try:
1744
+ if 200 <= _response.status_code < 300:
1745
+ _data = typing.cast(
1746
+ PostCorporateGroupResponse,
1747
+ construct_type(
1748
+ type_=PostCorporateGroupResponse, # type: ignore
1749
+ object_=_response.json(),
1750
+ ),
1751
+ )
1752
+ return AsyncHttpResponse(response=_response, data=_data)
1753
+ if _response.status_code == 400:
1754
+ raise BadRequestError(
1755
+ headers=dict(_response.headers),
1756
+ body=typing.cast(
1757
+ typing.Any,
1758
+ construct_type(
1759
+ type_=typing.Any, # type: ignore
1760
+ object_=_response.json(),
1761
+ ),
1762
+ ),
1763
+ )
1764
+ _response_json = _response.json()
1765
+ except JSONDecodeError:
1766
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1767
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1768
+
1769
+ async def delete_sub_account_from_group(
1770
+ self,
1771
+ group_id: str,
1772
+ *,
1773
+ sub_account_ids: typing.Sequence[int],
1774
+ request_options: typing.Optional[RequestOptions] = None,
1775
+ ) -> AsyncHttpResponse[None]:
1776
+ """
1777
+ This endpoint allows you to remove a sub-organization from a group.
1778
+
1779
+ Parameters
1780
+ ----------
1781
+ group_id : str
1782
+ Group id
1783
+
1784
+ sub_account_ids : typing.Sequence[int]
1785
+ List of sub-account ids
1786
+
1787
+ request_options : typing.Optional[RequestOptions]
1788
+ Request-specific configuration.
1789
+
1790
+ Returns
1791
+ -------
1792
+ AsyncHttpResponse[None]
1793
+ """
1794
+ _response = await self._client_wrapper.httpx_client.request(
1795
+ f"corporate/group/unlink/{jsonable_encoder(group_id)}/subAccounts",
1796
+ method="PUT",
1797
+ json={
1798
+ "subAccountIds": sub_account_ids,
1799
+ },
1800
+ headers={
1801
+ "content-type": "application/json",
1802
+ },
1803
+ request_options=request_options,
1804
+ omit=OMIT,
1805
+ )
1806
+ try:
1807
+ if 200 <= _response.status_code < 300:
1808
+ return AsyncHttpResponse(response=_response, data=None)
1809
+ if _response.status_code == 400:
1810
+ raise BadRequestError(
1811
+ headers=dict(_response.headers),
1812
+ body=typing.cast(
1813
+ typing.Any,
1814
+ construct_type(
1815
+ type_=typing.Any, # type: ignore
1816
+ object_=_response.json(),
1817
+ ),
1818
+ ),
1819
+ )
1820
+ _response_json = _response.json()
1821
+ except JSONDecodeError:
1822
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1823
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1824
+
1825
+ async def get_a_group_details(
1826
+ self, id: str, *, request_options: typing.Optional[RequestOptions] = None
1827
+ ) -> AsyncHttpResponse[GetCorporateGroupIdResponse]:
1828
+ """
1829
+ This endpoint allows you to retrieve a specific group’s information such as
1830
+ the list of sub-organizations and the user associated with the group.
1831
+
1832
+ Parameters
1833
+ ----------
1834
+ id : str
1835
+ Id of the group of sub-organization
1836
+
1837
+ request_options : typing.Optional[RequestOptions]
1838
+ Request-specific configuration.
1839
+
1840
+ Returns
1841
+ -------
1842
+ AsyncHttpResponse[GetCorporateGroupIdResponse]
1843
+ Group details
1844
+ """
1845
+ _response = await self._client_wrapper.httpx_client.request(
1846
+ f"corporate/group/{jsonable_encoder(id)}",
1847
+ method="GET",
1848
+ request_options=request_options,
1849
+ )
1850
+ try:
1851
+ if 200 <= _response.status_code < 300:
1852
+ _data = typing.cast(
1853
+ GetCorporateGroupIdResponse,
1854
+ construct_type(
1855
+ type_=GetCorporateGroupIdResponse, # type: ignore
1856
+ object_=_response.json(),
1857
+ ),
1858
+ )
1859
+ return AsyncHttpResponse(response=_response, data=_data)
1860
+ _response_json = _response.json()
1861
+ except JSONDecodeError:
1862
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1863
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1864
+
1865
+ async def update_a_group_of_sub_accounts(
1866
+ self,
1867
+ id: str,
1868
+ *,
1869
+ group_name: typing.Optional[str] = OMIT,
1870
+ sub_account_ids: typing.Optional[typing.Sequence[int]] = OMIT,
1871
+ request_options: typing.Optional[RequestOptions] = None,
1872
+ ) -> AsyncHttpResponse[None]:
1873
+ """
1874
+ This endpoint allows to update a group of sub-accounts
1875
+
1876
+ Parameters
1877
+ ----------
1878
+ id : str
1879
+ Id of the group
1880
+
1881
+ group_name : typing.Optional[str]
1882
+ The name of the group of sub-accounts
1883
+
1884
+ sub_account_ids : typing.Optional[typing.Sequence[int]]
1885
+ Pass the list of sub-account Ids to be included in the group
1886
+
1887
+ request_options : typing.Optional[RequestOptions]
1888
+ Request-specific configuration.
1889
+
1890
+ Returns
1891
+ -------
1892
+ AsyncHttpResponse[None]
1893
+ """
1894
+ _response = await self._client_wrapper.httpx_client.request(
1895
+ f"corporate/group/{jsonable_encoder(id)}",
1896
+ method="PUT",
1897
+ json={
1898
+ "groupName": group_name,
1899
+ "subAccountIds": sub_account_ids,
1900
+ },
1901
+ headers={
1902
+ "content-type": "application/json",
1903
+ },
1904
+ request_options=request_options,
1905
+ omit=OMIT,
1906
+ )
1907
+ try:
1908
+ if 200 <= _response.status_code < 300:
1909
+ return AsyncHttpResponse(response=_response, data=None)
1910
+ if _response.status_code == 400:
1911
+ raise BadRequestError(
1912
+ headers=dict(_response.headers),
1913
+ body=typing.cast(
1914
+ typing.Any,
1915
+ construct_type(
1916
+ type_=typing.Any, # type: ignore
1917
+ object_=_response.json(),
1918
+ ),
1919
+ ),
1920
+ )
1921
+ _response_json = _response.json()
1922
+ except JSONDecodeError:
1923
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1924
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1925
+
1926
+ async def delete_a_group(
1927
+ self, id: str, *, request_options: typing.Optional[RequestOptions] = None
1928
+ ) -> AsyncHttpResponse[None]:
1929
+ """
1930
+ This endpoint allows you to delete a group of sub-organizations. When a
1931
+ group is deleted, the sub-organizations are no longer part of this group.
1932
+ The users associated with the group are no longer associated with the group
1933
+ once deleted.
1934
+
1935
+ Parameters
1936
+ ----------
1937
+ id : str
1938
+ Id of the group
1939
+
1940
+ request_options : typing.Optional[RequestOptions]
1941
+ Request-specific configuration.
1942
+
1943
+ Returns
1944
+ -------
1945
+ AsyncHttpResponse[None]
1946
+ """
1947
+ _response = await self._client_wrapper.httpx_client.request(
1948
+ f"corporate/group/{jsonable_encoder(id)}",
1949
+ method="DELETE",
1950
+ request_options=request_options,
1951
+ )
1952
+ try:
1953
+ if 200 <= _response.status_code < 300:
1954
+ return AsyncHttpResponse(response=_response, data=None)
1955
+ if _response.status_code == 400:
1956
+ raise BadRequestError(
1957
+ headers=dict(_response.headers),
1958
+ body=typing.cast(
1959
+ typing.Any,
1960
+ construct_type(
1961
+ type_=typing.Any, # type: ignore
1962
+ object_=_response.json(),
1963
+ ),
1964
+ ),
1965
+ )
1966
+ _response_json = _response.json()
1967
+ except JSONDecodeError:
1968
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1969
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1970
+
1971
+ async def get_sub_account_groups(
1972
+ self, *, request_options: typing.Optional[RequestOptions] = None
1973
+ ) -> AsyncHttpResponse[typing.List[GetSubAccountGroupsResponseItem]]:
1974
+ """
1975
+ This endpoint allows you to list all groups created on your Admin account.
1976
+
1977
+ Parameters
1978
+ ----------
1979
+ request_options : typing.Optional[RequestOptions]
1980
+ Request-specific configuration.
1981
+
1982
+ Returns
1983
+ -------
1984
+ AsyncHttpResponse[typing.List[GetSubAccountGroupsResponseItem]]
1985
+ list of all the sub-account groups
1986
+ """
1987
+ _response = await self._client_wrapper.httpx_client.request(
1988
+ "corporate/groups",
1989
+ method="GET",
1990
+ request_options=request_options,
1991
+ )
1992
+ try:
1993
+ if 200 <= _response.status_code < 300:
1994
+ _data = typing.cast(
1995
+ typing.List[GetSubAccountGroupsResponseItem],
1996
+ construct_type(
1997
+ type_=typing.List[GetSubAccountGroupsResponseItem], # type: ignore
1998
+ object_=_response.json(),
1999
+ ),
2000
+ )
2001
+ return AsyncHttpResponse(response=_response, data=_data)
2002
+ _response_json = _response.json()
2003
+ except JSONDecodeError:
2004
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2005
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2006
+
2007
+ async def get_corporate_invited_users_list(
2008
+ self,
2009
+ *,
2010
+ type: typing.Optional[str] = None,
2011
+ offset: typing.Optional[int] = None,
2012
+ limit: typing.Optional[int] = None,
2013
+ request_options: typing.Optional[RequestOptions] = None,
2014
+ ) -> AsyncHttpResponse[GetCorporateInvitedUsersListResponse]:
2015
+ """
2016
+ This endpoint allows you to list all Admin users of your Admin account. You
2017
+ can filter users by type (active or pending) and paginate results using
2018
+ offset and limit.
2019
+
2020
+ Parameters
2021
+ ----------
2022
+ type : typing.Optional[str]
2023
+ User type (active | pending). This is required if offset is provided for
2024
+ limited result.
2025
+
2026
+ offset : typing.Optional[int]
2027
+ Page number for the result set. This is optional, default value will be
2028
+ the 1st page.
2029
+
2030
+ limit : typing.Optional[int]
2031
+ Number of users to be displayed on each page. This is optional, the
2032
+ default limit is 20, but max allowed limit is 100.
2033
+
2034
+ request_options : typing.Optional[RequestOptions]
2035
+ Request-specific configuration.
2036
+
2037
+ Returns
2038
+ -------
2039
+ AsyncHttpResponse[GetCorporateInvitedUsersListResponse]
2040
+ list of all admin users
2041
+ """
2042
+ _response = await self._client_wrapper.httpx_client.request(
2043
+ "corporate/invited/users",
2044
+ method="GET",
2045
+ params={
2046
+ "type": type,
2047
+ "offset": offset,
2048
+ "limit": limit,
2049
+ },
2050
+ request_options=request_options,
2051
+ )
2052
+ try:
2053
+ if 200 <= _response.status_code < 300:
2054
+ _data = typing.cast(
2055
+ GetCorporateInvitedUsersListResponse,
2056
+ construct_type(
2057
+ type_=GetCorporateInvitedUsersListResponse, # type: ignore
2058
+ object_=_response.json(),
2059
+ ),
2060
+ )
2061
+ return AsyncHttpResponse(response=_response, data=_data)
2062
+ _response_json = _response.json()
2063
+ except JSONDecodeError:
2064
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2065
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2066
+
2067
+ async def list_of_all_i_ps(
2068
+ self, *, request_options: typing.Optional[RequestOptions] = None
2069
+ ) -> AsyncHttpResponse[typing.List[GetCorporateIpResponseItem]]:
2070
+ """
2071
+ This endpoint allows you to retrieve the list of active IPs on your Admin
2072
+ account
2073
+
2074
+ Parameters
2075
+ ----------
2076
+ request_options : typing.Optional[RequestOptions]
2077
+ Request-specific configuration.
2078
+
2079
+ Returns
2080
+ -------
2081
+ AsyncHttpResponse[typing.List[GetCorporateIpResponseItem]]
2082
+ List of all IPs
2083
+ """
2084
+ _response = await self._client_wrapper.httpx_client.request(
2085
+ "corporate/ip",
2086
+ method="GET",
2087
+ request_options=request_options,
2088
+ )
2089
+ try:
2090
+ if 200 <= _response.status_code < 300:
2091
+ _data = typing.cast(
2092
+ typing.List[GetCorporateIpResponseItem],
2093
+ construct_type(
2094
+ type_=typing.List[GetCorporateIpResponseItem], # type: ignore
2095
+ object_=_response.json(),
2096
+ ),
2097
+ )
2098
+ return AsyncHttpResponse(response=_response, data=_data)
2099
+ _response_json = _response.json()
2100
+ except JSONDecodeError:
2101
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2102
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2103
+
2104
+ async def get_the_details_of_requested_master_account(
2105
+ self, *, request_options: typing.Optional[RequestOptions] = None
2106
+ ) -> AsyncHttpResponse[GetCorporateMasterAccountResponse]:
2107
+ """
2108
+ This endpoint will provide the details of the master account.
2109
+
2110
+ Parameters
2111
+ ----------
2112
+ request_options : typing.Optional[RequestOptions]
2113
+ Request-specific configuration.
2114
+
2115
+ Returns
2116
+ -------
2117
+ AsyncHttpResponse[GetCorporateMasterAccountResponse]
2118
+ Master account details
2119
+ """
2120
+ _response = await self._client_wrapper.httpx_client.request(
2121
+ "corporate/masterAccount",
2122
+ method="GET",
2123
+ request_options=request_options,
2124
+ )
2125
+ try:
2126
+ if 200 <= _response.status_code < 300:
2127
+ _data = typing.cast(
2128
+ GetCorporateMasterAccountResponse,
2129
+ construct_type(
2130
+ type_=GetCorporateMasterAccountResponse, # type: ignore
2131
+ object_=_response.json(),
2132
+ ),
2133
+ )
2134
+ return AsyncHttpResponse(response=_response, data=_data)
2135
+ if _response.status_code == 400:
2136
+ raise BadRequestError(
2137
+ headers=dict(_response.headers),
2138
+ body=typing.cast(
2139
+ typing.Any,
2140
+ construct_type(
2141
+ type_=typing.Any, # type: ignore
2142
+ object_=_response.json(),
2143
+ ),
2144
+ ),
2145
+ )
2146
+ _response_json = _response.json()
2147
+ except JSONDecodeError:
2148
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2149
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2150
+
2151
+ async def generate_sso_token_to_access_admin_account(
2152
+ self, *, email: str, request_options: typing.Optional[RequestOptions] = None
2153
+ ) -> AsyncHttpResponse[GetSsoToken]:
2154
+ """
2155
+ This endpoint generates an SSO token to authenticate and access the admin
2156
+ account using the endpoint
2157
+ https://account-app.brevo.com/account/login/corporate/sso/[token], where
2158
+ [token] will be replaced by the actual token.
2159
+
2160
+ Parameters
2161
+ ----------
2162
+ email : str
2163
+ User email of admin account
2164
+
2165
+ request_options : typing.Optional[RequestOptions]
2166
+ Request-specific configuration.
2167
+
2168
+ Returns
2169
+ -------
2170
+ AsyncHttpResponse[GetSsoToken]
2171
+ Session token
2172
+ """
2173
+ _response = await self._client_wrapper.httpx_client.request(
2174
+ "corporate/ssoToken",
2175
+ method="POST",
2176
+ json={
2177
+ "email": email,
2178
+ },
2179
+ headers={
2180
+ "content-type": "application/json",
2181
+ },
2182
+ request_options=request_options,
2183
+ omit=OMIT,
2184
+ )
2185
+ try:
2186
+ if 200 <= _response.status_code < 300:
2187
+ _data = typing.cast(
2188
+ GetSsoToken,
2189
+ construct_type(
2190
+ type_=GetSsoToken, # type: ignore
2191
+ object_=_response.json(),
2192
+ ),
2193
+ )
2194
+ return AsyncHttpResponse(response=_response, data=_data)
2195
+ if _response.status_code == 400:
2196
+ raise BadRequestError(
2197
+ headers=dict(_response.headers),
2198
+ body=typing.cast(
2199
+ typing.Any,
2200
+ construct_type(
2201
+ type_=typing.Any, # type: ignore
2202
+ object_=_response.json(),
2203
+ ),
2204
+ ),
2205
+ )
2206
+ if _response.status_code == 403:
2207
+ raise ForbiddenError(
2208
+ headers=dict(_response.headers),
2209
+ body=typing.cast(
2210
+ typing.Any,
2211
+ construct_type(
2212
+ type_=typing.Any, # type: ignore
2213
+ object_=_response.json(),
2214
+ ),
2215
+ ),
2216
+ )
2217
+ _response_json = _response.json()
2218
+ except JSONDecodeError:
2219
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2220
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2221
+
2222
+ async def get_the_list_of_all_the_sub_accounts_of_the_master_account(
2223
+ self, *, offset: int, limit: int, request_options: typing.Optional[RequestOptions] = None
2224
+ ) -> AsyncHttpResponse[GetCorporateSubAccountResponse]:
2225
+ """
2226
+ This endpoint will provide the list all the sub-accounts of the master
2227
+ account.
2228
+
2229
+ Parameters
2230
+ ----------
2231
+ offset : int
2232
+ Index of the first sub-account in the page
2233
+
2234
+ limit : int
2235
+ Number of sub-accounts to be displayed on each page
2236
+
2237
+ request_options : typing.Optional[RequestOptions]
2238
+ Request-specific configuration.
2239
+
2240
+ Returns
2241
+ -------
2242
+ AsyncHttpResponse[GetCorporateSubAccountResponse]
2243
+ Sub-accounts list
2244
+ """
2245
+ _response = await self._client_wrapper.httpx_client.request(
2246
+ "corporate/subAccount",
2247
+ method="GET",
2248
+ params={
2249
+ "offset": offset,
2250
+ "limit": limit,
2251
+ },
2252
+ request_options=request_options,
2253
+ )
2254
+ try:
2255
+ if 200 <= _response.status_code < 300:
2256
+ _data = typing.cast(
2257
+ GetCorporateSubAccountResponse,
2258
+ construct_type(
2259
+ type_=GetCorporateSubAccountResponse, # type: ignore
2260
+ object_=_response.json(),
2261
+ ),
2262
+ )
2263
+ return AsyncHttpResponse(response=_response, data=_data)
2264
+ if _response.status_code == 400:
2265
+ raise BadRequestError(
2266
+ headers=dict(_response.headers),
2267
+ body=typing.cast(
2268
+ typing.Any,
2269
+ construct_type(
2270
+ type_=typing.Any, # type: ignore
2271
+ object_=_response.json(),
2272
+ ),
2273
+ ),
2274
+ )
2275
+ _response_json = _response.json()
2276
+ except JSONDecodeError:
2277
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2278
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2279
+
2280
+ async def create_a_new_sub_account_under_a_master_account(
2281
+ self,
2282
+ *,
2283
+ company_name: str,
2284
+ email: str,
2285
+ group_ids: typing.Optional[typing.Sequence[str]] = OMIT,
2286
+ language: typing.Optional[PostCorporateSubAccountRequestLanguage] = OMIT,
2287
+ timezone: typing.Optional[str] = OMIT,
2288
+ request_options: typing.Optional[RequestOptions] = None,
2289
+ ) -> AsyncHttpResponse[PostCorporateSubAccountResponse]:
2290
+ """
2291
+ This endpoint will create a new sub-account under a master account
2292
+
2293
+ Parameters
2294
+ ----------
2295
+ company_name : str
2296
+ Set the name of the sub-account company
2297
+
2298
+ email : str
2299
+ Email address for the organization
2300
+
2301
+ group_ids : typing.Optional[typing.Sequence[str]]
2302
+ Set the group(s) for the sub-account
2303
+
2304
+ language : typing.Optional[PostCorporateSubAccountRequestLanguage]
2305
+ Set the language of the sub-account
2306
+
2307
+ timezone : typing.Optional[str]
2308
+ Set the timezone of the sub-account
2309
+
2310
+ request_options : typing.Optional[RequestOptions]
2311
+ Request-specific configuration.
2312
+
2313
+ Returns
2314
+ -------
2315
+ AsyncHttpResponse[PostCorporateSubAccountResponse]
2316
+ Created sub-account ID
2317
+ """
2318
+ _response = await self._client_wrapper.httpx_client.request(
2319
+ "corporate/subAccount",
2320
+ method="POST",
2321
+ json={
2322
+ "companyName": company_name,
2323
+ "email": email,
2324
+ "groupIds": group_ids,
2325
+ "language": language,
2326
+ "timezone": timezone,
2327
+ },
2328
+ headers={
2329
+ "content-type": "application/json",
2330
+ },
2331
+ request_options=request_options,
2332
+ omit=OMIT,
2333
+ )
2334
+ try:
2335
+ if 200 <= _response.status_code < 300:
2336
+ _data = typing.cast(
2337
+ PostCorporateSubAccountResponse,
2338
+ construct_type(
2339
+ type_=PostCorporateSubAccountResponse, # type: ignore
2340
+ object_=_response.json(),
2341
+ ),
2342
+ )
2343
+ return AsyncHttpResponse(response=_response, data=_data)
2344
+ if _response.status_code == 400:
2345
+ raise BadRequestError(
2346
+ headers=dict(_response.headers),
2347
+ body=typing.cast(
2348
+ typing.Any,
2349
+ construct_type(
2350
+ type_=typing.Any, # type: ignore
2351
+ object_=_response.json(),
2352
+ ),
2353
+ ),
2354
+ )
2355
+ _response_json = _response.json()
2356
+ except JSONDecodeError:
2357
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2358
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2359
+
2360
+ async def associate_an_ip_to_sub_accounts(
2361
+ self, *, ids: typing.Sequence[int], ip: str, request_options: typing.Optional[RequestOptions] = None
2362
+ ) -> AsyncHttpResponse[typing.Dict[str, typing.Any]]:
2363
+ """
2364
+ This endpoint allows to associate an IP to sub-accounts
2365
+
2366
+ Parameters
2367
+ ----------
2368
+ ids : typing.Sequence[int]
2369
+ Pass the list of sub-account Ids to be associated with the IP
2370
+ address
2371
+
2372
+ ip : str
2373
+ IP address
2374
+
2375
+ request_options : typing.Optional[RequestOptions]
2376
+ Request-specific configuration.
2377
+
2378
+ Returns
2379
+ -------
2380
+ AsyncHttpResponse[typing.Dict[str, typing.Any]]
2381
+ IP has been associated with sub-accounts successfully
2382
+ """
2383
+ _response = await self._client_wrapper.httpx_client.request(
2384
+ "corporate/subAccount/ip/associate",
2385
+ method="POST",
2386
+ json={
2387
+ "ids": ids,
2388
+ "ip": ip,
2389
+ },
2390
+ headers={
2391
+ "content-type": "application/json",
2392
+ },
2393
+ request_options=request_options,
2394
+ omit=OMIT,
2395
+ )
2396
+ try:
2397
+ if 200 <= _response.status_code < 300:
2398
+ _data = typing.cast(
2399
+ typing.Dict[str, typing.Any],
2400
+ construct_type(
2401
+ type_=typing.Dict[str, typing.Any], # type: ignore
2402
+ object_=_response.json(),
2403
+ ),
2404
+ )
2405
+ return AsyncHttpResponse(response=_response, data=_data)
2406
+ if _response.status_code == 400:
2407
+ raise BadRequestError(
2408
+ headers=dict(_response.headers),
2409
+ body=typing.cast(
2410
+ typing.Any,
2411
+ construct_type(
2412
+ type_=typing.Any, # type: ignore
2413
+ object_=_response.json(),
2414
+ ),
2415
+ ),
2416
+ )
2417
+ _response_json = _response.json()
2418
+ except JSONDecodeError:
2419
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2420
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2421
+
2422
+ async def dissociate_an_ip_to_sub_accounts(
2423
+ self, *, ids: typing.Sequence[int], ip: str, request_options: typing.Optional[RequestOptions] = None
2424
+ ) -> AsyncHttpResponse[None]:
2425
+ """
2426
+ This endpoint allows to dissociate an IP from sub-accounts
2427
+
2428
+ Parameters
2429
+ ----------
2430
+ ids : typing.Sequence[int]
2431
+ Pass the list of sub-account Ids to be dissociated from the IP
2432
+ address
2433
+
2434
+ ip : str
2435
+ IP address
2436
+
2437
+ request_options : typing.Optional[RequestOptions]
2438
+ Request-specific configuration.
2439
+
2440
+ Returns
2441
+ -------
2442
+ AsyncHttpResponse[None]
2443
+ """
2444
+ _response = await self._client_wrapper.httpx_client.request(
2445
+ "corporate/subAccount/ip/dissociate",
2446
+ method="PUT",
2447
+ json={
2448
+ "ids": ids,
2449
+ "ip": ip,
2450
+ },
2451
+ headers={
2452
+ "content-type": "application/json",
2453
+ },
2454
+ request_options=request_options,
2455
+ omit=OMIT,
2456
+ )
2457
+ try:
2458
+ if 200 <= _response.status_code < 300:
2459
+ return AsyncHttpResponse(response=_response, data=None)
2460
+ if _response.status_code == 400:
2461
+ raise BadRequestError(
2462
+ headers=dict(_response.headers),
2463
+ body=typing.cast(
2464
+ typing.Any,
2465
+ construct_type(
2466
+ type_=typing.Any, # type: ignore
2467
+ object_=_response.json(),
2468
+ ),
2469
+ ),
2470
+ )
2471
+ _response_json = _response.json()
2472
+ except JSONDecodeError:
2473
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2474
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2475
+
2476
+ async def create_an_api_key_for_a_sub_account(
2477
+ self, *, id: int, name: str, request_options: typing.Optional[RequestOptions] = None
2478
+ ) -> AsyncHttpResponse[PostCorporateSubAccountKeyResponse]:
2479
+ """
2480
+ This endpoint will generate an API v3 key for a sub-account
2481
+
2482
+ Parameters
2483
+ ----------
2484
+ id : int
2485
+ Id of the sub-account organization
2486
+
2487
+ name : str
2488
+ Name of the API key
2489
+
2490
+ request_options : typing.Optional[RequestOptions]
2491
+ Request-specific configuration.
2492
+
2493
+ Returns
2494
+ -------
2495
+ AsyncHttpResponse[PostCorporateSubAccountKeyResponse]
2496
+ API key
2497
+ """
2498
+ _response = await self._client_wrapper.httpx_client.request(
2499
+ "corporate/subAccount/key",
2500
+ method="POST",
2501
+ json={
2502
+ "id": id,
2503
+ "name": name,
2504
+ },
2505
+ headers={
2506
+ "content-type": "application/json",
2507
+ },
2508
+ request_options=request_options,
2509
+ omit=OMIT,
2510
+ )
2511
+ try:
2512
+ if 200 <= _response.status_code < 300:
2513
+ _data = typing.cast(
2514
+ PostCorporateSubAccountKeyResponse,
2515
+ construct_type(
2516
+ type_=PostCorporateSubAccountKeyResponse, # type: ignore
2517
+ object_=_response.json(),
2518
+ ),
2519
+ )
2520
+ return AsyncHttpResponse(response=_response, data=_data)
2521
+ if _response.status_code == 400:
2522
+ raise BadRequestError(
2523
+ headers=dict(_response.headers),
2524
+ body=typing.cast(
2525
+ typing.Any,
2526
+ construct_type(
2527
+ type_=typing.Any, # type: ignore
2528
+ object_=_response.json(),
2529
+ ),
2530
+ ),
2531
+ )
2532
+ _response_json = _response.json()
2533
+ except JSONDecodeError:
2534
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2535
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2536
+
2537
+ async def generate_sso_token_to_access_sub_account(
2538
+ self,
2539
+ *,
2540
+ id: int,
2541
+ email: typing.Optional[str] = OMIT,
2542
+ target: typing.Optional[PostCorporateSubAccountSsoTokenRequestTarget] = OMIT,
2543
+ url: typing.Optional[str] = OMIT,
2544
+ request_options: typing.Optional[RequestOptions] = None,
2545
+ ) -> AsyncHttpResponse[GetSsoToken]:
2546
+ """
2547
+ This endpoint generates an sso token to authenticate and access a
2548
+ sub-account of the master using the account endpoint
2549
+ https://account-app.brevo.com/account/login/sub-account/sso/[token], where
2550
+ [token] will be replaced by the actual token.
2551
+
2552
+ Parameters
2553
+ ----------
2554
+ id : int
2555
+ Id of the sub-account organization
2556
+
2557
+ email : typing.Optional[str]
2558
+ User email of sub-account organization
2559
+
2560
+ target : typing.Optional[PostCorporateSubAccountSsoTokenRequestTarget]
2561
+ **Set target after login success** * **automation** - Redirect
2562
+ to Automation after login * **email_campaign** - Redirect to
2563
+ Email Campaign after login * **contacts** - Redirect to Contacts
2564
+ after login * **landing_pages** - Redirect to Landing Pages
2565
+ after login * **email_transactional** - Redirect to Email
2566
+ Transactional after login * **senders** - Redirect to Senders
2567
+ after login * **sms_campaign** - Redirect to Sms Campaign after
2568
+ login * **sms_transactional** - Redirect to Sms Transactional
2569
+ after login
2570
+
2571
+ url : typing.Optional[str]
2572
+ Set the full target URL after login success. The user will land
2573
+ directly on this target URL after login
2574
+
2575
+ request_options : typing.Optional[RequestOptions]
2576
+ Request-specific configuration.
2577
+
2578
+ Returns
2579
+ -------
2580
+ AsyncHttpResponse[GetSsoToken]
2581
+ Session token
2582
+ """
2583
+ _response = await self._client_wrapper.httpx_client.request(
2584
+ "corporate/subAccount/ssoToken",
2585
+ method="POST",
2586
+ json={
2587
+ "email": email,
2588
+ "id": id,
2589
+ "target": target,
2590
+ "url": url,
2591
+ },
2592
+ headers={
2593
+ "content-type": "application/json",
2594
+ },
2595
+ request_options=request_options,
2596
+ omit=OMIT,
2597
+ )
2598
+ try:
2599
+ if 200 <= _response.status_code < 300:
2600
+ _data = typing.cast(
2601
+ GetSsoToken,
2602
+ construct_type(
2603
+ type_=GetSsoToken, # type: ignore
2604
+ object_=_response.json(),
2605
+ ),
2606
+ )
2607
+ return AsyncHttpResponse(response=_response, data=_data)
2608
+ if _response.status_code == 400:
2609
+ raise BadRequestError(
2610
+ headers=dict(_response.headers),
2611
+ body=typing.cast(
2612
+ typing.Any,
2613
+ construct_type(
2614
+ type_=typing.Any, # type: ignore
2615
+ object_=_response.json(),
2616
+ ),
2617
+ ),
2618
+ )
2619
+ if _response.status_code == 403:
2620
+ raise ForbiddenError(
2621
+ headers=dict(_response.headers),
2622
+ body=typing.cast(
2623
+ typing.Any,
2624
+ construct_type(
2625
+ type_=typing.Any, # type: ignore
2626
+ object_=_response.json(),
2627
+ ),
2628
+ ),
2629
+ )
2630
+ _response_json = _response.json()
2631
+ except JSONDecodeError:
2632
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2633
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2634
+
2635
+ async def get_sub_account_details(
2636
+ self, id: int, *, request_options: typing.Optional[RequestOptions] = None
2637
+ ) -> AsyncHttpResponse[GetCorporateSubAccountIdResponse]:
2638
+ """
2639
+ This endpoint will provide the details for the specified sub-account company
2640
+
2641
+ Parameters
2642
+ ----------
2643
+ id : int
2644
+ Id of the sub-account organization
2645
+
2646
+ request_options : typing.Optional[RequestOptions]
2647
+ Request-specific configuration.
2648
+
2649
+ Returns
2650
+ -------
2651
+ AsyncHttpResponse[GetCorporateSubAccountIdResponse]
2652
+ Sub-account organization details
2653
+ """
2654
+ _response = await self._client_wrapper.httpx_client.request(
2655
+ f"corporate/subAccount/{jsonable_encoder(id)}",
2656
+ method="GET",
2657
+ request_options=request_options,
2658
+ )
2659
+ try:
2660
+ if 200 <= _response.status_code < 300:
2661
+ _data = typing.cast(
2662
+ GetCorporateSubAccountIdResponse,
2663
+ construct_type(
2664
+ type_=GetCorporateSubAccountIdResponse, # type: ignore
2665
+ object_=_response.json(),
2666
+ ),
2667
+ )
2668
+ return AsyncHttpResponse(response=_response, data=_data)
2669
+ if _response.status_code == 400:
2670
+ raise BadRequestError(
2671
+ headers=dict(_response.headers),
2672
+ body=typing.cast(
2673
+ typing.Any,
2674
+ construct_type(
2675
+ type_=typing.Any, # type: ignore
2676
+ object_=_response.json(),
2677
+ ),
2678
+ ),
2679
+ )
2680
+ _response_json = _response.json()
2681
+ except JSONDecodeError:
2682
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2683
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2684
+
2685
+ async def delete_a_sub_account(
2686
+ self, id: int, *, request_options: typing.Optional[RequestOptions] = None
2687
+ ) -> AsyncHttpResponse[None]:
2688
+ """
2689
+ Parameters
2690
+ ----------
2691
+ id : int
2692
+ Id of the sub-account organization to be deleted
2693
+
2694
+ request_options : typing.Optional[RequestOptions]
2695
+ Request-specific configuration.
2696
+
2697
+ Returns
2698
+ -------
2699
+ AsyncHttpResponse[None]
2700
+ """
2701
+ _response = await self._client_wrapper.httpx_client.request(
2702
+ f"corporate/subAccount/{jsonable_encoder(id)}",
2703
+ method="DELETE",
2704
+ request_options=request_options,
2705
+ )
2706
+ try:
2707
+ if 200 <= _response.status_code < 300:
2708
+ return AsyncHttpResponse(response=_response, data=None)
2709
+ if _response.status_code == 400:
2710
+ raise BadRequestError(
2711
+ headers=dict(_response.headers),
2712
+ body=typing.cast(
2713
+ typing.Any,
2714
+ construct_type(
2715
+ type_=typing.Any, # type: ignore
2716
+ object_=_response.json(),
2717
+ ),
2718
+ ),
2719
+ )
2720
+ if _response.status_code == 404:
2721
+ raise NotFoundError(
2722
+ headers=dict(_response.headers),
2723
+ body=typing.cast(
2724
+ typing.Any,
2725
+ construct_type(
2726
+ type_=typing.Any, # type: ignore
2727
+ object_=_response.json(),
2728
+ ),
2729
+ ),
2730
+ )
2731
+ _response_json = _response.json()
2732
+ except JSONDecodeError:
2733
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2734
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2735
+
2736
+ async def enable_disable_sub_account_application_s(
2737
+ self,
2738
+ id: int,
2739
+ *,
2740
+ automation: typing.Optional[bool] = OMIT,
2741
+ conversations: typing.Optional[bool] = OMIT,
2742
+ crm: typing.Optional[bool] = OMIT,
2743
+ email_campaigns: typing.Optional[bool] = OMIT,
2744
+ facebook_ads: typing.Optional[bool] = OMIT,
2745
+ inbox: typing.Optional[bool] = OMIT,
2746
+ landing_pages: typing.Optional[bool] = OMIT,
2747
+ meetings: typing.Optional[bool] = OMIT,
2748
+ sms_campaigns: typing.Optional[bool] = OMIT,
2749
+ transactional_emails: typing.Optional[bool] = OMIT,
2750
+ transactional_sms: typing.Optional[bool] = OMIT,
2751
+ web_push: typing.Optional[bool] = OMIT,
2752
+ whatsapp: typing.Optional[bool] = OMIT,
2753
+ request_options: typing.Optional[RequestOptions] = None,
2754
+ ) -> AsyncHttpResponse[None]:
2755
+ """
2756
+ API endpoint for the Corporate owner to enable/disable applications on the
2757
+ sub-account
2758
+
2759
+ Parameters
2760
+ ----------
2761
+ id : int
2762
+ Id of the sub-account organization (mandatory)
2763
+
2764
+ automation : typing.Optional[bool]
2765
+ Set this field to enable or disable Automation on the
2766
+ sub-account
2767
+
2768
+ conversations : typing.Optional[bool]
2769
+ Set this field to enable or disable Conversations on the
2770
+ sub-account
2771
+
2772
+ crm : typing.Optional[bool]
2773
+ Set this field to enable or disable Sales CRM on the sub-account
2774
+
2775
+ email_campaigns : typing.Optional[bool]
2776
+ Set this field to enable or disable Email Campaigns on the
2777
+ sub-account
2778
+
2779
+ facebook_ads : typing.Optional[bool]
2780
+ Set this field to enable or disable Facebook ads on the
2781
+ sub-account
2782
+
2783
+ inbox : typing.Optional[bool]
2784
+ Set this field to enable or disable Inbox on the sub-account /
2785
+ Not applicable on ENTv2
2786
+
2787
+ landing_pages : typing.Optional[bool]
2788
+ Set this field to enable or disable Landing pages on the
2789
+ sub-account
2790
+
2791
+ meetings : typing.Optional[bool]
2792
+ Set this field to enable or disable Meetings on the sub-account
2793
+
2794
+ sms_campaigns : typing.Optional[bool]
2795
+ Set this field to enable or disable SMS Marketing on the
2796
+ sub-account
2797
+
2798
+ transactional_emails : typing.Optional[bool]
2799
+ Set this field to enable or disable Transactional Email on the
2800
+ sub-account
2801
+
2802
+ transactional_sms : typing.Optional[bool]
2803
+ Set this field to enable or disable Transactional SMS on the
2804
+ sub-account
2805
+
2806
+ web_push : typing.Optional[bool]
2807
+ Set this field to enable or disable Web Push on the sub-account
2808
+
2809
+ whatsapp : typing.Optional[bool]
2810
+ Set this field to enable or disable Whatsapp campaigns on the
2811
+ sub-account
2812
+
2813
+ request_options : typing.Optional[RequestOptions]
2814
+ Request-specific configuration.
2815
+
2816
+ Returns
2817
+ -------
2818
+ AsyncHttpResponse[None]
2819
+ """
2820
+ _response = await self._client_wrapper.httpx_client.request(
2821
+ f"corporate/subAccount/{jsonable_encoder(id)}/applications/toggle",
2822
+ method="PUT",
2823
+ json={
2824
+ "automation": automation,
2825
+ "conversations": conversations,
2826
+ "crm": crm,
2827
+ "email-campaigns": email_campaigns,
2828
+ "facebook-ads": facebook_ads,
2829
+ "inbox": inbox,
2830
+ "landing-pages": landing_pages,
2831
+ "meetings": meetings,
2832
+ "sms-campaigns": sms_campaigns,
2833
+ "transactional-emails": transactional_emails,
2834
+ "transactional-sms": transactional_sms,
2835
+ "web-push": web_push,
2836
+ "whatsapp": whatsapp,
2837
+ },
2838
+ headers={
2839
+ "content-type": "application/json",
2840
+ },
2841
+ request_options=request_options,
2842
+ omit=OMIT,
2843
+ )
2844
+ try:
2845
+ if 200 <= _response.status_code < 300:
2846
+ return AsyncHttpResponse(response=_response, data=None)
2847
+ if _response.status_code == 400:
2848
+ raise BadRequestError(
2849
+ headers=dict(_response.headers),
2850
+ body=typing.cast(
2851
+ typing.Any,
2852
+ construct_type(
2853
+ type_=typing.Any, # type: ignore
2854
+ object_=_response.json(),
2855
+ ),
2856
+ ),
2857
+ )
2858
+ if _response.status_code == 403:
2859
+ raise ForbiddenError(
2860
+ headers=dict(_response.headers),
2861
+ body=typing.cast(
2862
+ typing.Any,
2863
+ construct_type(
2864
+ type_=typing.Any, # type: ignore
2865
+ object_=_response.json(),
2866
+ ),
2867
+ ),
2868
+ )
2869
+ _response_json = _response.json()
2870
+ except JSONDecodeError:
2871
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2872
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2873
+
2874
+ async def update_sub_account_plan(
2875
+ self,
2876
+ id: int,
2877
+ *,
2878
+ credits: typing.Optional[PutCorporateSubAccountIdPlanRequestCredits] = OMIT,
2879
+ features: typing.Optional[PutCorporateSubAccountIdPlanRequestFeatures] = OMIT,
2880
+ request_options: typing.Optional[RequestOptions] = None,
2881
+ ) -> AsyncHttpResponse[None]:
2882
+ """
2883
+ This endpoint will update the sub-account plan. On the Corporate solution
2884
+ new version v2, you can set an unlimited number of credits in your
2885
+ sub-organization. Please pass the value “-1" to set the consumable in
2886
+ unlimited mode.
2887
+
2888
+ Parameters
2889
+ ----------
2890
+ id : int
2891
+ Id of the sub-account organization
2892
+
2893
+ credits : typing.Optional[PutCorporateSubAccountIdPlanRequestCredits]
2894
+ Credit details to update
2895
+
2896
+ features : typing.Optional[PutCorporateSubAccountIdPlanRequestFeatures]
2897
+ Features details to update
2898
+
2899
+ request_options : typing.Optional[RequestOptions]
2900
+ Request-specific configuration.
2901
+
2902
+ Returns
2903
+ -------
2904
+ AsyncHttpResponse[None]
2905
+ """
2906
+ _response = await self._client_wrapper.httpx_client.request(
2907
+ f"corporate/subAccount/{jsonable_encoder(id)}/plan",
2908
+ method="PUT",
2909
+ json={
2910
+ "credits": convert_and_respect_annotation_metadata(
2911
+ object_=credits, annotation=PutCorporateSubAccountIdPlanRequestCredits, direction="write"
2912
+ ),
2913
+ "features": convert_and_respect_annotation_metadata(
2914
+ object_=features, annotation=PutCorporateSubAccountIdPlanRequestFeatures, direction="write"
2915
+ ),
2916
+ },
2917
+ headers={
2918
+ "content-type": "application/json",
2919
+ },
2920
+ request_options=request_options,
2921
+ omit=OMIT,
2922
+ )
2923
+ try:
2924
+ if 200 <= _response.status_code < 300:
2925
+ return AsyncHttpResponse(response=_response, data=None)
2926
+ if _response.status_code == 400:
2927
+ raise BadRequestError(
2928
+ headers=dict(_response.headers),
2929
+ body=typing.cast(
2930
+ typing.Any,
2931
+ construct_type(
2932
+ type_=typing.Any, # type: ignore
2933
+ object_=_response.json(),
2934
+ ),
2935
+ ),
2936
+ )
2937
+ if _response.status_code == 403:
2938
+ raise ForbiddenError(
2939
+ headers=dict(_response.headers),
2940
+ body=typing.cast(
2941
+ typing.Any,
2942
+ construct_type(
2943
+ type_=typing.Any, # type: ignore
2944
+ object_=_response.json(),
2945
+ ),
2946
+ ),
2947
+ )
2948
+ _response_json = _response.json()
2949
+ except JSONDecodeError:
2950
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
2951
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
2952
+
2953
+ async def update_sub_accounts_plan(
2954
+ self,
2955
+ *,
2956
+ credits: typing.Optional[PutCorporateSubAccountsPlanRequestCredits] = OMIT,
2957
+ features: typing.Optional[PutCorporateSubAccountsPlanRequestFeatures] = OMIT,
2958
+ sub_account_ids: typing.Optional[typing.Sequence[int]] = OMIT,
2959
+ request_options: typing.Optional[RequestOptions] = None,
2960
+ ) -> AsyncHttpResponse[None]:
2961
+ """
2962
+ This endpoint will update multiple sub-accounts plan. On the Corporate
2963
+ solution new version v2, you can set an unlimited number of credits in your
2964
+ sub-organization. Please pass the value “-1" to set the consumable in
2965
+ unlimited mode.
2966
+
2967
+ Parameters
2968
+ ----------
2969
+ credits : typing.Optional[PutCorporateSubAccountsPlanRequestCredits]
2970
+ Credit details to update
2971
+
2972
+ features : typing.Optional[PutCorporateSubAccountsPlanRequestFeatures]
2973
+ Features details to update
2974
+
2975
+ sub_account_ids : typing.Optional[typing.Sequence[int]]
2976
+ List of sub-account ids
2977
+
2978
+ request_options : typing.Optional[RequestOptions]
2979
+ Request-specific configuration.
2980
+
2981
+ Returns
2982
+ -------
2983
+ AsyncHttpResponse[None]
2984
+ """
2985
+ _response = await self._client_wrapper.httpx_client.request(
2986
+ "corporate/subAccounts/plan",
2987
+ method="PUT",
2988
+ json={
2989
+ "credits": convert_and_respect_annotation_metadata(
2990
+ object_=credits, annotation=PutCorporateSubAccountsPlanRequestCredits, direction="write"
2991
+ ),
2992
+ "features": convert_and_respect_annotation_metadata(
2993
+ object_=features, annotation=PutCorporateSubAccountsPlanRequestFeatures, direction="write"
2994
+ ),
2995
+ "subAccountIds": sub_account_ids,
2996
+ },
2997
+ headers={
2998
+ "content-type": "application/json",
2999
+ },
3000
+ request_options=request_options,
3001
+ omit=OMIT,
3002
+ )
3003
+ try:
3004
+ if 200 <= _response.status_code < 300:
3005
+ return AsyncHttpResponse(response=_response, data=None)
3006
+ if _response.status_code == 400:
3007
+ raise BadRequestError(
3008
+ headers=dict(_response.headers),
3009
+ body=typing.cast(
3010
+ typing.Any,
3011
+ construct_type(
3012
+ type_=typing.Any, # type: ignore
3013
+ object_=_response.json(),
3014
+ ),
3015
+ ),
3016
+ )
3017
+ if _response.status_code == 403:
3018
+ raise ForbiddenError(
3019
+ headers=dict(_response.headers),
3020
+ body=typing.cast(
3021
+ typing.Any,
3022
+ construct_type(
3023
+ type_=typing.Any, # type: ignore
3024
+ object_=_response.json(),
3025
+ ),
3026
+ ),
3027
+ )
3028
+ _response_json = _response.json()
3029
+ except JSONDecodeError:
3030
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
3031
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
3032
+
3033
+ async def invite_admin_user(
3034
+ self,
3035
+ *,
3036
+ all_features_access: bool,
3037
+ email: str,
3038
+ privileges: typing.Sequence[InviteAdminUserRequestPrivilegesItem],
3039
+ group_ids: typing.Optional[typing.Sequence[str]] = OMIT,
3040
+ request_options: typing.Optional[RequestOptions] = None,
3041
+ ) -> AsyncHttpResponse[InviteAdminUserResponse]:
3042
+ """
3043
+ `This endpoint allows you to invite a member to manage the Admin account
3044
+ Features and their respective permissions are as below: - `my_plan`:
3045
+ - "all"
3046
+ - `api`:
3047
+ - "none"
3048
+ - `user_management`:
3049
+ - "all"
3050
+ - `app_management` | Not available in ENTv2:
3051
+ - "all"
3052
+ - `sub_organization_groups`
3053
+ - "create"
3054
+ - "edit_delete"
3055
+ - `create_sub_organizations`
3056
+ - "all"
3057
+ - `manage_sub_organizations`
3058
+ - "all"
3059
+ - `analytics`
3060
+ - "download_data"
3061
+ - "create_alerts"
3062
+ - "my_looks"
3063
+ - "explore_create"
3064
+ - `security`
3065
+ - "all"
3066
+ **Note**: - If `all_features_access: false` then only privileges are
3067
+ required otherwise if `true` then it's assumed that all permissions will be
3068
+ there for the invited admin user.
3069
+
3070
+ Parameters
3071
+ ----------
3072
+ all_features_access : bool
3073
+ All access to the features
3074
+
3075
+ email : str
3076
+ Email address for the organization
3077
+
3078
+ privileges : typing.Sequence[InviteAdminUserRequestPrivilegesItem]
3079
+
3080
+ group_ids : typing.Optional[typing.Sequence[str]]
3081
+ Ids of Group
3082
+
3083
+ request_options : typing.Optional[RequestOptions]
3084
+ Request-specific configuration.
3085
+
3086
+ Returns
3087
+ -------
3088
+ AsyncHttpResponse[InviteAdminUserResponse]
3089
+ Invitation ID
3090
+ """
3091
+ _response = await self._client_wrapper.httpx_client.request(
3092
+ "corporate/user/invitation/send",
3093
+ method="POST",
3094
+ json={
3095
+ "all_features_access": all_features_access,
3096
+ "email": email,
3097
+ "groupIds": group_ids,
3098
+ "privileges": convert_and_respect_annotation_metadata(
3099
+ object_=privileges,
3100
+ annotation=typing.Sequence[InviteAdminUserRequestPrivilegesItem],
3101
+ direction="write",
3102
+ ),
3103
+ },
3104
+ headers={
3105
+ "content-type": "application/json",
3106
+ },
3107
+ request_options=request_options,
3108
+ omit=OMIT,
3109
+ )
3110
+ try:
3111
+ if 200 <= _response.status_code < 300:
3112
+ _data = typing.cast(
3113
+ InviteAdminUserResponse,
3114
+ construct_type(
3115
+ type_=InviteAdminUserResponse, # type: ignore
3116
+ object_=_response.json(),
3117
+ ),
3118
+ )
3119
+ return AsyncHttpResponse(response=_response, data=_data)
3120
+ if _response.status_code == 400:
3121
+ raise BadRequestError(
3122
+ headers=dict(_response.headers),
3123
+ body=typing.cast(
3124
+ typing.Any,
3125
+ construct_type(
3126
+ type_=typing.Any, # type: ignore
3127
+ object_=_response.json(),
3128
+ ),
3129
+ ),
3130
+ )
3131
+ _response_json = _response.json()
3132
+ except JSONDecodeError:
3133
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
3134
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
3135
+
3136
+ async def resend_cancel_admin_user_invitation(
3137
+ self,
3138
+ action: PutCorporateUserInvitationActionEmailRequestAction,
3139
+ email: str,
3140
+ *,
3141
+ request_options: typing.Optional[RequestOptions] = None,
3142
+ ) -> AsyncHttpResponse[PutCorporateUserInvitationActionEmailResponse]:
3143
+ """
3144
+ This endpoint will allow the user to:
3145
+ - Resend an admin user invitation
3146
+ - Cancel an admin user invitation
3147
+
3148
+ Parameters
3149
+ ----------
3150
+ action : PutCorporateUserInvitationActionEmailRequestAction
3151
+ Action to be performed (cancel / resend)
3152
+
3153
+ email : str
3154
+ Email address of the recipient
3155
+
3156
+ request_options : typing.Optional[RequestOptions]
3157
+ Request-specific configuration.
3158
+
3159
+ Returns
3160
+ -------
3161
+ AsyncHttpResponse[PutCorporateUserInvitationActionEmailResponse]
3162
+ Response of the action performed
3163
+ """
3164
+ _response = await self._client_wrapper.httpx_client.request(
3165
+ f"corporate/user/invitation/{jsonable_encoder(action)}/{jsonable_encoder(email)}",
3166
+ method="PUT",
3167
+ request_options=request_options,
3168
+ )
3169
+ try:
3170
+ if 200 <= _response.status_code < 300:
3171
+ _data = typing.cast(
3172
+ PutCorporateUserInvitationActionEmailResponse,
3173
+ construct_type(
3174
+ type_=PutCorporateUserInvitationActionEmailResponse, # type: ignore
3175
+ object_=_response.json(),
3176
+ ),
3177
+ )
3178
+ return AsyncHttpResponse(response=_response, data=_data)
3179
+ if _response.status_code == 400:
3180
+ raise BadRequestError(
3181
+ headers=dict(_response.headers),
3182
+ body=typing.cast(
3183
+ typing.Any,
3184
+ construct_type(
3185
+ type_=typing.Any, # type: ignore
3186
+ object_=_response.json(),
3187
+ ),
3188
+ ),
3189
+ )
3190
+ _response_json = _response.json()
3191
+ except JSONDecodeError:
3192
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
3193
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
3194
+
3195
+ async def revoke_an_admin_user(
3196
+ self, email: str, *, request_options: typing.Optional[RequestOptions] = None
3197
+ ) -> AsyncHttpResponse[None]:
3198
+ """
3199
+ This endpoint allows to revoke/remove an invited member of your Admin
3200
+ account
3201
+
3202
+ Parameters
3203
+ ----------
3204
+ email : str
3205
+ Email of the invited user
3206
+
3207
+ request_options : typing.Optional[RequestOptions]
3208
+ Request-specific configuration.
3209
+
3210
+ Returns
3211
+ -------
3212
+ AsyncHttpResponse[None]
3213
+ """
3214
+ _response = await self._client_wrapper.httpx_client.request(
3215
+ f"corporate/user/revoke/{jsonable_encoder(email)}",
3216
+ method="DELETE",
3217
+ request_options=request_options,
3218
+ )
3219
+ try:
3220
+ if 200 <= _response.status_code < 300:
3221
+ return AsyncHttpResponse(response=_response, data=None)
3222
+ if _response.status_code == 400:
3223
+ raise BadRequestError(
3224
+ headers=dict(_response.headers),
3225
+ body=typing.cast(
3226
+ typing.Any,
3227
+ construct_type(
3228
+ type_=typing.Any, # type: ignore
3229
+ object_=_response.json(),
3230
+ ),
3231
+ ),
3232
+ )
3233
+ _response_json = _response.json()
3234
+ except JSONDecodeError:
3235
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
3236
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
3237
+
3238
+ async def get_corporate_user_permission(
3239
+ self, email: str, *, request_options: typing.Optional[RequestOptions] = None
3240
+ ) -> AsyncHttpResponse[GetCorporateUserPermissionResponse]:
3241
+ """
3242
+ This endpoint will provide the list of admin user permissions
3243
+
3244
+ Parameters
3245
+ ----------
3246
+ email : str
3247
+ Email of the invited user.
3248
+
3249
+ request_options : typing.Optional[RequestOptions]
3250
+ Request-specific configuration.
3251
+
3252
+ Returns
3253
+ -------
3254
+ AsyncHttpResponse[GetCorporateUserPermissionResponse]
3255
+ List of user's permissions
3256
+ """
3257
+ _response = await self._client_wrapper.httpx_client.request(
3258
+ f"corporate/user/{jsonable_encoder(email)}/permissions",
3259
+ method="GET",
3260
+ request_options=request_options,
3261
+ )
3262
+ try:
3263
+ if 200 <= _response.status_code < 300:
3264
+ _data = typing.cast(
3265
+ GetCorporateUserPermissionResponse,
3266
+ construct_type(
3267
+ type_=GetCorporateUserPermissionResponse, # type: ignore
3268
+ object_=_response.json(),
3269
+ ),
3270
+ )
3271
+ return AsyncHttpResponse(response=_response, data=_data)
3272
+ if _response.status_code == 400:
3273
+ raise BadRequestError(
3274
+ headers=dict(_response.headers),
3275
+ body=typing.cast(
3276
+ typing.Any,
3277
+ construct_type(
3278
+ type_=typing.Any, # type: ignore
3279
+ object_=_response.json(),
3280
+ ),
3281
+ ),
3282
+ )
3283
+ _response_json = _response.json()
3284
+ except JSONDecodeError:
3285
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
3286
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
3287
+
3288
+ async def change_admin_user_permissions(
3289
+ self,
3290
+ email: str,
3291
+ *,
3292
+ all_features_access: bool,
3293
+ privileges: typing.Sequence[PutCorporateUserEmailPermissionsRequestPrivilegesItem],
3294
+ request_options: typing.Optional[RequestOptions] = None,
3295
+ ) -> AsyncHttpResponse[None]:
3296
+ """
3297
+ This endpoint will allow you to change the permissions of Admin users of
3298
+ your Admin account
3299
+
3300
+ Parameters
3301
+ ----------
3302
+ email : str
3303
+ Email address of Admin user
3304
+
3305
+ all_features_access : bool
3306
+ All access to the features
3307
+
3308
+ privileges : typing.Sequence[PutCorporateUserEmailPermissionsRequestPrivilegesItem]
3309
+
3310
+ request_options : typing.Optional[RequestOptions]
3311
+ Request-specific configuration.
3312
+
3313
+ Returns
3314
+ -------
3315
+ AsyncHttpResponse[None]
3316
+ """
3317
+ _response = await self._client_wrapper.httpx_client.request(
3318
+ f"corporate/user/{jsonable_encoder(email)}/permissions",
3319
+ method="PUT",
3320
+ json={
3321
+ "all_features_access": all_features_access,
3322
+ "privileges": convert_and_respect_annotation_metadata(
3323
+ object_=privileges,
3324
+ annotation=typing.Sequence[PutCorporateUserEmailPermissionsRequestPrivilegesItem],
3325
+ direction="write",
3326
+ ),
3327
+ },
3328
+ headers={
3329
+ "content-type": "application/json",
3330
+ },
3331
+ request_options=request_options,
3332
+ omit=OMIT,
3333
+ )
3334
+ try:
3335
+ if 200 <= _response.status_code < 300:
3336
+ return AsyncHttpResponse(response=_response, data=None)
3337
+ if _response.status_code == 400:
3338
+ raise BadRequestError(
3339
+ headers=dict(_response.headers),
3340
+ body=typing.cast(
3341
+ typing.Any,
3342
+ construct_type(
3343
+ type_=typing.Any, # type: ignore
3344
+ object_=_response.json(),
3345
+ ),
3346
+ ),
3347
+ )
3348
+ _response_json = _response.json()
3349
+ except JSONDecodeError:
3350
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
3351
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)