sentdm 0.1.0 → 0.3.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 (361) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/README.md +96 -39
  4. data/lib/sentdm/client.rb +29 -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/models/api_error.rb +42 -0
  8. data/lib/sentdm/models/api_meta.rb +42 -0
  9. data/lib/sentdm/models/api_response_brand_with_kyc.rb +43 -0
  10. data/lib/sentdm/models/api_response_contact.rb +43 -0
  11. data/lib/sentdm/models/api_response_of_profile_detail.rb +43 -0
  12. data/lib/sentdm/models/api_response_of_user.rb +43 -0
  13. data/lib/sentdm/models/api_response_template.rb +43 -0
  14. data/lib/sentdm/models/api_response_webhook.rb +43 -0
  15. data/lib/sentdm/models/brand_create_params.rb +41 -0
  16. data/lib/sentdm/models/brand_data.rb +237 -0
  17. data/lib/sentdm/models/brand_delete_params.rb +27 -0
  18. data/lib/sentdm/models/brand_list_params.rb +14 -0
  19. data/lib/sentdm/models/brand_list_response.rb +43 -0
  20. data/lib/sentdm/models/brand_update_params.rb +41 -0
  21. data/lib/sentdm/models/brand_with_kyc.rb +335 -0
  22. data/lib/sentdm/models/brands/api_response_tcr_campaign_with_use_cases.rb +45 -0
  23. data/lib/sentdm/models/brands/base_dto.rb +32 -0
  24. data/lib/sentdm/models/brands/campaign_create_params.rb +43 -0
  25. data/lib/sentdm/models/brands/campaign_data.rb +123 -0
  26. data/lib/sentdm/models/brands/campaign_delete_params.rb +36 -0
  27. data/lib/sentdm/models/brands/campaign_list_params.rb +16 -0
  28. data/lib/sentdm/models/brands/campaign_list_response.rb +47 -0
  29. data/lib/sentdm/models/brands/campaign_update_params.rb +50 -0
  30. data/lib/sentdm/models/brands/messaging_use_case_us.rb +28 -0
  31. data/lib/sentdm/models/brands/sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_campaigns_campaign_use_case_data.rb +30 -0
  32. data/lib/sentdm/models/brands/tcr_campaign_with_use_cases.rb +236 -0
  33. data/lib/sentdm/models/contact.rb +122 -0
  34. data/lib/sentdm/models/contact_create_params.rb +41 -0
  35. data/lib/sentdm/models/contact_delete_params.rb +27 -0
  36. data/lib/sentdm/models/contact_list_params.rb +28 -5
  37. data/lib/sentdm/models/contact_list_response.rb +46 -21
  38. data/lib/sentdm/models/{message_retrieve_params.rb → contact_retrieve_params.rb} +2 -2
  39. data/lib/sentdm/models/contact_update_params.rb +49 -0
  40. data/lib/sentdm/models/destination_country.rb +21 -0
  41. data/lib/sentdm/models/lookup_retrieve_phone_info_params.rb +14 -0
  42. data/lib/sentdm/models/lookup_retrieve_phone_info_response.rb +104 -0
  43. data/lib/sentdm/models/me_retrieve_params.rb +14 -0
  44. data/lib/sentdm/models/me_retrieve_response.rb +200 -0
  45. data/lib/sentdm/models/message_retrieve_activities_params.rb +14 -0
  46. data/lib/sentdm/models/message_retrieve_activities_response.rb +103 -0
  47. data/lib/sentdm/models/message_retrieve_status_params.rb +14 -0
  48. data/lib/sentdm/models/message_retrieve_status_response.rb +237 -0
  49. data/lib/sentdm/models/message_send_params.rb +88 -0
  50. data/lib/sentdm/models/message_send_response.rb +123 -0
  51. data/lib/sentdm/models/mutation_request.rb +20 -0
  52. data/lib/sentdm/models/pagination_meta.rb +80 -0
  53. data/lib/sentdm/models/profile_complete_params.rb +41 -0
  54. data/lib/sentdm/models/profile_complete_response.rb +8 -0
  55. data/lib/sentdm/models/profile_create_params.rb +122 -0
  56. data/lib/sentdm/models/profile_delete_params.rb +34 -0
  57. data/lib/sentdm/models/profile_detail.rb +200 -0
  58. data/lib/sentdm/models/profile_list_params.rb +14 -0
  59. data/lib/sentdm/models/profile_list_response.rb +57 -0
  60. data/lib/sentdm/models/profile_retrieve_params.rb +14 -0
  61. data/lib/sentdm/models/profile_settings.rb +66 -0
  62. data/lib/sentdm/models/profile_update_params.rb +169 -0
  63. data/lib/sentdm/models/sent_dm_services_common_contracts_poc_os_authentication_config.rb +34 -0
  64. data/lib/sentdm/models/sent_dm_services_common_contracts_poc_os_template_body.rb +40 -0
  65. data/lib/sentdm/models/sent_dm_services_common_contracts_poc_os_template_button.rb +38 -0
  66. data/lib/sentdm/models/sent_dm_services_common_contracts_poc_os_template_button_props.rb +81 -0
  67. data/lib/sentdm/models/sent_dm_services_common_contracts_poc_os_template_footer.rb +34 -0
  68. data/lib/sentdm/models/sent_dm_services_common_contracts_poc_os_template_header.rb +39 -0
  69. data/lib/sentdm/models/tcr_brand_relationship.rb +18 -0
  70. data/lib/sentdm/models/tcr_vertical.rb +36 -0
  71. data/lib/sentdm/models/template.rb +90 -0
  72. data/lib/sentdm/models/template_create_params.rb +40 -19
  73. data/lib/sentdm/models/template_definition.rb +15 -255
  74. data/lib/sentdm/models/template_delete_params.rb +22 -1
  75. data/lib/sentdm/models/template_list_params.rb +9 -10
  76. data/lib/sentdm/models/template_list_response.rb +46 -21
  77. data/lib/sentdm/models/template_update_params.rb +73 -0
  78. data/lib/sentdm/models/user_invite_params.rb +57 -0
  79. data/lib/sentdm/models/user_list_params.rb +14 -0
  80. data/lib/sentdm/models/user_list_response.rb +57 -0
  81. data/lib/sentdm/models/user_remove_params.rb +34 -0
  82. data/lib/sentdm/models/user_response.rb +82 -0
  83. data/lib/sentdm/models/user_retrieve_params.rb +14 -0
  84. data/lib/sentdm/models/user_update_role_params.rb +49 -0
  85. data/lib/sentdm/models/webhook_create_params.rb +68 -0
  86. data/lib/sentdm/models/webhook_delete_params.rb +14 -0
  87. data/lib/sentdm/models/webhook_list_event_types_params.rb +14 -0
  88. data/lib/sentdm/models/webhook_list_event_types_response.rb +85 -0
  89. data/lib/sentdm/models/webhook_list_events_params.rb +32 -0
  90. data/lib/sentdm/models/webhook_list_events_response.rb +135 -0
  91. data/lib/sentdm/models/webhook_list_params.rb +38 -0
  92. data/lib/sentdm/models/webhook_list_response.rb +64 -0
  93. data/lib/sentdm/models/webhook_response.rb +87 -0
  94. data/lib/sentdm/models/webhook_retrieve_params.rb +14 -0
  95. data/lib/sentdm/models/webhook_rotate_secret_params.rb +30 -0
  96. data/lib/sentdm/models/webhook_rotate_secret_response.rb +56 -0
  97. data/lib/sentdm/models/webhook_test_params.rb +40 -0
  98. data/lib/sentdm/models/webhook_test_response.rb +62 -0
  99. data/lib/sentdm/models/webhook_toggle_status_params.rb +40 -0
  100. data/lib/sentdm/models/webhook_update_params.rb +68 -0
  101. data/lib/sentdm/models.rb +124 -10
  102. data/lib/sentdm/resources/brands/campaigns.rb +144 -0
  103. data/lib/sentdm/resources/brands.rb +128 -0
  104. data/lib/sentdm/resources/contacts.rb +111 -38
  105. data/lib/sentdm/resources/lookup.rb +35 -0
  106. data/lib/sentdm/resources/me.rb +34 -0
  107. data/lib/sentdm/resources/messages.rb +42 -77
  108. data/lib/sentdm/resources/profiles.rb +254 -0
  109. data/lib/sentdm/resources/templates.rb +94 -45
  110. data/lib/sentdm/resources/users.rb +158 -0
  111. data/lib/sentdm/resources/webhooks.rb +295 -0
  112. data/lib/sentdm/version.rb +1 -1
  113. data/lib/sentdm.rb +94 -14
  114. data/rbi/sentdm/client.rbi +22 -25
  115. data/rbi/sentdm/models/api_error.rbi +66 -0
  116. data/rbi/sentdm/models/api_meta.rbi +69 -0
  117. data/rbi/sentdm/models/api_response_brand_with_kyc.rbi +74 -0
  118. data/rbi/sentdm/models/api_response_contact.rbi +74 -0
  119. data/rbi/sentdm/models/api_response_of_profile_detail.rbi +74 -0
  120. data/rbi/sentdm/models/api_response_of_user.rbi +74 -0
  121. data/rbi/sentdm/models/api_response_template.rbi +74 -0
  122. data/rbi/sentdm/models/api_response_webhook.rbi +74 -0
  123. data/rbi/sentdm/models/brand_create_params.rbi +68 -0
  124. data/rbi/sentdm/models/brand_data.rbi +266 -0
  125. data/rbi/sentdm/models/brand_delete_params.rbi +62 -0
  126. data/rbi/sentdm/models/brand_list_params.rbi +27 -0
  127. data/rbi/sentdm/models/brand_list_response.rbi +71 -0
  128. data/rbi/sentdm/models/brand_update_params.rbi +68 -0
  129. data/rbi/sentdm/models/brand_with_kyc.rbi +398 -0
  130. data/rbi/sentdm/models/brands/api_response_tcr_campaign_with_use_cases.rbi +83 -0
  131. data/rbi/sentdm/models/brands/base_dto.rbi +53 -0
  132. data/rbi/sentdm/models/brands/campaign_create_params.rbi +73 -0
  133. data/rbi/sentdm/models/brands/campaign_data.rbi +148 -0
  134. data/rbi/sentdm/models/brands/campaign_delete_params.rbi +78 -0
  135. data/rbi/sentdm/models/brands/campaign_list_params.rbi +29 -0
  136. data/rbi/sentdm/models/brands/campaign_list_response.rbi +82 -0
  137. data/rbi/sentdm/models/brands/campaign_update_params.rbi +79 -0
  138. data/rbi/sentdm/models/brands/messaging_use_case_us.rbi +69 -0
  139. data/rbi/sentdm/models/brands/sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_campaigns_campaign_use_case_data.rbi +52 -0
  140. data/rbi/sentdm/models/brands/tcr_campaign_with_use_cases.rbi +404 -0
  141. data/rbi/sentdm/models/contact.rbi +179 -0
  142. data/rbi/sentdm/models/contact_create_params.rbi +68 -0
  143. data/rbi/sentdm/models/contact_delete_params.rbi +62 -0
  144. data/rbi/sentdm/models/contact_list_params.rbi +26 -4
  145. data/rbi/sentdm/models/contact_list_response.rbi +91 -37
  146. data/rbi/sentdm/models/{message_retrieve_params.rbi → contact_retrieve_params.rbi} +2 -2
  147. data/rbi/sentdm/models/contact_update_params.rbi +73 -0
  148. data/rbi/sentdm/models/destination_country.rbi +32 -0
  149. data/rbi/sentdm/models/lookup_retrieve_phone_info_params.rbi +30 -0
  150. data/rbi/sentdm/models/lookup_retrieve_phone_info_response.rbi +183 -0
  151. data/rbi/sentdm/models/me_retrieve_params.rbi +27 -0
  152. data/rbi/sentdm/models/me_retrieve_response.rbi +314 -0
  153. data/rbi/sentdm/models/message_retrieve_activities_params.rbi +30 -0
  154. data/rbi/sentdm/models/message_retrieve_activities_response.rbi +234 -0
  155. data/rbi/sentdm/models/message_retrieve_status_params.rbi +27 -0
  156. data/rbi/sentdm/models/message_retrieve_status_response.rbi +434 -0
  157. data/rbi/sentdm/models/message_send_params.rbi +143 -0
  158. data/rbi/sentdm/models/message_send_response.rbi +231 -0
  159. data/rbi/sentdm/models/mutation_request.rbi +32 -0
  160. data/rbi/sentdm/models/pagination_meta.rbi +135 -0
  161. data/rbi/sentdm/models/profile_complete_params.rbi +65 -0
  162. data/rbi/sentdm/models/profile_complete_response.rbi +8 -0
  163. data/rbi/sentdm/models/profile_create_params.rbi +156 -0
  164. data/rbi/sentdm/models/profile_delete_params.rbi +59 -0
  165. data/rbi/sentdm/models/profile_detail.rbi +273 -0
  166. data/rbi/sentdm/models/profile_list_params.rbi +27 -0
  167. data/rbi/sentdm/models/profile_list_response.rbi +111 -0
  168. data/rbi/sentdm/models/profile_retrieve_params.rbi +27 -0
  169. data/rbi/sentdm/models/profile_settings.rbi +86 -0
  170. data/rbi/sentdm/models/profile_update_params.rbi +196 -0
  171. data/rbi/sentdm/models/sent_dm_services_common_contracts_poc_os_authentication_config.rbi +56 -0
  172. data/rbi/sentdm/models/sent_dm_services_common_contracts_poc_os_template_body.rbi +76 -0
  173. data/rbi/sentdm/models/sent_dm_services_common_contracts_poc_os_template_button.rbi +79 -0
  174. data/rbi/sentdm/models/sent_dm_services_common_contracts_poc_os_template_button_props.rbi +104 -0
  175. data/rbi/sentdm/models/sent_dm_services_common_contracts_poc_os_template_footer.rbi +60 -0
  176. data/rbi/sentdm/models/sent_dm_services_common_contracts_poc_os_template_header.rbi +62 -0
  177. data/rbi/sentdm/models/tcr_brand_relationship.rbi +30 -0
  178. data/rbi/sentdm/models/tcr_vertical.rbi +41 -0
  179. data/rbi/sentdm/models/template.rbi +129 -0
  180. data/rbi/sentdm/models/template_create_params.rbi +47 -23
  181. data/rbi/sentdm/models/template_definition.rbi +74 -405
  182. data/rbi/sentdm/models/template_delete_params.rbi +36 -5
  183. data/rbi/sentdm/models/template_list_params.rbi +8 -10
  184. data/rbi/sentdm/models/template_list_response.rbi +91 -37
  185. data/rbi/sentdm/models/template_update_params.rbi +105 -0
  186. data/rbi/sentdm/models/user_invite_params.rbi +90 -0
  187. data/rbi/sentdm/models/user_list_params.rbi +27 -0
  188. data/rbi/sentdm/models/user_list_response.rbi +111 -0
  189. data/rbi/sentdm/models/user_remove_params.rbi +59 -0
  190. data/rbi/sentdm/models/user_response.rbi +118 -0
  191. data/rbi/sentdm/models/user_retrieve_params.rbi +27 -0
  192. data/rbi/sentdm/models/user_update_role_params.rbi +79 -0
  193. data/rbi/sentdm/models/webhook_create_params.rbi +102 -0
  194. data/rbi/sentdm/models/webhook_delete_params.rbi +27 -0
  195. data/rbi/sentdm/models/webhook_list_event_types_params.rbi +27 -0
  196. data/rbi/sentdm/models/webhook_list_event_types_response.rbi +206 -0
  197. data/rbi/sentdm/models/webhook_list_events_params.rbi +48 -0
  198. data/rbi/sentdm/models/webhook_list_events_response.rbi +263 -0
  199. data/rbi/sentdm/models/webhook_list_params.rbi +59 -0
  200. data/rbi/sentdm/models/webhook_list_response.rbi +126 -0
  201. data/rbi/sentdm/models/webhook_response.rbi +134 -0
  202. data/rbi/sentdm/models/webhook_retrieve_params.rbi +27 -0
  203. data/rbi/sentdm/models/webhook_rotate_secret_params.rbi +67 -0
  204. data/rbi/sentdm/models/webhook_rotate_secret_response.rbi +112 -0
  205. data/rbi/sentdm/models/webhook_test_params.rbi +66 -0
  206. data/rbi/sentdm/models/webhook_test_response.rbi +111 -0
  207. data/rbi/sentdm/models/webhook_toggle_status_params.rbi +66 -0
  208. data/rbi/sentdm/models/webhook_update_params.rbi +102 -0
  209. data/rbi/sentdm/models.rbi +125 -10
  210. data/rbi/sentdm/resources/brands/campaigns.rbi +108 -0
  211. data/rbi/sentdm/resources/brands.rbi +93 -0
  212. data/rbi/sentdm/resources/contacts.rbi +89 -26
  213. data/rbi/sentdm/resources/lookup.rbi +24 -0
  214. data/rbi/sentdm/resources/me.rbi +23 -0
  215. data/rbi/sentdm/resources/messages.rbi +41 -60
  216. data/rbi/sentdm/resources/profiles.rbi +238 -0
  217. data/rbi/sentdm/resources/templates.rbi +94 -41
  218. data/rbi/sentdm/resources/users.rbi +116 -0
  219. data/rbi/sentdm/resources/webhooks.rbi +218 -0
  220. data/sig/sentdm/client.rbs +9 -8
  221. data/sig/sentdm/models/api_error.rbs +39 -0
  222. data/sig/sentdm/models/api_meta.rbs +41 -0
  223. data/sig/sentdm/models/api_response_brand_with_kyc.rbs +39 -0
  224. data/sig/sentdm/models/api_response_contact.rbs +39 -0
  225. data/sig/sentdm/models/api_response_of_profile_detail.rbs +39 -0
  226. data/sig/sentdm/models/api_response_of_user.rbs +39 -0
  227. data/sig/sentdm/models/api_response_template.rbs +39 -0
  228. data/sig/sentdm/models/api_response_webhook.rbs +39 -0
  229. data/sig/sentdm/models/brand_create_params.rbs +36 -0
  230. data/sig/sentdm/models/brand_data.rbs +164 -0
  231. data/sig/sentdm/models/brand_delete_params.rbs +32 -0
  232. data/sig/sentdm/models/brand_list_params.rbs +14 -0
  233. data/sig/sentdm/models/brand_list_response.rbs +39 -0
  234. data/sig/sentdm/models/brand_update_params.rbs +36 -0
  235. data/sig/sentdm/models/brand_with_kyc.rbs +237 -0
  236. data/sig/sentdm/models/brands/api_response_tcr_campaign_with_use_cases.rbs +41 -0
  237. data/sig/sentdm/models/brands/base_dto.rbs +27 -0
  238. data/sig/sentdm/models/brands/campaign_create_params.rbs +42 -0
  239. data/sig/sentdm/models/brands/campaign_data.rbs +82 -0
  240. data/sig/sentdm/models/brands/campaign_delete_params.rbs +38 -0
  241. data/sig/sentdm/models/brands/campaign_list_params.rbs +17 -0
  242. data/sig/sentdm/models/brands/campaign_list_response.rbs +41 -0
  243. data/sig/sentdm/models/brands/campaign_update_params.rbs +47 -0
  244. data/sig/sentdm/models/brands/messaging_use_case_us.rbs +40 -0
  245. data/sig/sentdm/models/brands/sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_campaigns_campaign_use_case_data.rbs +27 -0
  246. data/sig/sentdm/models/brands/tcr_campaign_with_use_cases.rbs +285 -0
  247. data/sig/sentdm/models/{contact_list_item.rbs → contact.rbs} +31 -5
  248. data/sig/sentdm/models/contact_create_params.rbs +38 -0
  249. data/sig/sentdm/models/contact_delete_params.rbs +32 -0
  250. data/sig/sentdm/models/contact_list_params.rbs +19 -1
  251. data/sig/sentdm/models/contact_list_response.rbs +44 -31
  252. data/sig/sentdm/models/{message_retrieve_params.rbs → contact_retrieve_params.rbs} +2 -2
  253. data/sig/sentdm/models/contact_update_params.rbs +45 -0
  254. data/sig/sentdm/models/destination_country.rbs +19 -0
  255. data/sig/sentdm/models/lookup_retrieve_phone_info_params.rbs +15 -0
  256. data/sig/sentdm/models/lookup_retrieve_phone_info_response.rbs +102 -0
  257. data/sig/sentdm/models/me_retrieve_params.rbs +14 -0
  258. data/sig/sentdm/models/me_retrieve_response.rbs +162 -0
  259. data/sig/sentdm/models/message_retrieve_activities_params.rbs +15 -0
  260. data/sig/sentdm/models/message_retrieve_activities_response.rbs +105 -0
  261. data/sig/sentdm/models/message_retrieve_status_params.rbs +15 -0
  262. data/sig/sentdm/models/message_retrieve_status_response.rbs +224 -0
  263. data/sig/sentdm/models/message_send_params.rbs +79 -0
  264. data/sig/sentdm/models/message_send_response.rbs +108 -0
  265. data/sig/sentdm/models/mutation_request.rbs +15 -0
  266. data/sig/sentdm/models/pagination_meta.rbs +67 -0
  267. data/sig/sentdm/models/profile_complete_params.rbs +36 -0
  268. data/sig/sentdm/models/profile_complete_response.rbs +5 -0
  269. data/sig/sentdm/models/profile_create_params.rbs +96 -0
  270. data/sig/sentdm/models/profile_delete_params.rbs +32 -0
  271. data/sig/sentdm/models/profile_detail.rbs +168 -0
  272. data/sig/sentdm/models/profile_list_params.rbs +14 -0
  273. data/sig/sentdm/models/profile_list_response.rbs +53 -0
  274. data/sig/sentdm/models/profile_retrieve_params.rbs +15 -0
  275. data/sig/sentdm/models/profile_settings.rbs +50 -0
  276. data/sig/sentdm/models/profile_update_params.rbs +122 -0
  277. data/sig/sentdm/models/sent_dm_services_common_contracts_poc_os_authentication_config.rbs +24 -0
  278. data/sig/sentdm/models/sent_dm_services_common_contracts_poc_os_template_body.rbs +30 -0
  279. data/sig/sentdm/models/sent_dm_services_common_contracts_poc_os_template_button.rbs +38 -0
  280. data/sig/sentdm/models/sent_dm_services_common_contracts_poc_os_template_button_props.rbs +75 -0
  281. data/sig/sentdm/models/sent_dm_services_common_contracts_poc_os_template_footer.rbs +32 -0
  282. data/sig/sentdm/models/sent_dm_services_common_contracts_poc_os_template_header.rbs +32 -0
  283. data/sig/sentdm/models/tcr_brand_relationship.rbs +22 -0
  284. data/sig/sentdm/models/tcr_vertical.rbs +58 -0
  285. data/sig/sentdm/models/{template_response.rbs → template.rbs} +18 -31
  286. data/sig/sentdm/models/template_create_params.rbs +29 -6
  287. data/sig/sentdm/models/template_definition.rbs +20 -233
  288. data/sig/sentdm/models/template_delete_params.rbs +18 -3
  289. data/sig/sentdm/models/template_list_response.rbs +44 -31
  290. data/sig/sentdm/models/template_update_params.rbs +62 -0
  291. data/sig/sentdm/models/user_invite_params.rbs +56 -0
  292. data/sig/sentdm/models/user_list_params.rbs +14 -0
  293. data/sig/sentdm/models/user_list_response.rbs +53 -0
  294. data/sig/sentdm/models/user_remove_params.rbs +32 -0
  295. data/sig/sentdm/models/user_response.rbs +72 -0
  296. data/sig/sentdm/models/user_retrieve_params.rbs +15 -0
  297. data/sig/sentdm/models/user_update_role_params.rbs +49 -0
  298. data/sig/sentdm/models/webhook_create_params.rbs +70 -0
  299. data/sig/sentdm/models/webhook_delete_params.rbs +15 -0
  300. data/sig/sentdm/models/webhook_list_event_types_params.rbs +15 -0
  301. data/sig/sentdm/models/webhook_list_event_types_response.rbs +98 -0
  302. data/sig/sentdm/models/webhook_list_events_params.rbs +32 -0
  303. data/sig/sentdm/models/webhook_list_events_response.rbs +146 -0
  304. data/sig/sentdm/models/webhook_list_params.rbs +36 -0
  305. data/sig/sentdm/models/webhook_list_response.rbs +67 -0
  306. data/sig/sentdm/models/webhook_response.rbs +98 -0
  307. data/sig/sentdm/models/webhook_retrieve_params.rbs +15 -0
  308. data/sig/sentdm/models/webhook_rotate_secret_params.rbs +38 -0
  309. data/sig/sentdm/models/webhook_rotate_secret_response.rbs +51 -0
  310. data/sig/sentdm/models/webhook_test_params.rbs +38 -0
  311. data/sig/sentdm/models/webhook_test_response.rbs +55 -0
  312. data/sig/sentdm/models/webhook_toggle_status_params.rbs +38 -0
  313. data/sig/sentdm/models/webhook_update_params.rbs +70 -0
  314. data/sig/sentdm/models.rbs +118 -10
  315. data/sig/sentdm/resources/brands/campaigns.rbs +38 -0
  316. data/sig/sentdm/resources/brands.rbs +34 -0
  317. data/sig/sentdm/resources/contacts.rbs +28 -8
  318. data/sig/sentdm/resources/lookup.rbs +12 -0
  319. data/sig/sentdm/resources/{number_lookup.rbs → me.rbs} +2 -3
  320. data/sig/sentdm/resources/messages.rbs +12 -18
  321. data/sig/sentdm/resources/profiles.rbs +72 -0
  322. data/sig/sentdm/resources/templates.rbs +24 -4
  323. data/sig/sentdm/resources/users.rbs +41 -0
  324. data/sig/sentdm/resources/webhooks.rbs +80 -0
  325. metadata +284 -44
  326. data/lib/sentdm/models/contact_list_item.rb +0 -96
  327. data/lib/sentdm/models/contact_retrieve_by_phone_params.rb +0 -22
  328. data/lib/sentdm/models/contact_retrieve_id_params.rb +0 -22
  329. data/lib/sentdm/models/message_retrieve_response.rb +0 -227
  330. data/lib/sentdm/models/message_send_quick_message_params.rb +0 -34
  331. data/lib/sentdm/models/message_send_to_contact_params.rb +0 -46
  332. data/lib/sentdm/models/message_send_to_phone_params.rb +0 -47
  333. data/lib/sentdm/models/number_lookup_retrieve_params.rb +0 -20
  334. data/lib/sentdm/models/number_lookup_retrieve_response.rb +0 -83
  335. data/lib/sentdm/models/template_response.rb +0 -100
  336. data/lib/sentdm/resources/number_lookup.rb +0 -37
  337. data/lib/sentdm/resources/organizations/users.rb +0 -16
  338. data/lib/sentdm/resources/organizations.rb +0 -18
  339. data/rbi/sentdm/models/contact_list_item.rbi +0 -144
  340. data/rbi/sentdm/models/contact_retrieve_by_phone_params.rbi +0 -40
  341. data/rbi/sentdm/models/contact_retrieve_id_params.rbi +0 -40
  342. data/rbi/sentdm/models/message_retrieve_response.rbi +0 -376
  343. data/rbi/sentdm/models/message_send_quick_message_params.rbi +0 -56
  344. data/rbi/sentdm/models/message_send_to_contact_params.rbi +0 -63
  345. data/rbi/sentdm/models/message_send_to_phone_params.rbi +0 -65
  346. data/rbi/sentdm/models/number_lookup_retrieve_params.rbi +0 -35
  347. data/rbi/sentdm/models/number_lookup_retrieve_response.rbi +0 -132
  348. data/rbi/sentdm/models/template_response.rbi +0 -149
  349. data/rbi/sentdm/resources/number_lookup.rbi +0 -24
  350. data/rbi/sentdm/resources/organizations/users.rbi +0 -14
  351. data/rbi/sentdm/resources/organizations.rbi +0 -15
  352. data/sig/sentdm/models/contact_retrieve_by_phone_params.rbs +0 -23
  353. data/sig/sentdm/models/contact_retrieve_id_params.rbs +0 -20
  354. data/sig/sentdm/models/message_retrieve_response.rbs +0 -188
  355. data/sig/sentdm/models/message_send_quick_message_params.rbs +0 -28
  356. data/sig/sentdm/models/message_send_to_contact_params.rbs +0 -36
  357. data/sig/sentdm/models/message_send_to_phone_params.rbs +0 -36
  358. data/sig/sentdm/models/number_lookup_retrieve_params.rbs +0 -23
  359. data/sig/sentdm/models/number_lookup_retrieve_response.rbs +0 -78
  360. data/sig/sentdm/resources/organizations/users.rbs +0 -9
  361. data/sig/sentdm/resources/organizations.rbs +0 -9
@@ -3,118 +3,83 @@
3
3
  module Sentdm
4
4
  module Resources
5
5
  class Messages
6
- # Retrieves comprehensive details about a specific message using the message ID.
7
- # Returns complete message data including delivery status, channel information,
8
- # template details, contact information, and pricing. The customer ID is extracted
9
- # from the authentication token to ensure the message belongs to the authenticated
10
- # customer.
6
+ # Retrieves the activity log for a specific message. Activities track the message
7
+ # lifecycle including acceptance, processing, sending, delivery, and any errors.
11
8
  #
12
- # @overload retrieve(id, request_options: {})
9
+ # @overload retrieve_activities(id, request_options: {})
10
+ #
11
+ # @param id [String] Message ID from route parameter
13
12
  #
14
- # @param id [String]
15
13
  # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
16
14
  #
17
- # @return [Sentdm::Models::MessageRetrieveResponse]
15
+ # @return [Sentdm::Models::MessageRetrieveActivitiesResponse]
18
16
  #
19
- # @see Sentdm::Models::MessageRetrieveParams
20
- def retrieve(id, params = {})
17
+ # @see Sentdm::Models::MessageRetrieveActivitiesParams
18
+ def retrieve_activities(id, params = {})
21
19
  @client.request(
22
20
  method: :get,
23
- path: ["v2/messages/%1$s", id],
24
- model: Sentdm::Models::MessageRetrieveResponse,
21
+ path: ["v3/messages/%1$s/activities", id],
22
+ model: Sentdm::Models::MessageRetrieveActivitiesResponse,
25
23
  options: params[:request_options]
26
24
  )
27
25
  end
28
26
 
29
- # Some parameter documentations has been truncated, see
30
- # {Sentdm::Models::MessageSendQuickMessageParams} for more details.
31
- #
32
- # Sends a message to a phone number using the default template. This endpoint is
33
- # rate limited to 5 messages per customer per day. The customer ID is extracted
34
- # from the authentication token.
27
+ # Retrieves the current status and details of a message by ID. Includes delivery
28
+ # status, timestamps, and error information if applicable.
35
29
  #
36
- # @overload send_quick_message(custom_message:, phone_number:, request_options: {})
30
+ # @overload retrieve_status(id, request_options: {})
37
31
  #
38
- # @param custom_message [String] The custom message content to include in the template
39
- #
40
- # @param phone_number [String] The phone number to send the message to, in international format (e.g., +1234567
32
+ # @param id [String] Message ID
41
33
  #
42
34
  # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
43
35
  #
44
- # @return [nil]
36
+ # @return [Sentdm::Models::MessageRetrieveStatusResponse]
45
37
  #
46
- # @see Sentdm::Models::MessageSendQuickMessageParams
47
- def send_quick_message(params)
48
- parsed, options = Sentdm::MessageSendQuickMessageParams.dump_request(params)
38
+ # @see Sentdm::Models::MessageRetrieveStatusParams
39
+ def retrieve_status(id, params = {})
49
40
  @client.request(
50
- method: :post,
51
- path: "v2/messages/quick-message",
52
- body: parsed,
53
- model: NilClass,
54
- options: options
41
+ method: :get,
42
+ path: ["v3/messages/%1$s", id],
43
+ model: Sentdm::Models::MessageRetrieveStatusResponse,
44
+ options: params[:request_options]
55
45
  )
56
46
  end
57
47
 
58
48
  # Some parameter documentations has been truncated, see
59
- # {Sentdm::Models::MessageSendToContactParams} for more details.
60
- #
61
- # Sends a message to a specific contact using a template. The message can be sent
62
- # via SMS or WhatsApp depending on the contact's capabilities. Optionally specify
63
- # a webhook URL to receive delivery status updates. The customer ID is extracted
64
- # from the authentication token.
65
- #
66
- # @overload send_to_contact(contact_id:, template_id:, template_variables: nil, request_options: {})
67
- #
68
- # @param contact_id [String] The unique identifier of the contact to send the message to
49
+ # {Sentdm::Models::MessageSendParams} for more details.
69
50
  #
70
- # @param template_id [String] The unique identifier of the template to use for the message
51
+ # Sends a message to one or more recipients using a template. Supports
52
+ # multi-channel broadcast — when multiple channels are specified (e.g. ["sms",
53
+ # "whatsapp"]), a separate message is created for each (recipient, channel) pair.
54
+ # Returns immediately with per-recipient message IDs for async tracking via
55
+ # webhooks or the GET /messages/{id} endpoint.
71
56
  #
72
- # @param template_variables [Hash{Symbol=>String}, nil] Optional key-value pairs of template variables to replace in the template body.
73
- #
74
- # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
75
- #
76
- # @return [nil]
77
- #
78
- # @see Sentdm::Models::MessageSendToContactParams
79
- def send_to_contact(params)
80
- parsed, options = Sentdm::MessageSendToContactParams.dump_request(params)
81
- @client.request(
82
- method: :post,
83
- path: "v2/messages/contact",
84
- body: parsed,
85
- model: NilClass,
86
- options: options
87
- )
88
- end
89
-
90
- # Some parameter documentations has been truncated, see
91
- # {Sentdm::Models::MessageSendToPhoneParams} for more details.
57
+ # @overload send_(channel: nil, template: nil, test_mode: nil, to: nil, idempotency_key: nil, request_options: {})
92
58
  #
93
- # Sends a message to a phone number using a template. The phone number doesn't
94
- # need to be a pre-existing contact. The message can be sent via SMS or WhatsApp.
95
- # Optionally specify a webhook URL to receive delivery status updates. The
96
- # customer ID is extracted from the authentication token.
59
+ # @param channel [Array<String>, nil] Body param: Channels to broadcast on, e.g. ["whatsapp", "sms"].
97
60
  #
98
- # @overload send_to_phone(phone_number:, template_id:, template_variables: nil, request_options: {})
61
+ # @param template [Sentdm::Models::MessageSendParams::Template] Body param: Template reference (by id or name, with optional parameters)
99
62
  #
100
- # @param phone_number [String] The phone number to send the message to, in international format (e.g., +1234567
63
+ # @param test_mode [Boolean] Body param: Test mode flag - when true, the operation is simulated without side
101
64
  #
102
- # @param template_id [String] The unique identifier of the template to use for the message
65
+ # @param to [Array<String>] Body param: List of recipient phone numbers in E.164 format (multi-recipient fan
103
66
  #
104
- # @param template_variables [Hash{Symbol=>String}, nil] Optional key-value pairs of template variables to replace in the template body.
67
+ # @param idempotency_key [String] Header param: Unique key to ensure idempotent request processing. Must be 1-255
105
68
  #
106
69
  # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
107
70
  #
108
- # @return [nil]
71
+ # @return [Sentdm::Models::MessageSendResponse]
109
72
  #
110
- # @see Sentdm::Models::MessageSendToPhoneParams
111
- def send_to_phone(params)
112
- parsed, options = Sentdm::MessageSendToPhoneParams.dump_request(params)
73
+ # @see Sentdm::Models::MessageSendParams
74
+ def send_(params = {})
75
+ parsed, options = Sentdm::MessageSendParams.dump_request(params)
76
+ header_params = {idempotency_key: "idempotency-key"}
113
77
  @client.request(
114
78
  method: :post,
115
- path: "v2/messages/phone",
116
- body: parsed,
117
- model: NilClass,
79
+ path: "v3/messages",
80
+ headers: parsed.slice(*header_params.keys).transform_keys(header_params),
81
+ body: parsed.except(*header_params.keys),
82
+ model: Sentdm::Models::MessageSendResponse,
118
83
  options: options
119
84
  )
120
85
  end
@@ -0,0 +1,254 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Resources
5
+ class Profiles
6
+ # Some parameter documentations has been truncated, see
7
+ # {Sentdm::Models::ProfileCreateParams} for more details.
8
+ #
9
+ # Creates a new sender profile within an organization. Profiles represent
10
+ # different brands, departments, or use cases, each with their own messaging
11
+ # configuration and settings. Requires admin role in the organization.
12
+ #
13
+ # @overload create(allow_contact_sharing: nil, allow_template_sharing: nil, billing_model: nil, description: nil, icon: nil, inherit_contacts: nil, inherit_tcr_brand: nil, inherit_tcr_campaign: nil, inherit_templates: nil, name: nil, short_name: nil, test_mode: nil, idempotency_key: nil, request_options: {})
14
+ #
15
+ # @param allow_contact_sharing [Boolean] Body param: Whether contacts are shared across profiles (default: false)
16
+ #
17
+ # @param allow_template_sharing [Boolean] Body param: Whether templates are shared across profiles (default: false)
18
+ #
19
+ # @param billing_model [String, nil] Body param: Billing model: profile, organization, or profile_and_organization (d
20
+ #
21
+ # @param description [String, nil] Body param: Profile description (optional)
22
+ #
23
+ # @param icon [String, nil] Body param: Profile icon URL (optional)
24
+ #
25
+ # @param inherit_contacts [Boolean, nil] Body param: Whether this profile inherits contacts from organization (default: t
26
+ #
27
+ # @param inherit_tcr_brand [Boolean, nil] Body param: Whether this profile inherits TCR brand from organization (default:
28
+ #
29
+ # @param inherit_tcr_campaign [Boolean, nil] Body param: Whether this profile inherits TCR campaign from organization (defaul
30
+ #
31
+ # @param inherit_templates [Boolean, nil] Body param: Whether this profile inherits templates from organization (default:
32
+ #
33
+ # @param name [String] Body param: Profile name (required)
34
+ #
35
+ # @param short_name [String, nil] Body param: Profile short name/abbreviation (optional)
36
+ #
37
+ # @param test_mode [Boolean] Body param: Test mode flag - when true, the operation is simulated without side
38
+ #
39
+ # @param idempotency_key [String] Header param: Unique key to ensure idempotent request processing. Must be 1-255
40
+ #
41
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
42
+ #
43
+ # @return [Sentdm::Models::APIResponseOfProfileDetail]
44
+ #
45
+ # @see Sentdm::Models::ProfileCreateParams
46
+ def create(params = {})
47
+ parsed, options = Sentdm::ProfileCreateParams.dump_request(params)
48
+ header_params = {idempotency_key: "idempotency-key"}
49
+ @client.request(
50
+ method: :post,
51
+ path: "v3/profiles",
52
+ headers: parsed.slice(*header_params.keys).transform_keys(header_params),
53
+ body: parsed.except(*header_params.keys),
54
+ model: Sentdm::APIResponseOfProfileDetail,
55
+ options: options
56
+ )
57
+ end
58
+
59
+ # Retrieves detailed information about a specific sender profile within an
60
+ # organization.
61
+ #
62
+ # @overload retrieve(profile_id, request_options: {})
63
+ #
64
+ # @param profile_id [String]
65
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
66
+ #
67
+ # @return [Sentdm::Models::APIResponseOfProfileDetail]
68
+ #
69
+ # @see Sentdm::Models::ProfileRetrieveParams
70
+ def retrieve(profile_id, params = {})
71
+ @client.request(
72
+ method: :get,
73
+ path: ["v3/profiles/%1$s", profile_id],
74
+ model: Sentdm::APIResponseOfProfileDetail,
75
+ options: params[:request_options]
76
+ )
77
+ end
78
+
79
+ # Some parameter documentations has been truncated, see
80
+ # {Sentdm::Models::ProfileUpdateParams} for more details.
81
+ #
82
+ # Updates a profile's configuration and settings. Requires admin role in the
83
+ # organization. Only provided fields will be updated (partial update).
84
+ #
85
+ # @overload update(path_profile_id, allow_contact_sharing: nil, allow_number_change_during_onboarding: nil, allow_template_sharing: nil, billing_model: nil, description: nil, icon: nil, inherit_contacts: nil, inherit_tcr_brand: nil, inherit_tcr_campaign: nil, inherit_templates: nil, name: nil, body_profile_id: nil, sending_phone_number: nil, sending_phone_number_profile_id: nil, sending_whatsapp_number_profile_id: nil, short_name: nil, test_mode: nil, whatsapp_phone_number: nil, idempotency_key: nil, request_options: {})
86
+ #
87
+ # @param path_profile_id [String] Path param
88
+ #
89
+ # @param allow_contact_sharing [Boolean, nil] Body param: Whether contacts are shared across profiles (optional)
90
+ #
91
+ # @param allow_number_change_during_onboarding [Boolean, nil] Body param: Whether number changes are allowed during onboarding (optional)
92
+ #
93
+ # @param allow_template_sharing [Boolean, nil] Body param: Whether templates are shared across profiles (optional)
94
+ #
95
+ # @param billing_model [String, nil] Body param: Billing model: profile, organization, or profile_and_organization (o
96
+ #
97
+ # @param description [String, nil] Body param: Profile description (optional)
98
+ #
99
+ # @param icon [String, nil] Body param: Profile icon URL (optional)
100
+ #
101
+ # @param inherit_contacts [Boolean, nil] Body param: Whether this profile inherits contacts from organization (optional)
102
+ #
103
+ # @param inherit_tcr_brand [Boolean, nil] Body param: Whether this profile inherits TCR brand from organization (optional)
104
+ #
105
+ # @param inherit_tcr_campaign [Boolean, nil] Body param: Whether this profile inherits TCR campaign from organization (option
106
+ #
107
+ # @param inherit_templates [Boolean, nil] Body param: Whether this profile inherits templates from organization (optional)
108
+ #
109
+ # @param name [String, nil] Body param: Profile name (optional)
110
+ #
111
+ # @param body_profile_id [String] Body param: Profile ID from route parameter
112
+ #
113
+ # @param sending_phone_number [String, nil] Body param: Direct phone number for SMS sending (optional)
114
+ #
115
+ # @param sending_phone_number_profile_id [String, nil] Body param: Reference to another profile to use for SMS/Telnyx configuration (op
116
+ #
117
+ # @param sending_whatsapp_number_profile_id [String, nil] Body param: Reference to another profile to use for WhatsApp configuration (opti
118
+ #
119
+ # @param short_name [String, nil] Body param: Profile short name/abbreviation (optional)
120
+ #
121
+ # @param test_mode [Boolean] Body param: Test mode flag - when true, the operation is simulated without side
122
+ #
123
+ # @param whatsapp_phone_number [String, nil] Body param: Direct phone number for WhatsApp sending (optional)
124
+ #
125
+ # @param idempotency_key [String] Header param: Unique key to ensure idempotent request processing. Must be 1-255
126
+ #
127
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
128
+ #
129
+ # @return [Sentdm::Models::APIResponseOfProfileDetail]
130
+ #
131
+ # @see Sentdm::Models::ProfileUpdateParams
132
+ def update(path_profile_id, params = {})
133
+ parsed, options = Sentdm::ProfileUpdateParams.dump_request(params)
134
+ header_params = {idempotency_key: "idempotency-key"}
135
+ @client.request(
136
+ method: :patch,
137
+ path: ["v3/profiles/%1$s", path_profile_id],
138
+ headers: parsed.slice(*header_params.keys).transform_keys(header_params),
139
+ body: parsed.except(*header_params.keys),
140
+ model: Sentdm::APIResponseOfProfileDetail,
141
+ options: options
142
+ )
143
+ end
144
+
145
+ # Retrieves all sender profiles within an organization. Profiles represent
146
+ # different brands, departments, or use cases within an organization, each with
147
+ # their own messaging configuration.
148
+ #
149
+ # @overload list(request_options: {})
150
+ #
151
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
152
+ #
153
+ # @return [Sentdm::Models::ProfileListResponse]
154
+ #
155
+ # @see Sentdm::Models::ProfileListParams
156
+ def list(params = {})
157
+ @client.request(
158
+ method: :get,
159
+ path: "v3/profiles",
160
+ model: Sentdm::Models::ProfileListResponse,
161
+ options: params[:request_options]
162
+ )
163
+ end
164
+
165
+ # Some parameter documentations has been truncated, see
166
+ # {Sentdm::Models::ProfileDeleteParams} for more details.
167
+ #
168
+ # Soft deletes a sender profile. The profile will be marked as deleted but data is
169
+ # retained. Requires admin role in the organization.
170
+ #
171
+ # @overload delete(path_profile_id, body_profile_id: nil, test_mode: nil, request_options: {})
172
+ #
173
+ # @param path_profile_id [String]
174
+ #
175
+ # @param body_profile_id [String] Profile ID from route parameter
176
+ #
177
+ # @param test_mode [Boolean] Test mode flag - when true, the operation is simulated without side effects
178
+ #
179
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
180
+ #
181
+ # @return [nil]
182
+ #
183
+ # @see Sentdm::Models::ProfileDeleteParams
184
+ def delete(path_profile_id, params = {})
185
+ parsed, options = Sentdm::ProfileDeleteParams.dump_request(params)
186
+ @client.request(
187
+ method: :delete,
188
+ path: ["v3/profiles/%1$s", path_profile_id],
189
+ headers: {"content-type" => "*/*"},
190
+ body: parsed,
191
+ model: NilClass,
192
+ options: options
193
+ )
194
+ end
195
+
196
+ # Some parameter documentations has been truncated, see
197
+ # {Sentdm::Models::ProfileCompleteParams} for more details.
198
+ #
199
+ # Final step in profile compliance workflow. Validates all prerequisites (general
200
+ # data, brand, campaigns), connects profile to Telnyx/WhatsApp, and sets status
201
+ # based on configuration. The process runs in the background and calls the
202
+ # provided webhook URL when finished.
203
+ #
204
+ # Prerequisites:
205
+ # - Profile must be completed
206
+ # - If inheritTcrBrand=false: Profile must have existing brand
207
+ # - If inheritTcrBrand=true: Parent must have existing brand
208
+ # - If TCR application: Must have at least one campaign (own or inherited)
209
+ # - If inheritTcrCampaign=false: Profile should have campaigns
210
+ # - If inheritTcrCampaign=true: Parent must have campaigns
211
+ #
212
+ # Status Logic:
213
+ # - If both SMS and WhatsApp channels are missing → SUBMITTED
214
+ # - If TCR application and not inheriting brand/campaigns → SUBMITTED
215
+ # - If non-TCR with destination country (IsMain=true) → SUBMITTED
216
+ # - Otherwise → COMPLETED
217
+ #
218
+ # @overload complete(profile_id, web_hook_url:, test_mode: nil, idempotency_key: nil, request_options: {})
219
+ #
220
+ # @param profile_id [String] Path param: Profile ID from route
221
+ #
222
+ # @param web_hook_url [String] Body param: Webhook URL to call when profile completion finishes (success or fai
223
+ #
224
+ # @param test_mode [Boolean] Body param: Test mode flag - when true, the operation is simulated without side
225
+ #
226
+ # @param idempotency_key [String] Header param: Unique key to ensure idempotent request processing. Must be 1-255
227
+ #
228
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
229
+ #
230
+ # @return [Object]
231
+ #
232
+ # @see Sentdm::Models::ProfileCompleteParams
233
+ def complete(profile_id, params)
234
+ parsed, options = Sentdm::ProfileCompleteParams.dump_request(params)
235
+ header_params = {idempotency_key: "idempotency-key"}
236
+ @client.request(
237
+ method: :post,
238
+ path: ["v3/profiles/%1$s/complete", profile_id],
239
+ headers: parsed.slice(*header_params.keys).transform_keys(header_params),
240
+ body: parsed.except(*header_params.keys),
241
+ model: Sentdm::Internal::Type::Unknown,
242
+ options: options
243
+ )
244
+ end
245
+
246
+ # @api private
247
+ #
248
+ # @param client [Sentdm::Client]
249
+ def initialize(client:)
250
+ @client = client
251
+ end
252
+ end
253
+ end
254
+ end
@@ -6,77 +6,121 @@ module Sentdm
6
6
  # Some parameter documentations has been truncated, see
7
7
  # {Sentdm::Models::TemplateCreateParams} for more details.
8
8
  #
9
- # Creates a new message template for the authenticated customer with comprehensive
10
- # template definitions including headers, body, footer, and interactive buttons.
11
- # Supports automatic metadata generation using AI (display name, language,
12
- # category). Optionally submits the template for WhatsApp review. The customer ID
13
- # is extracted from the authentication token.
9
+ # Creates a new message template with header, body, footer, and buttons. The
10
+ # template can be submitted for review immediately or saved as draft for later
11
+ # submission.
14
12
  #
15
- # @overload create(definition:, category: nil, language: nil, submit_for_review: nil, request_options: {})
13
+ # @overload create(category: nil, creation_source: nil, definition: nil, language: nil, submit_for_review: nil, test_mode: nil, idempotency_key: nil, request_options: {})
16
14
  #
17
- # @param definition [Sentdm::Models::TemplateDefinition] Template definition containing header, body, footer, and buttons
15
+ # @param category [String, nil] Body param: Template category: MARKETING, UTILITY, AUTHENTICATION (optional, aut
18
16
  #
19
- # @param category [String, nil] The template category (e.g., MARKETING, UTILITY, AUTHENTICATION). Can only be se
17
+ # @param creation_source [String, nil] Body param: Source of template creation (default: from-api)
20
18
  #
21
- # @param language [String, nil] The template language code (e.g., en_US, es_ES). Can only be set when creating a
19
+ # @param definition [Sentdm::Models::TemplateDefinition] Body param: Template definition including header, body, footer, and buttons
22
20
  #
23
- # @param submit_for_review [Boolean] When false, the template will be saved as draft.
21
+ # @param language [String, nil] Body param: Template language code (e.g., en_US) (optional, auto-detected if not
22
+ #
23
+ # @param submit_for_review [Boolean] Body param: Whether to submit the template for review after creation (default: f
24
+ #
25
+ # @param test_mode [Boolean] Body param: Test mode flag - when true, the operation is simulated without side
26
+ #
27
+ # @param idempotency_key [String] Header param: Unique key to ensure idempotent request processing. Must be 1-255
24
28
  #
25
29
  # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
26
30
  #
27
- # @return [Sentdm::Models::TemplateResponse]
31
+ # @return [Sentdm::Models::APIResponseTemplate]
28
32
  #
29
33
  # @see Sentdm::Models::TemplateCreateParams
30
- def create(params)
34
+ def create(params = {})
31
35
  parsed, options = Sentdm::TemplateCreateParams.dump_request(params)
36
+ header_params = {idempotency_key: "idempotency-key"}
32
37
  @client.request(
33
38
  method: :post,
34
- path: "v2/templates",
35
- body: parsed,
36
- model: Sentdm::TemplateResponse,
39
+ path: "v3/templates",
40
+ headers: parsed.slice(*header_params.keys).transform_keys(header_params),
41
+ body: parsed.except(*header_params.keys),
42
+ model: Sentdm::APIResponseTemplate,
37
43
  options: options
38
44
  )
39
45
  end
40
46
 
41
- # Retrieves a specific message template by its unique identifier for the
42
- # authenticated customer with comprehensive template definitions including
43
- # headers, body, footer, and interactive buttons. The customer ID is extracted
44
- # from the authentication token.
47
+ # Retrieves a specific template by its ID. Returns template details including
48
+ # name, category, language, status, and definition.
45
49
  #
46
50
  # @overload retrieve(id, request_options: {})
47
51
  #
48
- # @param id [String]
52
+ # @param id [String] Template ID from route parameter
53
+ #
49
54
  # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
50
55
  #
51
- # @return [Sentdm::Models::TemplateResponse]
56
+ # @return [Sentdm::Models::APIResponseTemplate]
52
57
  #
53
58
  # @see Sentdm::Models::TemplateRetrieveParams
54
59
  def retrieve(id, params = {})
55
60
  @client.request(
56
61
  method: :get,
57
- path: ["v2/templates/%1$s", id],
58
- model: Sentdm::TemplateResponse,
62
+ path: ["v3/templates/%1$s", id],
63
+ model: Sentdm::APIResponseTemplate,
59
64
  options: params[:request_options]
60
65
  )
61
66
  end
62
67
 
63
- # Retrieves all message templates available for the authenticated customer with
64
- # comprehensive template definitions including headers, body, footer, and
65
- # interactive buttons. Supports advanced filtering by search term, status, and
66
- # category, plus pagination. The customer ID is extracted from the authentication
67
- # token.
68
+ # Some parameter documentations has been truncated, see
69
+ # {Sentdm::Models::TemplateUpdateParams} for more details.
70
+ #
71
+ # Updates an existing template's name, category, language, definition, or submits
72
+ # it for review.
73
+ #
74
+ # @overload update(id, category: nil, definition: nil, language: nil, name: nil, submit_for_review: nil, test_mode: nil, idempotency_key: nil, request_options: {})
75
+ #
76
+ # @param id [String] Path param: Template ID from route parameter
77
+ #
78
+ # @param category [String, nil] Body param: Template category: MARKETING, UTILITY, AUTHENTICATION
79
+ #
80
+ # @param definition [Sentdm::Models::TemplateDefinition, nil] Body param: Template definition including header, body, footer, and buttons
81
+ #
82
+ # @param language [String, nil] Body param: Template language code (e.g., en_US)
83
+ #
84
+ # @param name [String, nil] Body param: Template display name
85
+ #
86
+ # @param submit_for_review [Boolean] Body param: Whether to submit the template for review after updating (default: f
87
+ #
88
+ # @param test_mode [Boolean] Body param: Test mode flag - when true, the operation is simulated without side
89
+ #
90
+ # @param idempotency_key [String] Header param: Unique key to ensure idempotent request processing. Must be 1-255
91
+ #
92
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
93
+ #
94
+ # @return [Sentdm::Models::APIResponseTemplate]
95
+ #
96
+ # @see Sentdm::Models::TemplateUpdateParams
97
+ def update(id, params = {})
98
+ parsed, options = Sentdm::TemplateUpdateParams.dump_request(params)
99
+ header_params = {idempotency_key: "idempotency-key"}
100
+ @client.request(
101
+ method: :put,
102
+ path: ["v3/templates/%1$s", id],
103
+ headers: parsed.slice(*header_params.keys).transform_keys(header_params),
104
+ body: parsed.except(*header_params.keys),
105
+ model: Sentdm::APIResponseTemplate,
106
+ options: options
107
+ )
108
+ end
109
+
110
+ # Retrieves a paginated list of message templates for the authenticated customer.
111
+ # Supports filtering by status, category, and search term.
68
112
  #
69
113
  # @overload list(page:, page_size:, category: nil, search: nil, status: nil, request_options: {})
70
114
  #
71
- # @param page [Integer] The page number (zero-indexed). Default is 0.
115
+ # @param page [Integer] Page number (1-indexed)
72
116
  #
73
- # @param page_size [Integer] The number of items per page (1-1000). Default is 100.
117
+ # @param page_size [Integer]
74
118
  #
75
- # @param category [String, nil] Optional filter by template category (e.g., MARKETING, UTILITY, AUTHENTICATION)
119
+ # @param category [String, nil] Optional category filter: MARKETING, UTILITY, AUTHENTICATION
76
120
  #
77
- # @param search [String, nil] Optional search term to filter templates by name or content
121
+ # @param search [String, nil] Optional search term for filtering templates
78
122
  #
79
- # @param status [String, nil] Optional filter by template status (e.g., APPROVED, PENDING, REJECTED, DRAFT)
123
+ # @param status [String, nil] Optional status filter: APPROVED, PENDING, REJECTED
80
124
  #
81
125
  # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
82
126
  #
@@ -87,24 +131,26 @@ module Sentdm
87
131
  parsed, options = Sentdm::TemplateListParams.dump_request(params)
88
132
  @client.request(
89
133
  method: :get,
90
- path: "v2/templates",
134
+ path: "v3/templates",
91
135
  query: parsed.transform_keys(page_size: "pageSize"),
92
136
  model: Sentdm::Models::TemplateListResponse,
93
137
  options: options
94
138
  )
95
139
  end
96
140
 
97
- # Deletes a specific message template by its unique identifier for the
98
- # authenticated customer with smart deletion strategy. Deletion behavior: - If
99
- # template has NO messages: Permanently deleted from database (hard delete). - If
100
- # template has messages: Marked as deleted but preserved for message history (soft
101
- # delete with snapshot). The template must exist and belong to the authenticated
102
- # customer to be deleted successfully. The customer ID is extracted from the
103
- # authentication token.
141
+ # Some parameter documentations has been truncated, see
142
+ # {Sentdm::Models::TemplateDeleteParams} for more details.
143
+ #
144
+ # Deletes a template by ID. Optionally, you can also delete the template from
145
+ # WhatsApp/Meta by setting delete_from_meta=true.
146
+ #
147
+ # @overload delete(id, delete_from_meta: nil, test_mode: nil, request_options: {})
104
148
  #
105
- # @overload delete(id, request_options: {})
149
+ # @param id [String] Template ID from route parameter
106
150
  #
107
- # @param id [String] The unique identifier (GUID) of the resource to retrieve
151
+ # @param delete_from_meta [Boolean, nil] Whether to also delete the template from WhatsApp/Meta (optional, defaults to fa
152
+ #
153
+ # @param test_mode [Boolean] Test mode flag - when true, the operation is simulated without side effects
108
154
  #
109
155
  # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
110
156
  #
@@ -112,11 +158,14 @@ module Sentdm
112
158
  #
113
159
  # @see Sentdm::Models::TemplateDeleteParams
114
160
  def delete(id, params = {})
161
+ parsed, options = Sentdm::TemplateDeleteParams.dump_request(params)
115
162
  @client.request(
116
163
  method: :delete,
117
- path: ["v2/templates/%1$s", id],
164
+ path: ["v3/templates/%1$s", id],
165
+ headers: {"content-type" => "*/*"},
166
+ body: parsed,
118
167
  model: NilClass,
119
- options: params[:request_options]
168
+ options: options
120
169
  )
121
170
  end
122
171