wavix-ruby-sdk 1.0.0

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 (485) hide show
  1. checksums.yaml +7 -0
  2. data/.fern/metadata.json +10 -0
  3. data/.fernignore +5 -0
  4. data/.rubocop.yml +103 -0
  5. data/CONTRIBUTING.md +120 -0
  6. data/LICENSE +21 -0
  7. data/README.md +271 -0
  8. data/Rakefile +20 -0
  9. data/SECURITY.md +25 -0
  10. data/custom.gemspec.rb +16 -0
  11. data/lib/wavix/api_keys/client.rb +158 -0
  12. data/lib/wavix/api_keys/types/api_key_create_request.rb +45 -0
  13. data/lib/wavix/api_keys/types/api_key_update_request.rb +47 -0
  14. data/lib/wavix/api_keys/types/delete_api_keys_request.rb +11 -0
  15. data/lib/wavix/api_keys/types/list_api_keys_request.rb +11 -0
  16. data/lib/wavix/billing/client.rb +24 -0
  17. data/lib/wavix/billing/invoices/client.rb +89 -0
  18. data/lib/wavix/billing/invoices/types/download_invoices_request.rb +13 -0
  19. data/lib/wavix/billing/invoices/types/list_invoices_request.rb +15 -0
  20. data/lib/wavix/billing/invoices/types/list_invoices_response.rb +17 -0
  21. data/lib/wavix/billing/transactions/client.rb +67 -0
  22. data/lib/wavix/billing/transactions/types/list_transactions_request.rb +25 -0
  23. data/lib/wavix/billing/transactions/types/list_transactions_response.rb +17 -0
  24. data/lib/wavix/buy/cities/client.rb +56 -0
  25. data/lib/wavix/buy/cities/types/list_cities_request.rb +15 -0
  26. data/lib/wavix/buy/cities/types/list_cities_response.rb +13 -0
  27. data/lib/wavix/buy/client.rb +39 -0
  28. data/lib/wavix/buy/countries/client.rb +54 -0
  29. data/lib/wavix/buy/countries/types/list_countries_request.rb +13 -0
  30. data/lib/wavix/buy/countries/types/list_countries_response.rb +13 -0
  31. data/lib/wavix/buy/numbers/client.rb +60 -0
  32. data/lib/wavix/buy/numbers/types/list_numbers_request.rb +21 -0
  33. data/lib/wavix/buy/numbers/types/list_numbers_response.rb +15 -0
  34. data/lib/wavix/buy/region_cities/client.rb +56 -0
  35. data/lib/wavix/buy/region_cities/types/list_region_cities_request.rb +17 -0
  36. data/lib/wavix/buy/region_cities/types/list_region_cities_response.rb +13 -0
  37. data/lib/wavix/buy/regions/client.rb +55 -0
  38. data/lib/wavix/buy/regions/types/list_regions_request.rb +15 -0
  39. data/lib/wavix/buy/regions/types/list_regions_response.rb +13 -0
  40. data/lib/wavix/call_control/audio/client.rb +89 -0
  41. data/lib/wavix/call_control/audio/types/call_audio_play_request.rb +15 -0
  42. data/lib/wavix/call_control/audio/types/stop_audio_request.rb +13 -0
  43. data/lib/wavix/call_control/client.rb +275 -0
  44. data/lib/wavix/call_control/streams/client.rb +91 -0
  45. data/lib/wavix/call_control/streams/types/call_stream_create_request.rb +19 -0
  46. data/lib/wavix/call_control/streams/types/delete_streams_request.rb +15 -0
  47. data/lib/wavix/call_control/types/call_answer_request.rb +21 -0
  48. data/lib/wavix/call_control/types/call_dtmf_collect_request.rb +21 -0
  49. data/lib/wavix/call_control/types/call_dtmf_collect_request_prompt.rb +15 -0
  50. data/lib/wavix/call_control/types/call_dtmf_collect_request_prompt_say.rb +16 -0
  51. data/lib/wavix/call_control/types/call_request.rb +23 -0
  52. data/lib/wavix/call_control/types/delete_call_control_request.rb +11 -0
  53. data/lib/wavix/call_control/types/get_call_control_request.rb +11 -0
  54. data/lib/wavix/call_control/types/update_call_request.rb +13 -0
  55. data/lib/wavix/call_recording/client.rb +168 -0
  56. data/lib/wavix/call_recording/types/delete_call_recording_request.rb +11 -0
  57. data/lib/wavix/call_recording/types/get_by_call_call_recording_request.rb +11 -0
  58. data/lib/wavix/call_recording/types/get_call_recording_request.rb +11 -0
  59. data/lib/wavix/call_recording/types/list_call_recording_request.rb +25 -0
  60. data/lib/wavix/call_webhooks/client.rb +120 -0
  61. data/lib/wavix/call_webhooks/types/call_webhooks_create_request.rb +13 -0
  62. data/lib/wavix/call_webhooks/types/call_webhooks_create_request_event_type.rb +14 -0
  63. data/lib/wavix/call_webhooks/types/delete_call_webhooks_request.rb +11 -0
  64. data/lib/wavix/call_webhooks/types/delete_call_webhooks_request_event_type.rb +14 -0
  65. data/lib/wavix/cart/client.rb +147 -0
  66. data/lib/wavix/cart/types/add_cart_request.rb +11 -0
  67. data/lib/wavix/cart/types/checkout_cart_request.rb +11 -0
  68. data/lib/wavix/cart/types/checkout_cart_response.rb +11 -0
  69. data/lib/wavix/cart/types/get_cart_response.rb +13 -0
  70. data/lib/wavix/cart/types/remove_cart_request.rb +11 -0
  71. data/lib/wavix/cart/types/remove_cart_response.rb +11 -0
  72. data/lib/wavix/cdrs/client.rb +277 -0
  73. data/lib/wavix/cdrs/transcription/client.rb +51 -0
  74. data/lib/wavix/cdrs/transcription/types/get_transcription_request.rb +13 -0
  75. data/lib/wavix/cdrs/types/cdr_retranscription_request.rb +15 -0
  76. data/lib/wavix/cdrs/types/cdr_search_request.rb +33 -0
  77. data/lib/wavix/cdrs/types/cdr_search_request_disposition.rb +17 -0
  78. data/lib/wavix/cdrs/types/cdr_search_request_type.rb +14 -0
  79. data/lib/wavix/cdrs/types/get_cdrs_request.rb +13 -0
  80. data/lib/wavix/cdrs/types/list_all_cdrs_request.rb +29 -0
  81. data/lib/wavix/cdrs/types/list_cdrs_request.rb +29 -0
  82. data/lib/wavix/cdrs/types/transcriptions_cdrs_request.rb +11 -0
  83. data/lib/wavix/client.rb +122 -0
  84. data/lib/wavix/environment.rb +7 -0
  85. data/lib/wavix/errors/api_error.rb +8 -0
  86. data/lib/wavix/errors/client_error.rb +17 -0
  87. data/lib/wavix/errors/redirect_error.rb +8 -0
  88. data/lib/wavix/errors/response_error.rb +42 -0
  89. data/lib/wavix/errors/server_error.rb +11 -0
  90. data/lib/wavix/errors/timeout_error.rb +8 -0
  91. data/lib/wavix/internal/errors/constraint_error.rb +10 -0
  92. data/lib/wavix/internal/errors/type_error.rb +10 -0
  93. data/lib/wavix/internal/http/base_request.rb +51 -0
  94. data/lib/wavix/internal/http/raw_client.rb +215 -0
  95. data/lib/wavix/internal/iterators/cursor_item_iterator.rb +28 -0
  96. data/lib/wavix/internal/iterators/cursor_page_iterator.rb +63 -0
  97. data/lib/wavix/internal/iterators/item_iterator.rb +65 -0
  98. data/lib/wavix/internal/iterators/offset_item_iterator.rb +30 -0
  99. data/lib/wavix/internal/iterators/offset_page_iterator.rb +103 -0
  100. data/lib/wavix/internal/json/request.rb +41 -0
  101. data/lib/wavix/internal/json/serializable.rb +25 -0
  102. data/lib/wavix/internal/multipart/multipart_encoder.rb +141 -0
  103. data/lib/wavix/internal/multipart/multipart_form_data.rb +78 -0
  104. data/lib/wavix/internal/multipart/multipart_form_data_part.rb +51 -0
  105. data/lib/wavix/internal/multipart/multipart_request.rb +40 -0
  106. data/lib/wavix/internal/types/array.rb +47 -0
  107. data/lib/wavix/internal/types/boolean.rb +34 -0
  108. data/lib/wavix/internal/types/enum.rb +56 -0
  109. data/lib/wavix/internal/types/hash.rb +36 -0
  110. data/lib/wavix/internal/types/model/field.rb +38 -0
  111. data/lib/wavix/internal/types/model.rb +208 -0
  112. data/lib/wavix/internal/types/type.rb +35 -0
  113. data/lib/wavix/internal/types/union.rb +161 -0
  114. data/lib/wavix/internal/types/unknown.rb +15 -0
  115. data/lib/wavix/internal/types/utils.rb +116 -0
  116. data/lib/wavix/link_shortener/client.rb +53 -0
  117. data/lib/wavix/link_shortener/metrics/client.rb +65 -0
  118. data/lib/wavix/link_shortener/metrics/types/list_metrics_request.rb +23 -0
  119. data/lib/wavix/link_shortener/types/short_link_create_request.rb +19 -0
  120. data/lib/wavix/number_validator/client.rb +94 -0
  121. data/lib/wavix/number_validator/results/client.rb +50 -0
  122. data/lib/wavix/number_validator/results/types/get_results_request.rb +13 -0
  123. data/lib/wavix/number_validator/types/get_number_validator_request.rb +13 -0
  124. data/lib/wavix/number_validator/types/get_number_validator_response.rb +43 -0
  125. data/lib/wavix/number_validator/types/phone_validation_request.rb +17 -0
  126. data/lib/wavix/numbers/client.rb +216 -0
  127. data/lib/wavix/numbers/papers/client.rb +69 -0
  128. data/lib/wavix/numbers/papers/types/upload_papers_request.rb +11 -0
  129. data/lib/wavix/numbers/types/bulk_update_numbers_response.rb +11 -0
  130. data/lib/wavix/numbers/types/delete_numbers_request.rb +13 -0
  131. data/lib/wavix/numbers/types/delete_numbers_response.rb +11 -0
  132. data/lib/wavix/numbers/types/get_numbers_request.rb +11 -0
  133. data/lib/wavix/numbers/types/list_numbers_request.rb +21 -0
  134. data/lib/wavix/numbers/types/number_bulk_update_request.rb +25 -0
  135. data/lib/wavix/numbers/types/number_update_request.rb +25 -0
  136. data/lib/wavix/profile/client.rb +85 -0
  137. data/lib/wavix/profile/config/client.rb +48 -0
  138. data/lib/wavix/profile/config/types/get_config_response.rb +15 -0
  139. data/lib/wavix/profile/types/profile_update_request.rb +31 -0
  140. data/lib/wavix/profile/types/profile_update_request_company_info.rb +21 -0
  141. data/lib/wavix/profile/types/profile_update_request_company_info_industry.rb +25 -0
  142. data/lib/wavix/sip_trunks/client.rb +194 -0
  143. data/lib/wavix/sip_trunks/types/delete_sip_trunks_request.rb +11 -0
  144. data/lib/wavix/sip_trunks/types/get_sip_trunks_request.rb +11 -0
  145. data/lib/wavix/sip_trunks/types/list_sip_trunks_request.rb +13 -0
  146. data/lib/wavix/sip_trunks/types/update_sip_trunks_request.rb +13 -0
  147. data/lib/wavix/sms_and_mms/client.rb +29 -0
  148. data/lib/wavix/sms_and_mms/messages/client.rb +194 -0
  149. data/lib/wavix/sms_and_mms/messages/types/get_messages_request.rb +13 -0
  150. data/lib/wavix/sms_and_mms/messages/types/get_messages_response.rb +45 -0
  151. data/lib/wavix/sms_and_mms/messages/types/list_all_messages_request.rb +27 -0
  152. data/lib/wavix/sms_and_mms/messages/types/list_all_messages_request_message_type.rb +16 -0
  153. data/lib/wavix/sms_and_mms/messages/types/list_messages_request.rb +31 -0
  154. data/lib/wavix/sms_and_mms/messages/types/list_messages_request_message_type.rb +16 -0
  155. data/lib/wavix/sms_and_mms/messages/types/list_messages_response.rb +15 -0
  156. data/lib/wavix/sms_and_mms/messages/types/send_messages_request.rb +23 -0
  157. data/lib/wavix/sms_and_mms/opt_outs/client.rb +99 -0
  158. data/lib/wavix/sms_and_mms/opt_outs/types/create_opt_outs_response.rb +13 -0
  159. data/lib/wavix/sms_and_mms/opt_outs/types/list_opt_outs_request.rb +23 -0
  160. data/lib/wavix/sms_and_mms/opt_outs/types/opt_out_create_request.rb +13 -0
  161. data/lib/wavix/sms_and_mms/sender_ids/client.rb +150 -0
  162. data/lib/wavix/sms_and_mms/sender_ids/types/delete_sender_ids_request.rb +13 -0
  163. data/lib/wavix/sms_and_mms/sender_ids/types/delete_sender_ids_response.rb +13 -0
  164. data/lib/wavix/sms_and_mms/sender_ids/types/get_sender_ids_request.rb +13 -0
  165. data/lib/wavix/sms_and_mms/sender_ids/types/sender_id_create_request.rb +23 -0
  166. data/lib/wavix/sms_and_mms/sender_ids/types/sender_id_create_request_monthly_volume.rb +19 -0
  167. data/lib/wavix/sms_and_mms/sender_ids/types/sender_id_create_request_usecase.rb +17 -0
  168. data/lib/wavix/speech_analytics/client.rb +157 -0
  169. data/lib/wavix/speech_analytics/file/client.rb +48 -0
  170. data/lib/wavix/speech_analytics/file/types/get_file_request.rb +13 -0
  171. data/lib/wavix/speech_analytics/types/create_speech_analytics_request.rb +9 -0
  172. data/lib/wavix/speech_analytics/types/create_speech_analytics_response.rb +15 -0
  173. data/lib/wavix/speech_analytics/types/get_speech_analytics_request.rb +11 -0
  174. data/lib/wavix/speech_analytics/types/get_speech_analytics_response.rb +31 -0
  175. data/lib/wavix/speech_analytics/types/get_speech_analytics_response_language.rb +17 -0
  176. data/lib/wavix/speech_analytics/types/get_speech_analytics_response_status.rb +14 -0
  177. data/lib/wavix/speech_analytics/types/speech_analytics_retranscribe_request.rb +15 -0
  178. data/lib/wavix/sub_accounts/client.rb +165 -0
  179. data/lib/wavix/sub_accounts/transactions/client.rb +64 -0
  180. data/lib/wavix/sub_accounts/transactions/types/list_transactions_request.rb +23 -0
  181. data/lib/wavix/sub_accounts/types/get_sub_accounts_request.rb +11 -0
  182. data/lib/wavix/sub_accounts/types/list_sub_accounts_request.rb +11 -0
  183. data/lib/wavix/sub_accounts/types/list_sub_accounts_request_status.rb +14 -0
  184. data/lib/wavix/sub_accounts/types/sub_accounts_create_request.rb +13 -0
  185. data/lib/wavix/sub_accounts/types/sub_accounts_create_request_default_destinations.rb +14 -0
  186. data/lib/wavix/sub_accounts/types/sub_accounts_update_request.rb +17 -0
  187. data/lib/wavix/sub_accounts/types/sub_accounts_update_request_default_destinations.rb +14 -0
  188. data/lib/wavix/sub_accounts/types/sub_accounts_update_request_status.rb +14 -0
  189. data/lib/wavix/ten_dlc/brand_appeals/client.rb +93 -0
  190. data/lib/wavix/ten_dlc/brand_appeals/types/create_brand_appeals_request.rb +19 -0
  191. data/lib/wavix/ten_dlc/brand_appeals/types/create_brand_appeals_response.rb +13 -0
  192. data/lib/wavix/ten_dlc/brand_appeals/types/list_brand_appeals_request.rb +13 -0
  193. data/lib/wavix/ten_dlc/brand_evidence/client.rb +158 -0
  194. data/lib/wavix/ten_dlc/brand_evidence/types/delete_brand_evidence_request.rb +15 -0
  195. data/lib/wavix/ten_dlc/brand_evidence/types/delete_brand_evidence_response.rb +13 -0
  196. data/lib/wavix/ten_dlc/brand_evidence/types/get_brand_evidence_request.rb +15 -0
  197. data/lib/wavix/ten_dlc/brand_evidence/types/list_brand_evidence_request.rb +13 -0
  198. data/lib/wavix/ten_dlc/brand_evidence/types/upload_brand_evidence_request.rb +13 -0
  199. data/lib/wavix/ten_dlc/brand_evidence/types/upload_brand_evidence_response.rb +19 -0
  200. data/lib/wavix/ten_dlc/brand_vetting_appeals/client.rb +87 -0
  201. data/lib/wavix/ten_dlc/brand_vetting_appeals/types/create_brand_vetting_appeals_response.rb +13 -0
  202. data/lib/wavix/ten_dlc/brand_vetting_appeals/types/list_brand_vetting_appeals_request.rb +13 -0
  203. data/lib/wavix/ten_dlc/brand_vetting_appeals/types/ten_dlc_brand_vetting_appeal_create_request.rb +23 -0
  204. data/lib/wavix/ten_dlc/brand_vettings/client.rb +127 -0
  205. data/lib/wavix/ten_dlc/brand_vettings/types/list_brand_vettings_request.rb +13 -0
  206. data/lib/wavix/ten_dlc/brand_vettings/types/ten_dlc_brand_vetting_create_request.rb +17 -0
  207. data/lib/wavix/ten_dlc/brand_vettings/types/ten_dlc_brand_vetting_import_request.rb +19 -0
  208. data/lib/wavix/ten_dlc/brands/client.rb +257 -0
  209. data/lib/wavix/ten_dlc/brands/types/create_brands_response.rb +61 -0
  210. data/lib/wavix/ten_dlc/brands/types/create_brands_response_entity_type.rb +18 -0
  211. data/lib/wavix/ten_dlc/brands/types/create_brands_response_status.rb +19 -0
  212. data/lib/wavix/ten_dlc/brands/types/delete_brands_request.rb +13 -0
  213. data/lib/wavix/ten_dlc/brands/types/delete_brands_response.rb +13 -0
  214. data/lib/wavix/ten_dlc/brands/types/get_brands_request.rb +13 -0
  215. data/lib/wavix/ten_dlc/brands/types/get_brands_response.rb +61 -0
  216. data/lib/wavix/ten_dlc/brands/types/get_brands_response_entity_type.rb +18 -0
  217. data/lib/wavix/ten_dlc/brands/types/get_brands_response_status.rb +19 -0
  218. data/lib/wavix/ten_dlc/brands/types/list_brands_request.rb +35 -0
  219. data/lib/wavix/ten_dlc/brands/types/list_brands_response.rb +16 -0
  220. data/lib/wavix/ten_dlc/brands/types/list_brands_response_pagination.rb +20 -0
  221. data/lib/wavix/ten_dlc/brands/types/qualify_usecase_brands_request.rb +15 -0
  222. data/lib/wavix/ten_dlc/brands/types/qualify_usecase_brands_request_use_case.rb +40 -0
  223. data/lib/wavix/ten_dlc/brands/types/qualify_usecase_brands_response.rb +17 -0
  224. data/lib/wavix/ten_dlc/brands/types/ten_dlc_brand_update_request.rb +51 -0
  225. data/lib/wavix/ten_dlc/brands/types/ten_dlc_brand_update_request_entity_type.rb +18 -0
  226. data/lib/wavix/ten_dlc/brands/types/ten_dlc_brand_update_request_vertical.rb +23 -0
  227. data/lib/wavix/ten_dlc/brands/types/update_brands_response.rb +61 -0
  228. data/lib/wavix/ten_dlc/brands/types/update_brands_response_entity_type.rb +18 -0
  229. data/lib/wavix/ten_dlc/brands/types/update_brands_response_status.rb +19 -0
  230. data/lib/wavix/ten_dlc/campaign_numbers/client.rb +123 -0
  231. data/lib/wavix/ten_dlc/campaign_numbers/types/link_campaign_numbers_request.rb +17 -0
  232. data/lib/wavix/ten_dlc/campaign_numbers/types/link_campaign_numbers_response.rb +13 -0
  233. data/lib/wavix/ten_dlc/campaign_numbers/types/list_campaign_numbers_request.rb +15 -0
  234. data/lib/wavix/ten_dlc/campaign_numbers/types/list_campaign_numbers_response.rb +17 -0
  235. data/lib/wavix/ten_dlc/campaign_numbers/types/unlink_campaign_numbers_request.rb +17 -0
  236. data/lib/wavix/ten_dlc/campaign_numbers/types/unlink_campaign_numbers_response.rb +13 -0
  237. data/lib/wavix/ten_dlc/campaigns/client.rb +316 -0
  238. data/lib/wavix/ten_dlc/campaigns/types/create_campaigns_response.rb +89 -0
  239. data/lib/wavix/ten_dlc/campaigns/types/delete_campaigns_request.rb +15 -0
  240. data/lib/wavix/ten_dlc/campaigns/types/delete_campaigns_response.rb +13 -0
  241. data/lib/wavix/ten_dlc/campaigns/types/get_campaigns_request.rb +15 -0
  242. data/lib/wavix/ten_dlc/campaigns/types/get_campaigns_response.rb +89 -0
  243. data/lib/wavix/ten_dlc/campaigns/types/list_by_brand_campaigns_request.rb +29 -0
  244. data/lib/wavix/ten_dlc/campaigns/types/list_by_brand_campaigns_response.rb +16 -0
  245. data/lib/wavix/ten_dlc/campaigns/types/list_by_brand_campaigns_response_pagination.rb +20 -0
  246. data/lib/wavix/ten_dlc/campaigns/types/list_campaigns_request.rb +27 -0
  247. data/lib/wavix/ten_dlc/campaigns/types/list_campaigns_response.rb +16 -0
  248. data/lib/wavix/ten_dlc/campaigns/types/list_campaigns_response_pagination.rb +20 -0
  249. data/lib/wavix/ten_dlc/campaigns/types/nudge_campaigns_request.rb +19 -0
  250. data/lib/wavix/ten_dlc/campaigns/types/ten_dlc_campaign_create_request.rb +69 -0
  251. data/lib/wavix/ten_dlc/campaigns/types/ten_dlc_campaign_update_request.rb +67 -0
  252. data/lib/wavix/ten_dlc/campaigns/types/ten_dlc_campaign_update_request_usecase.rb +20 -0
  253. data/lib/wavix/ten_dlc/campaigns/types/update_campaigns_response.rb +89 -0
  254. data/lib/wavix/ten_dlc/client.rb +54 -0
  255. data/lib/wavix/ten_dlc/subscriptions/client.rb +118 -0
  256. data/lib/wavix/ten_dlc/subscriptions/types/create_subscriptions_response.rb +16 -0
  257. data/lib/wavix/ten_dlc/subscriptions/types/delete_subscriptions_request.rb +13 -0
  258. data/lib/wavix/ten_dlc/subscriptions/types/delete_subscriptions_response.rb +13 -0
  259. data/lib/wavix/two_fa/client.rb +29 -0
  260. data/lib/wavix/two_fa/events/client.rb +49 -0
  261. data/lib/wavix/two_fa/events/types/list_events_request.rb +13 -0
  262. data/lib/wavix/two_fa/sessions/client.rb +55 -0
  263. data/lib/wavix/two_fa/sessions/types/list_sessions_request.rb +17 -0
  264. data/lib/wavix/two_fa/verification/client.rb +171 -0
  265. data/lib/wavix/two_fa/verification/types/cancel_verification_request.rb +13 -0
  266. data/lib/wavix/two_fa/verification/types/check_verification_response.rb +13 -0
  267. data/lib/wavix/two_fa/verification/types/create_verification_response.rb +25 -0
  268. data/lib/wavix/two_fa/verification/types/resend_verification_response.rb +19 -0
  269. data/lib/wavix/two_fa/verification/types/two_factor_verification_check_request.rb +15 -0
  270. data/lib/wavix/two_fa/verification/types/two_factor_verification_create_request.rb +17 -0
  271. data/lib/wavix/two_fa/verification/types/two_factor_verification_resend_request.rb +15 -0
  272. data/lib/wavix/two_fa/verification/types/two_factor_verification_resend_request_channel.rb +16 -0
  273. data/lib/wavix/types/account_error_response.rb +12 -0
  274. data/lib/wavix/types/account_limits.rb +13 -0
  275. data/lib/wavix/types/allowed_i_ps.rb +23 -0
  276. data/lib/wavix/types/allowed_i_ps_item.rb +11 -0
  277. data/lib/wavix/types/api_key.rb +52 -0
  278. data/lib/wavix/types/api_key_calls_scope_permission.rb +10 -0
  279. data/lib/wavix/types/api_key_calls_scope_permission_allow.rb +13 -0
  280. data/lib/wavix/types/api_key_scope_permission.rb +10 -0
  281. data/lib/wavix/types/api_key_scope_permission_allow.rb +13 -0
  282. data/lib/wavix/types/available_number.rb +38 -0
  283. data/lib/wavix/types/available_number_list_response.rb +11 -0
  284. data/lib/wavix/types/bad_request_error_body.rb +11 -0
  285. data/lib/wavix/types/billing_transaction_list_response.rb +13 -0
  286. data/lib/wavix/types/brand_status_updated_webhook.rb +11 -0
  287. data/lib/wavix/types/brand_status_updated_webhook_status.rb +16 -0
  288. data/lib/wavix/types/call.rb +33 -0
  289. data/lib/wavix/types/call_control_validation_error_response.rb +13 -0
  290. data/lib/wavix/types/call_create_response.rb +33 -0
  291. data/lib/wavix/types/call_create_response_event_type.rb +19 -0
  292. data/lib/wavix/types/call_direction.rb +12 -0
  293. data/lib/wavix/types/call_disposition.rb +15 -0
  294. data/lib/wavix/types/call_event_type.rb +19 -0
  295. data/lib/wavix/types/call_list_response.rb +11 -0
  296. data/lib/wavix/types/call_recording_list_response.rb +13 -0
  297. data/lib/wavix/types/call_response.rb +11 -0
  298. data/lib/wavix/types/call_status_webhook.rb +28 -0
  299. data/lib/wavix/types/call_status_webhook_direction.rb +12 -0
  300. data/lib/wavix/types/call_stream_channel.rb +13 -0
  301. data/lib/wavix/types/call_stream_response.rb +11 -0
  302. data/lib/wavix/types/call_stream_type.rb +12 -0
  303. data/lib/wavix/types/call_webhook.rb +14 -0
  304. data/lib/wavix/types/call_webhook_event_type.rb +12 -0
  305. data/lib/wavix/types/call_webhook_list_response.rb +23 -0
  306. data/lib/wavix/types/call_webhook_list_response_item.rb +11 -0
  307. data/lib/wavix/types/call_webhook_list_response_item_event_type.rb +12 -0
  308. data/lib/wavix/types/campaign_status_updated_webhook.rb +13 -0
  309. data/lib/wavix/types/campaign_status_updated_webhook_status.rb +17 -0
  310. data/lib/wavix/types/cart_response.rb +11 -0
  311. data/lib/wavix/types/cdr.rb +38 -0
  312. data/lib/wavix/types/cdr_list_response.rb +11 -0
  313. data/lib/wavix/types/cdr_response.rb +41 -0
  314. data/lib/wavix/types/cdr_transcription_completed_webhook.rb +11 -0
  315. data/lib/wavix/types/cdr_transcription_completed_webhook_status.rb +12 -0
  316. data/lib/wavix/types/cdr_transcription_response.rb +31 -0
  317. data/lib/wavix/types/cdr_transcription_search_response.rb +11 -0
  318. data/lib/wavix/types/cdr_with_transcription.rb +40 -0
  319. data/lib/wavix/types/city.rb +13 -0
  320. data/lib/wavix/types/city_list_response.rb +9 -0
  321. data/lib/wavix/types/country.rb +13 -0
  322. data/lib/wavix/types/country_has_no_regions_error_response.rb +11 -0
  323. data/lib/wavix/types/country_list_response.rb +9 -0
  324. data/lib/wavix/types/document_type.rb +13 -0
  325. data/lib/wavix/types/document_type_id.rb +23 -0
  326. data/lib/wavix/types/file_transcript_response.rb +11 -0
  327. data/lib/wavix/types/file_transcript_turn.rb +18 -0
  328. data/lib/wavix/types/file_transcription_completed_webhook.rb +13 -0
  329. data/lib/wavix/types/file_transcription_response.rb +29 -0
  330. data/lib/wavix/types/file_transcription_response_language.rb +15 -0
  331. data/lib/wavix/types/file_transcription_response_status.rb +12 -0
  332. data/lib/wavix/types/financial_transaction.rb +24 -0
  333. data/lib/wavix/types/forbidden_error_response.rb +11 -0
  334. data/lib/wavix/types/inbound_call_destination.rb +22 -0
  335. data/lib/wavix/types/inbound_call_transport.rb +23 -0
  336. data/lib/wavix/types/inbound_message.rb +18 -0
  337. data/lib/wavix/types/invalid_recording.rb +12 -0
  338. data/lib/wavix/types/invoice.rb +16 -0
  339. data/lib/wavix/types/invoice_list_response.rb +13 -0
  340. data/lib/wavix/types/list_brand_evidence_response.rb +9 -0
  341. data/lib/wavix/types/list_sessions_response_item.rb +23 -0
  342. data/lib/wavix/types/message.rb +42 -0
  343. data/lib/wavix/types/message_body.rb +11 -0
  344. data/lib/wavix/types/message_create_request.rb +19 -0
  345. data/lib/wavix/types/message_delivery_status.rb +18 -0
  346. data/lib/wavix/types/message_list_response.rb +11 -0
  347. data/lib/wavix/types/message_response.rb +41 -0
  348. data/lib/wavix/types/messages_delivery_report.rb +32 -0
  349. data/lib/wavix/types/not_found_error_body.rb +11 -0
  350. data/lib/wavix/types/not_found_error_response.rb +11 -0
  351. data/lib/wavix/types/number.rb +63 -0
  352. data/lib/wavix/types/number_destination.rb +16 -0
  353. data/lib/wavix/types/number_document.rb +24 -0
  354. data/lib/wavix/types/number_list_response.rb +13 -0
  355. data/lib/wavix/types/number_status_updated_webhook.rb +15 -0
  356. data/lib/wavix/types/number_status_updated_webhook_status.rb +13 -0
  357. data/lib/wavix/types/number_validator_create_bulk_response.rb +13 -0
  358. data/lib/wavix/types/number_validator_create_bulk_response_request_id.rb +10 -0
  359. data/lib/wavix/types/on_call_event_payload.rb +12 -0
  360. data/lib/wavix/types/on_call_event_payload_type.rb +12 -0
  361. data/lib/wavix/types/opt_out.rb +11 -0
  362. data/lib/wavix/types/opt_out_item.rb +15 -0
  363. data/lib/wavix/types/opt_outs_list_response.rb +11 -0
  364. data/lib/wavix/types/pagination.rb +15 -0
  365. data/lib/wavix/types/phone_lookup_details.rb +13 -0
  366. data/lib/wavix/types/phone_number_validation_type.rb +13 -0
  367. data/lib/wavix/types/phone_validation_batch_response.rb +15 -0
  368. data/lib/wavix/types/phone_validation_batch_result_response.rb +15 -0
  369. data/lib/wavix/types/phone_validation_response.rb +41 -0
  370. data/lib/wavix/types/phone_validation_result_response.rb +42 -0
  371. data/lib/wavix/types/profile_config_response.rb +11 -0
  372. data/lib/wavix/types/profile_response.rb +31 -0
  373. data/lib/wavix/types/profile_response_company_info.rb +20 -0
  374. data/lib/wavix/types/profile_response_company_info_country.rb +12 -0
  375. data/lib/wavix/types/profile_response_company_info_industry.rb +23 -0
  376. data/lib/wavix/types/profile_response_default_destinations_item.rb +11 -0
  377. data/lib/wavix/types/record_not_found_error_response.rb +11 -0
  378. data/lib/wavix/types/recording.rb +22 -0
  379. data/lib/wavix/types/recording_deleted_error_response.rb +15 -0
  380. data/lib/wavix/types/region.rb +12 -0
  381. data/lib/wavix/types/region_list_response.rb +9 -0
  382. data/lib/wavix/types/send_messages_response.rb +41 -0
  383. data/lib/wavix/types/sender_id.rb +20 -0
  384. data/lib/wavix/types/sender_id_details.rb +19 -0
  385. data/lib/wavix/types/sender_id_list_response.rb +9 -0
  386. data/lib/wavix/types/sender_id_response.rb +19 -0
  387. data/lib/wavix/types/sender_id_response_type.rb +13 -0
  388. data/lib/wavix/types/sender_id_type.rb +12 -0
  389. data/lib/wavix/types/short_link_metrics_item.rb +27 -0
  390. data/lib/wavix/types/short_link_metrics_response.rb +11 -0
  391. data/lib/wavix/types/short_link_response.rb +9 -0
  392. data/lib/wavix/types/sip_trunk_create_request.rb +51 -0
  393. data/lib/wavix/types/sip_trunk_create_request_allowed_ips_item.rb +9 -0
  394. data/lib/wavix/types/sip_trunk_create_request_host_request.rb +11 -0
  395. data/lib/wavix/types/sip_trunk_list_response.rb +11 -0
  396. data/lib/wavix/types/sip_trunk_response.rb +59 -0
  397. data/lib/wavix/types/sip_trunk_summary.rb +42 -0
  398. data/lib/wavix/types/sip_trunk_summary_host_request.rb +12 -0
  399. data/lib/wavix/types/sub_accounts_list_response.rb +11 -0
  400. data/lib/wavix/types/sub_accounts_transactions_list_response.rb +11 -0
  401. data/lib/wavix/types/sub_accounts_transactions_list_response_transactions_item.rb +19 -0
  402. data/lib/wavix/types/sub_organization_response.rb +22 -0
  403. data/lib/wavix/types/sub_organization_response_default_destinations.rb +12 -0
  404. data/lib/wavix/types/sub_organization_response_status.rb +12 -0
  405. data/lib/wavix/types/submit_file_transcription_response.rb +13 -0
  406. data/lib/wavix/types/success_response.rb +9 -0
  407. data/lib/wavix/types/tcr_error_message.rb +11 -0
  408. data/lib/wavix/types/tcr_feedback.rb +9 -0
  409. data/lib/wavix/types/tcr_feedback_category.rb +18 -0
  410. data/lib/wavix/types/ten_dlc_brand.rb +57 -0
  411. data/lib/wavix/types/ten_dlc_brand_appeal.rb +21 -0
  412. data/lib/wavix/types/ten_dlc_brand_appeal_create_request.rb +14 -0
  413. data/lib/wavix/types/ten_dlc_brand_appeal_outcome.rb +14 -0
  414. data/lib/wavix/types/ten_dlc_brand_appeal_outcome_feedback.rb +10 -0
  415. data/lib/wavix/types/ten_dlc_brand_appeal_outcome_vetting_status.rb +15 -0
  416. data/lib/wavix/types/ten_dlc_brand_create_request.rb +14 -0
  417. data/lib/wavix/types/ten_dlc_brand_create_request_entity_type.rb +14 -0
  418. data/lib/wavix/types/ten_dlc_brand_create_request_stock_exchange.rb +14 -0
  419. data/lib/wavix/types/ten_dlc_brand_create_request_stock_exchange_entity_type.rb +13 -0
  420. data/lib/wavix/types/ten_dlc_brand_create_request_vertical.rb +19 -0
  421. data/lib/wavix/types/ten_dlc_brand_create_request_zero.rb +10 -0
  422. data/lib/wavix/types/ten_dlc_brand_create_request_zero_entity_type.rb +11 -0
  423. data/lib/wavix/types/ten_dlc_brand_entity_type.rb +14 -0
  424. data/lib/wavix/types/ten_dlc_brand_evidence.rb +15 -0
  425. data/lib/wavix/types/ten_dlc_brand_identity_verification_status.rb +15 -0
  426. data/lib/wavix/types/ten_dlc_brand_list_response.rb +12 -0
  427. data/lib/wavix/types/ten_dlc_brand_list_response_pagination.rb +16 -0
  428. data/lib/wavix/types/ten_dlc_brand_qualification_result.rb +13 -0
  429. data/lib/wavix/types/ten_dlc_brand_status.rb +15 -0
  430. data/lib/wavix/types/ten_dlc_brand_vetting.rb +29 -0
  431. data/lib/wavix/types/ten_dlc_brand_vetting_appeal.rb +31 -0
  432. data/lib/wavix/types/ten_dlc_brand_vetting_appeal_appeal_outcome.rb +14 -0
  433. data/lib/wavix/types/ten_dlc_brand_vetting_appeal_appeal_outcome_feedback.rb +10 -0
  434. data/lib/wavix/types/ten_dlc_brand_vetting_appeal_outcome.rb +13 -0
  435. data/lib/wavix/types/ten_dlc_brand_vetting_appeal_outcome_feedback.rb +10 -0
  436. data/lib/wavix/types/ten_dlc_brand_vetting_appeal_outcome_reason.rb +9 -0
  437. data/lib/wavix/types/ten_dlc_campaign.rb +85 -0
  438. data/lib/wavix/types/ten_dlc_campaign_list_response.rb +12 -0
  439. data/lib/wavix/types/ten_dlc_campaign_list_response_pagination.rb +16 -0
  440. data/lib/wavix/types/ten_dlc_campaign_nudge_request.rb +13 -0
  441. data/lib/wavix/types/ten_dlc_campaign_number.rb +11 -0
  442. data/lib/wavix/types/ten_dlc_campaign_number_list_response.rb +13 -0
  443. data/lib/wavix/types/ten_dlc_event_subscription.rb +12 -0
  444. data/lib/wavix/types/ten_dlcmno_metadata.rb +40 -0
  445. data/lib/wavix/types/transaction_status.rb +14 -0
  446. data/lib/wavix/types/transaction_type.rb +23 -0
  447. data/lib/wavix/types/transcript_turn.rb +19 -0
  448. data/lib/wavix/types/transcription_filter.rb +13 -0
  449. data/lib/wavix/types/transcription_filter_agent.rb +14 -0
  450. data/lib/wavix/types/transcription_filter_any.rb +14 -0
  451. data/lib/wavix/types/transcription_filter_client.rb +14 -0
  452. data/lib/wavix/types/transcription_language.rb +15 -0
  453. data/lib/wavix/types/transcription_reference.rb +11 -0
  454. data/lib/wavix/types/transcription_status.rb +12 -0
  455. data/lib/wavix/types/tts_language.rb +14 -0
  456. data/lib/wavix/types/tts_voice_id.rb +26 -0
  457. data/lib/wavix/types/two_factor_verification_check_response.rb +9 -0
  458. data/lib/wavix/types/two_factor_verification_event.rb +17 -0
  459. data/lib/wavix/types/two_factor_verification_resend_response.rb +15 -0
  460. data/lib/wavix/types/two_factor_verification_response.rb +21 -0
  461. data/lib/wavix/types/unauthorized_error_response.rb +13 -0
  462. data/lib/wavix/types/unprocessable_entity_error_body.rb +11 -0
  463. data/lib/wavix/types/validation_error_response.rb +11 -0
  464. data/lib/wavix/types/voice_campaign_create_request.rb +9 -0
  465. data/lib/wavix/types/voice_campaign_response.rb +16 -0
  466. data/lib/wavix/types/voice_campaigns_create_response.rb +9 -0
  467. data/lib/wavix/types/voice_campaigns_create_response_voice_campaign.rb +17 -0
  468. data/lib/wavix/types/voice_campaigns_get_response.rb +9 -0
  469. data/lib/wavix/types/voice_campaigns_get_response_voice_campaign.rb +17 -0
  470. data/lib/wavix/types/web_rtc_token.rb +16 -0
  471. data/lib/wavix/types/web_rtc_token_response.rb +17 -0
  472. data/lib/wavix/types/web_rtc_tokens_list_response.rb +12 -0
  473. data/lib/wavix/version.rb +5 -0
  474. data/lib/wavix/voice_campaigns/client.rb +83 -0
  475. data/lib/wavix/voice_campaigns/types/create_voice_campaigns_request.rb +11 -0
  476. data/lib/wavix/voice_campaigns/types/get_voice_campaigns_request.rb +11 -0
  477. data/lib/wavix/webrtc/client.rb +19 -0
  478. data/lib/wavix/webrtc/tokens/client.rb +191 -0
  479. data/lib/wavix/webrtc/tokens/types/delete_tokens_request.rb +13 -0
  480. data/lib/wavix/webrtc/tokens/types/get_tokens_request.rb +13 -0
  481. data/lib/wavix/webrtc/tokens/types/web_rtc_token_create_request.rb +17 -0
  482. data/lib/wavix/webrtc/tokens/types/web_rtc_token_update_request.rb +15 -0
  483. data/lib/wavix.rb +477 -0
  484. data/reference.md +10623 -0
  485. metadata +526 -0
@@ -0,0 +1,94 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Wavix
4
+ module NumberValidator
5
+ class Client
6
+ # @param client [Wavix::Internal::Http::RawClient]
7
+ #
8
+ # @return [void]
9
+ def initialize(client:)
10
+ @client = client
11
+ end
12
+
13
+ # Validates a single phone number and returns line type, carrier, portability, and reachability details.
14
+ #
15
+ # @param request_options [Hash]
16
+ # @param params [Hash]
17
+ # @option request_options [String] :base_url
18
+ # @option request_options [Hash{String => Object}] :additional_headers
19
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
20
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
21
+ # @option request_options [Integer] :timeout_in_seconds
22
+ # @option params [String] :phone_number
23
+ # @option params [Wavix::Types::PhoneNumberValidationType] :type
24
+ #
25
+ # @return [Wavix::NumberValidator::Types::GetNumberValidatorResponse]
26
+ def get(request_options: {}, **params)
27
+ params = Wavix::Internal::Types::Utils.normalize_keys(params)
28
+ query_params = {}
29
+ query_params["phone_number"] = params[:phone_number] if params.key?(:phone_number)
30
+ query_params["type"] = params[:type] if params.key?(:type)
31
+
32
+ request = Wavix::Internal::JSON::Request.new(
33
+ base_url: request_options[:base_url],
34
+ method: "GET",
35
+ path: "v1/validation",
36
+ query: query_params,
37
+ request_options: request_options
38
+ )
39
+ begin
40
+ response = @client.send(request)
41
+ rescue Net::HTTPRequestTimeout
42
+ raise Wavix::Errors::TimeoutError
43
+ end
44
+ code = response.code.to_i
45
+ if code.between?(200, 299)
46
+ Wavix::NumberValidator::Types::GetNumberValidatorResponse.load(response.body)
47
+ else
48
+ error_class = Wavix::Errors::ResponseError.subclass_for_code(code)
49
+ raise error_class.new(response.body, code: code)
50
+ end
51
+ end
52
+
53
+ # Validates a batch of phone numbers. When `async` is `true`, returns a `request_id` to poll for results instead
54
+ # of the validation details.
55
+ #
56
+ # @param request_options [Hash]
57
+ # @param params [Wavix::NumberValidator::Types::PhoneValidationRequest]
58
+ # @option request_options [String] :base_url
59
+ # @option request_options [Hash{String => Object}] :additional_headers
60
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
61
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
62
+ # @option request_options [Integer] :timeout_in_seconds
63
+ #
64
+ # @return [Wavix::Types::NumberValidatorCreateBulkResponse]
65
+ def create_bulk(request_options: {}, **params)
66
+ params = Wavix::Internal::Types::Utils.normalize_keys(params)
67
+ request = Wavix::Internal::JSON::Request.new(
68
+ base_url: request_options[:base_url],
69
+ method: "POST",
70
+ path: "v1/validation",
71
+ body: Wavix::NumberValidator::Types::PhoneValidationRequest.new(params).to_h,
72
+ request_options: request_options
73
+ )
74
+ begin
75
+ response = @client.send(request)
76
+ rescue Net::HTTPRequestTimeout
77
+ raise Wavix::Errors::TimeoutError
78
+ end
79
+ code = response.code.to_i
80
+ if code.between?(200, 299)
81
+ Wavix::Types::NumberValidatorCreateBulkResponse.load(response.body)
82
+ else
83
+ error_class = Wavix::Errors::ResponseError.subclass_for_code(code)
84
+ raise error_class.new(response.body, code: code)
85
+ end
86
+ end
87
+
88
+ # @return [Wavix::Results::Client]
89
+ def results
90
+ @results ||= Wavix::NumberValidator::Results::Client.new(client: @client)
91
+ end
92
+ end
93
+ end
94
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Wavix
4
+ module NumberValidator
5
+ module Results
6
+ class Client
7
+ # @param client [Wavix::Internal::Http::RawClient]
8
+ #
9
+ # @return [void]
10
+ def initialize(client:)
11
+ @client = client
12
+ end
13
+
14
+ # Returns the results of an asynchronous batch validation identified by `request_id`.
15
+ #
16
+ # @param request_options [Hash]
17
+ # @param params [Hash]
18
+ # @option request_options [String] :base_url
19
+ # @option request_options [Hash{String => Object}] :additional_headers
20
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
21
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
22
+ # @option request_options [Integer] :timeout_in_seconds
23
+ # @option params [String] :request_id
24
+ #
25
+ # @return [Wavix::Types::PhoneValidationBatchResultResponse]
26
+ def get(request_options: {}, **params)
27
+ params = Wavix::Internal::Types::Utils.normalize_keys(params)
28
+ request = Wavix::Internal::JSON::Request.new(
29
+ base_url: request_options[:base_url],
30
+ method: "GET",
31
+ path: "v1/validation/#{URI.encode_uri_component(params[:request_id].to_s)}",
32
+ request_options: request_options
33
+ )
34
+ begin
35
+ response = @client.send(request)
36
+ rescue Net::HTTPRequestTimeout
37
+ raise Wavix::Errors::TimeoutError
38
+ end
39
+ code = response.code.to_i
40
+ if code.between?(200, 299)
41
+ Wavix::Types::PhoneValidationBatchResultResponse.load(response.body)
42
+ else
43
+ error_class = Wavix::Errors::ResponseError.subclass_for_code(code)
44
+ raise error_class.new(response.body, code: code)
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Wavix
4
+ module NumberValidator
5
+ module Results
6
+ module Types
7
+ class GetResultsRequest < Internal::Types::Model
8
+ field :request_id, -> { String }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Wavix
4
+ module NumberValidator
5
+ module Types
6
+ class GetNumberValidatorRequest < Internal::Types::Model
7
+ field :phone_number, -> { String }, optional: false, nullable: false
8
+
9
+ field :type, -> { Wavix::Types::PhoneNumberValidationType }, optional: false, nullable: false
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Wavix
4
+ module NumberValidator
5
+ module Types
6
+ class GetNumberValidatorResponse < Internal::Types::Model
7
+ field :phone_number, -> { String }, optional: false, nullable: false
8
+
9
+ field :valid, -> { Internal::Types::Boolean }, optional: false, nullable: false
10
+
11
+ field :country_code, -> { String }, optional: false, nullable: true
12
+
13
+ field :e164format, -> { String }, optional: false, nullable: false, api_name: "e164_format"
14
+
15
+ field :national_format, -> { String }, optional: false, nullable: false
16
+
17
+ field :ported, -> { Internal::Types::Boolean }, optional: true, nullable: false
18
+
19
+ field :mcc, -> { String }, optional: true, nullable: false
20
+
21
+ field :mnc, -> { String }, optional: true, nullable: false
22
+
23
+ field :number_type, -> { String }, optional: true, nullable: false
24
+
25
+ field :carrier_name, -> { String }, optional: true, nullable: false
26
+
27
+ field :risky_destination, -> { Internal::Types::Boolean }, optional: true, nullable: false
28
+
29
+ field :unallocated_range, -> { Internal::Types::Boolean }, optional: true, nullable: false
30
+
31
+ field :reachable, -> { Internal::Types::Boolean }, optional: true, nullable: false
32
+
33
+ field :roaming, -> { Internal::Types::Boolean }, optional: true, nullable: false
34
+
35
+ field :timezone, -> { String }, optional: true, nullable: false
36
+
37
+ field :charge, -> { String }, optional: false, nullable: false
38
+
39
+ field :error_code, -> { String }, optional: false, nullable: false
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Wavix
4
+ module NumberValidator
5
+ module Types
6
+ class PhoneValidationRequest < Internal::Types::Model
7
+ field :phone_numbers, -> { Internal::Types::Array[String] }, optional: false, nullable: false
8
+
9
+ field :type, -> { Wavix::Types::PhoneNumberValidationType }, optional: false, nullable: false
10
+
11
+ field :async, -> { Internal::Types::Boolean }, optional: false, nullable: false
12
+
13
+ field :force, -> { Internal::Types::Boolean }, optional: false, nullable: false
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,216 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Wavix
4
+ module Numbers
5
+ class Client
6
+ # @param client [Wavix::Internal::Http::RawClient]
7
+ #
8
+ # @return [void]
9
+ def initialize(client:)
10
+ @client = client
11
+ end
12
+
13
+ # Returns a paginated list of the phone numbers owned by the authenticated account.
14
+ #
15
+ # @param request_options [Hash]
16
+ # @param params [Hash]
17
+ # @option request_options [String] :base_url
18
+ # @option request_options [Hash{String => Object}] :additional_headers
19
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
20
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
21
+ # @option request_options [Integer] :timeout_in_seconds
22
+ # @option params [Integer, nil] :city_id
23
+ # @option params [String, nil] :search
24
+ # @option params [String, nil] :label
25
+ # @option params [Boolean, nil] :label_present
26
+ # @option params [Integer, nil] :page
27
+ # @option params [Integer, nil] :per_page
28
+ #
29
+ # @return [Wavix::Types::NumberListResponse]
30
+ def list(request_options: {}, **params)
31
+ params = Wavix::Internal::Types::Utils.normalize_keys(params)
32
+ query_params = {}
33
+ query_params["city_id"] = params[:city_id] if params.key?(:city_id)
34
+ query_params["search"] = params[:search] if params.key?(:search)
35
+ query_params["label"] = params[:label] if params.key?(:label)
36
+ query_params["label_present"] = params[:label_present] if params.key?(:label_present)
37
+ query_params["page"] = params[:page] if params.key?(:page)
38
+ query_params["per_page"] = params[:per_page] if params.key?(:per_page)
39
+
40
+ request = Wavix::Internal::JSON::Request.new(
41
+ base_url: request_options[:base_url],
42
+ method: "GET",
43
+ path: "v1/numbers",
44
+ query: query_params,
45
+ request_options: request_options
46
+ )
47
+ begin
48
+ response = @client.send(request)
49
+ rescue Net::HTTPRequestTimeout
50
+ raise Wavix::Errors::TimeoutError
51
+ end
52
+ code = response.code.to_i
53
+ if code.between?(200, 299)
54
+ Wavix::Types::NumberListResponse.load(response.body)
55
+ else
56
+ error_class = Wavix::Errors::ResponseError.subclass_for_code(code)
57
+ raise error_class.new(response.body, code: code)
58
+ end
59
+ end
60
+
61
+ # Releases the listed phone numbers back to stock. Selection accepts either `ids` (record IDs) or `dids` (phone
62
+ # numbers), but not both.
63
+ #
64
+ # @param request_options [Hash]
65
+ # @param params [Hash]
66
+ # @option request_options [String] :base_url
67
+ # @option request_options [Hash{String => Object}] :additional_headers
68
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
69
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
70
+ # @option request_options [Integer] :timeout_in_seconds
71
+ # @option params [Integer, nil] :ids
72
+ # @option params [String, nil] :dids
73
+ #
74
+ # @return [Wavix::Numbers::Types::DeleteNumbersResponse]
75
+ def delete(request_options: {}, **params)
76
+ params = Wavix::Internal::Types::Utils.normalize_keys(params)
77
+ query_params = {}
78
+ query_params["ids"] = params[:ids] if params.key?(:ids)
79
+ query_params["dids"] = params[:dids] if params.key?(:dids)
80
+
81
+ request = Wavix::Internal::JSON::Request.new(
82
+ base_url: request_options[:base_url],
83
+ method: "DELETE",
84
+ path: "v1/numbers",
85
+ query: query_params,
86
+ request_options: request_options
87
+ )
88
+ begin
89
+ response = @client.send(request)
90
+ rescue Net::HTTPRequestTimeout
91
+ raise Wavix::Errors::TimeoutError
92
+ end
93
+ code = response.code.to_i
94
+ if code.between?(200, 299)
95
+ Wavix::Numbers::Types::DeleteNumbersResponse.load(response.body)
96
+ else
97
+ error_class = Wavix::Errors::ResponseError.subclass_for_code(code)
98
+ raise error_class.new(response.body, code: code)
99
+ end
100
+ end
101
+
102
+ # Applies the same changes to every listed phone number. Only the provided fields are changed. Destination and SMS
103
+ # callback changes are applied asynchronously and may not be reflected in the response immediately.
104
+ #
105
+ # @param request_options [Hash]
106
+ # @param params [Wavix::Numbers::Types::NumberBulkUpdateRequest]
107
+ # @option request_options [String] :base_url
108
+ # @option request_options [Hash{String => Object}] :additional_headers
109
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
110
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
111
+ # @option request_options [Integer] :timeout_in_seconds
112
+ #
113
+ # @return [Wavix::Numbers::Types::BulkUpdateNumbersResponse]
114
+ def bulk_update(request_options: {}, **params)
115
+ params = Wavix::Internal::Types::Utils.normalize_keys(params)
116
+ request = Wavix::Internal::JSON::Request.new(
117
+ base_url: request_options[:base_url],
118
+ method: "PATCH",
119
+ path: "v1/numbers",
120
+ body: Wavix::Numbers::Types::NumberBulkUpdateRequest.new(params).to_h,
121
+ request_options: request_options
122
+ )
123
+ begin
124
+ response = @client.send(request)
125
+ rescue Net::HTTPRequestTimeout
126
+ raise Wavix::Errors::TimeoutError
127
+ end
128
+ code = response.code.to_i
129
+ if code.between?(200, 299)
130
+ Wavix::Numbers::Types::BulkUpdateNumbersResponse.load(response.body)
131
+ else
132
+ error_class = Wavix::Errors::ResponseError.subclass_for_code(code)
133
+ raise error_class.new(response.body, code: code)
134
+ end
135
+ end
136
+
137
+ # Returns the phone number identified by `id`, including its destinations, documents, and feature settings.
138
+ #
139
+ # @param request_options [Hash]
140
+ # @param params [Hash]
141
+ # @option request_options [String] :base_url
142
+ # @option request_options [Hash{String => Object}] :additional_headers
143
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
144
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
145
+ # @option request_options [Integer] :timeout_in_seconds
146
+ # @option params [Integer] :id
147
+ #
148
+ # @return [Wavix::Types::Number]
149
+ def get(request_options: {}, **params)
150
+ params = Wavix::Internal::Types::Utils.normalize_keys(params)
151
+ request = Wavix::Internal::JSON::Request.new(
152
+ base_url: request_options[:base_url],
153
+ method: "GET",
154
+ path: "v1/numbers/#{URI.encode_uri_component(params[:id].to_s)}",
155
+ request_options: request_options
156
+ )
157
+ begin
158
+ response = @client.send(request)
159
+ rescue Net::HTTPRequestTimeout
160
+ raise Wavix::Errors::TimeoutError
161
+ end
162
+ code = response.code.to_i
163
+ if code.between?(200, 299)
164
+ Wavix::Types::Number.load(response.body)
165
+ else
166
+ error_class = Wavix::Errors::ResponseError.subclass_for_code(code)
167
+ raise error_class.new(response.body, code: code)
168
+ end
169
+ end
170
+
171
+ # Updates the phone number identified by `id`. Only the provided fields are changed.
172
+ #
173
+ # @param request_options [Hash]
174
+ # @param params [Wavix::Numbers::Types::NumberUpdateRequest]
175
+ # @option request_options [String] :base_url
176
+ # @option request_options [Hash{String => Object}] :additional_headers
177
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
178
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
179
+ # @option request_options [Integer] :timeout_in_seconds
180
+ # @option params [Integer] :id
181
+ #
182
+ # @return [Wavix::Types::Number]
183
+ def update(request_options: {}, **params)
184
+ params = Wavix::Internal::Types::Utils.normalize_keys(params)
185
+ request_data = Wavix::Numbers::Types::NumberUpdateRequest.new(params).to_h
186
+ non_body_param_names = %w[id]
187
+ body = request_data.except(*non_body_param_names)
188
+
189
+ request = Wavix::Internal::JSON::Request.new(
190
+ base_url: request_options[:base_url],
191
+ method: "PATCH",
192
+ path: "v1/numbers/#{URI.encode_uri_component(params[:id].to_s)}",
193
+ body: body,
194
+ request_options: request_options
195
+ )
196
+ begin
197
+ response = @client.send(request)
198
+ rescue Net::HTTPRequestTimeout
199
+ raise Wavix::Errors::TimeoutError
200
+ end
201
+ code = response.code.to_i
202
+ if code.between?(200, 299)
203
+ Wavix::Types::Number.load(response.body)
204
+ else
205
+ error_class = Wavix::Errors::ResponseError.subclass_for_code(code)
206
+ raise error_class.new(response.body, code: code)
207
+ end
208
+ end
209
+
210
+ # @return [Wavix::Papers::Client]
211
+ def papers
212
+ @papers ||= Wavix::Numbers::Papers::Client.new(client: @client)
213
+ end
214
+ end
215
+ end
216
+ end
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Wavix
4
+ module Numbers
5
+ module Papers
6
+ class Client
7
+ # @param client [Wavix::Internal::Http::RawClient]
8
+ #
9
+ # @return [void]
10
+ def initialize(client:)
11
+ @client = client
12
+ end
13
+
14
+ # Uploads a verification document for one or more phone numbers.
15
+ # Uploaded files must meet the following requirements:
16
+ # - Allowed formats: PNG, JPG, JPEG, TIFF, BMP, or PDF
17
+ # - Maximum file size: 10 MB
18
+ # - Files can't be password protected
19
+ # - PDF files must not contain digital signatures
20
+ #
21
+ # @param request_options [Hash]
22
+ # @param params [void]
23
+ # @option request_options [String] :base_url
24
+ # @option request_options [Hash{String => Object}] :additional_headers
25
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
26
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
27
+ # @option request_options [Integer] :timeout_in_seconds
28
+ #
29
+ # @return [Array[Wavix::Types::NumberDocument]]
30
+ def upload(request_options: {}, **params)
31
+ params = Wavix::Internal::Types::Utils.normalize_keys(params)
32
+ body = Internal::Multipart::FormData.new
33
+
34
+ if params[:did_ids]
35
+ body.add(
36
+ name: "did_ids",
37
+ value: params[:did_ids]
38
+ )
39
+ end
40
+ body.add_part(params[:doc_attachment].to_form_data_part(name: "doc_attachment")) if params[:doc_attachment]
41
+ if params[:doc_id]
42
+ body.add(
43
+ name: "doc_id",
44
+ value: params[:doc_id]
45
+ )
46
+ end
47
+
48
+ request = Wavix::Internal::Multipart::Request.new(
49
+ base_url: request_options[:base_url],
50
+ method: "POST",
51
+ path: "v1/numbers/papers",
52
+ body: body,
53
+ request_options: request_options
54
+ )
55
+ begin
56
+ response = @client.send(request)
57
+ rescue Net::HTTPRequestTimeout
58
+ raise Wavix::Errors::TimeoutError
59
+ end
60
+ code = response.code.to_i
61
+ return if code.between?(200, 299)
62
+
63
+ error_class = Wavix::Errors::ResponseError.subclass_for_code(code)
64
+ raise error_class.new(response.body, code: code)
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Wavix
4
+ module Numbers
5
+ module Papers
6
+ module Types
7
+ class UploadPapersRequest < Internal::Types::Model; end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Wavix
4
+ module Numbers
5
+ module Types
6
+ class BulkUpdateNumbersResponse < Internal::Types::Model
7
+ field :items, -> { Internal::Types::Array[Wavix::Types::Number] }, optional: true, nullable: false
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Wavix
4
+ module Numbers
5
+ module Types
6
+ class DeleteNumbersRequest < Internal::Types::Model
7
+ field :ids, -> { Integer }, optional: true, nullable: false
8
+
9
+ field :dids, -> { String }, optional: true, nullable: false
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Wavix
4
+ module Numbers
5
+ module Types
6
+ class DeleteNumbersResponse < Internal::Types::Model
7
+ field :success, -> { Internal::Types::Boolean }, optional: false, nullable: false
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Wavix
4
+ module Numbers
5
+ module Types
6
+ class GetNumbersRequest < Internal::Types::Model
7
+ field :id, -> { Integer }, optional: false, nullable: false
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Wavix
4
+ module Numbers
5
+ module Types
6
+ class ListNumbersRequest < Internal::Types::Model
7
+ field :city_id, -> { Integer }, optional: true, nullable: false
8
+
9
+ field :search, -> { String }, optional: true, nullable: false
10
+
11
+ field :label, -> { String }, optional: true, nullable: false
12
+
13
+ field :label_present, -> { Internal::Types::Boolean }, optional: true, nullable: false
14
+
15
+ field :page, -> { Integer }, optional: true, nullable: false
16
+
17
+ field :per_page, -> { Integer }, optional: true, nullable: false
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Wavix
4
+ module Numbers
5
+ module Types
6
+ class NumberBulkUpdateRequest < Internal::Types::Model
7
+ field :ids, -> { Internal::Types::Array[Integer] }, optional: false, nullable: false
8
+
9
+ field :sms_enabled, -> { Internal::Types::Boolean }, optional: true, nullable: false
10
+
11
+ field :destinations, -> { Internal::Types::Array[Wavix::Types::NumberDestination] }, optional: true, nullable: false
12
+
13
+ field :sms_relay_url, -> { String }, optional: true, nullable: false
14
+
15
+ field :call_recording_enabled, -> { Internal::Types::Boolean }, optional: true, nullable: false
16
+
17
+ field :transcription_enabled, -> { Internal::Types::Boolean }, optional: true, nullable: false
18
+
19
+ field :transcription_threshold, -> { Integer }, optional: true, nullable: false
20
+
21
+ field :call_status_url, -> { String }, optional: true, nullable: false
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Wavix
4
+ module Numbers
5
+ module Types
6
+ class NumberUpdateRequest < Internal::Types::Model
7
+ field :id, -> { Integer }, optional: false, nullable: false
8
+
9
+ field :sms_enabled, -> { Internal::Types::Boolean }, optional: true, nullable: false
10
+
11
+ field :destinations, -> { Internal::Types::Array[Wavix::Types::NumberDestination] }, optional: true, nullable: false
12
+
13
+ field :sms_relay_url, -> { String }, optional: true, nullable: false
14
+
15
+ field :call_recording_enabled, -> { Internal::Types::Boolean }, optional: true, nullable: false
16
+
17
+ field :transcription_enabled, -> { Internal::Types::Boolean }, optional: true, nullable: false
18
+
19
+ field :transcription_threshold, -> { Integer }, optional: true, nullable: false
20
+
21
+ field :call_status_url, -> { String }, optional: true, nullable: false
22
+ end
23
+ end
24
+ end
25
+ end