wavix-python-sdk 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (497) hide show
  1. wavix/__init__.py +801 -0
  2. wavix/_default_clients.py +32 -0
  3. wavix/api_keys/__init__.py +4 -0
  4. wavix/api_keys/client.py +764 -0
  5. wavix/api_keys/raw_client.py +1191 -0
  6. wavix/billing/__init__.py +41 -0
  7. wavix/billing/client.py +82 -0
  8. wavix/billing/invoices/__init__.py +34 -0
  9. wavix/billing/invoices/client.py +203 -0
  10. wavix/billing/invoices/raw_client.py +302 -0
  11. wavix/billing/invoices/types/__init__.py +34 -0
  12. wavix/billing/invoices/types/list_invoices_response.py +31 -0
  13. wavix/billing/raw_client.py +13 -0
  14. wavix/billing/transactions/__init__.py +34 -0
  15. wavix/billing/transactions/client.py +209 -0
  16. wavix/billing/transactions/raw_client.py +253 -0
  17. wavix/billing/transactions/types/__init__.py +34 -0
  18. wavix/billing/transactions/types/list_transactions_response.py +31 -0
  19. wavix/buy/__init__.py +61 -0
  20. wavix/buy/cities/__init__.py +34 -0
  21. wavix/buy/cities/client.py +134 -0
  22. wavix/buy/cities/raw_client.py +201 -0
  23. wavix/buy/cities/types/__init__.py +34 -0
  24. wavix/buy/cities/types/list_cities_response.py +23 -0
  25. wavix/buy/client.py +139 -0
  26. wavix/buy/countries/__init__.py +34 -0
  27. wavix/buy/countries/client.py +116 -0
  28. wavix/buy/countries/raw_client.py +144 -0
  29. wavix/buy/countries/types/__init__.py +34 -0
  30. wavix/buy/countries/types/list_countries_response.py +23 -0
  31. wavix/buy/numbers/__init__.py +34 -0
  32. wavix/buy/numbers/client.py +168 -0
  33. wavix/buy/numbers/raw_client.py +227 -0
  34. wavix/buy/numbers/types/__init__.py +34 -0
  35. wavix/buy/numbers/types/list_numbers_response.py +26 -0
  36. wavix/buy/raw_client.py +13 -0
  37. wavix/buy/region_cities/__init__.py +34 -0
  38. wavix/buy/region_cities/client.py +142 -0
  39. wavix/buy/region_cities/raw_client.py +207 -0
  40. wavix/buy/region_cities/types/__init__.py +34 -0
  41. wavix/buy/region_cities/types/list_region_cities_response.py +23 -0
  42. wavix/buy/regions/__init__.py +34 -0
  43. wavix/buy/regions/client.py +132 -0
  44. wavix/buy/regions/raw_client.py +222 -0
  45. wavix/buy/regions/types/__init__.py +34 -0
  46. wavix/buy/regions/types/list_regions_response.py +23 -0
  47. wavix/call_control/__init__.py +40 -0
  48. wavix/call_control/audio/__init__.py +4 -0
  49. wavix/call_control/audio/client.py +195 -0
  50. wavix/call_control/audio/raw_client.py +333 -0
  51. wavix/call_control/client.py +796 -0
  52. wavix/call_control/raw_client.py +1224 -0
  53. wavix/call_control/streams/__init__.py +4 -0
  54. wavix/call_control/streams/client.py +250 -0
  55. wavix/call_control/streams/raw_client.py +325 -0
  56. wavix/call_control/types/__init__.py +38 -0
  57. wavix/call_control/types/call_dtmf_collect_request_prompt.py +33 -0
  58. wavix/call_control/types/call_dtmf_collect_request_prompt_say.py +31 -0
  59. wavix/call_recording/__init__.py +4 -0
  60. wavix/call_recording/client.py +430 -0
  61. wavix/call_recording/raw_client.py +726 -0
  62. wavix/call_webhooks/__init__.py +37 -0
  63. wavix/call_webhooks/client.py +281 -0
  64. wavix/call_webhooks/raw_client.py +529 -0
  65. wavix/call_webhooks/types/__init__.py +38 -0
  66. wavix/call_webhooks/types/call_webhooks_create_request_event_type.py +5 -0
  67. wavix/call_webhooks/types/delete_call_webhooks_request_event_type.py +5 -0
  68. wavix/cart/__init__.py +38 -0
  69. wavix/cart/client.py +327 -0
  70. wavix/cart/raw_client.py +629 -0
  71. wavix/cart/types/__init__.py +40 -0
  72. wavix/cart/types/checkout_cart_response.py +22 -0
  73. wavix/cart/types/get_cart_response.py +29 -0
  74. wavix/cart/types/remove_cart_response.py +22 -0
  75. wavix/cdrs/__init__.py +39 -0
  76. wavix/cdrs/client.py +968 -0
  77. wavix/cdrs/raw_client.py +1176 -0
  78. wavix/cdrs/transcription/__init__.py +4 -0
  79. wavix/cdrs/transcription/client.py +112 -0
  80. wavix/cdrs/transcription/raw_client.py +156 -0
  81. wavix/cdrs/types/__init__.py +38 -0
  82. wavix/cdrs/types/cdr_search_request_disposition.py +5 -0
  83. wavix/cdrs/types/cdr_search_request_type.py +5 -0
  84. wavix/client.py +578 -0
  85. wavix/core/__init__.py +127 -0
  86. wavix/core/api_error.py +23 -0
  87. wavix/core/client_wrapper.py +119 -0
  88. wavix/core/datetime_utils.py +70 -0
  89. wavix/core/file.py +67 -0
  90. wavix/core/force_multipart.py +18 -0
  91. wavix/core/http_client.py +839 -0
  92. wavix/core/http_response.py +59 -0
  93. wavix/core/http_sse/__init__.py +42 -0
  94. wavix/core/http_sse/_api.py +170 -0
  95. wavix/core/http_sse/_decoders.py +61 -0
  96. wavix/core/http_sse/_exceptions.py +7 -0
  97. wavix/core/http_sse/_models.py +17 -0
  98. wavix/core/jsonable_encoder.py +120 -0
  99. wavix/core/logging.py +107 -0
  100. wavix/core/parse_error.py +36 -0
  101. wavix/core/pydantic_utilities.py +508 -0
  102. wavix/core/query_encoder.py +58 -0
  103. wavix/core/remove_none_from_dict.py +11 -0
  104. wavix/core/request_options.py +35 -0
  105. wavix/core/serialization.py +347 -0
  106. wavix/environment.py +7 -0
  107. wavix/errors/__init__.py +56 -0
  108. wavix/errors/bad_request_error.py +10 -0
  109. wavix/errors/forbidden_error.py +10 -0
  110. wavix/errors/not_found_error.py +10 -0
  111. wavix/errors/service_unavailable_error.py +11 -0
  112. wavix/errors/too_many_requests_error.py +11 -0
  113. wavix/errors/unauthorized_error.py +11 -0
  114. wavix/errors/unprocessable_entity_error.py +10 -0
  115. wavix/link_shortener/__init__.py +34 -0
  116. wavix/link_shortener/client.py +194 -0
  117. wavix/link_shortener/metrics/__init__.py +4 -0
  118. wavix/link_shortener/metrics/client.py +198 -0
  119. wavix/link_shortener/metrics/raw_client.py +218 -0
  120. wavix/link_shortener/raw_client.py +265 -0
  121. wavix/number_validator/__init__.py +35 -0
  122. wavix/number_validator/client.py +271 -0
  123. wavix/number_validator/raw_client.py +383 -0
  124. wavix/number_validator/results/__init__.py +4 -0
  125. wavix/number_validator/results/client.py +114 -0
  126. wavix/number_validator/results/raw_client.py +156 -0
  127. wavix/number_validator/types/__init__.py +34 -0
  128. wavix/number_validator/types/get_number_validator_response.py +112 -0
  129. wavix/numbers/__init__.py +39 -0
  130. wavix/numbers/client.py +689 -0
  131. wavix/numbers/papers/__init__.py +4 -0
  132. wavix/numbers/papers/client.py +155 -0
  133. wavix/numbers/papers/raw_client.py +208 -0
  134. wavix/numbers/raw_client.py +1000 -0
  135. wavix/numbers/types/__init__.py +38 -0
  136. wavix/numbers/types/bulk_update_numbers_response.py +23 -0
  137. wavix/numbers/types/delete_numbers_response.py +22 -0
  138. wavix/profile/__init__.py +41 -0
  139. wavix/profile/client.py +308 -0
  140. wavix/profile/config/__init__.py +34 -0
  141. wavix/profile/config/client.py +100 -0
  142. wavix/profile/config/raw_client.py +124 -0
  143. wavix/profile/config/types/__init__.py +34 -0
  144. wavix/profile/config/types/get_config_response.py +25 -0
  145. wavix/profile/raw_client.py +360 -0
  146. wavix/profile/types/__init__.py +38 -0
  147. wavix/profile/types/profile_update_request_company_info.py +48 -0
  148. wavix/profile/types/profile_update_request_company_info_industry.py +22 -0
  149. wavix/py.typed +0 -0
  150. wavix/sip_trunks/__init__.py +4 -0
  151. wavix/sip_trunks/client.py +927 -0
  152. wavix/sip_trunks/raw_client.py +1324 -0
  153. wavix/sms_and_mms/__init__.py +66 -0
  154. wavix/sms_and_mms/client.py +101 -0
  155. wavix/sms_and_mms/messages/__init__.py +49 -0
  156. wavix/sms_and_mms/messages/client.py +625 -0
  157. wavix/sms_and_mms/messages/raw_client.py +793 -0
  158. wavix/sms_and_mms/messages/types/__init__.py +47 -0
  159. wavix/sms_and_mms/messages/types/get_messages_response.py +97 -0
  160. wavix/sms_and_mms/messages/types/list_all_messages_request_message_type.py +5 -0
  161. wavix/sms_and_mms/messages/types/list_messages_request_message_type.py +5 -0
  162. wavix/sms_and_mms/messages/types/list_messages_response.py +26 -0
  163. wavix/sms_and_mms/opt_outs/__init__.py +34 -0
  164. wavix/sms_and_mms/opt_outs/client.py +277 -0
  165. wavix/sms_and_mms/opt_outs/raw_client.py +438 -0
  166. wavix/sms_and_mms/opt_outs/types/__init__.py +34 -0
  167. wavix/sms_and_mms/opt_outs/types/create_opt_outs_response.py +22 -0
  168. wavix/sms_and_mms/raw_client.py +13 -0
  169. wavix/sms_and_mms/sender_ids/__init__.py +38 -0
  170. wavix/sms_and_mms/sender_ids/client.py +391 -0
  171. wavix/sms_and_mms/sender_ids/raw_client.py +617 -0
  172. wavix/sms_and_mms/sender_ids/types/__init__.py +40 -0
  173. wavix/sms_and_mms/sender_ids/types/delete_sender_ids_response.py +22 -0
  174. wavix/sms_and_mms/sender_ids/types/sender_id_create_request_monthly_volume.py +7 -0
  175. wavix/sms_and_mms/sender_ids/types/sender_id_create_request_usecase.py +5 -0
  176. wavix/speech_analytics/__init__.py +52 -0
  177. wavix/speech_analytics/client.py +372 -0
  178. wavix/speech_analytics/file/__init__.py +4 -0
  179. wavix/speech_analytics/file/client.py +114 -0
  180. wavix/speech_analytics/file/raw_client.py +148 -0
  181. wavix/speech_analytics/raw_client.py +527 -0
  182. wavix/speech_analytics/types/__init__.py +47 -0
  183. wavix/speech_analytics/types/create_speech_analytics_response.py +32 -0
  184. wavix/speech_analytics/types/get_speech_analytics_response.py +77 -0
  185. wavix/speech_analytics/types/get_speech_analytics_response_language.py +5 -0
  186. wavix/speech_analytics/types/get_speech_analytics_response_status.py +5 -0
  187. wavix/sub_accounts/__init__.py +52 -0
  188. wavix/sub_accounts/client.py +442 -0
  189. wavix/sub_accounts/raw_client.py +775 -0
  190. wavix/sub_accounts/transactions/__init__.py +4 -0
  191. wavix/sub_accounts/transactions/client.py +198 -0
  192. wavix/sub_accounts/transactions/raw_client.py +265 -0
  193. wavix/sub_accounts/types/__init__.py +47 -0
  194. wavix/sub_accounts/types/list_sub_accounts_request_status.py +5 -0
  195. wavix/sub_accounts/types/sub_accounts_create_request_default_destinations.py +31 -0
  196. wavix/sub_accounts/types/sub_accounts_update_request_default_destinations.py +31 -0
  197. wavix/sub_accounts/types/sub_accounts_update_request_status.py +5 -0
  198. wavix/ten_dlc/__init__.py +167 -0
  199. wavix/ten_dlc/brand_appeals/__init__.py +34 -0
  200. wavix/ten_dlc/brand_appeals/client.py +244 -0
  201. wavix/ten_dlc/brand_appeals/raw_client.py +390 -0
  202. wavix/ten_dlc/brand_appeals/types/__init__.py +34 -0
  203. wavix/ten_dlc/brand_appeals/types/create_brand_appeals_response.py +22 -0
  204. wavix/ten_dlc/brand_evidence/__init__.py +37 -0
  205. wavix/ten_dlc/brand_evidence/client.py +365 -0
  206. wavix/ten_dlc/brand_evidence/raw_client.py +599 -0
  207. wavix/ten_dlc/brand_evidence/types/__init__.py +38 -0
  208. wavix/ten_dlc/brand_evidence/types/delete_brand_evidence_response.py +22 -0
  209. wavix/ten_dlc/brand_evidence/types/upload_brand_evidence_response.py +38 -0
  210. wavix/ten_dlc/brand_vetting_appeals/__init__.py +34 -0
  211. wavix/ten_dlc/brand_vetting_appeals/client.py +258 -0
  212. wavix/ten_dlc/brand_vetting_appeals/raw_client.py +381 -0
  213. wavix/ten_dlc/brand_vetting_appeals/types/__init__.py +36 -0
  214. wavix/ten_dlc/brand_vetting_appeals/types/create_brand_vetting_appeals_response.py +22 -0
  215. wavix/ten_dlc/brand_vettings/__init__.py +4 -0
  216. wavix/ten_dlc/brand_vettings/client.py +325 -0
  217. wavix/ten_dlc/brand_vettings/raw_client.py +518 -0
  218. wavix/ten_dlc/brands/__init__.py +85 -0
  219. wavix/ten_dlc/brands/client.py +870 -0
  220. wavix/ten_dlc/brands/raw_client.py +1263 -0
  221. wavix/ten_dlc/brands/types/__init__.py +83 -0
  222. wavix/ten_dlc/brands/types/create_brands_response.py +143 -0
  223. wavix/ten_dlc/brands/types/create_brands_response_entity_type.py +7 -0
  224. wavix/ten_dlc/brands/types/create_brands_response_status.py +7 -0
  225. wavix/ten_dlc/brands/types/delete_brands_response.py +22 -0
  226. wavix/ten_dlc/brands/types/get_brands_response.py +143 -0
  227. wavix/ten_dlc/brands/types/get_brands_response_entity_type.py +7 -0
  228. wavix/ten_dlc/brands/types/get_brands_response_status.py +7 -0
  229. wavix/ten_dlc/brands/types/list_brands_response.py +33 -0
  230. wavix/ten_dlc/brands/types/list_brands_response_pagination.py +41 -0
  231. wavix/ten_dlc/brands/types/qualify_usecase_brands_request_use_case.py +35 -0
  232. wavix/ten_dlc/brands/types/qualify_usecase_brands_response.py +33 -0
  233. wavix/ten_dlc/brands/types/ten_dlc_brand_update_request_entity_type.py +7 -0
  234. wavix/ten_dlc/brands/types/ten_dlc_brand_update_request_vertical.py +18 -0
  235. wavix/ten_dlc/brands/types/update_brands_response.py +143 -0
  236. wavix/ten_dlc/brands/types/update_brands_response_entity_type.py +7 -0
  237. wavix/ten_dlc/brands/types/update_brands_response_status.py +7 -0
  238. wavix/ten_dlc/campaign_numbers/__init__.py +38 -0
  239. wavix/ten_dlc/campaign_numbers/client.py +304 -0
  240. wavix/ten_dlc/campaign_numbers/raw_client.py +448 -0
  241. wavix/ten_dlc/campaign_numbers/types/__init__.py +40 -0
  242. wavix/ten_dlc/campaign_numbers/types/link_campaign_numbers_response.py +22 -0
  243. wavix/ten_dlc/campaign_numbers/types/list_campaign_numbers_response.py +33 -0
  244. wavix/ten_dlc/campaign_numbers/types/unlink_campaign_numbers_response.py +22 -0
  245. wavix/ten_dlc/campaigns/__init__.py +64 -0
  246. wavix/ten_dlc/campaigns/client.py +1493 -0
  247. wavix/ten_dlc/campaigns/raw_client.py +1840 -0
  248. wavix/ten_dlc/campaigns/types/__init__.py +62 -0
  249. wavix/ten_dlc/campaigns/types/create_campaigns_response.py +211 -0
  250. wavix/ten_dlc/campaigns/types/delete_campaigns_response.py +22 -0
  251. wavix/ten_dlc/campaigns/types/get_campaigns_response.py +211 -0
  252. wavix/ten_dlc/campaigns/types/list_by_brand_campaigns_response.py +33 -0
  253. wavix/ten_dlc/campaigns/types/list_by_brand_campaigns_response_pagination.py +41 -0
  254. wavix/ten_dlc/campaigns/types/list_campaigns_response.py +33 -0
  255. wavix/ten_dlc/campaigns/types/list_campaigns_response_pagination.py +41 -0
  256. wavix/ten_dlc/campaigns/types/ten_dlc_campaign_update_request_usecase.py +15 -0
  257. wavix/ten_dlc/campaigns/types/update_campaigns_response.py +211 -0
  258. wavix/ten_dlc/client.py +196 -0
  259. wavix/ten_dlc/raw_client.py +13 -0
  260. wavix/ten_dlc/subscriptions/__init__.py +37 -0
  261. wavix/ten_dlc/subscriptions/client.py +271 -0
  262. wavix/ten_dlc/subscriptions/raw_client.py +398 -0
  263. wavix/ten_dlc/subscriptions/types/__init__.py +38 -0
  264. wavix/ten_dlc/subscriptions/types/create_subscriptions_response.py +31 -0
  265. wavix/ten_dlc/subscriptions/types/delete_subscriptions_response.py +22 -0
  266. wavix/two_fa/__init__.py +56 -0
  267. wavix/two_fa/client.py +101 -0
  268. wavix/two_fa/events/__init__.py +4 -0
  269. wavix/two_fa/events/client.py +114 -0
  270. wavix/two_fa/events/raw_client.py +156 -0
  271. wavix/two_fa/raw_client.py +13 -0
  272. wavix/two_fa/sessions/__init__.py +4 -0
  273. wavix/two_fa/sessions/client.py +142 -0
  274. wavix/two_fa/sessions/raw_client.py +200 -0
  275. wavix/two_fa/verification/__init__.py +49 -0
  276. wavix/two_fa/verification/client.py +395 -0
  277. wavix/two_fa/verification/raw_client.py +664 -0
  278. wavix/two_fa/verification/types/__init__.py +47 -0
  279. wavix/two_fa/verification/types/check_verification_response.py +22 -0
  280. wavix/two_fa/verification/types/create_verification_response.py +51 -0
  281. wavix/two_fa/verification/types/resend_verification_response.py +38 -0
  282. wavix/two_fa/verification/types/two_factor_verification_resend_request_channel.py +5 -0
  283. wavix/types/__init__.py +637 -0
  284. wavix/types/account_error_response.py +31 -0
  285. wavix/types/account_limits.py +32 -0
  286. wavix/types/allowed_i_ps.py +7 -0
  287. wavix/types/allowed_i_ps_item.py +27 -0
  288. wavix/types/api_key.py +138 -0
  289. wavix/types/api_key_calls_scope_permission.py +30 -0
  290. wavix/types/api_key_calls_scope_permission_allow.py +5 -0
  291. wavix/types/api_key_scope_permission.py +30 -0
  292. wavix/types/api_key_scope_permission_allow.py +5 -0
  293. wavix/types/available_number.py +97 -0
  294. wavix/types/available_number_list_response.py +26 -0
  295. wavix/types/bad_request_error_body.py +27 -0
  296. wavix/types/billing_transaction_list_response.py +31 -0
  297. wavix/types/brand_status_updated_webhook.py +28 -0
  298. wavix/types/brand_status_updated_webhook_status.py +7 -0
  299. wavix/types/call.py +92 -0
  300. wavix/types/call_control_validation_error_response.py +34 -0
  301. wavix/types/call_create_response.py +92 -0
  302. wavix/types/call_create_response_event_type.py +18 -0
  303. wavix/types/call_direction.py +5 -0
  304. wavix/types/call_disposition.py +5 -0
  305. wavix/types/call_event_type.py +18 -0
  306. wavix/types/call_list_response.py +28 -0
  307. wavix/types/call_recording_list_response.py +28 -0
  308. wavix/types/call_response.py +24 -0
  309. wavix/types/call_status_webhook.py +70 -0
  310. wavix/types/call_status_webhook_direction.py +5 -0
  311. wavix/types/call_stream_channel.py +5 -0
  312. wavix/types/call_stream_response.py +27 -0
  313. wavix/types/call_stream_type.py +5 -0
  314. wavix/types/call_webhook.py +37 -0
  315. wavix/types/call_webhook_event_type.py +5 -0
  316. wavix/types/call_webhook_list_response.py +10 -0
  317. wavix/types/call_webhook_list_response_item.py +28 -0
  318. wavix/types/call_webhook_list_response_item_event_type.py +5 -0
  319. wavix/types/campaign_status_updated_webhook.py +41 -0
  320. wavix/types/campaign_status_updated_webhook_status.py +7 -0
  321. wavix/types/cart_response.py +29 -0
  322. wavix/types/cdr.py +97 -0
  323. wavix/types/cdr_list_response.py +26 -0
  324. wavix/types/cdr_response.py +104 -0
  325. wavix/types/cdr_transcription_completed_webhook.py +28 -0
  326. wavix/types/cdr_transcription_completed_webhook_status.py +5 -0
  327. wavix/types/cdr_transcription_response.py +74 -0
  328. wavix/types/cdr_transcription_search_response.py +26 -0
  329. wavix/types/cdr_with_transcription.py +97 -0
  330. wavix/types/city.py +32 -0
  331. wavix/types/city_list_response.py +23 -0
  332. wavix/types/country.py +32 -0
  333. wavix/types/country_has_no_regions_error_response.py +27 -0
  334. wavix/types/country_list_response.py +23 -0
  335. wavix/types/document_type.py +32 -0
  336. wavix/types/document_type_id.py +7 -0
  337. wavix/types/file_transcript_response.py +30 -0
  338. wavix/types/file_transcript_turn.py +46 -0
  339. wavix/types/file_transcription_completed_webhook.py +32 -0
  340. wavix/types/file_transcription_response.py +77 -0
  341. wavix/types/file_transcription_response_language.py +5 -0
  342. wavix/types/file_transcription_response_status.py +5 -0
  343. wavix/types/financial_transaction.py +57 -0
  344. wavix/types/forbidden_error_response.py +27 -0
  345. wavix/types/inbound_call_destination.py +53 -0
  346. wavix/types/inbound_call_transport.py +6 -0
  347. wavix/types/inbound_message.py +46 -0
  348. wavix/types/invalid_recording.py +31 -0
  349. wavix/types/invoice.py +42 -0
  350. wavix/types/invoice_list_response.py +31 -0
  351. wavix/types/list_brand_evidence_response.py +23 -0
  352. wavix/types/list_sessions_response_item.py +58 -0
  353. wavix/types/message.py +103 -0
  354. wavix/types/message_body.py +29 -0
  355. wavix/types/message_create_request.py +46 -0
  356. wavix/types/message_delivery_status.py +8 -0
  357. wavix/types/message_list_response.py +26 -0
  358. wavix/types/message_response.py +97 -0
  359. wavix/types/messages_delivery_report.py +81 -0
  360. wavix/types/not_found_error_body.py +27 -0
  361. wavix/types/not_found_error_response.py +27 -0
  362. wavix/types/number.py +160 -0
  363. wavix/types/number_destination.py +38 -0
  364. wavix/types/number_document.py +58 -0
  365. wavix/types/number_list_response.py +32 -0
  366. wavix/types/number_status_updated_webhook.py +38 -0
  367. wavix/types/number_status_updated_webhook_status.py +5 -0
  368. wavix/types/number_validator_create_bulk_response.py +10 -0
  369. wavix/types/number_validator_create_bulk_response_request_id.py +26 -0
  370. wavix/types/on_call_event_payload.py +34 -0
  371. wavix/types/on_call_event_payload_type.py +5 -0
  372. wavix/types/opt_out.py +27 -0
  373. wavix/types/opt_out_item.py +38 -0
  374. wavix/types/opt_outs_list_response.py +26 -0
  375. wavix/types/pagination.py +37 -0
  376. wavix/types/phone_lookup_details.py +32 -0
  377. wavix/types/phone_number_validation_type.py +5 -0
  378. wavix/types/phone_validation_batch_response.py +38 -0
  379. wavix/types/phone_validation_batch_result_response.py +41 -0
  380. wavix/types/phone_validation_response.py +112 -0
  381. wavix/types/phone_validation_result_response.py +115 -0
  382. wavix/types/profile_config_response.py +25 -0
  383. wavix/types/profile_response.py +79 -0
  384. wavix/types/profile_response_company_info.py +53 -0
  385. wavix/types/profile_response_company_info_country.py +31 -0
  386. wavix/types/profile_response_company_info_industry.py +22 -0
  387. wavix/types/profile_response_default_destinations_item.py +27 -0
  388. wavix/types/record_not_found_error_response.py +27 -0
  389. wavix/types/recording.py +57 -0
  390. wavix/types/recording_deleted_error_response.py +38 -0
  391. wavix/types/region.py +31 -0
  392. wavix/types/region_list_response.py +23 -0
  393. wavix/types/send_messages_response.py +100 -0
  394. wavix/types/sender_id.py +48 -0
  395. wavix/types/sender_id_details.py +44 -0
  396. wavix/types/sender_id_list_response.py +23 -0
  397. wavix/types/sender_id_response.py +48 -0
  398. wavix/types/sender_id_response_type.py +5 -0
  399. wavix/types/sender_id_type.py +5 -0
  400. wavix/types/short_link_metrics_item.py +69 -0
  401. wavix/types/short_link_metrics_response.py +26 -0
  402. wavix/types/short_link_response.py +22 -0
  403. wavix/types/sip_trunk_create_request.py +132 -0
  404. wavix/types/sip_trunk_create_request_allowed_ips_item.py +22 -0
  405. wavix/types/sip_trunk_create_request_host_request.py +26 -0
  406. wavix/types/sip_trunk_list_response.py +26 -0
  407. wavix/types/sip_trunk_response.py +145 -0
  408. wavix/types/sip_trunk_summary.py +114 -0
  409. wavix/types/sip_trunk_summary_host_request.py +31 -0
  410. wavix/types/sub_accounts_list_response.py +26 -0
  411. wavix/types/sub_accounts_transactions_list_response.py +30 -0
  412. wavix/types/sub_accounts_transactions_list_response_transactions_item.py +48 -0
  413. wavix/types/sub_organization_response.py +59 -0
  414. wavix/types/sub_organization_response_default_destinations.py +31 -0
  415. wavix/types/sub_organization_response_status.py +5 -0
  416. wavix/types/submit_file_transcription_response.py +32 -0
  417. wavix/types/success_response.py +22 -0
  418. wavix/types/tcr_error_message.py +27 -0
  419. wavix/types/tcr_feedback.py +23 -0
  420. wavix/types/tcr_feedback_category.py +47 -0
  421. wavix/types/ten_dlc_brand.py +143 -0
  422. wavix/types/ten_dlc_brand_appeal.py +54 -0
  423. wavix/types/ten_dlc_brand_appeal_create_request.py +36 -0
  424. wavix/types/ten_dlc_brand_appeal_outcome.py +38 -0
  425. wavix/types/ten_dlc_brand_appeal_outcome_feedback.py +27 -0
  426. wavix/types/ten_dlc_brand_appeal_outcome_vetting_status.py +7 -0
  427. wavix/types/ten_dlc_brand_create_request.py +8 -0
  428. wavix/types/ten_dlc_brand_create_request_entity_type.py +7 -0
  429. wavix/types/ten_dlc_brand_create_request_stock_exchange.py +26 -0
  430. wavix/types/ten_dlc_brand_create_request_stock_exchange_entity_type.py +7 -0
  431. wavix/types/ten_dlc_brand_create_request_vertical.py +18 -0
  432. wavix/types/ten_dlc_brand_create_request_zero.py +24 -0
  433. wavix/types/ten_dlc_brand_create_request_zero_entity_type.py +5 -0
  434. wavix/types/ten_dlc_brand_entity_type.py +7 -0
  435. wavix/types/ten_dlc_brand_evidence.py +38 -0
  436. wavix/types/ten_dlc_brand_identity_verification_status.py +7 -0
  437. wavix/types/ten_dlc_brand_list_response.py +33 -0
  438. wavix/types/ten_dlc_brand_list_response_pagination.py +41 -0
  439. wavix/types/ten_dlc_brand_qualification_result.py +33 -0
  440. wavix/types/ten_dlc_brand_status.py +7 -0
  441. wavix/types/ten_dlc_brand_vetting.py +71 -0
  442. wavix/types/ten_dlc_brand_vetting_appeal.py +78 -0
  443. wavix/types/ten_dlc_brand_vetting_appeal_appeal_outcome.py +37 -0
  444. wavix/types/ten_dlc_brand_vetting_appeal_appeal_outcome_feedback.py +26 -0
  445. wavix/types/ten_dlc_brand_vetting_appeal_outcome.py +33 -0
  446. wavix/types/ten_dlc_brand_vetting_appeal_outcome_feedback.py +26 -0
  447. wavix/types/ten_dlc_brand_vetting_appeal_outcome_reason.py +22 -0
  448. wavix/types/ten_dlc_campaign.py +211 -0
  449. wavix/types/ten_dlc_campaign_list_response.py +33 -0
  450. wavix/types/ten_dlc_campaign_list_response_pagination.py +41 -0
  451. wavix/types/ten_dlc_campaign_nudge_request.py +32 -0
  452. wavix/types/ten_dlc_campaign_number.py +27 -0
  453. wavix/types/ten_dlc_campaign_number_list_response.py +33 -0
  454. wavix/types/ten_dlc_event_subscription.py +31 -0
  455. wavix/types/ten_dlcmno_metadata.py +101 -0
  456. wavix/types/transaction_status.py +5 -0
  457. wavix/types/transaction_type.py +50 -0
  458. wavix/types/transcript_turn.py +46 -0
  459. wavix/types/transcription_filter.py +35 -0
  460. wavix/types/transcription_filter_agent.py +36 -0
  461. wavix/types/transcription_filter_any.py +36 -0
  462. wavix/types/transcription_filter_client.py +36 -0
  463. wavix/types/transcription_language.py +5 -0
  464. wavix/types/transcription_reference.py +29 -0
  465. wavix/types/transcription_status.py +5 -0
  466. wavix/types/tts_language.py +5 -0
  467. wavix/types/tts_voice_id.py +25 -0
  468. wavix/types/two_factor_verification_check_response.py +22 -0
  469. wavix/types/two_factor_verification_event.py +47 -0
  470. wavix/types/two_factor_verification_resend_response.py +38 -0
  471. wavix/types/two_factor_verification_response.py +51 -0
  472. wavix/types/unauthorized_error_response.py +32 -0
  473. wavix/types/unprocessable_entity_error_body.py +27 -0
  474. wavix/types/validation_error_response.py +27 -0
  475. wavix/types/voice_campaign_create_request.py +20 -0
  476. wavix/types/voice_campaign_response.py +41 -0
  477. wavix/types/voice_campaigns_create_response.py +20 -0
  478. wavix/types/voice_campaigns_create_response_voice_campaign.py +43 -0
  479. wavix/types/voice_campaigns_get_response.py +20 -0
  480. wavix/types/voice_campaigns_get_response_voice_campaign.py +43 -0
  481. wavix/types/web_rtc_token.py +43 -0
  482. wavix/types/web_rtc_token_response.py +44 -0
  483. wavix/types/web_rtc_tokens_list_response.py +30 -0
  484. wavix/version.py +3 -0
  485. wavix/voice_campaigns/__init__.py +4 -0
  486. wavix/voice_campaigns/client.py +197 -0
  487. wavix/voice_campaigns/raw_client.py +332 -0
  488. wavix/webrtc/__init__.py +34 -0
  489. wavix/webrtc/client.py +63 -0
  490. wavix/webrtc/raw_client.py +13 -0
  491. wavix/webrtc/tokens/__init__.py +4 -0
  492. wavix/webrtc/tokens/client.py +432 -0
  493. wavix/webrtc/tokens/raw_client.py +869 -0
  494. wavix_python_sdk-1.0.0.dist-info/LICENSE +21 -0
  495. wavix_python_sdk-1.0.0.dist-info/METADATA +339 -0
  496. wavix_python_sdk-1.0.0.dist-info/RECORD +497 -0
  497. wavix_python_sdk-1.0.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,1840 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+ from json.decoder import JSONDecodeError
6
+
7
+ from ...core.api_error import ApiError
8
+ from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
9
+ from ...core.http_response import AsyncHttpResponse, HttpResponse
10
+ from ...core.jsonable_encoder import encode_path_param
11
+ from ...core.parse_error import ParsingError
12
+ from ...core.pydantic_utilities import parse_obj_as
13
+ from ...core.request_options import RequestOptions
14
+ from ...errors.bad_request_error import BadRequestError
15
+ from ...errors.forbidden_error import ForbiddenError
16
+ from ...errors.not_found_error import NotFoundError
17
+ from ...errors.too_many_requests_error import TooManyRequestsError
18
+ from ...types.success_response import SuccessResponse
19
+ from ...types.validation_error_response import ValidationErrorResponse
20
+ from .types.create_campaigns_response import CreateCampaignsResponse
21
+ from .types.delete_campaigns_response import DeleteCampaignsResponse
22
+ from .types.get_campaigns_response import GetCampaignsResponse
23
+ from .types.list_by_brand_campaigns_response import ListByBrandCampaignsResponse
24
+ from .types.list_campaigns_response import ListCampaignsResponse
25
+ from .types.ten_dlc_campaign_update_request_usecase import TenDlcCampaignUpdateRequestUsecase
26
+ from .types.update_campaigns_response import UpdateCampaignsResponse
27
+ from pydantic import ValidationError
28
+
29
+ # this is used as the default value for optional parameters
30
+ OMIT = typing.cast(typing.Any, ...)
31
+
32
+
33
+ class RawCampaignsClient:
34
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
35
+ self._client_wrapper = client_wrapper
36
+
37
+ def list(
38
+ self,
39
+ *,
40
+ name: typing.Optional[str] = None,
41
+ usecase: typing.Optional[str] = None,
42
+ status: typing.Optional[str] = None,
43
+ mock: typing.Optional[bool] = None,
44
+ created_before: typing.Optional[dt.date] = None,
45
+ created_after: typing.Optional[dt.date] = None,
46
+ page: typing.Optional[int] = None,
47
+ per_page: typing.Optional[int] = None,
48
+ request_options: typing.Optional[RequestOptions] = None,
49
+ ) -> HttpResponse[ListCampaignsResponse]:
50
+ """
51
+ Returns a paginated list of 10DLC Campaigns for the authenticated account, filtered by date, status, and use case.
52
+
53
+ Parameters
54
+ ----------
55
+ name : typing.Optional[str]
56
+ Filters Campaigns by name. Matches partial values.
57
+
58
+ usecase : typing.Optional[str]
59
+ Filters Campaigns by use case.
60
+
61
+ status : typing.Optional[str]
62
+ Filters Campaigns by status.
63
+
64
+ mock : typing.Optional[bool]
65
+ When `true`, returns only mock Campaigns used for testing. Default `false`.
66
+
67
+ created_before : typing.Optional[dt.date]
68
+ Returns Campaigns created on or before this date, in `YYYY-MM-DD` format.
69
+
70
+ created_after : typing.Optional[dt.date]
71
+ Returns Campaigns created on or after this date, in `YYYY-MM-DD` format.
72
+
73
+ page : typing.Optional[int]
74
+ Page number to retrieve. Default `1`.
75
+
76
+ per_page : typing.Optional[int]
77
+ Number of records to return per page. Default `25`.
78
+
79
+ request_options : typing.Optional[RequestOptions]
80
+ Request-specific configuration.
81
+
82
+ Returns
83
+ -------
84
+ HttpResponse[ListCampaignsResponse]
85
+ Returns a paginated list of 10DLC Campaigns.
86
+ """
87
+ _response = self._client_wrapper.httpx_client.request(
88
+ "v3/10dlc/brands/campaigns",
89
+ method="GET",
90
+ params={
91
+ "name": name,
92
+ "usecase": usecase,
93
+ "status": status,
94
+ "mock": mock,
95
+ "created_before": str(created_before) if created_before is not None else None,
96
+ "created_after": str(created_after) if created_after is not None else None,
97
+ "page": page,
98
+ "per_page": per_page,
99
+ },
100
+ request_options=request_options,
101
+ )
102
+ try:
103
+ if 200 <= _response.status_code < 300:
104
+ _data = typing.cast(
105
+ ListCampaignsResponse,
106
+ parse_obj_as(
107
+ type_=ListCampaignsResponse, # type: ignore
108
+ object_=_response.json(),
109
+ ),
110
+ )
111
+ return HttpResponse(response=_response, data=_data)
112
+ if _response.status_code == 403:
113
+ raise ForbiddenError(
114
+ headers=dict(_response.headers),
115
+ body=typing.cast(
116
+ typing.Any,
117
+ parse_obj_as(
118
+ type_=typing.Any, # type: ignore
119
+ object_=_response.json(),
120
+ ),
121
+ ),
122
+ )
123
+ _response_json = _response.json()
124
+ except JSONDecodeError:
125
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
126
+ except ValidationError as e:
127
+ raise ParsingError(
128
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
129
+ )
130
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
131
+
132
+ def list_by_brand(
133
+ self,
134
+ brand_id: str,
135
+ *,
136
+ name: typing.Optional[str] = None,
137
+ usecase: typing.Optional[str] = None,
138
+ status: typing.Optional[str] = None,
139
+ mock: typing.Optional[bool] = None,
140
+ created_before: typing.Optional[dt.date] = None,
141
+ created_after: typing.Optional[dt.date] = None,
142
+ page: typing.Optional[int] = None,
143
+ per_page: typing.Optional[int] = None,
144
+ request_options: typing.Optional[RequestOptions] = None,
145
+ ) -> HttpResponse[ListByBrandCampaignsResponse]:
146
+ """
147
+ Returns a paginated list of 10DLC Campaigns associated with the 10DLC Brand identified by `brand_id`.
148
+
149
+ Parameters
150
+ ----------
151
+ brand_id : str
152
+ The unique ID of the 10DLC Brand.
153
+
154
+ name : typing.Optional[str]
155
+ Filters Campaigns by name. Matches partial values.
156
+
157
+ usecase : typing.Optional[str]
158
+ Filters Campaigns by use case.
159
+
160
+ status : typing.Optional[str]
161
+ Filters Campaigns by status.
162
+
163
+ mock : typing.Optional[bool]
164
+ When `true`, returns only mock Campaigns used for testing. Default `false`.
165
+
166
+ created_before : typing.Optional[dt.date]
167
+ Returns Campaigns created on or before this date, in `YYYY-MM-DD` format.
168
+
169
+ created_after : typing.Optional[dt.date]
170
+ Returns Campaigns created on or after this date, in `YYYY-MM-DD` format.
171
+
172
+ page : typing.Optional[int]
173
+ Page number to retrieve. Default `1`.
174
+
175
+ per_page : typing.Optional[int]
176
+ Number of records to return per page. Default `25`.
177
+
178
+ request_options : typing.Optional[RequestOptions]
179
+ Request-specific configuration.
180
+
181
+ Returns
182
+ -------
183
+ HttpResponse[ListByBrandCampaignsResponse]
184
+ Returns a paginated list of 10DLC Campaigns.
185
+ """
186
+ _response = self._client_wrapper.httpx_client.request(
187
+ f"v3/10dlc/brands/{encode_path_param(brand_id)}/campaigns",
188
+ method="GET",
189
+ params={
190
+ "name": name,
191
+ "usecase": usecase,
192
+ "status": status,
193
+ "mock": mock,
194
+ "created_before": str(created_before) if created_before is not None else None,
195
+ "created_after": str(created_after) if created_after is not None else None,
196
+ "page": page,
197
+ "per_page": per_page,
198
+ },
199
+ request_options=request_options,
200
+ )
201
+ try:
202
+ if 200 <= _response.status_code < 300:
203
+ _data = typing.cast(
204
+ ListByBrandCampaignsResponse,
205
+ parse_obj_as(
206
+ type_=ListByBrandCampaignsResponse, # type: ignore
207
+ object_=_response.json(),
208
+ ),
209
+ )
210
+ return HttpResponse(response=_response, data=_data)
211
+ if _response.status_code == 403:
212
+ raise ForbiddenError(
213
+ headers=dict(_response.headers),
214
+ body=typing.cast(
215
+ typing.Any,
216
+ parse_obj_as(
217
+ type_=typing.Any, # type: ignore
218
+ object_=_response.json(),
219
+ ),
220
+ ),
221
+ )
222
+ if _response.status_code == 404:
223
+ raise NotFoundError(
224
+ headers=dict(_response.headers),
225
+ body=typing.cast(
226
+ typing.Any,
227
+ parse_obj_as(
228
+ type_=typing.Any, # type: ignore
229
+ object_=_response.json(),
230
+ ),
231
+ ),
232
+ )
233
+ _response_json = _response.json()
234
+ except JSONDecodeError:
235
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
236
+ except ValidationError as e:
237
+ raise ParsingError(
238
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
239
+ )
240
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
241
+
242
+ def create(
243
+ self,
244
+ brand_id: str,
245
+ *,
246
+ affiliate_marketing: bool,
247
+ age_gated: bool,
248
+ auto_renewal: bool,
249
+ direct_lending: bool,
250
+ embedded_links: bool,
251
+ description: str,
252
+ optin_workflow: str,
253
+ help: bool,
254
+ help_keywords: str,
255
+ help_message: str,
256
+ optin: bool,
257
+ optin_keywords: str,
258
+ optin_message: str,
259
+ optout: bool,
260
+ optout_keywords: str,
261
+ optout_message: str,
262
+ name: str,
263
+ sample1: str,
264
+ mock: bool,
265
+ usecase: str,
266
+ terms_conditions: str,
267
+ embedded_phones: typing.Optional[bool] = OMIT,
268
+ embedded_link_sample: typing.Optional[str] = OMIT,
269
+ sample2: typing.Optional[str] = OMIT,
270
+ sample3: typing.Optional[str] = OMIT,
271
+ sample4: typing.Optional[str] = OMIT,
272
+ sample5: typing.Optional[str] = OMIT,
273
+ privacy_policy: typing.Optional[str] = OMIT,
274
+ request_options: typing.Optional[RequestOptions] = None,
275
+ ) -> HttpResponse[CreateCampaignsResponse]:
276
+ """
277
+ Registers a 10DLC Campaign under the 10DLC Brand identified by `brand_id`. The Brand must have a verified identity status.
278
+
279
+ Parameters
280
+ ----------
281
+ brand_id : str
282
+ The unique ID of the 10DLC Brand.
283
+
284
+ affiliate_marketing : bool
285
+ Indicates whether the Campaign is used for affiliate marketing.
286
+
287
+ age_gated : bool
288
+ Indicates whether the Campaign messages contain age-gated content.
289
+
290
+ auto_renewal : bool
291
+ Indicates whether the Campaign is automatically renewed at the end of each billing period.
292
+
293
+ direct_lending : bool
294
+ Indicates whether the Campaign messages contain direct lending content.
295
+
296
+ embedded_links : bool
297
+ Indicates whether the Campaign messages contain embedded links.
298
+
299
+ description : str
300
+ Description of the Campaign and its messaging purpose.
301
+
302
+ optin_workflow : str
303
+ Description of the workflow through which subscribers opt in to the Campaign.
304
+
305
+ help : bool
306
+ Indicates whether the Campaign provides a help system that subscribers can trigger with a keyword such as HELP or INFO.
307
+
308
+ help_keywords : str
309
+ Comma-separated list of help keywords. Keywords are case-insensitive.
310
+
311
+ help_message : str
312
+ Acknowledgement sent when a subscriber texts a help keyword.
313
+
314
+ optin : bool
315
+ Indicates whether the Campaign requires subscribers to opt in before receiving messages.
316
+
317
+ optin_keywords : str
318
+ Comma-separated list of opt-in keywords. Keywords are case-insensitive.
319
+
320
+ optin_message : str
321
+ Acknowledgement sent when a subscriber texts an opt-in keyword.
322
+
323
+ optout : bool
324
+ Indicates whether the Campaign provides an opt-out system that subscribers can trigger with a keyword such as STOP or QUIT.
325
+
326
+ optout_keywords : str
327
+ Comma-separated list of opt-out keywords. Keywords are case-insensitive.
328
+
329
+ optout_message : str
330
+ Acknowledgement sent when a subscriber texts an opt-out keyword.
331
+
332
+ name : str
333
+ Display name of the Campaign.
334
+
335
+ sample1 : str
336
+ Sample message demonstrating the content sent through the Campaign.
337
+
338
+ mock : bool
339
+ Indicates whether the Campaign is a mock campaign used for testing. Mock campaigns cannot send production traffic.
340
+
341
+ usecase : str
342
+ Registered use case for the Campaign, such as `2FA` or `MARKETING`.
343
+
344
+ terms_conditions : str
345
+ URL of the Campaign terms and conditions.
346
+
347
+ embedded_phones : typing.Optional[bool]
348
+ Indicates whether the Campaign messages contain embedded phone numbers.
349
+
350
+ embedded_link_sample : typing.Optional[str]
351
+ Sample of an embedded link used in Campaign messages.
352
+
353
+ sample2 : typing.Optional[str]
354
+ Sample message demonstrating the content sent through the Campaign.
355
+
356
+ sample3 : typing.Optional[str]
357
+ Sample message demonstrating the content sent through the Campaign.
358
+
359
+ sample4 : typing.Optional[str]
360
+ Sample message demonstrating the content sent through the Campaign.
361
+
362
+ sample5 : typing.Optional[str]
363
+ Sample message demonstrating the content sent through the Campaign.
364
+
365
+ privacy_policy : typing.Optional[str]
366
+ URL of the Campaign privacy policy.
367
+
368
+ request_options : typing.Optional[RequestOptions]
369
+ Request-specific configuration.
370
+
371
+ Returns
372
+ -------
373
+ HttpResponse[CreateCampaignsResponse]
374
+ Returns the registered 10DLC Campaign.
375
+ """
376
+ _response = self._client_wrapper.httpx_client.request(
377
+ f"v3/10dlc/brands/{encode_path_param(brand_id)}/campaigns",
378
+ method="POST",
379
+ json={
380
+ "affiliate_marketing": affiliate_marketing,
381
+ "age_gated": age_gated,
382
+ "auto_renewal": auto_renewal,
383
+ "direct_lending": direct_lending,
384
+ "embedded_links": embedded_links,
385
+ "embedded_phones": embedded_phones,
386
+ "embedded_link_sample": embedded_link_sample,
387
+ "description": description,
388
+ "optin_workflow": optin_workflow,
389
+ "help": help,
390
+ "help_keywords": help_keywords,
391
+ "help_message": help_message,
392
+ "optin": optin,
393
+ "optin_keywords": optin_keywords,
394
+ "optin_message": optin_message,
395
+ "optout": optout,
396
+ "optout_keywords": optout_keywords,
397
+ "optout_message": optout_message,
398
+ "name": name,
399
+ "sample1": sample1,
400
+ "sample2": sample2,
401
+ "sample3": sample3,
402
+ "sample4": sample4,
403
+ "sample5": sample5,
404
+ "mock": mock,
405
+ "usecase": usecase,
406
+ "privacy_policy": privacy_policy,
407
+ "terms_conditions": terms_conditions,
408
+ },
409
+ headers={
410
+ "content-type": "application/json",
411
+ },
412
+ request_options=request_options,
413
+ omit=OMIT,
414
+ )
415
+ try:
416
+ if 200 <= _response.status_code < 300:
417
+ _data = typing.cast(
418
+ CreateCampaignsResponse,
419
+ parse_obj_as(
420
+ type_=CreateCampaignsResponse, # type: ignore
421
+ object_=_response.json(),
422
+ ),
423
+ )
424
+ return HttpResponse(response=_response, data=_data)
425
+ if _response.status_code == 400:
426
+ raise BadRequestError(
427
+ headers=dict(_response.headers),
428
+ body=typing.cast(
429
+ typing.Any,
430
+ parse_obj_as(
431
+ type_=typing.Any, # type: ignore
432
+ object_=_response.json(),
433
+ ),
434
+ ),
435
+ )
436
+ if _response.status_code == 403:
437
+ raise ForbiddenError(
438
+ headers=dict(_response.headers),
439
+ body=typing.cast(
440
+ typing.Any,
441
+ parse_obj_as(
442
+ type_=typing.Any, # type: ignore
443
+ object_=_response.json(),
444
+ ),
445
+ ),
446
+ )
447
+ if _response.status_code == 404:
448
+ raise NotFoundError(
449
+ headers=dict(_response.headers),
450
+ body=typing.cast(
451
+ typing.Any,
452
+ parse_obj_as(
453
+ type_=typing.Any, # type: ignore
454
+ object_=_response.json(),
455
+ ),
456
+ ),
457
+ )
458
+ _response_json = _response.json()
459
+ except JSONDecodeError:
460
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
461
+ except ValidationError as e:
462
+ raise ParsingError(
463
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
464
+ )
465
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
466
+
467
+ def get(
468
+ self, brand_id: str, campaign_id: str, *, request_options: typing.Optional[RequestOptions] = None
469
+ ) -> HttpResponse[GetCampaignsResponse]:
470
+ """
471
+ Returns the 10DLC Campaign identified by `campaign_id` under the Brand identified by `brand_id`.
472
+
473
+ Parameters
474
+ ----------
475
+ brand_id : str
476
+ The unique ID of the 10DLC Brand.
477
+
478
+ campaign_id : str
479
+ The unique ID of the 10DLC Campaign.
480
+
481
+ request_options : typing.Optional[RequestOptions]
482
+ Request-specific configuration.
483
+
484
+ Returns
485
+ -------
486
+ HttpResponse[GetCampaignsResponse]
487
+ Returns the 10DLC Campaign.
488
+ """
489
+ _response = self._client_wrapper.httpx_client.request(
490
+ f"v3/10dlc/brands/{encode_path_param(brand_id)}/campaigns/{encode_path_param(campaign_id)}",
491
+ method="GET",
492
+ request_options=request_options,
493
+ )
494
+ try:
495
+ if 200 <= _response.status_code < 300:
496
+ _data = typing.cast(
497
+ GetCampaignsResponse,
498
+ parse_obj_as(
499
+ type_=GetCampaignsResponse, # type: ignore
500
+ object_=_response.json(),
501
+ ),
502
+ )
503
+ return HttpResponse(response=_response, data=_data)
504
+ if _response.status_code == 403:
505
+ raise ForbiddenError(
506
+ headers=dict(_response.headers),
507
+ body=typing.cast(
508
+ typing.Any,
509
+ parse_obj_as(
510
+ type_=typing.Any, # type: ignore
511
+ object_=_response.json(),
512
+ ),
513
+ ),
514
+ )
515
+ if _response.status_code == 404:
516
+ raise NotFoundError(
517
+ headers=dict(_response.headers),
518
+ body=typing.cast(
519
+ typing.Any,
520
+ parse_obj_as(
521
+ type_=typing.Any, # type: ignore
522
+ object_=_response.json(),
523
+ ),
524
+ ),
525
+ )
526
+ _response_json = _response.json()
527
+ except JSONDecodeError:
528
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
529
+ except ValidationError as e:
530
+ raise ParsingError(
531
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
532
+ )
533
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
534
+
535
+ def update(
536
+ self,
537
+ brand_id: str,
538
+ campaign_id: str,
539
+ *,
540
+ name: typing.Optional[str] = OMIT,
541
+ usecase: typing.Optional[TenDlcCampaignUpdateRequestUsecase] = OMIT,
542
+ description: typing.Optional[str] = OMIT,
543
+ embedded_links: typing.Optional[bool] = OMIT,
544
+ embedded_phones: typing.Optional[bool] = OMIT,
545
+ age_gated: typing.Optional[bool] = OMIT,
546
+ direct_lending: typing.Optional[bool] = OMIT,
547
+ optin: typing.Optional[bool] = OMIT,
548
+ optout: typing.Optional[bool] = OMIT,
549
+ help: typing.Optional[bool] = OMIT,
550
+ sample1: typing.Optional[str] = OMIT,
551
+ sample2: typing.Optional[str] = OMIT,
552
+ sample3: typing.Optional[str] = OMIT,
553
+ sample4: typing.Optional[str] = OMIT,
554
+ sample5: typing.Optional[str] = OMIT,
555
+ optin_workflow: typing.Optional[str] = OMIT,
556
+ help_message: typing.Optional[str] = OMIT,
557
+ optin_message: typing.Optional[str] = OMIT,
558
+ optout_message: typing.Optional[str] = OMIT,
559
+ auto_renewal: typing.Optional[bool] = OMIT,
560
+ optin_keywords: typing.Optional[str] = OMIT,
561
+ help_keywords: typing.Optional[str] = OMIT,
562
+ optout_keywords: typing.Optional[str] = OMIT,
563
+ terms_conditions: typing.Optional[str] = OMIT,
564
+ privacy_policy: typing.Optional[str] = OMIT,
565
+ embedded_link_sample: typing.Optional[str] = OMIT,
566
+ request_options: typing.Optional[RequestOptions] = None,
567
+ ) -> HttpResponse[UpdateCampaignsResponse]:
568
+ """
569
+ Updates the 10DLC Campaign identified by `campaign_id`. Only the provided fields are changed.
570
+
571
+ Parameters
572
+ ----------
573
+ brand_id : str
574
+ The unique ID of the 10DLC Brand.
575
+
576
+ campaign_id : str
577
+ The unique ID of the 10DLC Campaign.
578
+
579
+ name : typing.Optional[str]
580
+ Display name of the Campaign.
581
+
582
+ usecase : typing.Optional[TenDlcCampaignUpdateRequestUsecase]
583
+ Registered use case for the Campaign. One of `CUSTOMER_CARE` (customer support messaging), `MARKETING` (promotional content), `ACCOUNT_NOTIFICATION` (account-related alerts), `FRAUD_ALERT` (fraud and suspicious-activity warnings), `PUBLIC_SERVICE_ANNOUNCEMENT` (public-interest notices), or `SECURITY_ALERT` (security-related warnings).
584
+
585
+ description : typing.Optional[str]
586
+ Description of the Campaign and its messaging purpose.
587
+
588
+ embedded_links : typing.Optional[bool]
589
+ Indicates whether the Campaign messages contain embedded links.
590
+
591
+ embedded_phones : typing.Optional[bool]
592
+ Indicates whether the Campaign messages contain embedded phone numbers.
593
+
594
+ age_gated : typing.Optional[bool]
595
+ Indicates whether the Campaign messages contain age-gated content.
596
+
597
+ direct_lending : typing.Optional[bool]
598
+ Indicates whether the Campaign messages contain direct lending content.
599
+
600
+ optin : typing.Optional[bool]
601
+ Indicates whether the Campaign requires subscribers to opt in before receiving messages.
602
+
603
+ optout : typing.Optional[bool]
604
+ Indicates whether the Campaign provides an opt-out system that subscribers can trigger with a keyword.
605
+
606
+ help : typing.Optional[bool]
607
+ Indicates whether the Campaign provides a help system that subscribers can trigger with a keyword.
608
+
609
+ sample1 : typing.Optional[str]
610
+ Sample message demonstrating the content sent through the Campaign.
611
+
612
+ sample2 : typing.Optional[str]
613
+ Sample message demonstrating the content sent through the Campaign.
614
+
615
+ sample3 : typing.Optional[str]
616
+ Sample message demonstrating the content sent through the Campaign.
617
+
618
+ sample4 : typing.Optional[str]
619
+ Sample message demonstrating the content sent through the Campaign.
620
+
621
+ sample5 : typing.Optional[str]
622
+ Sample message demonstrating the content sent through the Campaign.
623
+
624
+ optin_workflow : typing.Optional[str]
625
+ Description of the workflow through which subscribers opt in to the Campaign.
626
+
627
+ help_message : typing.Optional[str]
628
+ Acknowledgement sent when a subscriber texts a help keyword.
629
+
630
+ optin_message : typing.Optional[str]
631
+ Acknowledgement sent when a subscriber texts an opt-in keyword.
632
+
633
+ optout_message : typing.Optional[str]
634
+ Acknowledgement sent when a subscriber texts an opt-out keyword.
635
+
636
+ auto_renewal : typing.Optional[bool]
637
+ Indicates whether the Campaign is automatically renewed at the end of each billing period.
638
+
639
+ optin_keywords : typing.Optional[str]
640
+ Comma-separated list of opt-in keywords. Keywords are case-insensitive.
641
+
642
+ help_keywords : typing.Optional[str]
643
+ Comma-separated list of help keywords. Keywords are case-insensitive.
644
+
645
+ optout_keywords : typing.Optional[str]
646
+ Comma-separated list of opt-out keywords. Keywords are case-insensitive.
647
+
648
+ terms_conditions : typing.Optional[str]
649
+ URL of the Campaign terms and conditions.
650
+
651
+ privacy_policy : typing.Optional[str]
652
+ URL of the Campaign privacy policy.
653
+
654
+ embedded_link_sample : typing.Optional[str]
655
+ Sample of an embedded link used in Campaign messages.
656
+
657
+ request_options : typing.Optional[RequestOptions]
658
+ Request-specific configuration.
659
+
660
+ Returns
661
+ -------
662
+ HttpResponse[UpdateCampaignsResponse]
663
+ Returns the updated 10DLC Campaign.
664
+ """
665
+ _response = self._client_wrapper.httpx_client.request(
666
+ f"v3/10dlc/brands/{encode_path_param(brand_id)}/campaigns/{encode_path_param(campaign_id)}",
667
+ method="PUT",
668
+ json={
669
+ "name": name,
670
+ "usecase": usecase,
671
+ "description": description,
672
+ "embedded_links": embedded_links,
673
+ "embedded_phones": embedded_phones,
674
+ "age_gated": age_gated,
675
+ "direct_lending": direct_lending,
676
+ "optin": optin,
677
+ "optout": optout,
678
+ "help": help,
679
+ "sample1": sample1,
680
+ "sample2": sample2,
681
+ "sample3": sample3,
682
+ "sample4": sample4,
683
+ "sample5": sample5,
684
+ "optin_workflow": optin_workflow,
685
+ "help_message": help_message,
686
+ "optin_message": optin_message,
687
+ "optout_message": optout_message,
688
+ "auto_renewal": auto_renewal,
689
+ "optin_keywords": optin_keywords,
690
+ "help_keywords": help_keywords,
691
+ "optout_keywords": optout_keywords,
692
+ "terms_conditions": terms_conditions,
693
+ "privacy_policy": privacy_policy,
694
+ "embedded_link_sample": embedded_link_sample,
695
+ },
696
+ headers={
697
+ "content-type": "application/json",
698
+ },
699
+ request_options=request_options,
700
+ omit=OMIT,
701
+ )
702
+ try:
703
+ if 200 <= _response.status_code < 300:
704
+ _data = typing.cast(
705
+ UpdateCampaignsResponse,
706
+ parse_obj_as(
707
+ type_=UpdateCampaignsResponse, # type: ignore
708
+ object_=_response.json(),
709
+ ),
710
+ )
711
+ return HttpResponse(response=_response, data=_data)
712
+ if _response.status_code == 400:
713
+ raise BadRequestError(
714
+ headers=dict(_response.headers),
715
+ body=typing.cast(
716
+ typing.Any,
717
+ parse_obj_as(
718
+ type_=typing.Any, # type: ignore
719
+ object_=_response.json(),
720
+ ),
721
+ ),
722
+ )
723
+ if _response.status_code == 403:
724
+ raise ForbiddenError(
725
+ headers=dict(_response.headers),
726
+ body=typing.cast(
727
+ typing.Any,
728
+ parse_obj_as(
729
+ type_=typing.Any, # type: ignore
730
+ object_=_response.json(),
731
+ ),
732
+ ),
733
+ )
734
+ if _response.status_code == 404:
735
+ raise NotFoundError(
736
+ headers=dict(_response.headers),
737
+ body=typing.cast(
738
+ typing.Any,
739
+ parse_obj_as(
740
+ type_=typing.Any, # type: ignore
741
+ object_=_response.json(),
742
+ ),
743
+ ),
744
+ )
745
+ _response_json = _response.json()
746
+ except JSONDecodeError:
747
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
748
+ except ValidationError as e:
749
+ raise ParsingError(
750
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
751
+ )
752
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
753
+
754
+ def delete(
755
+ self, brand_id: str, campaign_id: str, *, request_options: typing.Optional[RequestOptions] = None
756
+ ) -> HttpResponse[DeleteCampaignsResponse]:
757
+ """
758
+ Deletes a 10DLC Campaign. Associated phone numbers cannot be used as Sender IDs once the Campaign is deleted.
759
+
760
+ Parameters
761
+ ----------
762
+ brand_id : str
763
+ The unique ID of the 10DLC Brand.
764
+
765
+ campaign_id : str
766
+ The unique ID of the 10DLC Campaign.
767
+
768
+ request_options : typing.Optional[RequestOptions]
769
+ Request-specific configuration.
770
+
771
+ Returns
772
+ -------
773
+ HttpResponse[DeleteCampaignsResponse]
774
+ Returns a success confirmation. The 10DLC Campaign is deleted.
775
+ """
776
+ _response = self._client_wrapper.httpx_client.request(
777
+ f"v3/10dlc/brands/{encode_path_param(brand_id)}/campaigns/{encode_path_param(campaign_id)}",
778
+ method="DELETE",
779
+ request_options=request_options,
780
+ )
781
+ try:
782
+ if 200 <= _response.status_code < 300:
783
+ _data = typing.cast(
784
+ DeleteCampaignsResponse,
785
+ parse_obj_as(
786
+ type_=DeleteCampaignsResponse, # type: ignore
787
+ object_=_response.json(),
788
+ ),
789
+ )
790
+ return HttpResponse(response=_response, data=_data)
791
+ if _response.status_code == 403:
792
+ raise ForbiddenError(
793
+ headers=dict(_response.headers),
794
+ body=typing.cast(
795
+ typing.Any,
796
+ parse_obj_as(
797
+ type_=typing.Any, # type: ignore
798
+ object_=_response.json(),
799
+ ),
800
+ ),
801
+ )
802
+ if _response.status_code == 404:
803
+ raise NotFoundError(
804
+ headers=dict(_response.headers),
805
+ body=typing.cast(
806
+ typing.Any,
807
+ parse_obj_as(
808
+ type_=typing.Any, # type: ignore
809
+ object_=_response.json(),
810
+ ),
811
+ ),
812
+ )
813
+ _response_json = _response.json()
814
+ except JSONDecodeError:
815
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
816
+ except ValidationError as e:
817
+ raise ParsingError(
818
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
819
+ )
820
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
821
+
822
+ def nudge(
823
+ self,
824
+ brand_id: str,
825
+ campaign_id: str,
826
+ *,
827
+ nudge_intent: str,
828
+ description: str,
829
+ request_options: typing.Optional[RequestOptions] = None,
830
+ ) -> HttpResponse[SuccessResponse]:
831
+ """
832
+ Requests action on a pending or rejected 10DLC Campaign. Use `nudge_intent` to specify the action:
833
+ - `REVIEW`: Request review for a pending Campaign. - `APPEAL_REJECTION`: Appeal a rejected Campaign.
834
+ Note:
835
+ - The Campaign must be at least 72 hours old.
836
+ - Only one nudge request per Campaign is allowed every 24 hours.
837
+
838
+ Parameters
839
+ ----------
840
+ brand_id : str
841
+ The unique ID of the 10DLC Brand.
842
+
843
+ campaign_id : str
844
+ The unique ID of the 10DLC Campaign.
845
+
846
+ nudge_intent : str
847
+ Nudge intent. Allowed values: `REVIEW`, `APPEAL_REJECTION`.
848
+ Use `nudge_intent` to specify the action: - `REVIEW`: Request review for a pending Campaign. - `APPEAL_REJECTION`: Appeal a rejected Campaign.
849
+
850
+ description : str
851
+ Description of the nudge request.
852
+
853
+ request_options : typing.Optional[RequestOptions]
854
+ Request-specific configuration.
855
+
856
+ Returns
857
+ -------
858
+ HttpResponse[SuccessResponse]
859
+ Returns a success confirmation. The nudge request is submitted.
860
+ """
861
+ _response = self._client_wrapper.httpx_client.request(
862
+ f"v3/10dlc/brands/{encode_path_param(brand_id)}/campaigns/{encode_path_param(campaign_id)}/nudge",
863
+ method="POST",
864
+ json={
865
+ "nudge_intent": nudge_intent,
866
+ "description": description,
867
+ },
868
+ headers={
869
+ "content-type": "application/json",
870
+ },
871
+ request_options=request_options,
872
+ omit=OMIT,
873
+ )
874
+ try:
875
+ if 200 <= _response.status_code < 300:
876
+ _data = typing.cast(
877
+ SuccessResponse,
878
+ parse_obj_as(
879
+ type_=SuccessResponse, # type: ignore
880
+ object_=_response.json(),
881
+ ),
882
+ )
883
+ return HttpResponse(response=_response, data=_data)
884
+ if _response.status_code == 400:
885
+ raise BadRequestError(
886
+ headers=dict(_response.headers),
887
+ body=typing.cast(
888
+ typing.Any,
889
+ parse_obj_as(
890
+ type_=typing.Any, # type: ignore
891
+ object_=_response.json(),
892
+ ),
893
+ ),
894
+ )
895
+ if _response.status_code == 403:
896
+ raise ForbiddenError(
897
+ headers=dict(_response.headers),
898
+ body=typing.cast(
899
+ typing.Any,
900
+ parse_obj_as(
901
+ type_=typing.Any, # type: ignore
902
+ object_=_response.json(),
903
+ ),
904
+ ),
905
+ )
906
+ if _response.status_code == 404:
907
+ raise NotFoundError(
908
+ headers=dict(_response.headers),
909
+ body=typing.cast(
910
+ typing.Any,
911
+ parse_obj_as(
912
+ type_=typing.Any, # type: ignore
913
+ object_=_response.json(),
914
+ ),
915
+ ),
916
+ )
917
+ if _response.status_code == 429:
918
+ raise TooManyRequestsError(
919
+ headers=dict(_response.headers),
920
+ body=typing.cast(
921
+ ValidationErrorResponse,
922
+ parse_obj_as(
923
+ type_=ValidationErrorResponse, # type: ignore
924
+ object_=_response.json(),
925
+ ),
926
+ ),
927
+ )
928
+ _response_json = _response.json()
929
+ except JSONDecodeError:
930
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
931
+ except ValidationError as e:
932
+ raise ParsingError(
933
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
934
+ )
935
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
936
+
937
+
938
+ class AsyncRawCampaignsClient:
939
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
940
+ self._client_wrapper = client_wrapper
941
+
942
+ async def list(
943
+ self,
944
+ *,
945
+ name: typing.Optional[str] = None,
946
+ usecase: typing.Optional[str] = None,
947
+ status: typing.Optional[str] = None,
948
+ mock: typing.Optional[bool] = None,
949
+ created_before: typing.Optional[dt.date] = None,
950
+ created_after: typing.Optional[dt.date] = None,
951
+ page: typing.Optional[int] = None,
952
+ per_page: typing.Optional[int] = None,
953
+ request_options: typing.Optional[RequestOptions] = None,
954
+ ) -> AsyncHttpResponse[ListCampaignsResponse]:
955
+ """
956
+ Returns a paginated list of 10DLC Campaigns for the authenticated account, filtered by date, status, and use case.
957
+
958
+ Parameters
959
+ ----------
960
+ name : typing.Optional[str]
961
+ Filters Campaigns by name. Matches partial values.
962
+
963
+ usecase : typing.Optional[str]
964
+ Filters Campaigns by use case.
965
+
966
+ status : typing.Optional[str]
967
+ Filters Campaigns by status.
968
+
969
+ mock : typing.Optional[bool]
970
+ When `true`, returns only mock Campaigns used for testing. Default `false`.
971
+
972
+ created_before : typing.Optional[dt.date]
973
+ Returns Campaigns created on or before this date, in `YYYY-MM-DD` format.
974
+
975
+ created_after : typing.Optional[dt.date]
976
+ Returns Campaigns created on or after this date, in `YYYY-MM-DD` format.
977
+
978
+ page : typing.Optional[int]
979
+ Page number to retrieve. Default `1`.
980
+
981
+ per_page : typing.Optional[int]
982
+ Number of records to return per page. Default `25`.
983
+
984
+ request_options : typing.Optional[RequestOptions]
985
+ Request-specific configuration.
986
+
987
+ Returns
988
+ -------
989
+ AsyncHttpResponse[ListCampaignsResponse]
990
+ Returns a paginated list of 10DLC Campaigns.
991
+ """
992
+ _response = await self._client_wrapper.httpx_client.request(
993
+ "v3/10dlc/brands/campaigns",
994
+ method="GET",
995
+ params={
996
+ "name": name,
997
+ "usecase": usecase,
998
+ "status": status,
999
+ "mock": mock,
1000
+ "created_before": str(created_before) if created_before is not None else None,
1001
+ "created_after": str(created_after) if created_after is not None else None,
1002
+ "page": page,
1003
+ "per_page": per_page,
1004
+ },
1005
+ request_options=request_options,
1006
+ )
1007
+ try:
1008
+ if 200 <= _response.status_code < 300:
1009
+ _data = typing.cast(
1010
+ ListCampaignsResponse,
1011
+ parse_obj_as(
1012
+ type_=ListCampaignsResponse, # type: ignore
1013
+ object_=_response.json(),
1014
+ ),
1015
+ )
1016
+ return AsyncHttpResponse(response=_response, data=_data)
1017
+ if _response.status_code == 403:
1018
+ raise ForbiddenError(
1019
+ headers=dict(_response.headers),
1020
+ body=typing.cast(
1021
+ typing.Any,
1022
+ parse_obj_as(
1023
+ type_=typing.Any, # type: ignore
1024
+ object_=_response.json(),
1025
+ ),
1026
+ ),
1027
+ )
1028
+ _response_json = _response.json()
1029
+ except JSONDecodeError:
1030
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1031
+ except ValidationError as e:
1032
+ raise ParsingError(
1033
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
1034
+ )
1035
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1036
+
1037
+ async def list_by_brand(
1038
+ self,
1039
+ brand_id: str,
1040
+ *,
1041
+ name: typing.Optional[str] = None,
1042
+ usecase: typing.Optional[str] = None,
1043
+ status: typing.Optional[str] = None,
1044
+ mock: typing.Optional[bool] = None,
1045
+ created_before: typing.Optional[dt.date] = None,
1046
+ created_after: typing.Optional[dt.date] = None,
1047
+ page: typing.Optional[int] = None,
1048
+ per_page: typing.Optional[int] = None,
1049
+ request_options: typing.Optional[RequestOptions] = None,
1050
+ ) -> AsyncHttpResponse[ListByBrandCampaignsResponse]:
1051
+ """
1052
+ Returns a paginated list of 10DLC Campaigns associated with the 10DLC Brand identified by `brand_id`.
1053
+
1054
+ Parameters
1055
+ ----------
1056
+ brand_id : str
1057
+ The unique ID of the 10DLC Brand.
1058
+
1059
+ name : typing.Optional[str]
1060
+ Filters Campaigns by name. Matches partial values.
1061
+
1062
+ usecase : typing.Optional[str]
1063
+ Filters Campaigns by use case.
1064
+
1065
+ status : typing.Optional[str]
1066
+ Filters Campaigns by status.
1067
+
1068
+ mock : typing.Optional[bool]
1069
+ When `true`, returns only mock Campaigns used for testing. Default `false`.
1070
+
1071
+ created_before : typing.Optional[dt.date]
1072
+ Returns Campaigns created on or before this date, in `YYYY-MM-DD` format.
1073
+
1074
+ created_after : typing.Optional[dt.date]
1075
+ Returns Campaigns created on or after this date, in `YYYY-MM-DD` format.
1076
+
1077
+ page : typing.Optional[int]
1078
+ Page number to retrieve. Default `1`.
1079
+
1080
+ per_page : typing.Optional[int]
1081
+ Number of records to return per page. Default `25`.
1082
+
1083
+ request_options : typing.Optional[RequestOptions]
1084
+ Request-specific configuration.
1085
+
1086
+ Returns
1087
+ -------
1088
+ AsyncHttpResponse[ListByBrandCampaignsResponse]
1089
+ Returns a paginated list of 10DLC Campaigns.
1090
+ """
1091
+ _response = await self._client_wrapper.httpx_client.request(
1092
+ f"v3/10dlc/brands/{encode_path_param(brand_id)}/campaigns",
1093
+ method="GET",
1094
+ params={
1095
+ "name": name,
1096
+ "usecase": usecase,
1097
+ "status": status,
1098
+ "mock": mock,
1099
+ "created_before": str(created_before) if created_before is not None else None,
1100
+ "created_after": str(created_after) if created_after is not None else None,
1101
+ "page": page,
1102
+ "per_page": per_page,
1103
+ },
1104
+ request_options=request_options,
1105
+ )
1106
+ try:
1107
+ if 200 <= _response.status_code < 300:
1108
+ _data = typing.cast(
1109
+ ListByBrandCampaignsResponse,
1110
+ parse_obj_as(
1111
+ type_=ListByBrandCampaignsResponse, # type: ignore
1112
+ object_=_response.json(),
1113
+ ),
1114
+ )
1115
+ return AsyncHttpResponse(response=_response, data=_data)
1116
+ if _response.status_code == 403:
1117
+ raise ForbiddenError(
1118
+ headers=dict(_response.headers),
1119
+ body=typing.cast(
1120
+ typing.Any,
1121
+ parse_obj_as(
1122
+ type_=typing.Any, # type: ignore
1123
+ object_=_response.json(),
1124
+ ),
1125
+ ),
1126
+ )
1127
+ if _response.status_code == 404:
1128
+ raise NotFoundError(
1129
+ headers=dict(_response.headers),
1130
+ body=typing.cast(
1131
+ typing.Any,
1132
+ parse_obj_as(
1133
+ type_=typing.Any, # type: ignore
1134
+ object_=_response.json(),
1135
+ ),
1136
+ ),
1137
+ )
1138
+ _response_json = _response.json()
1139
+ except JSONDecodeError:
1140
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1141
+ except ValidationError as e:
1142
+ raise ParsingError(
1143
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
1144
+ )
1145
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1146
+
1147
+ async def create(
1148
+ self,
1149
+ brand_id: str,
1150
+ *,
1151
+ affiliate_marketing: bool,
1152
+ age_gated: bool,
1153
+ auto_renewal: bool,
1154
+ direct_lending: bool,
1155
+ embedded_links: bool,
1156
+ description: str,
1157
+ optin_workflow: str,
1158
+ help: bool,
1159
+ help_keywords: str,
1160
+ help_message: str,
1161
+ optin: bool,
1162
+ optin_keywords: str,
1163
+ optin_message: str,
1164
+ optout: bool,
1165
+ optout_keywords: str,
1166
+ optout_message: str,
1167
+ name: str,
1168
+ sample1: str,
1169
+ mock: bool,
1170
+ usecase: str,
1171
+ terms_conditions: str,
1172
+ embedded_phones: typing.Optional[bool] = OMIT,
1173
+ embedded_link_sample: typing.Optional[str] = OMIT,
1174
+ sample2: typing.Optional[str] = OMIT,
1175
+ sample3: typing.Optional[str] = OMIT,
1176
+ sample4: typing.Optional[str] = OMIT,
1177
+ sample5: typing.Optional[str] = OMIT,
1178
+ privacy_policy: typing.Optional[str] = OMIT,
1179
+ request_options: typing.Optional[RequestOptions] = None,
1180
+ ) -> AsyncHttpResponse[CreateCampaignsResponse]:
1181
+ """
1182
+ Registers a 10DLC Campaign under the 10DLC Brand identified by `brand_id`. The Brand must have a verified identity status.
1183
+
1184
+ Parameters
1185
+ ----------
1186
+ brand_id : str
1187
+ The unique ID of the 10DLC Brand.
1188
+
1189
+ affiliate_marketing : bool
1190
+ Indicates whether the Campaign is used for affiliate marketing.
1191
+
1192
+ age_gated : bool
1193
+ Indicates whether the Campaign messages contain age-gated content.
1194
+
1195
+ auto_renewal : bool
1196
+ Indicates whether the Campaign is automatically renewed at the end of each billing period.
1197
+
1198
+ direct_lending : bool
1199
+ Indicates whether the Campaign messages contain direct lending content.
1200
+
1201
+ embedded_links : bool
1202
+ Indicates whether the Campaign messages contain embedded links.
1203
+
1204
+ description : str
1205
+ Description of the Campaign and its messaging purpose.
1206
+
1207
+ optin_workflow : str
1208
+ Description of the workflow through which subscribers opt in to the Campaign.
1209
+
1210
+ help : bool
1211
+ Indicates whether the Campaign provides a help system that subscribers can trigger with a keyword such as HELP or INFO.
1212
+
1213
+ help_keywords : str
1214
+ Comma-separated list of help keywords. Keywords are case-insensitive.
1215
+
1216
+ help_message : str
1217
+ Acknowledgement sent when a subscriber texts a help keyword.
1218
+
1219
+ optin : bool
1220
+ Indicates whether the Campaign requires subscribers to opt in before receiving messages.
1221
+
1222
+ optin_keywords : str
1223
+ Comma-separated list of opt-in keywords. Keywords are case-insensitive.
1224
+
1225
+ optin_message : str
1226
+ Acknowledgement sent when a subscriber texts an opt-in keyword.
1227
+
1228
+ optout : bool
1229
+ Indicates whether the Campaign provides an opt-out system that subscribers can trigger with a keyword such as STOP or QUIT.
1230
+
1231
+ optout_keywords : str
1232
+ Comma-separated list of opt-out keywords. Keywords are case-insensitive.
1233
+
1234
+ optout_message : str
1235
+ Acknowledgement sent when a subscriber texts an opt-out keyword.
1236
+
1237
+ name : str
1238
+ Display name of the Campaign.
1239
+
1240
+ sample1 : str
1241
+ Sample message demonstrating the content sent through the Campaign.
1242
+
1243
+ mock : bool
1244
+ Indicates whether the Campaign is a mock campaign used for testing. Mock campaigns cannot send production traffic.
1245
+
1246
+ usecase : str
1247
+ Registered use case for the Campaign, such as `2FA` or `MARKETING`.
1248
+
1249
+ terms_conditions : str
1250
+ URL of the Campaign terms and conditions.
1251
+
1252
+ embedded_phones : typing.Optional[bool]
1253
+ Indicates whether the Campaign messages contain embedded phone numbers.
1254
+
1255
+ embedded_link_sample : typing.Optional[str]
1256
+ Sample of an embedded link used in Campaign messages.
1257
+
1258
+ sample2 : typing.Optional[str]
1259
+ Sample message demonstrating the content sent through the Campaign.
1260
+
1261
+ sample3 : typing.Optional[str]
1262
+ Sample message demonstrating the content sent through the Campaign.
1263
+
1264
+ sample4 : typing.Optional[str]
1265
+ Sample message demonstrating the content sent through the Campaign.
1266
+
1267
+ sample5 : typing.Optional[str]
1268
+ Sample message demonstrating the content sent through the Campaign.
1269
+
1270
+ privacy_policy : typing.Optional[str]
1271
+ URL of the Campaign privacy policy.
1272
+
1273
+ request_options : typing.Optional[RequestOptions]
1274
+ Request-specific configuration.
1275
+
1276
+ Returns
1277
+ -------
1278
+ AsyncHttpResponse[CreateCampaignsResponse]
1279
+ Returns the registered 10DLC Campaign.
1280
+ """
1281
+ _response = await self._client_wrapper.httpx_client.request(
1282
+ f"v3/10dlc/brands/{encode_path_param(brand_id)}/campaigns",
1283
+ method="POST",
1284
+ json={
1285
+ "affiliate_marketing": affiliate_marketing,
1286
+ "age_gated": age_gated,
1287
+ "auto_renewal": auto_renewal,
1288
+ "direct_lending": direct_lending,
1289
+ "embedded_links": embedded_links,
1290
+ "embedded_phones": embedded_phones,
1291
+ "embedded_link_sample": embedded_link_sample,
1292
+ "description": description,
1293
+ "optin_workflow": optin_workflow,
1294
+ "help": help,
1295
+ "help_keywords": help_keywords,
1296
+ "help_message": help_message,
1297
+ "optin": optin,
1298
+ "optin_keywords": optin_keywords,
1299
+ "optin_message": optin_message,
1300
+ "optout": optout,
1301
+ "optout_keywords": optout_keywords,
1302
+ "optout_message": optout_message,
1303
+ "name": name,
1304
+ "sample1": sample1,
1305
+ "sample2": sample2,
1306
+ "sample3": sample3,
1307
+ "sample4": sample4,
1308
+ "sample5": sample5,
1309
+ "mock": mock,
1310
+ "usecase": usecase,
1311
+ "privacy_policy": privacy_policy,
1312
+ "terms_conditions": terms_conditions,
1313
+ },
1314
+ headers={
1315
+ "content-type": "application/json",
1316
+ },
1317
+ request_options=request_options,
1318
+ omit=OMIT,
1319
+ )
1320
+ try:
1321
+ if 200 <= _response.status_code < 300:
1322
+ _data = typing.cast(
1323
+ CreateCampaignsResponse,
1324
+ parse_obj_as(
1325
+ type_=CreateCampaignsResponse, # type: ignore
1326
+ object_=_response.json(),
1327
+ ),
1328
+ )
1329
+ return AsyncHttpResponse(response=_response, data=_data)
1330
+ if _response.status_code == 400:
1331
+ raise BadRequestError(
1332
+ headers=dict(_response.headers),
1333
+ body=typing.cast(
1334
+ typing.Any,
1335
+ parse_obj_as(
1336
+ type_=typing.Any, # type: ignore
1337
+ object_=_response.json(),
1338
+ ),
1339
+ ),
1340
+ )
1341
+ if _response.status_code == 403:
1342
+ raise ForbiddenError(
1343
+ headers=dict(_response.headers),
1344
+ body=typing.cast(
1345
+ typing.Any,
1346
+ parse_obj_as(
1347
+ type_=typing.Any, # type: ignore
1348
+ object_=_response.json(),
1349
+ ),
1350
+ ),
1351
+ )
1352
+ if _response.status_code == 404:
1353
+ raise NotFoundError(
1354
+ headers=dict(_response.headers),
1355
+ body=typing.cast(
1356
+ typing.Any,
1357
+ parse_obj_as(
1358
+ type_=typing.Any, # type: ignore
1359
+ object_=_response.json(),
1360
+ ),
1361
+ ),
1362
+ )
1363
+ _response_json = _response.json()
1364
+ except JSONDecodeError:
1365
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1366
+ except ValidationError as e:
1367
+ raise ParsingError(
1368
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
1369
+ )
1370
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1371
+
1372
+ async def get(
1373
+ self, brand_id: str, campaign_id: str, *, request_options: typing.Optional[RequestOptions] = None
1374
+ ) -> AsyncHttpResponse[GetCampaignsResponse]:
1375
+ """
1376
+ Returns the 10DLC Campaign identified by `campaign_id` under the Brand identified by `brand_id`.
1377
+
1378
+ Parameters
1379
+ ----------
1380
+ brand_id : str
1381
+ The unique ID of the 10DLC Brand.
1382
+
1383
+ campaign_id : str
1384
+ The unique ID of the 10DLC Campaign.
1385
+
1386
+ request_options : typing.Optional[RequestOptions]
1387
+ Request-specific configuration.
1388
+
1389
+ Returns
1390
+ -------
1391
+ AsyncHttpResponse[GetCampaignsResponse]
1392
+ Returns the 10DLC Campaign.
1393
+ """
1394
+ _response = await self._client_wrapper.httpx_client.request(
1395
+ f"v3/10dlc/brands/{encode_path_param(brand_id)}/campaigns/{encode_path_param(campaign_id)}",
1396
+ method="GET",
1397
+ request_options=request_options,
1398
+ )
1399
+ try:
1400
+ if 200 <= _response.status_code < 300:
1401
+ _data = typing.cast(
1402
+ GetCampaignsResponse,
1403
+ parse_obj_as(
1404
+ type_=GetCampaignsResponse, # type: ignore
1405
+ object_=_response.json(),
1406
+ ),
1407
+ )
1408
+ return AsyncHttpResponse(response=_response, data=_data)
1409
+ if _response.status_code == 403:
1410
+ raise ForbiddenError(
1411
+ headers=dict(_response.headers),
1412
+ body=typing.cast(
1413
+ typing.Any,
1414
+ parse_obj_as(
1415
+ type_=typing.Any, # type: ignore
1416
+ object_=_response.json(),
1417
+ ),
1418
+ ),
1419
+ )
1420
+ if _response.status_code == 404:
1421
+ raise NotFoundError(
1422
+ headers=dict(_response.headers),
1423
+ body=typing.cast(
1424
+ typing.Any,
1425
+ parse_obj_as(
1426
+ type_=typing.Any, # type: ignore
1427
+ object_=_response.json(),
1428
+ ),
1429
+ ),
1430
+ )
1431
+ _response_json = _response.json()
1432
+ except JSONDecodeError:
1433
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1434
+ except ValidationError as e:
1435
+ raise ParsingError(
1436
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
1437
+ )
1438
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1439
+
1440
+ async def update(
1441
+ self,
1442
+ brand_id: str,
1443
+ campaign_id: str,
1444
+ *,
1445
+ name: typing.Optional[str] = OMIT,
1446
+ usecase: typing.Optional[TenDlcCampaignUpdateRequestUsecase] = OMIT,
1447
+ description: typing.Optional[str] = OMIT,
1448
+ embedded_links: typing.Optional[bool] = OMIT,
1449
+ embedded_phones: typing.Optional[bool] = OMIT,
1450
+ age_gated: typing.Optional[bool] = OMIT,
1451
+ direct_lending: typing.Optional[bool] = OMIT,
1452
+ optin: typing.Optional[bool] = OMIT,
1453
+ optout: typing.Optional[bool] = OMIT,
1454
+ help: typing.Optional[bool] = OMIT,
1455
+ sample1: typing.Optional[str] = OMIT,
1456
+ sample2: typing.Optional[str] = OMIT,
1457
+ sample3: typing.Optional[str] = OMIT,
1458
+ sample4: typing.Optional[str] = OMIT,
1459
+ sample5: typing.Optional[str] = OMIT,
1460
+ optin_workflow: typing.Optional[str] = OMIT,
1461
+ help_message: typing.Optional[str] = OMIT,
1462
+ optin_message: typing.Optional[str] = OMIT,
1463
+ optout_message: typing.Optional[str] = OMIT,
1464
+ auto_renewal: typing.Optional[bool] = OMIT,
1465
+ optin_keywords: typing.Optional[str] = OMIT,
1466
+ help_keywords: typing.Optional[str] = OMIT,
1467
+ optout_keywords: typing.Optional[str] = OMIT,
1468
+ terms_conditions: typing.Optional[str] = OMIT,
1469
+ privacy_policy: typing.Optional[str] = OMIT,
1470
+ embedded_link_sample: typing.Optional[str] = OMIT,
1471
+ request_options: typing.Optional[RequestOptions] = None,
1472
+ ) -> AsyncHttpResponse[UpdateCampaignsResponse]:
1473
+ """
1474
+ Updates the 10DLC Campaign identified by `campaign_id`. Only the provided fields are changed.
1475
+
1476
+ Parameters
1477
+ ----------
1478
+ brand_id : str
1479
+ The unique ID of the 10DLC Brand.
1480
+
1481
+ campaign_id : str
1482
+ The unique ID of the 10DLC Campaign.
1483
+
1484
+ name : typing.Optional[str]
1485
+ Display name of the Campaign.
1486
+
1487
+ usecase : typing.Optional[TenDlcCampaignUpdateRequestUsecase]
1488
+ Registered use case for the Campaign. One of `CUSTOMER_CARE` (customer support messaging), `MARKETING` (promotional content), `ACCOUNT_NOTIFICATION` (account-related alerts), `FRAUD_ALERT` (fraud and suspicious-activity warnings), `PUBLIC_SERVICE_ANNOUNCEMENT` (public-interest notices), or `SECURITY_ALERT` (security-related warnings).
1489
+
1490
+ description : typing.Optional[str]
1491
+ Description of the Campaign and its messaging purpose.
1492
+
1493
+ embedded_links : typing.Optional[bool]
1494
+ Indicates whether the Campaign messages contain embedded links.
1495
+
1496
+ embedded_phones : typing.Optional[bool]
1497
+ Indicates whether the Campaign messages contain embedded phone numbers.
1498
+
1499
+ age_gated : typing.Optional[bool]
1500
+ Indicates whether the Campaign messages contain age-gated content.
1501
+
1502
+ direct_lending : typing.Optional[bool]
1503
+ Indicates whether the Campaign messages contain direct lending content.
1504
+
1505
+ optin : typing.Optional[bool]
1506
+ Indicates whether the Campaign requires subscribers to opt in before receiving messages.
1507
+
1508
+ optout : typing.Optional[bool]
1509
+ Indicates whether the Campaign provides an opt-out system that subscribers can trigger with a keyword.
1510
+
1511
+ help : typing.Optional[bool]
1512
+ Indicates whether the Campaign provides a help system that subscribers can trigger with a keyword.
1513
+
1514
+ sample1 : typing.Optional[str]
1515
+ Sample message demonstrating the content sent through the Campaign.
1516
+
1517
+ sample2 : typing.Optional[str]
1518
+ Sample message demonstrating the content sent through the Campaign.
1519
+
1520
+ sample3 : typing.Optional[str]
1521
+ Sample message demonstrating the content sent through the Campaign.
1522
+
1523
+ sample4 : typing.Optional[str]
1524
+ Sample message demonstrating the content sent through the Campaign.
1525
+
1526
+ sample5 : typing.Optional[str]
1527
+ Sample message demonstrating the content sent through the Campaign.
1528
+
1529
+ optin_workflow : typing.Optional[str]
1530
+ Description of the workflow through which subscribers opt in to the Campaign.
1531
+
1532
+ help_message : typing.Optional[str]
1533
+ Acknowledgement sent when a subscriber texts a help keyword.
1534
+
1535
+ optin_message : typing.Optional[str]
1536
+ Acknowledgement sent when a subscriber texts an opt-in keyword.
1537
+
1538
+ optout_message : typing.Optional[str]
1539
+ Acknowledgement sent when a subscriber texts an opt-out keyword.
1540
+
1541
+ auto_renewal : typing.Optional[bool]
1542
+ Indicates whether the Campaign is automatically renewed at the end of each billing period.
1543
+
1544
+ optin_keywords : typing.Optional[str]
1545
+ Comma-separated list of opt-in keywords. Keywords are case-insensitive.
1546
+
1547
+ help_keywords : typing.Optional[str]
1548
+ Comma-separated list of help keywords. Keywords are case-insensitive.
1549
+
1550
+ optout_keywords : typing.Optional[str]
1551
+ Comma-separated list of opt-out keywords. Keywords are case-insensitive.
1552
+
1553
+ terms_conditions : typing.Optional[str]
1554
+ URL of the Campaign terms and conditions.
1555
+
1556
+ privacy_policy : typing.Optional[str]
1557
+ URL of the Campaign privacy policy.
1558
+
1559
+ embedded_link_sample : typing.Optional[str]
1560
+ Sample of an embedded link used in Campaign messages.
1561
+
1562
+ request_options : typing.Optional[RequestOptions]
1563
+ Request-specific configuration.
1564
+
1565
+ Returns
1566
+ -------
1567
+ AsyncHttpResponse[UpdateCampaignsResponse]
1568
+ Returns the updated 10DLC Campaign.
1569
+ """
1570
+ _response = await self._client_wrapper.httpx_client.request(
1571
+ f"v3/10dlc/brands/{encode_path_param(brand_id)}/campaigns/{encode_path_param(campaign_id)}",
1572
+ method="PUT",
1573
+ json={
1574
+ "name": name,
1575
+ "usecase": usecase,
1576
+ "description": description,
1577
+ "embedded_links": embedded_links,
1578
+ "embedded_phones": embedded_phones,
1579
+ "age_gated": age_gated,
1580
+ "direct_lending": direct_lending,
1581
+ "optin": optin,
1582
+ "optout": optout,
1583
+ "help": help,
1584
+ "sample1": sample1,
1585
+ "sample2": sample2,
1586
+ "sample3": sample3,
1587
+ "sample4": sample4,
1588
+ "sample5": sample5,
1589
+ "optin_workflow": optin_workflow,
1590
+ "help_message": help_message,
1591
+ "optin_message": optin_message,
1592
+ "optout_message": optout_message,
1593
+ "auto_renewal": auto_renewal,
1594
+ "optin_keywords": optin_keywords,
1595
+ "help_keywords": help_keywords,
1596
+ "optout_keywords": optout_keywords,
1597
+ "terms_conditions": terms_conditions,
1598
+ "privacy_policy": privacy_policy,
1599
+ "embedded_link_sample": embedded_link_sample,
1600
+ },
1601
+ headers={
1602
+ "content-type": "application/json",
1603
+ },
1604
+ request_options=request_options,
1605
+ omit=OMIT,
1606
+ )
1607
+ try:
1608
+ if 200 <= _response.status_code < 300:
1609
+ _data = typing.cast(
1610
+ UpdateCampaignsResponse,
1611
+ parse_obj_as(
1612
+ type_=UpdateCampaignsResponse, # type: ignore
1613
+ object_=_response.json(),
1614
+ ),
1615
+ )
1616
+ return AsyncHttpResponse(response=_response, data=_data)
1617
+ if _response.status_code == 400:
1618
+ raise BadRequestError(
1619
+ headers=dict(_response.headers),
1620
+ body=typing.cast(
1621
+ typing.Any,
1622
+ parse_obj_as(
1623
+ type_=typing.Any, # type: ignore
1624
+ object_=_response.json(),
1625
+ ),
1626
+ ),
1627
+ )
1628
+ if _response.status_code == 403:
1629
+ raise ForbiddenError(
1630
+ headers=dict(_response.headers),
1631
+ body=typing.cast(
1632
+ typing.Any,
1633
+ parse_obj_as(
1634
+ type_=typing.Any, # type: ignore
1635
+ object_=_response.json(),
1636
+ ),
1637
+ ),
1638
+ )
1639
+ if _response.status_code == 404:
1640
+ raise NotFoundError(
1641
+ headers=dict(_response.headers),
1642
+ body=typing.cast(
1643
+ typing.Any,
1644
+ parse_obj_as(
1645
+ type_=typing.Any, # type: ignore
1646
+ object_=_response.json(),
1647
+ ),
1648
+ ),
1649
+ )
1650
+ _response_json = _response.json()
1651
+ except JSONDecodeError:
1652
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1653
+ except ValidationError as e:
1654
+ raise ParsingError(
1655
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
1656
+ )
1657
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1658
+
1659
+ async def delete(
1660
+ self, brand_id: str, campaign_id: str, *, request_options: typing.Optional[RequestOptions] = None
1661
+ ) -> AsyncHttpResponse[DeleteCampaignsResponse]:
1662
+ """
1663
+ Deletes a 10DLC Campaign. Associated phone numbers cannot be used as Sender IDs once the Campaign is deleted.
1664
+
1665
+ Parameters
1666
+ ----------
1667
+ brand_id : str
1668
+ The unique ID of the 10DLC Brand.
1669
+
1670
+ campaign_id : str
1671
+ The unique ID of the 10DLC Campaign.
1672
+
1673
+ request_options : typing.Optional[RequestOptions]
1674
+ Request-specific configuration.
1675
+
1676
+ Returns
1677
+ -------
1678
+ AsyncHttpResponse[DeleteCampaignsResponse]
1679
+ Returns a success confirmation. The 10DLC Campaign is deleted.
1680
+ """
1681
+ _response = await self._client_wrapper.httpx_client.request(
1682
+ f"v3/10dlc/brands/{encode_path_param(brand_id)}/campaigns/{encode_path_param(campaign_id)}",
1683
+ method="DELETE",
1684
+ request_options=request_options,
1685
+ )
1686
+ try:
1687
+ if 200 <= _response.status_code < 300:
1688
+ _data = typing.cast(
1689
+ DeleteCampaignsResponse,
1690
+ parse_obj_as(
1691
+ type_=DeleteCampaignsResponse, # type: ignore
1692
+ object_=_response.json(),
1693
+ ),
1694
+ )
1695
+ return AsyncHttpResponse(response=_response, data=_data)
1696
+ if _response.status_code == 403:
1697
+ raise ForbiddenError(
1698
+ headers=dict(_response.headers),
1699
+ body=typing.cast(
1700
+ typing.Any,
1701
+ parse_obj_as(
1702
+ type_=typing.Any, # type: ignore
1703
+ object_=_response.json(),
1704
+ ),
1705
+ ),
1706
+ )
1707
+ if _response.status_code == 404:
1708
+ raise NotFoundError(
1709
+ headers=dict(_response.headers),
1710
+ body=typing.cast(
1711
+ typing.Any,
1712
+ parse_obj_as(
1713
+ type_=typing.Any, # type: ignore
1714
+ object_=_response.json(),
1715
+ ),
1716
+ ),
1717
+ )
1718
+ _response_json = _response.json()
1719
+ except JSONDecodeError:
1720
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1721
+ except ValidationError as e:
1722
+ raise ParsingError(
1723
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
1724
+ )
1725
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1726
+
1727
+ async def nudge(
1728
+ self,
1729
+ brand_id: str,
1730
+ campaign_id: str,
1731
+ *,
1732
+ nudge_intent: str,
1733
+ description: str,
1734
+ request_options: typing.Optional[RequestOptions] = None,
1735
+ ) -> AsyncHttpResponse[SuccessResponse]:
1736
+ """
1737
+ Requests action on a pending or rejected 10DLC Campaign. Use `nudge_intent` to specify the action:
1738
+ - `REVIEW`: Request review for a pending Campaign. - `APPEAL_REJECTION`: Appeal a rejected Campaign.
1739
+ Note:
1740
+ - The Campaign must be at least 72 hours old.
1741
+ - Only one nudge request per Campaign is allowed every 24 hours.
1742
+
1743
+ Parameters
1744
+ ----------
1745
+ brand_id : str
1746
+ The unique ID of the 10DLC Brand.
1747
+
1748
+ campaign_id : str
1749
+ The unique ID of the 10DLC Campaign.
1750
+
1751
+ nudge_intent : str
1752
+ Nudge intent. Allowed values: `REVIEW`, `APPEAL_REJECTION`.
1753
+ Use `nudge_intent` to specify the action: - `REVIEW`: Request review for a pending Campaign. - `APPEAL_REJECTION`: Appeal a rejected Campaign.
1754
+
1755
+ description : str
1756
+ Description of the nudge request.
1757
+
1758
+ request_options : typing.Optional[RequestOptions]
1759
+ Request-specific configuration.
1760
+
1761
+ Returns
1762
+ -------
1763
+ AsyncHttpResponse[SuccessResponse]
1764
+ Returns a success confirmation. The nudge request is submitted.
1765
+ """
1766
+ _response = await self._client_wrapper.httpx_client.request(
1767
+ f"v3/10dlc/brands/{encode_path_param(brand_id)}/campaigns/{encode_path_param(campaign_id)}/nudge",
1768
+ method="POST",
1769
+ json={
1770
+ "nudge_intent": nudge_intent,
1771
+ "description": description,
1772
+ },
1773
+ headers={
1774
+ "content-type": "application/json",
1775
+ },
1776
+ request_options=request_options,
1777
+ omit=OMIT,
1778
+ )
1779
+ try:
1780
+ if 200 <= _response.status_code < 300:
1781
+ _data = typing.cast(
1782
+ SuccessResponse,
1783
+ parse_obj_as(
1784
+ type_=SuccessResponse, # type: ignore
1785
+ object_=_response.json(),
1786
+ ),
1787
+ )
1788
+ return AsyncHttpResponse(response=_response, data=_data)
1789
+ if _response.status_code == 400:
1790
+ raise BadRequestError(
1791
+ headers=dict(_response.headers),
1792
+ body=typing.cast(
1793
+ typing.Any,
1794
+ parse_obj_as(
1795
+ type_=typing.Any, # type: ignore
1796
+ object_=_response.json(),
1797
+ ),
1798
+ ),
1799
+ )
1800
+ if _response.status_code == 403:
1801
+ raise ForbiddenError(
1802
+ headers=dict(_response.headers),
1803
+ body=typing.cast(
1804
+ typing.Any,
1805
+ parse_obj_as(
1806
+ type_=typing.Any, # type: ignore
1807
+ object_=_response.json(),
1808
+ ),
1809
+ ),
1810
+ )
1811
+ if _response.status_code == 404:
1812
+ raise NotFoundError(
1813
+ headers=dict(_response.headers),
1814
+ body=typing.cast(
1815
+ typing.Any,
1816
+ parse_obj_as(
1817
+ type_=typing.Any, # type: ignore
1818
+ object_=_response.json(),
1819
+ ),
1820
+ ),
1821
+ )
1822
+ if _response.status_code == 429:
1823
+ raise TooManyRequestsError(
1824
+ headers=dict(_response.headers),
1825
+ body=typing.cast(
1826
+ ValidationErrorResponse,
1827
+ parse_obj_as(
1828
+ type_=ValidationErrorResponse, # type: ignore
1829
+ object_=_response.json(),
1830
+ ),
1831
+ ),
1832
+ )
1833
+ _response_json = _response.json()
1834
+ except JSONDecodeError:
1835
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1836
+ except ValidationError as e:
1837
+ raise ParsingError(
1838
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
1839
+ )
1840
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)