sentdm 0.2.0 → 0.3.1

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 (354) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -0
  3. data/README.md +105 -39
  4. data/lib/sentdm/client.rb +36 -36
  5. data/lib/sentdm/internal/type/base_model.rb +5 -5
  6. data/lib/sentdm/internal/type/enum.rb +25 -0
  7. data/lib/sentdm/internal/util.rb +31 -0
  8. data/lib/sentdm/models/api_error.rb +42 -0
  9. data/lib/sentdm/models/api_meta.rb +42 -0
  10. data/lib/sentdm/models/api_response_brand_with_kyc.rb +43 -0
  11. data/lib/sentdm/models/api_response_contact.rb +43 -0
  12. data/lib/sentdm/models/api_response_of_profile_detail.rb +43 -0
  13. data/lib/sentdm/models/api_response_of_user.rb +43 -0
  14. data/lib/sentdm/models/api_response_template.rb +43 -0
  15. data/lib/sentdm/models/api_response_webhook.rb +43 -0
  16. data/lib/sentdm/models/brand_create_params.rb +41 -0
  17. data/lib/sentdm/models/brand_data.rb +237 -0
  18. data/lib/sentdm/models/brand_delete_params.rb +34 -0
  19. data/lib/sentdm/models/{message_retrieve_params.rb → brand_list_params.rb} +2 -2
  20. data/lib/sentdm/models/brand_list_response.rb +43 -0
  21. data/lib/sentdm/models/brand_update_params.rb +48 -0
  22. data/lib/sentdm/models/brand_with_kyc.rb +335 -0
  23. data/lib/sentdm/models/brands/api_response_tcr_campaign_with_use_cases.rb +45 -0
  24. data/lib/sentdm/models/brands/base_dto.rb +32 -0
  25. data/lib/sentdm/models/brands/campaign_create_params.rb +50 -0
  26. data/lib/sentdm/models/brands/campaign_data.rb +123 -0
  27. data/lib/sentdm/models/brands/campaign_delete_params.rb +43 -0
  28. data/lib/sentdm/models/brands/campaign_list_params.rb +22 -0
  29. data/lib/sentdm/models/brands/campaign_list_response.rb +47 -0
  30. data/lib/sentdm/models/brands/campaign_update_params.rb +57 -0
  31. data/lib/sentdm/models/brands/messaging_use_case_us.rb +28 -0
  32. data/lib/sentdm/models/brands/sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_campaigns_campaign_use_case_data.rb +30 -0
  33. data/lib/sentdm/models/brands/tcr_campaign_with_use_cases.rb +236 -0
  34. data/lib/sentdm/models/contact.rb +122 -0
  35. data/lib/sentdm/models/contact_create_params.rb +41 -0
  36. data/lib/sentdm/models/contact_delete_params.rb +34 -0
  37. data/lib/sentdm/models/contact_list_params.rb +28 -5
  38. data/lib/sentdm/models/contact_list_response.rb +46 -21
  39. data/lib/sentdm/models/{contact_retrieve_id_params.rb → contact_retrieve_params.rb} +3 -5
  40. data/lib/sentdm/models/contact_update_params.rb +56 -0
  41. data/lib/sentdm/models/destination_country.rb +21 -0
  42. data/lib/sentdm/models/{number_lookup_retrieve_params.rb → lookup_retrieve_phone_info_params.rb} +2 -2
  43. data/lib/sentdm/models/lookup_retrieve_phone_info_response.rb +104 -0
  44. data/lib/sentdm/models/me_retrieve_params.rb +14 -0
  45. data/lib/sentdm/models/me_retrieve_response.rb +200 -0
  46. data/lib/sentdm/models/message_retrieve_activities_params.rb +20 -0
  47. data/lib/sentdm/models/message_retrieve_activities_response.rb +103 -0
  48. data/lib/sentdm/models/message_retrieve_status_params.rb +20 -0
  49. data/lib/sentdm/models/message_retrieve_status_response.rb +237 -0
  50. data/lib/sentdm/models/message_send_params.rb +88 -0
  51. data/lib/sentdm/models/message_send_response.rb +123 -0
  52. data/lib/sentdm/models/mutation_request.rb +20 -0
  53. data/lib/sentdm/models/pagination_meta.rb +80 -0
  54. data/lib/sentdm/models/profile_complete_params.rb +48 -0
  55. data/lib/sentdm/models/profile_complete_response.rb +8 -0
  56. data/lib/sentdm/models/profile_create_params.rb +122 -0
  57. data/lib/sentdm/models/profile_delete_params.rb +41 -0
  58. data/lib/sentdm/models/profile_detail.rb +200 -0
  59. data/lib/sentdm/models/profile_list_params.rb +14 -0
  60. data/lib/sentdm/models/profile_list_response.rb +57 -0
  61. data/lib/sentdm/models/profile_retrieve_params.rb +20 -0
  62. data/lib/sentdm/models/profile_settings.rb +66 -0
  63. data/lib/sentdm/models/profile_update_params.rb +176 -0
  64. data/lib/sentdm/models/sent_dm_services_common_contracts_poc_os_authentication_config.rb +34 -0
  65. data/lib/sentdm/models/sent_dm_services_common_contracts_poc_os_template_body.rb +40 -0
  66. data/lib/sentdm/models/sent_dm_services_common_contracts_poc_os_template_button.rb +38 -0
  67. data/lib/sentdm/models/sent_dm_services_common_contracts_poc_os_template_button_props.rb +81 -0
  68. data/lib/sentdm/models/sent_dm_services_common_contracts_poc_os_template_footer.rb +34 -0
  69. data/lib/sentdm/models/sent_dm_services_common_contracts_poc_os_template_header.rb +39 -0
  70. data/lib/sentdm/models/tcr_brand_relationship.rb +18 -0
  71. data/lib/sentdm/models/tcr_vertical.rb +36 -0
  72. data/lib/sentdm/models/template.rb +90 -0
  73. data/lib/sentdm/models/template_create_params.rb +40 -19
  74. data/lib/sentdm/models/template_definition.rb +15 -255
  75. data/lib/sentdm/models/template_delete_params.rb +29 -1
  76. data/lib/sentdm/models/template_list_params.rb +9 -10
  77. data/lib/sentdm/models/template_list_response.rb +46 -21
  78. data/lib/sentdm/models/template_retrieve_params.rb +7 -1
  79. data/lib/sentdm/models/template_update_params.rb +80 -0
  80. data/lib/sentdm/models/user_invite_params.rb +57 -0
  81. data/lib/sentdm/models/user_list_params.rb +14 -0
  82. data/lib/sentdm/models/user_list_response.rb +57 -0
  83. data/lib/sentdm/models/user_remove_params.rb +41 -0
  84. data/lib/sentdm/models/user_response.rb +82 -0
  85. data/lib/sentdm/models/user_retrieve_params.rb +20 -0
  86. data/lib/sentdm/models/user_update_role_params.rb +56 -0
  87. data/lib/sentdm/models/webhook_create_params.rb +68 -0
  88. data/lib/sentdm/models/webhook_delete_params.rb +20 -0
  89. data/lib/sentdm/models/webhook_list_event_types_params.rb +14 -0
  90. data/lib/sentdm/models/webhook_list_event_types_response.rb +85 -0
  91. data/lib/sentdm/models/webhook_list_events_params.rb +38 -0
  92. data/lib/sentdm/models/webhook_list_events_response.rb +135 -0
  93. data/lib/sentdm/models/webhook_list_params.rb +38 -0
  94. data/lib/sentdm/models/webhook_list_response.rb +64 -0
  95. data/lib/sentdm/models/webhook_response.rb +87 -0
  96. data/lib/sentdm/models/webhook_retrieve_params.rb +20 -0
  97. data/lib/sentdm/models/webhook_rotate_secret_params.rb +36 -0
  98. data/lib/sentdm/models/webhook_rotate_secret_response.rb +56 -0
  99. data/lib/sentdm/models/webhook_test_params.rb +47 -0
  100. data/lib/sentdm/models/webhook_test_response.rb +62 -0
  101. data/lib/sentdm/models/webhook_toggle_status_params.rb +47 -0
  102. data/lib/sentdm/models/webhook_update_params.rb +75 -0
  103. data/lib/sentdm/models.rb +124 -10
  104. data/lib/sentdm/resources/brands/campaigns.rb +145 -0
  105. data/lib/sentdm/resources/brands.rb +130 -0
  106. data/lib/sentdm/resources/contacts.rb +113 -38
  107. data/lib/sentdm/resources/lookup.rb +35 -0
  108. data/lib/sentdm/resources/me.rb +35 -0
  109. data/lib/sentdm/resources/messages.rb +43 -77
  110. data/lib/sentdm/resources/profiles.rb +255 -0
  111. data/lib/sentdm/resources/templates.rb +97 -46
  112. data/lib/sentdm/resources/users.rb +159 -0
  113. data/lib/sentdm/resources/webhooks.rb +298 -0
  114. data/lib/sentdm/version.rb +1 -1
  115. data/lib/sentdm.rb +94 -12
  116. data/rbi/sentdm/client.rbi +28 -25
  117. data/rbi/sentdm/internal/util.rbi +20 -0
  118. data/rbi/sentdm/models/api_error.rbi +66 -0
  119. data/rbi/sentdm/models/api_meta.rbi +69 -0
  120. data/rbi/sentdm/models/api_response_brand_with_kyc.rbi +74 -0
  121. data/rbi/sentdm/models/api_response_contact.rbi +74 -0
  122. data/rbi/sentdm/models/api_response_of_profile_detail.rbi +74 -0
  123. data/rbi/sentdm/models/api_response_of_user.rbi +74 -0
  124. data/rbi/sentdm/models/api_response_template.rbi +74 -0
  125. data/rbi/sentdm/models/api_response_webhook.rbi +74 -0
  126. data/rbi/sentdm/models/brand_create_params.rbi +68 -0
  127. data/rbi/sentdm/models/brand_data.rbi +266 -0
  128. data/rbi/sentdm/models/brand_delete_params.rbi +68 -0
  129. data/rbi/sentdm/models/{message_retrieve_params.rbi → brand_list_params.rbi} +2 -2
  130. data/rbi/sentdm/models/brand_list_response.rbi +71 -0
  131. data/rbi/sentdm/models/brand_update_params.rbi +74 -0
  132. data/rbi/sentdm/models/brand_with_kyc.rbi +398 -0
  133. data/rbi/sentdm/models/brands/api_response_tcr_campaign_with_use_cases.rbi +83 -0
  134. data/rbi/sentdm/models/brands/base_dto.rbi +53 -0
  135. data/rbi/sentdm/models/brands/campaign_create_params.rbi +79 -0
  136. data/rbi/sentdm/models/brands/campaign_data.rbi +148 -0
  137. data/rbi/sentdm/models/brands/campaign_delete_params.rbi +84 -0
  138. data/rbi/sentdm/models/brands/campaign_list_params.rbi +37 -0
  139. data/rbi/sentdm/models/brands/campaign_list_response.rbi +82 -0
  140. data/rbi/sentdm/models/brands/campaign_update_params.rbi +85 -0
  141. data/rbi/sentdm/models/brands/messaging_use_case_us.rbi +69 -0
  142. data/rbi/sentdm/models/brands/sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_campaigns_campaign_use_case_data.rbi +52 -0
  143. data/rbi/sentdm/models/brands/tcr_campaign_with_use_cases.rbi +404 -0
  144. data/rbi/sentdm/models/contact.rbi +179 -0
  145. data/rbi/sentdm/models/contact_create_params.rbi +68 -0
  146. data/rbi/sentdm/models/contact_delete_params.rbi +68 -0
  147. data/rbi/sentdm/models/contact_list_params.rbi +26 -4
  148. data/rbi/sentdm/models/contact_list_response.rbi +91 -37
  149. data/rbi/sentdm/models/{contact_retrieve_id_params.rbi → contact_retrieve_params.rbi} +3 -8
  150. data/rbi/sentdm/models/contact_update_params.rbi +79 -0
  151. data/rbi/sentdm/models/destination_country.rbi +32 -0
  152. data/rbi/sentdm/models/{number_lookup_retrieve_params.rbi → lookup_retrieve_phone_info_params.rbi} +5 -2
  153. data/rbi/sentdm/models/lookup_retrieve_phone_info_response.rbi +183 -0
  154. data/rbi/sentdm/models/me_retrieve_params.rbi +27 -0
  155. data/rbi/sentdm/models/me_retrieve_response.rbi +314 -0
  156. data/rbi/sentdm/models/message_retrieve_activities_params.rbi +38 -0
  157. data/rbi/sentdm/models/message_retrieve_activities_response.rbi +234 -0
  158. data/rbi/sentdm/models/message_retrieve_status_params.rbi +35 -0
  159. data/rbi/sentdm/models/message_retrieve_status_response.rbi +434 -0
  160. data/rbi/sentdm/models/message_send_params.rbi +143 -0
  161. data/rbi/sentdm/models/message_send_response.rbi +231 -0
  162. data/rbi/sentdm/models/mutation_request.rbi +32 -0
  163. data/rbi/sentdm/models/pagination_meta.rbi +135 -0
  164. data/rbi/sentdm/models/profile_complete_params.rbi +71 -0
  165. data/rbi/sentdm/models/profile_complete_response.rbi +8 -0
  166. data/rbi/sentdm/models/profile_create_params.rbi +156 -0
  167. data/rbi/sentdm/models/profile_delete_params.rbi +65 -0
  168. data/rbi/sentdm/models/profile_detail.rbi +273 -0
  169. data/rbi/sentdm/models/profile_list_params.rbi +27 -0
  170. data/rbi/sentdm/models/profile_list_response.rbi +111 -0
  171. data/rbi/sentdm/models/profile_retrieve_params.rbi +35 -0
  172. data/rbi/sentdm/models/profile_settings.rbi +86 -0
  173. data/rbi/sentdm/models/profile_update_params.rbi +202 -0
  174. data/rbi/sentdm/models/sent_dm_services_common_contracts_poc_os_authentication_config.rbi +56 -0
  175. data/rbi/sentdm/models/sent_dm_services_common_contracts_poc_os_template_body.rbi +76 -0
  176. data/rbi/sentdm/models/sent_dm_services_common_contracts_poc_os_template_button.rbi +79 -0
  177. data/rbi/sentdm/models/sent_dm_services_common_contracts_poc_os_template_button_props.rbi +104 -0
  178. data/rbi/sentdm/models/sent_dm_services_common_contracts_poc_os_template_footer.rbi +60 -0
  179. data/rbi/sentdm/models/sent_dm_services_common_contracts_poc_os_template_header.rbi +62 -0
  180. data/rbi/sentdm/models/tcr_brand_relationship.rbi +30 -0
  181. data/rbi/sentdm/models/tcr_vertical.rbi +41 -0
  182. data/rbi/sentdm/models/template.rbi +129 -0
  183. data/rbi/sentdm/models/template_create_params.rbi +47 -23
  184. data/rbi/sentdm/models/template_definition.rbi +74 -405
  185. data/rbi/sentdm/models/template_delete_params.rbi +42 -5
  186. data/rbi/sentdm/models/template_list_params.rbi +8 -10
  187. data/rbi/sentdm/models/template_list_response.rbi +91 -37
  188. data/rbi/sentdm/models/template_retrieve_params.rbi +13 -5
  189. data/rbi/sentdm/models/template_update_params.rbi +111 -0
  190. data/rbi/sentdm/models/user_invite_params.rbi +90 -0
  191. data/rbi/sentdm/models/user_list_params.rbi +27 -0
  192. data/rbi/sentdm/models/user_list_response.rbi +111 -0
  193. data/rbi/sentdm/models/user_remove_params.rbi +65 -0
  194. data/rbi/sentdm/models/user_response.rbi +118 -0
  195. data/rbi/sentdm/models/user_retrieve_params.rbi +35 -0
  196. data/rbi/sentdm/models/user_update_role_params.rbi +85 -0
  197. data/rbi/sentdm/models/webhook_create_params.rbi +102 -0
  198. data/rbi/sentdm/models/webhook_delete_params.rbi +35 -0
  199. data/rbi/sentdm/models/webhook_list_event_types_params.rbi +27 -0
  200. data/rbi/sentdm/models/webhook_list_event_types_response.rbi +206 -0
  201. data/rbi/sentdm/models/webhook_list_events_params.rbi +53 -0
  202. data/rbi/sentdm/models/webhook_list_events_response.rbi +263 -0
  203. data/rbi/sentdm/models/webhook_list_params.rbi +59 -0
  204. data/rbi/sentdm/models/webhook_list_response.rbi +126 -0
  205. data/rbi/sentdm/models/webhook_response.rbi +134 -0
  206. data/rbi/sentdm/models/webhook_retrieve_params.rbi +35 -0
  207. data/rbi/sentdm/models/webhook_rotate_secret_params.rbi +72 -0
  208. data/rbi/sentdm/models/webhook_rotate_secret_response.rbi +112 -0
  209. data/rbi/sentdm/models/webhook_test_params.rbi +72 -0
  210. data/rbi/sentdm/models/webhook_test_response.rbi +111 -0
  211. data/rbi/sentdm/models/webhook_toggle_status_params.rbi +72 -0
  212. data/rbi/sentdm/models/webhook_update_params.rbi +108 -0
  213. data/rbi/sentdm/models.rbi +125 -10
  214. data/rbi/sentdm/resources/brands/campaigns.rbi +109 -0
  215. data/rbi/sentdm/resources/brands.rbi +95 -0
  216. data/rbi/sentdm/resources/contacts.rbi +90 -26
  217. data/rbi/sentdm/resources/lookup.rbi +24 -0
  218. data/rbi/sentdm/resources/me.rbi +24 -0
  219. data/rbi/sentdm/resources/messages.rbi +42 -60
  220. data/rbi/sentdm/resources/profiles.rbi +239 -0
  221. data/rbi/sentdm/resources/templates.rbi +95 -41
  222. data/rbi/sentdm/resources/users.rbi +117 -0
  223. data/rbi/sentdm/resources/webhooks.rbi +219 -0
  224. data/sig/sentdm/client.rbs +11 -8
  225. data/sig/sentdm/internal/util.rbs +10 -0
  226. data/sig/sentdm/models/api_error.rbs +39 -0
  227. data/sig/sentdm/models/api_meta.rbs +41 -0
  228. data/sig/sentdm/models/api_response_brand_with_kyc.rbs +39 -0
  229. data/sig/sentdm/models/api_response_contact.rbs +39 -0
  230. data/sig/sentdm/models/api_response_of_profile_detail.rbs +39 -0
  231. data/sig/sentdm/models/api_response_of_user.rbs +39 -0
  232. data/sig/sentdm/models/api_response_template.rbs +39 -0
  233. data/sig/sentdm/models/api_response_webhook.rbs +39 -0
  234. data/sig/sentdm/models/brand_create_params.rbs +36 -0
  235. data/sig/sentdm/models/brand_data.rbs +164 -0
  236. data/sig/sentdm/models/brand_delete_params.rbs +36 -0
  237. data/sig/sentdm/models/brand_list_params.rbs +14 -0
  238. data/sig/sentdm/models/brand_list_response.rbs +39 -0
  239. data/sig/sentdm/models/brand_update_params.rbs +45 -0
  240. data/sig/sentdm/models/brand_with_kyc.rbs +237 -0
  241. data/sig/sentdm/models/brands/api_response_tcr_campaign_with_use_cases.rbs +41 -0
  242. data/sig/sentdm/models/brands/base_dto.rbs +27 -0
  243. data/sig/sentdm/models/brands/campaign_create_params.rbs +47 -0
  244. data/sig/sentdm/models/brands/campaign_data.rbs +82 -0
  245. data/sig/sentdm/models/brands/campaign_delete_params.rbs +46 -0
  246. data/sig/sentdm/models/brands/campaign_list_params.rbs +25 -0
  247. data/sig/sentdm/models/brands/campaign_list_response.rbs +41 -0
  248. data/sig/sentdm/models/brands/campaign_update_params.rbs +52 -0
  249. data/sig/sentdm/models/brands/messaging_use_case_us.rbs +40 -0
  250. data/sig/sentdm/models/brands/sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_campaigns_campaign_use_case_data.rbs +27 -0
  251. data/sig/sentdm/models/brands/tcr_campaign_with_use_cases.rbs +285 -0
  252. data/sig/sentdm/models/{contact_list_item.rbs → contact.rbs} +31 -5
  253. data/sig/sentdm/models/contact_create_params.rbs +38 -0
  254. data/sig/sentdm/models/contact_delete_params.rbs +36 -0
  255. data/sig/sentdm/models/contact_list_params.rbs +19 -1
  256. data/sig/sentdm/models/contact_list_response.rbs +44 -31
  257. data/sig/sentdm/models/{contact_retrieve_id_params.rbs → contact_retrieve_params.rbs} +2 -2
  258. data/sig/sentdm/models/contact_update_params.rbs +50 -0
  259. data/sig/sentdm/models/destination_country.rbs +19 -0
  260. data/sig/sentdm/models/{number_lookup_retrieve_params.rbs → lookup_retrieve_phone_info_params.rbs} +2 -2
  261. data/sig/sentdm/models/lookup_retrieve_phone_info_response.rbs +102 -0
  262. data/sig/sentdm/models/me_retrieve_params.rbs +14 -0
  263. data/sig/sentdm/models/me_retrieve_response.rbs +162 -0
  264. data/sig/sentdm/models/message_retrieve_activities_params.rbs +20 -0
  265. data/sig/sentdm/models/message_retrieve_activities_response.rbs +105 -0
  266. data/sig/sentdm/models/message_retrieve_status_params.rbs +20 -0
  267. data/sig/sentdm/models/message_retrieve_status_response.rbs +224 -0
  268. data/sig/sentdm/models/message_send_params.rbs +79 -0
  269. data/sig/sentdm/models/message_send_response.rbs +108 -0
  270. data/sig/sentdm/models/mutation_request.rbs +15 -0
  271. data/sig/sentdm/models/pagination_meta.rbs +67 -0
  272. data/sig/sentdm/models/profile_complete_params.rbs +45 -0
  273. data/sig/sentdm/models/profile_complete_response.rbs +5 -0
  274. data/sig/sentdm/models/profile_create_params.rbs +96 -0
  275. data/sig/sentdm/models/profile_delete_params.rbs +36 -0
  276. data/sig/sentdm/models/profile_detail.rbs +168 -0
  277. data/sig/sentdm/models/profile_list_params.rbs +14 -0
  278. data/sig/sentdm/models/profile_list_response.rbs +53 -0
  279. data/sig/sentdm/models/{contact_retrieve_by_phone_params.rbs → profile_retrieve_params.rbs} +6 -6
  280. data/sig/sentdm/models/profile_settings.rbs +50 -0
  281. data/sig/sentdm/models/profile_update_params.rbs +127 -0
  282. data/sig/sentdm/models/sent_dm_services_common_contracts_poc_os_authentication_config.rbs +24 -0
  283. data/sig/sentdm/models/sent_dm_services_common_contracts_poc_os_template_body.rbs +30 -0
  284. data/sig/sentdm/models/sent_dm_services_common_contracts_poc_os_template_button.rbs +38 -0
  285. data/sig/sentdm/models/sent_dm_services_common_contracts_poc_os_template_button_props.rbs +75 -0
  286. data/sig/sentdm/models/sent_dm_services_common_contracts_poc_os_template_footer.rbs +32 -0
  287. data/sig/sentdm/models/sent_dm_services_common_contracts_poc_os_template_header.rbs +32 -0
  288. data/sig/sentdm/models/tcr_brand_relationship.rbs +22 -0
  289. data/sig/sentdm/models/tcr_vertical.rbs +58 -0
  290. data/sig/sentdm/models/{template_response_v2.rbs → template.rbs} +18 -31
  291. data/sig/sentdm/models/template_create_params.rbs +29 -6
  292. data/sig/sentdm/models/template_definition.rbs +20 -233
  293. data/sig/sentdm/models/template_delete_params.rbs +22 -3
  294. data/sig/sentdm/models/template_list_response.rbs +44 -31
  295. data/sig/sentdm/models/template_retrieve_params.rbs +8 -3
  296. data/sig/sentdm/models/template_update_params.rbs +67 -0
  297. data/sig/sentdm/models/user_invite_params.rbs +56 -0
  298. data/sig/sentdm/models/user_list_params.rbs +14 -0
  299. data/sig/sentdm/models/user_list_response.rbs +53 -0
  300. data/sig/sentdm/models/user_remove_params.rbs +36 -0
  301. data/sig/sentdm/models/user_response.rbs +72 -0
  302. data/sig/sentdm/models/user_retrieve_params.rbs +23 -0
  303. data/sig/sentdm/models/user_update_role_params.rbs +54 -0
  304. data/sig/sentdm/models/webhook_create_params.rbs +70 -0
  305. data/sig/sentdm/models/webhook_delete_params.rbs +20 -0
  306. data/sig/sentdm/models/{message_retrieve_params.rbs → webhook_list_event_types_params.rbs} +2 -2
  307. data/sig/sentdm/models/webhook_list_event_types_response.rbs +98 -0
  308. data/sig/sentdm/models/webhook_list_events_params.rbs +36 -0
  309. data/sig/sentdm/models/webhook_list_events_response.rbs +146 -0
  310. data/sig/sentdm/models/webhook_list_params.rbs +36 -0
  311. data/sig/sentdm/models/webhook_list_response.rbs +67 -0
  312. data/sig/sentdm/models/webhook_response.rbs +98 -0
  313. data/sig/sentdm/models/webhook_retrieve_params.rbs +20 -0
  314. data/sig/sentdm/models/webhook_rotate_secret_params.rbs +46 -0
  315. data/sig/sentdm/models/webhook_rotate_secret_response.rbs +51 -0
  316. data/sig/sentdm/models/webhook_test_params.rbs +47 -0
  317. data/sig/sentdm/models/webhook_test_response.rbs +55 -0
  318. data/sig/sentdm/models/webhook_toggle_status_params.rbs +42 -0
  319. data/sig/sentdm/models/webhook_update_params.rbs +75 -0
  320. data/sig/sentdm/models.rbs +118 -10
  321. data/sig/sentdm/resources/brands/campaigns.rbs +38 -0
  322. data/sig/sentdm/resources/brands.rbs +34 -0
  323. data/sig/sentdm/resources/contacts.rbs +28 -8
  324. data/sig/sentdm/resources/lookup.rbs +12 -0
  325. data/sig/sentdm/resources/{number_lookup.rbs → me.rbs} +2 -3
  326. data/sig/sentdm/resources/messages.rbs +12 -18
  327. data/sig/sentdm/resources/profiles.rbs +72 -0
  328. data/sig/sentdm/resources/templates.rbs +24 -4
  329. data/sig/sentdm/resources/users.rbs +41 -0
  330. data/sig/sentdm/resources/webhooks.rbs +80 -0
  331. metadata +284 -38
  332. data/lib/sentdm/models/contact_list_item.rb +0 -96
  333. data/lib/sentdm/models/contact_retrieve_by_phone_params.rb +0 -22
  334. data/lib/sentdm/models/message_retrieve_response.rb +0 -227
  335. data/lib/sentdm/models/message_send_quick_message_params.rb +0 -34
  336. data/lib/sentdm/models/message_send_to_contact_params.rb +0 -46
  337. data/lib/sentdm/models/message_send_to_phone_params.rb +0 -47
  338. data/lib/sentdm/models/number_lookup_retrieve_response.rb +0 -83
  339. data/lib/sentdm/models/template_response_v2.rb +0 -100
  340. data/lib/sentdm/resources/number_lookup.rb +0 -37
  341. data/rbi/sentdm/models/contact_list_item.rbi +0 -144
  342. data/rbi/sentdm/models/contact_retrieve_by_phone_params.rbi +0 -40
  343. data/rbi/sentdm/models/message_retrieve_response.rbi +0 -376
  344. data/rbi/sentdm/models/message_send_quick_message_params.rbi +0 -56
  345. data/rbi/sentdm/models/message_send_to_contact_params.rbi +0 -63
  346. data/rbi/sentdm/models/message_send_to_phone_params.rbi +0 -65
  347. data/rbi/sentdm/models/number_lookup_retrieve_response.rbi +0 -132
  348. data/rbi/sentdm/models/template_response_v2.rbi +0 -149
  349. data/rbi/sentdm/resources/number_lookup.rbi +0 -24
  350. data/sig/sentdm/models/message_retrieve_response.rbs +0 -188
  351. data/sig/sentdm/models/message_send_quick_message_params.rbs +0 -28
  352. data/sig/sentdm/models/message_send_to_contact_params.rbs +0 -36
  353. data/sig/sentdm/models/message_send_to_phone_params.rbs +0 -36
  354. data/sig/sentdm/models/number_lookup_retrieve_response.rbs +0 -78
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fab8dc014cdfdffd5db27dfeb306c0202ca83650d6d6e318538907885673f451
4
- data.tar.gz: 1a700098dc48f38b8552099ac2927132a0a619ef603d3afacdd7ee4b93fe4d29
3
+ metadata.gz: 55daa4cbbfa67e7eab52f43a902db3dfa1e12804f514a6fed126a2adb84e9cb5
4
+ data.tar.gz: 20bca2938be488c2018679a9c26a4799c0e82c16dbc7c9fa69cf6adb4bcf59df
5
5
  SHA512:
6
- metadata.gz: 64dc4a9f5d777c149fa0d7bc2fd7ecdb22da7d2e5a778717567bc617e201fd5cc275500d1d3a670404fb3e7350a51259774e5f6ad1aea585a0edcd72a3911f2d
7
- data.tar.gz: cb1dc7f0eea9e923b18d3ba2267e9d984eb75ed73dbd93bba4c6d2d17bb65f3bba883aeed481c48dfb3e934b7c25f7cc449fbf744a54c004edc5b0756d29c03d
6
+ metadata.gz: 95fe7e54513a8dfd92833d88a4a954933caeeb5d9ec3af775f851fb718713c4d1450728c048782fb86aa7337a26703934c54d0cf229242df69f2cf12ac15272c
7
+ data.tar.gz: 7f0972a458476b6482b7158dd7c5ab721191761943df7081e1226af7d10523ac27eb36b7257d1906e18d8fcf84e3af345c3b6134de0e0da9ec8987856c036186
data/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.1 (2026-03-11)
4
+
5
+ Full Changelog: [v0.3.0...v0.3.1](https://github.com/sentdm/sent-dm-ruby/compare/v0.3.0...v0.3.1)
6
+
7
+ ### Bug Fixes
8
+
9
+ * properly mock time in ruby ci tests ([4c4ebe0](https://github.com/sentdm/sent-dm-ruby/commit/4c4ebe03e980346d3ecc508e2740ad2ded666a8e))
10
+
11
+
12
+ ### Chores
13
+
14
+ * **ci:** add build step ([e67706a](https://github.com/sentdm/sent-dm-ruby/commit/e67706ab8895b76ca683a3e2e47244650be6aca0))
15
+ * **ci:** skip uploading artifacts on stainless-internal branches ([1d6bb94](https://github.com/sentdm/sent-dm-ruby/commit/1d6bb94d3b4eb5b4383827200ead9f557c39c72f))
16
+ * **internal:** codegen related update ([0dd8713](https://github.com/sentdm/sent-dm-ruby/commit/0dd871352c089d8e40788912ba5c1eec907f4640))
17
+ * **internal:** codegen related update ([7b3ead8](https://github.com/sentdm/sent-dm-ruby/commit/7b3ead8de1ffc36ea448af5eed97ac1fc4f462bb))
18
+
19
+ ## 0.3.0 (2026-02-18)
20
+
21
+ Full Changelog: [v0.2.0...v0.3.0](https://github.com/sentdm/sent-dm-ruby/compare/v0.2.0...v0.3.0)
22
+
23
+ ### Features
24
+
25
+ * **api:** manual updates ([e674172](https://github.com/sentdm/sent-dm-ruby/commit/e674172971f06d5616165303b01e6c0a24cf3744))
26
+ * **api:** manual updates ([6262e32](https://github.com/sentdm/sent-dm-ruby/commit/6262e327f30368608f29890d469c0352b9da80c8))
27
+ * **api:** manual updates ([33fff26](https://github.com/sentdm/sent-dm-ruby/commit/33fff2647eb26bde013600c8632b160a46f1eb73))
28
+
3
29
  ## 0.2.0 (2026-02-16)
4
30
 
5
31
  Full Changelog: [v0.1.0...v0.2.0](https://github.com/sentdm/sent-dm-ruby/compare/v0.1.0...v0.2.0)
data/README.md CHANGED
@@ -4,6 +4,15 @@ The Sent Dm Ruby library provides convenient access to the Sent Dm REST API from
4
4
 
5
5
  It is generated with [Stainless](https://www.stainless.com/).
6
6
 
7
+ ## MCP Server
8
+
9
+ Use the Sent Dm MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.
10
+
11
+ [![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40sentdm%2Fsentdm-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBzZW50ZG0vc2VudGRtLW1jcCJdLCJlbnYiOnsiU0VOVF9ETV9BUElfS0VZIjoiTXkgQVBJIEtleSJ9fQ)
12
+ [![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40sentdm%2Fsentdm-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40sentdm%2Fsentdm-mcp%22%5D%2C%22env%22%3A%7B%22SENT_DM_API_KEY%22%3A%22My%20API%20Key%22%7D%7D)
13
+
14
+ > Note: You may need to set environment variables in your MCP client.
15
+
7
16
  ## Documentation
8
17
 
9
18
  Documentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/sentdm).
@@ -17,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application
17
26
  <!-- x-release-please-start-version -->
18
27
 
19
28
  ```ruby
20
- gem "sentdm", "~> 0.2.0"
29
+ gem "sentdm", "~> 0.3.1"
21
30
  ```
22
31
 
23
32
  <!-- x-release-please-end -->
@@ -29,17 +38,20 @@ require "bundler/setup"
29
38
  require "sentdm"
30
39
 
31
40
  sent_dm = Sentdm::Client.new(
32
- api_key: ENV["SENT_DM_API_KEY"], # This is the default and can be omitted
33
- sender_id: ENV["SENT_DM_SENDER_ID"] # This is the default and can be omitted
41
+ api_key: ENV["SENT_DM_API_KEY"] # This is the default and can be omitted
34
42
  )
35
43
 
36
- result = sent_dm.messages.send_to_phone(
37
- phone_number: "+1234567890",
38
- template_id: "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
39
- template_variables: {name: "John Doe", order_id: "12345"}
44
+ response = sent_dm.messages.send_(
45
+ channel: ["sms", "whatsapp"],
46
+ template: {
47
+ id: "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
48
+ name: "order_confirmation",
49
+ parameters: {name: "John Doe", order_id: "12345"}
50
+ },
51
+ to: ["+14155551234", "+14155555678"]
40
52
  )
41
53
 
42
- puts(result)
54
+ puts(response.data)
43
55
  ```
44
56
 
45
57
  ### Handling errors
@@ -48,10 +60,14 @@ When the library is unable to connect to the API, or if the API returns a non-su
48
60
 
49
61
  ```ruby
50
62
  begin
51
- message = sent_dm.messages.send_to_phone(
52
- phone_number: "+1234567890",
53
- template_id: "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
54
- template_variables: {name: "John Doe", order_id: "12345"}
63
+ message = sent_dm.messages.send_(
64
+ channel: ["sms"],
65
+ template: {
66
+ id: "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
67
+ name: "order_confirmation",
68
+ parameters: {name: "John Doe", order_id: "12345"}
69
+ },
70
+ to: ["+14155551234"]
55
71
  )
56
72
  rescue Sentdm::Errors::APIConnectionError => e
57
73
  puts("The server could not be reached")
@@ -95,10 +111,14 @@ sent_dm = Sentdm::Client.new(
95
111
  )
96
112
 
97
113
  # Or, configure per-request:
98
- sent_dm.messages.send_to_phone(
99
- phone_number: "+1234567890",
100
- template_id: "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
101
- template_variables: {name: "John Doe", order_id: "12345"},
114
+ sent_dm.messages.send_(
115
+ channel: ["sms"],
116
+ template: {
117
+ id: "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
118
+ name: "order_confirmation",
119
+ parameters: {name: "John Doe", order_id: "12345"}
120
+ },
121
+ to: ["+14155551234"],
102
122
  request_options: {max_retries: 5}
103
123
  )
104
124
  ```
@@ -114,10 +134,14 @@ sent_dm = Sentdm::Client.new(
114
134
  )
115
135
 
116
136
  # Or, configure per-request:
117
- sent_dm.messages.send_to_phone(
118
- phone_number: "+1234567890",
119
- template_id: "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
120
- template_variables: {name: "John Doe", order_id: "12345"},
137
+ sent_dm.messages.send_(
138
+ channel: ["sms"],
139
+ template: {
140
+ id: "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
141
+ name: "order_confirmation",
142
+ parameters: {name: "John Doe", order_id: "12345"}
143
+ },
144
+ to: ["+14155551234"],
121
145
  request_options: {timeout: 5}
122
146
  )
123
147
  ```
@@ -149,11 +173,15 @@ You can send undocumented parameters to any endpoint, and read undocumented resp
149
173
  Note: the `extra_` parameters of the same name overrides the documented parameters.
150
174
 
151
175
  ```ruby
152
- result =
153
- sent_dm.messages.send_to_phone(
154
- phone_number: "+1234567890",
155
- template_id: "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
156
- template_variables: {name: "John Doe", order_id: "12345"},
176
+ response =
177
+ sent_dm.messages.send_(
178
+ channel: ["sms"],
179
+ template: {
180
+ id: "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
181
+ name: "order_confirmation",
182
+ parameters: {name: "John Doe", order_id: "12345"}
183
+ },
184
+ to: ["+14155551234"],
157
185
  request_options: {
158
186
  extra_query: {my_query_parameter: value},
159
187
  extra_body: {my_body_parameter: value},
@@ -161,7 +189,7 @@ result =
161
189
  }
162
190
  )
163
191
 
164
- puts(result[:my_undocumented_property])
192
+ puts(response[:my_undocumented_property])
165
193
  ```
166
194
 
167
195
  #### Undocumented request params
@@ -199,10 +227,14 @@ This library provides comprehensive [RBI](https://sorbet.org/docs/rbi) definitio
199
227
  You can provide typesafe request parameters like so:
200
228
 
201
229
  ```ruby
202
- sent_dm.messages.send_to_phone(
203
- phone_number: "+1234567890",
204
- template_id: "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
205
- template_variables: {name: "John Doe", order_id: "12345"}
230
+ sent_dm.messages.send_(
231
+ channel: ["sms", "whatsapp"],
232
+ template: Sentdm::MessageSendParams::Template.new(
233
+ id: "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
234
+ name: "order_confirmation",
235
+ parameters: {name: "John Doe", order_id: "12345"}
236
+ ),
237
+ to: ["+14155551234", "+14155555678"]
206
238
  )
207
239
  ```
208
240
 
@@ -210,19 +242,53 @@ Or, equivalently:
210
242
 
211
243
  ```ruby
212
244
  # Hashes work, but are not typesafe:
213
- sent_dm.messages.send_to_phone(
214
- phone_number: "+1234567890",
215
- template_id: "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
216
- template_variables: {name: "John Doe", order_id: "12345"}
245
+ sent_dm.messages.send_(
246
+ channel: ["sms", "whatsapp"],
247
+ template: {
248
+ id: "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
249
+ name: "order_confirmation",
250
+ parameters: {name: "John Doe", order_id: "12345"}
251
+ },
252
+ to: ["+14155551234", "+14155555678"]
217
253
  )
218
254
 
219
255
  # You can also splat a full Params class:
220
- params = Sentdm::MessageSendToPhoneParams.new(
221
- phone_number: "+1234567890",
222
- template_id: "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
223
- template_variables: {name: "John Doe", order_id: "12345"}
256
+ params = Sentdm::MessageSendParams.new(
257
+ channel: ["sms", "whatsapp"],
258
+ template: Sentdm::MessageSendParams::Template.new(
259
+ id: "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
260
+ name: "order_confirmation",
261
+ parameters: {name: "John Doe", order_id: "12345"}
262
+ ),
263
+ to: ["+14155551234", "+14155555678"]
264
+ )
265
+ sent_dm.messages.send_(**params)
266
+ ```
267
+
268
+ ### Enums
269
+
270
+ Since this library does not depend on `sorbet-runtime`, it cannot provide [`T::Enum`](https://sorbet.org/docs/tenum) instances. Instead, we provide "tagged symbols" instead, which is always a primitive at runtime:
271
+
272
+ ```ruby
273
+ # :BASIC_ACCOUNT
274
+ puts(Sentdm::TcrBrandRelationship::BASIC_ACCOUNT)
275
+
276
+ # Revealed type: `T.all(Sentdm::TcrBrandRelationship, Symbol)`
277
+ T.reveal_type(Sentdm::TcrBrandRelationship::BASIC_ACCOUNT)
278
+ ```
279
+
280
+ Enum parameters have a "relaxed" type, so you can either pass in enum constants or their literal value:
281
+
282
+ ```ruby
283
+ Sentdm::BrandData.new(
284
+ brand_relationship: Sentdm::TcrBrandRelationship::BASIC_ACCOUNT,
285
+ # …
286
+ )
287
+
288
+ Sentdm::BrandData.new(
289
+ brand_relationship: :BASIC_ACCOUNT,
290
+ # …
224
291
  )
225
- sent_dm.messages.send_to_phone(**params)
226
292
  ```
227
293
 
228
294
  ## Versioning
data/lib/sentdm/client.rb CHANGED
@@ -20,42 +20,46 @@ module Sentdm
20
20
  # @return [String]
21
21
  attr_reader :api_key
22
22
 
23
- # Customer sender ID (UUID) identifying the customer account. Obtain this from
24
- # your account settings. Pass via the `x-sender-id` header.
25
- # @return [String]
26
- attr_reader :sender_id
23
+ # Configure webhook endpoints for real-time event delivery
24
+ # @return [Sentdm::Resources::Webhooks]
25
+ attr_reader :webhooks
27
26
 
28
- # @return [Sentdm::Resources::Contacts]
29
- attr_reader :contacts
27
+ # Invite, update, and manage organization users and roles
28
+ # @return [Sentdm::Resources::Users]
29
+ attr_reader :users
30
+
31
+ # Manage message templates with variable substitution
32
+ # @return [Sentdm::Resources::Templates]
33
+ attr_reader :templates
30
34
 
35
+ # Manage organization profiles
36
+ # @return [Sentdm::Resources::Profiles]
37
+ attr_reader :profiles
38
+
39
+ # Send and track SMS and WhatsApp messages
31
40
  # @return [Sentdm::Resources::Messages]
32
41
  attr_reader :messages
33
42
 
34
- # @return [Sentdm::Resources::Templates]
35
- attr_reader :templates
43
+ # @return [Sentdm::Resources::Lookup]
44
+ attr_reader :lookup
36
45
 
37
- # @return [Sentdm::Resources::NumberLookup]
38
- attr_reader :number_lookup
46
+ # Create, update, and manage customer contact lists
47
+ # @return [Sentdm::Resources::Contacts]
48
+ attr_reader :contacts
39
49
 
40
- # @api private
41
- #
42
- # @return [Hash{String=>String}]
43
- private def auth_headers
44
- {**customer_api_key, **customer_sender_id}
45
- end
50
+ # Register and manage 10DLC brands for SMS compliance
51
+ # @return [Sentdm::Resources::Brands]
52
+ attr_reader :brands
46
53
 
47
- # @api private
48
- #
49
- # @return [Hash{String=>String}]
50
- private def customer_api_key
51
- {"x-api-key" => @api_key}
52
- end
54
+ # Retrieve account details
55
+ # @return [Sentdm::Resources::Me]
56
+ attr_reader :me
53
57
 
54
58
  # @api private
55
59
  #
56
60
  # @return [Hash{String=>String}]
57
- private def customer_sender_id
58
- {"x-sender-id" => @sender_id}
61
+ private def auth_headers
62
+ {"x-api-key" => @api_key}
59
63
  end
60
64
 
61
65
  # Creates and returns a new client for interacting with the API.
@@ -64,10 +68,6 @@ module Sentdm
64
68
  # `sk_test_*` keys for sandbox/testing. Pass via the `x-api-key` header. Defaults
65
69
  # to `ENV["SENT_DM_API_KEY"]`
66
70
  #
67
- # @param sender_id [String, nil] Customer sender ID (UUID) identifying the customer account. Obtain this from
68
- # your account settings. Pass via the `x-sender-id` header. Defaults to
69
- # `ENV["SENT_DM_SENDER_ID"]`
70
- #
71
71
  # @param base_url [String, nil] Override the default base URL for the API, e.g.,
72
72
  # `"https://api.example.com/v2/"`. Defaults to `ENV["SENT_DM_BASE_URL"]`
73
73
  #
@@ -80,7 +80,6 @@ module Sentdm
80
80
  # @param max_retry_delay [Float]
81
81
  def initialize(
82
82
  api_key: ENV["SENT_DM_API_KEY"],
83
- sender_id: ENV["SENT_DM_SENDER_ID"],
84
83
  base_url: ENV["SENT_DM_BASE_URL"],
85
84
  max_retries: self.class::DEFAULT_MAX_RETRIES,
86
85
  timeout: self.class::DEFAULT_TIMEOUT_IN_SECONDS,
@@ -92,12 +91,8 @@ module Sentdm
92
91
  if api_key.nil?
93
92
  raise ArgumentError.new("api_key is required, and can be set via environ: \"SENT_DM_API_KEY\"")
94
93
  end
95
- if sender_id.nil?
96
- raise ArgumentError.new("sender_id is required, and can be set via environ: \"SENT_DM_SENDER_ID\"")
97
- end
98
94
 
99
95
  @api_key = api_key.to_s
100
- @sender_id = sender_id.to_s
101
96
 
102
97
  super(
103
98
  base_url: base_url,
@@ -107,10 +102,15 @@ module Sentdm
107
102
  max_retry_delay: max_retry_delay
108
103
  )
109
104
 
110
- @contacts = Sentdm::Resources::Contacts.new(client: self)
111
- @messages = Sentdm::Resources::Messages.new(client: self)
105
+ @webhooks = Sentdm::Resources::Webhooks.new(client: self)
106
+ @users = Sentdm::Resources::Users.new(client: self)
112
107
  @templates = Sentdm::Resources::Templates.new(client: self)
113
- @number_lookup = Sentdm::Resources::NumberLookup.new(client: self)
108
+ @profiles = Sentdm::Resources::Profiles.new(client: self)
109
+ @messages = Sentdm::Resources::Messages.new(client: self)
110
+ @lookup = Sentdm::Resources::Lookup.new(client: self)
111
+ @contacts = Sentdm::Resources::Contacts.new(client: self)
112
+ @brands = Sentdm::Resources::Brands.new(client: self)
113
+ @me = Sentdm::Resources::Me.new(client: self)
114
114
  end
115
115
  end
116
116
  end
@@ -438,11 +438,11 @@ module Sentdm
438
438
  # @return [Hash{Symbol=>Object}]
439
439
  #
440
440
  # @example
441
- # # `contact_list_item` is a `Sentdm::ContactListItem`
442
- # contact_list_item => {
443
- # id: id,
444
- # available_channels: available_channels,
445
- # country_code: country_code
441
+ # # `api_error` is a `Sentdm::APIError`
442
+ # api_error => {
443
+ # code: code,
444
+ # details: details,
445
+ # doc_url: doc_url
446
446
  # }
447
447
  def deconstruct_keys(keys)
448
448
  (keys || self.class.known_fields.keys)
@@ -15,6 +15,31 @@ module Sentdm
15
15
  #
16
16
  # We can therefore convert string values to Symbols, but can't convert other
17
17
  # values safely.
18
+ #
19
+ # @example
20
+ # # `tcr_brand_relationship` is a `Sentdm::TcrBrandRelationship`
21
+ # case tcr_brand_relationship
22
+ # when Sentdm::TcrBrandRelationship::BASIC_ACCOUNT
23
+ # # ...
24
+ # when Sentdm::TcrBrandRelationship::MEDIUM_ACCOUNT
25
+ # # ...
26
+ # when Sentdm::TcrBrandRelationship::LARGE_ACCOUNT
27
+ # # ...
28
+ # else
29
+ # puts(tcr_brand_relationship)
30
+ # end
31
+ #
32
+ # @example
33
+ # case tcr_brand_relationship
34
+ # in :BASIC_ACCOUNT
35
+ # # ...
36
+ # in :MEDIUM_ACCOUNT
37
+ # # ...
38
+ # in :LARGE_ACCOUNT
39
+ # # ...
40
+ # else
41
+ # puts(tcr_brand_relationship)
42
+ # end
18
43
  module Enum
19
44
  include Sentdm::Internal::Type::Converter
20
45
  include Sentdm::Internal::Util::SorbetRuntimeSupport
@@ -490,6 +490,37 @@ module Sentdm
490
490
  JSONL_CONTENT = %r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}
491
491
 
492
492
  class << self
493
+ # @api private
494
+ #
495
+ # @param query [Hash{Symbol=>Object}]
496
+ #
497
+ # @return [Hash{Symbol=>Object}]
498
+ def encode_query_params(query)
499
+ out = {}
500
+ query.each { write_query_param_element!(out, _1, _2) }
501
+ out
502
+ end
503
+
504
+ # @api private
505
+ #
506
+ # @param collection [Hash{Symbol=>Object}]
507
+ # @param key [String]
508
+ # @param element [Object]
509
+ #
510
+ # @return [nil]
511
+ private def write_query_param_element!(collection, key, element)
512
+ case element
513
+ in Hash
514
+ element.each do |name, value|
515
+ write_query_param_element!(collection, "#{key}[#{name}]", value)
516
+ end
517
+ in Array
518
+ collection[key] = element.map(&:to_s).join(",")
519
+ else
520
+ collection[key] = element.to_s
521
+ end
522
+ end
523
+
493
524
  # @api private
494
525
  #
495
526
  # @param y [Enumerator::Yielder]
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Models
5
+ class APIError < Sentdm::Internal::Type::BaseModel
6
+ # @!attribute code
7
+ # Machine-readable error code (e.g., "RESOURCE_001")
8
+ #
9
+ # @return [String, nil]
10
+ optional :code, String
11
+
12
+ # @!attribute details
13
+ # Additional validation error details (field-level errors)
14
+ #
15
+ # @return [Hash{Symbol=>Array<String>}, nil]
16
+ optional :details, Sentdm::Internal::Type::HashOf[Sentdm::Internal::Type::ArrayOf[String]], nil?: true
17
+
18
+ # @!attribute doc_url
19
+ # URL to documentation about this error
20
+ #
21
+ # @return [String, nil]
22
+ optional :doc_url, String, nil?: true
23
+
24
+ # @!attribute message
25
+ # Human-readable error message
26
+ #
27
+ # @return [String, nil]
28
+ optional :message, String
29
+
30
+ # @!method initialize(code: nil, details: nil, doc_url: nil, message: nil)
31
+ # Error information
32
+ #
33
+ # @param code [String] Machine-readable error code (e.g., "RESOURCE_001")
34
+ #
35
+ # @param details [Hash{Symbol=>Array<String>}, nil] Additional validation error details (field-level errors)
36
+ #
37
+ # @param doc_url [String, nil] URL to documentation about this error
38
+ #
39
+ # @param message [String] Human-readable error message
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Models
5
+ class APIMeta < Sentdm::Internal::Type::BaseModel
6
+ # @!attribute request_id
7
+ # Unique identifier for this request (for tracing and support)
8
+ #
9
+ # @return [String, nil]
10
+ optional :request_id, String
11
+
12
+ # @!attribute response_time_ms
13
+ # Response time in milliseconds (optional)
14
+ #
15
+ # @return [Integer, nil]
16
+ optional :response_time_ms, Integer, nil?: true
17
+
18
+ # @!attribute timestamp
19
+ # Server timestamp when the response was generated
20
+ #
21
+ # @return [Time, nil]
22
+ optional :timestamp, Time
23
+
24
+ # @!attribute version
25
+ # API version used for this request
26
+ #
27
+ # @return [String, nil]
28
+ optional :version, String
29
+
30
+ # @!method initialize(request_id: nil, response_time_ms: nil, timestamp: nil, version: nil)
31
+ # Request and response metadata
32
+ #
33
+ # @param request_id [String] Unique identifier for this request (for tracing and support)
34
+ #
35
+ # @param response_time_ms [Integer, nil] Response time in milliseconds (optional)
36
+ #
37
+ # @param timestamp [Time] Server timestamp when the response was generated
38
+ #
39
+ # @param version [String] API version used for this request
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Models
5
+ # @see Sentdm::Resources::Brands#create
6
+ class APIResponseBrandWithKYC < Sentdm::Internal::Type::BaseModel
7
+ # @!attribute data
8
+ # The response data (null if error)
9
+ #
10
+ # @return [Sentdm::Models::BrandWithKYC, nil]
11
+ optional :data, -> { Sentdm::BrandWithKYC }, nil?: true
12
+
13
+ # @!attribute error
14
+ # Error details (null if successful)
15
+ #
16
+ # @return [Sentdm::Models::APIError, nil]
17
+ optional :error, -> { Sentdm::APIError }, nil?: true
18
+
19
+ # @!attribute meta
20
+ # Metadata about the request and response
21
+ #
22
+ # @return [Sentdm::Models::APIMeta, nil]
23
+ optional :meta, -> { Sentdm::APIMeta }
24
+
25
+ # @!attribute success
26
+ # Indicates whether the request was successful
27
+ #
28
+ # @return [Boolean, nil]
29
+ optional :success, Sentdm::Internal::Type::Boolean
30
+
31
+ # @!method initialize(data: nil, error: nil, meta: nil, success: nil)
32
+ # Standard API response envelope for all v3 endpoints
33
+ #
34
+ # @param data [Sentdm::Models::BrandWithKYC, nil] The response data (null if error)
35
+ #
36
+ # @param error [Sentdm::Models::APIError, nil] Error details (null if successful)
37
+ #
38
+ # @param meta [Sentdm::Models::APIMeta] Metadata about the request and response
39
+ #
40
+ # @param success [Boolean] Indicates whether the request was successful
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Models
5
+ # @see Sentdm::Resources::Contacts#create
6
+ class APIResponseContact < Sentdm::Internal::Type::BaseModel
7
+ # @!attribute data
8
+ # The response data (null if error)
9
+ #
10
+ # @return [Sentdm::Models::Contact, nil]
11
+ optional :data, -> { Sentdm::Contact }, nil?: true
12
+
13
+ # @!attribute error
14
+ # Error details (null if successful)
15
+ #
16
+ # @return [Sentdm::Models::APIError, nil]
17
+ optional :error, -> { Sentdm::APIError }, nil?: true
18
+
19
+ # @!attribute meta
20
+ # Metadata about the request and response
21
+ #
22
+ # @return [Sentdm::Models::APIMeta, nil]
23
+ optional :meta, -> { Sentdm::APIMeta }
24
+
25
+ # @!attribute success
26
+ # Indicates whether the request was successful
27
+ #
28
+ # @return [Boolean, nil]
29
+ optional :success, Sentdm::Internal::Type::Boolean
30
+
31
+ # @!method initialize(data: nil, error: nil, meta: nil, success: nil)
32
+ # Standard API response envelope for all v3 endpoints
33
+ #
34
+ # @param data [Sentdm::Models::Contact, nil] The response data (null if error)
35
+ #
36
+ # @param error [Sentdm::Models::APIError, nil] Error details (null if successful)
37
+ #
38
+ # @param meta [Sentdm::Models::APIMeta] Metadata about the request and response
39
+ #
40
+ # @param success [Boolean] Indicates whether the request was successful
41
+ end
42
+ end
43
+ end