one_msg_sdk 2.0.1 → 2.0.3

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 (298) hide show
  1. checksums.yaml +4 -4
  2. data/AGENTS.md +65 -19
  3. data/README.md +102 -34
  4. data/docs/AddTemplate200Response.md +18 -0
  5. data/docs/AddTemplateRequest.md +7 -7
  6. data/docs/CallingApi.md +27 -31
  7. data/docs/CallingSettings.md +18 -0
  8. data/docs/CallingSettingsCalling.md +38 -0
  9. data/docs/CallingSettingsCallingAudio.md +18 -0
  10. data/docs/CallingSettingsCallingCallHours.md +22 -0
  11. data/docs/CallingSettingsCallingSip.md +20 -0
  12. data/docs/CallingSettingsCallingSipServersInner.md +28 -0
  13. data/docs/CallingSettingsCallingVideo.md +18 -0
  14. data/docs/CatalogApi.md +1 -1
  15. data/docs/ChannelApi.md +151 -5
  16. data/docs/CreateFlowsRequest.md +26 -0
  17. data/docs/CreateGroupsGroupIdRequest.md +22 -0
  18. data/docs/CreateGroupsRequest.md +20 -0
  19. data/docs/CreateSettingsRequest.md +28 -0
  20. data/docs/CreateSettingsRequestWebhookUrl.md +49 -0
  21. data/docs/CreateUploadMedia200Response.md +18 -0
  22. data/docs/CreateUploadMediaRequest.md +20 -0
  23. data/docs/FlowsApi.md +32 -16
  24. data/docs/GetStatus200Response.md +26 -0
  25. data/docs/GetWebhook200Response.md +24 -2
  26. data/docs/GetWebhook200ResponseWebhookUrl.md +49 -0
  27. data/docs/GroupsApi.md +38 -18
  28. data/docs/InitiateCallRequest.md +28 -0
  29. data/docs/InitiateCallRequestSession.md +20 -0
  30. data/docs/InitiateCallResponse.md +26 -0
  31. data/docs/InitiateCallResponseCallsInner.md +18 -0
  32. data/docs/InitiateCallResponseResponse.md +18 -0
  33. data/docs/ListSettings200Response.md +52 -0
  34. data/docs/ListSettings200ResponseWebhookUrl.md +49 -0
  35. data/docs/MessagingApi.md +140 -35
  36. data/docs/PatchFlowsFlowIdAssetsRequest.md +18 -0
  37. data/docs/PatchFlowsFlowIdMetadataRequest.md +22 -0
  38. data/docs/ProfileApi.md +9 -11
  39. data/docs/RemoveTemplateRequest.md +18 -0
  40. data/docs/SendButtonRequest.md +9 -1
  41. data/docs/SendCarouselRequest1.md +4 -2
  42. data/docs/SendContactInfoRequest.md +26 -0
  43. data/docs/SendContactRequest.md +7 -1
  44. data/docs/SendContactRequestContact.md +26 -0
  45. data/docs/SendContactRequestContactName.md +49 -0
  46. data/docs/SendContactRequestContactsInner.md +3 -3
  47. data/docs/SendContactRequestContactsInnerPhonesInner.md +1 -1
  48. data/docs/SendListRequest.md +5 -1
  49. data/docs/SendLocationRequestRequest.md +5 -1
  50. data/docs/SendMessageRequest.md +6 -2
  51. data/docs/SendMessageRequestDirectSend.md +20 -0
  52. data/docs/SendProductRequest.md +30 -0
  53. data/docs/SendReactionRequest.md +3 -1
  54. data/docs/SendTemplateRequest.md +9 -5
  55. data/docs/SendTemplateRequestLanguage.md +3 -3
  56. data/docs/SetWebhook200Response.md +20 -0
  57. data/docs/SetWebhook200ResponseWebhookUrl.md +49 -0
  58. data/docs/SetWebhookRequest.md +18 -0
  59. data/docs/SetWebhookRequestWebhookUrl.md +49 -0
  60. data/docs/TemplatesApi.md +29 -17
  61. data/docs/UpdateCallingSettings200Response.md +22 -0
  62. data/docs/UpdateCallingSettings200ResponseResponse.md +18 -0
  63. data/docs/UpdateMe200Response.md +18 -0
  64. data/docs/UpdateMeRequest.md +6 -6
  65. data/docs/WebhookUrlStatus.md +34 -0
  66. data/docs/WebhooksApi.md +10 -12
  67. data/lib/one_msg_sdk/api/calling_api.rb +39 -31
  68. data/lib/one_msg_sdk/api/catalog_api.rb +4 -4
  69. data/lib/one_msg_sdk/api/channel_api.rb +146 -7
  70. data/lib/one_msg_sdk/api/flows_api.rb +58 -14
  71. data/lib/one_msg_sdk/api/groups_api.rb +48 -10
  72. data/lib/one_msg_sdk/api/messaging_api.rb +163 -38
  73. data/lib/one_msg_sdk/api/profile_api.rb +17 -13
  74. data/lib/one_msg_sdk/api/templates_api.rb +36 -13
  75. data/lib/one_msg_sdk/api/users_api.rb +2 -2
  76. data/lib/one_msg_sdk/api/webhooks_api.rb +19 -15
  77. data/lib/one_msg_sdk/api_client.rb +2 -2
  78. data/lib/one_msg_sdk/api_error.rb +2 -2
  79. data/lib/one_msg_sdk/api_model_base.rb +2 -2
  80. data/lib/one_msg_sdk/configuration.rb +2 -2
  81. data/lib/one_msg_sdk/models/add_template200_response.rb +150 -0
  82. data/lib/one_msg_sdk/models/add_template_request.rb +6 -2
  83. data/lib/one_msg_sdk/models/block_user_request.rb +2 -2
  84. data/lib/one_msg_sdk/models/calling_settings.rb +148 -0
  85. data/lib/one_msg_sdk/models/calling_settings_calling.rb +321 -0
  86. data/lib/one_msg_sdk/models/calling_settings_calling_audio.rb +148 -0
  87. data/lib/one_msg_sdk/models/calling_settings_calling_call_hours.rb +166 -0
  88. data/lib/one_msg_sdk/models/calling_settings_calling_sip.rb +193 -0
  89. data/lib/one_msg_sdk/models/calling_settings_calling_sip_servers_inner.rb +196 -0
  90. data/lib/one_msg_sdk/models/calling_settings_calling_video.rb +182 -0
  91. data/lib/one_msg_sdk/models/conversational_automation.rb +2 -2
  92. data/lib/one_msg_sdk/models/conversational_automation_commands_inner.rb +2 -2
  93. data/lib/one_msg_sdk/models/create_commerce200_response.rb +2 -2
  94. data/lib/one_msg_sdk/models/create_commerce_request.rb +2 -2
  95. data/lib/one_msg_sdk/models/create_commerce_request_params.rb +2 -2
  96. data/lib/one_msg_sdk/models/create_flows_request.rb +238 -0
  97. data/lib/one_msg_sdk/models/create_groups200_response.rb +2 -2
  98. data/lib/one_msg_sdk/models/create_groups_group_id_request.rb +168 -0
  99. data/lib/one_msg_sdk/models/create_groups_request.rb +175 -0
  100. data/lib/one_msg_sdk/models/create_read_message200_response.rb +2 -2
  101. data/lib/one_msg_sdk/models/create_read_message401_response.rb +2 -2
  102. data/lib/one_msg_sdk/models/create_read_message_request.rb +2 -2
  103. data/lib/one_msg_sdk/models/create_settings_request.rb +192 -0
  104. data/lib/one_msg_sdk/models/create_settings_request_webhook_url.rb +105 -0
  105. data/lib/one_msg_sdk/models/create_upload_media200_response.rb +147 -0
  106. data/lib/one_msg_sdk/models/create_upload_media_request.rb +158 -0
  107. data/lib/one_msg_sdk/models/delete_flows_flow_id200_response.rb +2 -2
  108. data/lib/one_msg_sdk/models/delete_groups_group_id200_response.rb +2 -2
  109. data/lib/one_msg_sdk/models/delete_media_legacy_request.rb +2 -2
  110. data/lib/one_msg_sdk/models/error_response.rb +2 -2
  111. data/lib/one_msg_sdk/models/get_commerce200_response_inner.rb +2 -2
  112. data/lib/one_msg_sdk/models/get_mm_lite_status200_response.rb +2 -2
  113. data/lib/one_msg_sdk/models/get_status200_response.rb +185 -0
  114. data/lib/one_msg_sdk/models/get_webhook200_response.rb +155 -6
  115. data/lib/one_msg_sdk/models/get_webhook200_response_webhook_url.rb +105 -0
  116. data/lib/one_msg_sdk/models/get_whatsapp_business_encryption200_response.rb +2 -2
  117. data/lib/one_msg_sdk/models/initiate_call_request.rb +277 -0
  118. data/lib/one_msg_sdk/models/initiate_call_request_session.rb +217 -0
  119. data/lib/one_msg_sdk/models/initiate_call_response.rb +188 -0
  120. data/lib/one_msg_sdk/models/initiate_call_response_calls_inner.rb +147 -0
  121. data/lib/one_msg_sdk/models/initiate_call_response_response.rb +148 -0
  122. data/lib/one_msg_sdk/models/list_blocked_users200_response.rb +2 -2
  123. data/lib/one_msg_sdk/models/list_flows200_response.rb +2 -2
  124. data/lib/one_msg_sdk/models/list_messages200_response.rb +2 -2
  125. data/lib/one_msg_sdk/models/list_settings200_response.rb +352 -0
  126. data/lib/one_msg_sdk/models/list_settings200_response_webhook_url.rb +105 -0
  127. data/lib/one_msg_sdk/models/list_templates200_response.rb +2 -2
  128. data/lib/one_msg_sdk/models/message_sent_response.rb +2 -2
  129. data/lib/one_msg_sdk/models/patch_flows_flow_id_assets200_response.rb +2 -2
  130. data/lib/one_msg_sdk/models/patch_flows_flow_id_assets_request.rb +167 -0
  131. data/lib/one_msg_sdk/models/patch_flows_flow_id_metadata_request.rb +190 -0
  132. data/lib/one_msg_sdk/models/profile_info.rb +2 -2
  133. data/lib/one_msg_sdk/models/remove_template_request.rb +165 -0
  134. data/lib/one_msg_sdk/models/retrieve_media200_response.rb +2 -2
  135. data/lib/one_msg_sdk/models/send_address_message_request.rb +2 -2
  136. data/lib/one_msg_sdk/models/send_button_request.rb +48 -3
  137. data/lib/one_msg_sdk/models/send_button_request_sections_inner.rb +2 -2
  138. data/lib/one_msg_sdk/models/send_button_request_sections_inner_reply.rb +2 -2
  139. data/lib/one_msg_sdk/models/send_carousel_request1.rb +38 -13
  140. data/lib/one_msg_sdk/models/send_contact_info_request.rb +222 -0
  141. data/lib/one_msg_sdk/models/send_contact_request.rb +32 -3
  142. data/lib/one_msg_sdk/models/send_contact_request_contact.rb +221 -0
  143. data/lib/one_msg_sdk/models/send_contact_request_contact_name.rb +105 -0
  144. data/lib/one_msg_sdk/models/send_contact_request_contacts_inner.rb +5 -5
  145. data/lib/one_msg_sdk/models/send_contact_request_contacts_inner_name.rb +2 -2
  146. data/lib/one_msg_sdk/models/send_contact_request_contacts_inner_org.rb +2 -2
  147. data/lib/one_msg_sdk/models/send_contact_request_contacts_inner_phones_inner.rb +3 -2
  148. data/lib/one_msg_sdk/models/send_cta_url_request.rb +2 -2
  149. data/lib/one_msg_sdk/models/send_file_request.rb +2 -2
  150. data/lib/one_msg_sdk/models/send_flow_request1.rb +2 -2
  151. data/lib/one_msg_sdk/models/send_flow_request1_header.rb +2 -2
  152. data/lib/one_msg_sdk/models/send_flow_request_header.rb +2 -2
  153. data/lib/one_msg_sdk/models/send_list_request.rb +23 -3
  154. data/lib/one_msg_sdk/models/send_list_request_sections_inner.rb +2 -2
  155. data/lib/one_msg_sdk/models/send_list_request_sections_inner_rows_inner.rb +2 -2
  156. data/lib/one_msg_sdk/models/send_location_request1.rb +2 -2
  157. data/lib/one_msg_sdk/models/send_location_request_request.rb +23 -3
  158. data/lib/one_msg_sdk/models/send_message_request.rb +60 -28
  159. data/lib/one_msg_sdk/models/send_message_request_direct_send.rb +189 -0
  160. data/lib/one_msg_sdk/models/send_order_details_request.rb +2 -2
  161. data/lib/one_msg_sdk/models/send_order_details_request_language.rb +2 -2
  162. data/lib/one_msg_sdk/models/send_order_details_request_order.rb +2 -2
  163. data/lib/one_msg_sdk/models/send_order_details_request_order_items_inner.rb +2 -2
  164. data/lib/one_msg_sdk/models/send_order_details_request_order_items_inner_amount.rb +2 -2
  165. data/lib/one_msg_sdk/models/send_payment_request_request.rb +2 -2
  166. data/lib/one_msg_sdk/models/send_product_request.rb +225 -0
  167. data/lib/one_msg_sdk/models/send_reaction_request.rb +14 -3
  168. data/lib/one_msg_sdk/models/send_sticker_request.rb +2 -2
  169. data/lib/one_msg_sdk/models/send_template_request.rb +29 -5
  170. data/lib/one_msg_sdk/models/send_template_request_language.rb +6 -2
  171. data/lib/one_msg_sdk/models/set_webhook200_response.rb +157 -0
  172. data/lib/one_msg_sdk/models/set_webhook200_response_webhook_url.rb +105 -0
  173. data/lib/one_msg_sdk/models/set_webhook_request.rb +164 -0
  174. data/lib/one_msg_sdk/models/set_webhook_request_webhook_url.rb +105 -0
  175. data/lib/one_msg_sdk/models/set_whatsapp_business_encryption_request.rb +2 -2
  176. data/lib/one_msg_sdk/models/success_response.rb +2 -2
  177. data/lib/one_msg_sdk/models/update_calling_settings200_response.rb +165 -0
  178. data/lib/one_msg_sdk/models/update_calling_settings200_response_response.rb +147 -0
  179. data/lib/one_msg_sdk/models/update_me200_response.rb +147 -0
  180. data/lib/one_msg_sdk/models/update_me_request.rb +6 -3
  181. data/lib/one_msg_sdk/models/webhook_url_status.rb +287 -0
  182. data/lib/one_msg_sdk/platform_client.rb +182 -0
  183. data/lib/one_msg_sdk/version.rb +3 -3
  184. data/lib/one_msg_sdk.rb +44 -2
  185. data/one_msg_sdk.gemspec +2 -2
  186. data/spec/api/calling_api_spec.rb +11 -11
  187. data/spec/api/catalog_api_spec.rb +3 -3
  188. data/spec/api/channel_api_spec.rb +29 -4
  189. data/spec/api/flows_api_spec.rb +10 -2
  190. data/spec/api/groups_api_spec.rb +10 -2
  191. data/spec/api/messaging_api_spec.rb +37 -9
  192. data/spec/api/profile_api_spec.rb +5 -5
  193. data/spec/api/templates_api_spec.rb +11 -5
  194. data/spec/api/users_api_spec.rb +2 -2
  195. data/spec/api/webhooks_api_spec.rb +6 -6
  196. data/spec/models/add_template200_response_spec.rb +36 -0
  197. data/spec/models/add_template_request_spec.rb +2 -2
  198. data/spec/models/block_user_request_spec.rb +2 -2
  199. data/spec/models/calling_settings_calling_audio_spec.rb +36 -0
  200. data/spec/models/calling_settings_calling_call_hours_spec.rb +48 -0
  201. data/spec/models/calling_settings_calling_sip_servers_inner_spec.rb +66 -0
  202. data/spec/models/calling_settings_calling_sip_spec.rb +46 -0
  203. data/spec/models/calling_settings_calling_spec.rb +112 -0
  204. data/spec/models/calling_settings_calling_video_spec.rb +40 -0
  205. data/spec/models/calling_settings_spec.rb +36 -0
  206. data/spec/models/conversational_automation_commands_inner_spec.rb +2 -2
  207. data/spec/models/conversational_automation_spec.rb +2 -2
  208. data/spec/models/create_commerce200_response_spec.rb +2 -2
  209. data/spec/models/create_commerce_request_params_spec.rb +2 -2
  210. data/spec/models/create_commerce_request_spec.rb +2 -2
  211. data/spec/models/create_flows_request_spec.rb +64 -0
  212. data/spec/models/create_groups200_response_spec.rb +2 -2
  213. data/spec/models/create_groups_group_id_request_spec.rb +48 -0
  214. data/spec/models/create_groups_request_spec.rb +42 -0
  215. data/spec/models/create_read_message200_response_spec.rb +2 -2
  216. data/spec/models/create_read_message401_response_spec.rb +2 -2
  217. data/spec/models/create_read_message_request_spec.rb +2 -2
  218. data/spec/models/create_settings_request_spec.rb +66 -0
  219. data/spec/models/create_settings_request_webhook_url_spec.rb +32 -0
  220. data/spec/models/create_upload_media200_response_spec.rb +36 -0
  221. data/spec/models/create_upload_media_request_spec.rb +42 -0
  222. data/spec/models/delete_flows_flow_id200_response_spec.rb +2 -2
  223. data/spec/models/delete_groups_group_id200_response_spec.rb +2 -2
  224. data/spec/models/delete_media_legacy_request_spec.rb +2 -2
  225. data/spec/models/error_response_spec.rb +2 -2
  226. data/spec/models/get_commerce200_response_inner_spec.rb +2 -2
  227. data/spec/models/get_mm_lite_status200_response_spec.rb +2 -2
  228. data/spec/models/get_status200_response_spec.rb +60 -0
  229. data/spec/models/get_webhook200_response_spec.rb +72 -2
  230. data/spec/models/get_webhook200_response_webhook_url_spec.rb +32 -0
  231. data/spec/models/get_whatsapp_business_encryption200_response_spec.rb +2 -2
  232. data/spec/models/initiate_call_request_session_spec.rb +46 -0
  233. data/spec/models/initiate_call_request_spec.rb +74 -0
  234. data/spec/models/initiate_call_response_calls_inner_spec.rb +36 -0
  235. data/spec/models/initiate_call_response_response_spec.rb +36 -0
  236. data/spec/models/initiate_call_response_spec.rb +60 -0
  237. data/spec/models/list_blocked_users200_response_spec.rb +2 -2
  238. data/spec/models/list_flows200_response_spec.rb +2 -2
  239. data/spec/models/list_messages200_response_spec.rb +2 -2
  240. data/spec/models/list_settings200_response_spec.rb +142 -0
  241. data/spec/models/list_settings200_response_webhook_url_spec.rb +32 -0
  242. data/spec/models/list_templates200_response_spec.rb +2 -2
  243. data/spec/models/message_sent_response_spec.rb +2 -2
  244. data/spec/models/patch_flows_flow_id_assets200_response_spec.rb +2 -2
  245. data/spec/models/patch_flows_flow_id_assets_request_spec.rb +36 -0
  246. data/spec/models/patch_flows_flow_id_metadata_request_spec.rb +52 -0
  247. data/spec/models/profile_info_spec.rb +2 -2
  248. data/spec/models/remove_template_request_spec.rb +36 -0
  249. data/spec/models/retrieve_media200_response_spec.rb +2 -2
  250. data/spec/models/send_address_message_request_spec.rb +2 -2
  251. data/spec/models/send_button_request_sections_inner_reply_spec.rb +2 -2
  252. data/spec/models/send_button_request_sections_inner_spec.rb +2 -2
  253. data/spec/models/send_button_request_spec.rb +26 -2
  254. data/spec/models/send_carousel_request1_spec.rb +8 -2
  255. data/spec/models/send_contact_info_request_spec.rb +60 -0
  256. data/spec/models/send_contact_request_contact_name_spec.rb +32 -0
  257. data/spec/models/send_contact_request_contact_spec.rb +60 -0
  258. data/spec/models/send_contact_request_contacts_inner_name_spec.rb +2 -2
  259. data/spec/models/send_contact_request_contacts_inner_org_spec.rb +2 -2
  260. data/spec/models/send_contact_request_contacts_inner_phones_inner_spec.rb +2 -2
  261. data/spec/models/send_contact_request_contacts_inner_spec.rb +2 -2
  262. data/spec/models/send_contact_request_spec.rb +20 -2
  263. data/spec/models/send_cta_url_request_spec.rb +2 -2
  264. data/spec/models/send_file_request_spec.rb +2 -2
  265. data/spec/models/send_flow_request1_header_spec.rb +2 -2
  266. data/spec/models/send_flow_request1_spec.rb +2 -2
  267. data/spec/models/send_flow_request_header_spec.rb +2 -2
  268. data/spec/models/send_list_request_sections_inner_rows_inner_spec.rb +2 -2
  269. data/spec/models/send_list_request_sections_inner_spec.rb +2 -2
  270. data/spec/models/send_list_request_spec.rb +14 -2
  271. data/spec/models/send_location_request1_spec.rb +2 -2
  272. data/spec/models/send_location_request_request_spec.rb +14 -2
  273. data/spec/models/send_message_request_direct_send_spec.rb +42 -0
  274. data/spec/models/send_message_request_spec.rb +18 -2
  275. data/spec/models/send_order_details_request_language_spec.rb +2 -2
  276. data/spec/models/send_order_details_request_order_items_inner_amount_spec.rb +2 -2
  277. data/spec/models/send_order_details_request_order_items_inner_spec.rb +2 -2
  278. data/spec/models/send_order_details_request_order_spec.rb +2 -2
  279. data/spec/models/send_order_details_request_spec.rb +2 -2
  280. data/spec/models/send_payment_request_request_spec.rb +2 -2
  281. data/spec/models/send_product_request_spec.rb +72 -0
  282. data/spec/models/send_reaction_request_spec.rb +8 -2
  283. data/spec/models/send_sticker_request_spec.rb +2 -2
  284. data/spec/models/send_template_request_language_spec.rb +2 -2
  285. data/spec/models/send_template_request_spec.rb +14 -2
  286. data/spec/models/set_webhook200_response_spec.rb +42 -0
  287. data/spec/models/set_webhook200_response_webhook_url_spec.rb +32 -0
  288. data/spec/models/set_webhook_request_spec.rb +36 -0
  289. data/spec/models/set_webhook_request_webhook_url_spec.rb +32 -0
  290. data/spec/models/set_whatsapp_business_encryption_request_spec.rb +2 -2
  291. data/spec/models/success_response_spec.rb +2 -2
  292. data/spec/models/update_calling_settings200_response_response_spec.rb +36 -0
  293. data/spec/models/update_calling_settings200_response_spec.rb +48 -0
  294. data/spec/models/update_me200_response_spec.rb +36 -0
  295. data/spec/models/update_me_request_spec.rb +2 -2
  296. data/spec/models/webhook_url_status_spec.rb +88 -0
  297. data/spec/spec_helper.rb +2 -2
  298. metadata +319 -89
@@ -0,0 +1,182 @@
1
+ require 'json'
2
+ require 'net/http'
3
+ require 'uri'
4
+
5
+ module OneMsgSdk
6
+ class PlatformError < StandardError
7
+ attr_reader :status, :body
8
+ def initialize(status, body)
9
+ super("Platform API HTTP #{status}")
10
+ @status = status
11
+ @body = body
12
+ end
13
+ end
14
+
15
+ # Platform API client. Bearer API key, not the WhatsApp channel token.
16
+ class PlatformClient
17
+ def initialize(api_key, base_url = 'https://api.1msg.io')
18
+ raise ArgumentError, 'api_key is required' if api_key.nil? || api_key.strip.empty?
19
+ @api_key = api_key.strip
20
+ @base_url = (base_url.nil? || base_url.strip.empty? ? 'https://api.1msg.io' : base_url).sub(%r{/+$}, '')
21
+ @operations = {}
22
+ JSON.parse("[{\"id\":\"listInboxChannels\",\"method\":\"GET\",\"path\":\"/api/v1/inbox/channels\",\"pathParams\":[]},{\"id\":\"listInboxChannelAssignees\",\"method\":\"GET\",\"path\":\"/api/v1/inbox/channels/{channelId}/assignees\",\"pathParams\":[\"channelId\"]},{\"id\":\"listInboxConversations\",\"method\":\"GET\",\"path\":\"/api/v1/inbox/conversations\",\"pathParams\":[]},{\"id\":\"searchInboxConversations\",\"method\":\"GET\",\"path\":\"/api/v1/inbox/conversations/search\",\"pathParams\":[]},{\"id\":\"countInboxConversations\",\"method\":\"GET\",\"path\":\"/api/v1/inbox/conversations/counts\",\"pathParams\":[]},{\"id\":\"getInboxConversation\",\"method\":\"GET\",\"path\":\"/api/v1/inbox/conversations/{conversationId}\",\"pathParams\":[\"conversationId\"]},{\"id\":\"updateInboxConversationStatus\",\"method\":\"PATCH\",\"path\":\"/api/v1/inbox/conversations/{conversationId}/status\",\"pathParams\":[\"conversationId\"]},{\"id\":\"updateInboxConversationAssignee\",\"method\":\"PATCH\",\"path\":\"/api/v1/inbox/conversations/{conversationId}/assignee\",\"pathParams\":[\"conversationId\"]},{\"id\":\"listInboxConversationMessages\",\"method\":\"GET\",\"path\":\"/api/v1/inbox/conversations/{conversationId}/messages\",\"pathParams\":[\"conversationId\"]},{\"id\":\"blockInboxContact\",\"method\":\"POST\",\"path\":\"/api/v1/inbox/conversations/{conversationId}/block\",\"pathParams\":[\"conversationId\"]},{\"id\":\"unblockInboxContact\",\"method\":\"POST\",\"path\":\"/api/v1/inbox/conversations/{conversationId}/unblock\",\"pathParams\":[\"conversationId\"]},{\"id\":\"renameInboxConversation\",\"method\":\"PATCH\",\"path\":\"/api/v1/inbox/conversations/{conversationId}/title\",\"pathParams\":[\"conversationId\"]},{\"id\":\"listInboxContacts\",\"method\":\"GET\",\"path\":\"/api/v1/inbox/contacts\",\"pathParams\":[]},{\"id\":\"getInboxWebhook\",\"method\":\"GET\",\"path\":\"/api/v1/inbox/webhook\",\"pathParams\":[]},{\"id\":\"setInboxWebhook\",\"method\":\"PUT\",\"path\":\"/api/v1/inbox/webhook\",\"pathParams\":[]},{\"id\":\"deleteInboxWebhook\",\"method\":\"DELETE\",\"path\":\"/api/v1/inbox/webhook\",\"pathParams\":[]},{\"id\":\"rotateInboxWebhookSecret\",\"method\":\"POST\",\"path\":\"/api/v1/inbox/webhook/secret\",\"pathParams\":[]},{\"id\":\"listCampaignSegments\",\"method\":\"GET\",\"path\":\"/api/v1/campaigns/segments\",\"pathParams\":[]},{\"id\":\"createCampaignSegment\",\"method\":\"POST\",\"path\":\"/api/v1/campaigns/segments\",\"pathParams\":[]},{\"id\":\"getCampaignSegment\",\"method\":\"GET\",\"path\":\"/api/v1/campaigns/segments/{segmentId}\",\"pathParams\":[\"segmentId\"]},{\"id\":\"updateCampaignSegment\",\"method\":\"PATCH\",\"path\":\"/api/v1/campaigns/segments/{segmentId}\",\"pathParams\":[\"segmentId\"]},{\"id\":\"deleteCampaignSegment\",\"method\":\"DELETE\",\"path\":\"/api/v1/campaigns/segments/{segmentId}\",\"pathParams\":[\"segmentId\"]},{\"id\":\"listCampaignSegmentMembers\",\"method\":\"GET\",\"path\":\"/api/v1/campaigns/segments/{segmentId}/members\",\"pathParams\":[\"segmentId\"]},{\"id\":\"addCampaignSegmentMembers\",\"method\":\"POST\",\"path\":\"/api/v1/campaigns/segments/{segmentId}/members\",\"pathParams\":[\"segmentId\"]},{\"id\":\"replaceCampaignSegmentMembers\",\"method\":\"PUT\",\"path\":\"/api/v1/campaigns/segments/{segmentId}/members\",\"pathParams\":[\"segmentId\"]},{\"id\":\"removeCampaignSegmentMembers\",\"method\":\"DELETE\",\"path\":\"/api/v1/campaigns/segments/{segmentId}/members\",\"pathParams\":[\"segmentId\"]},{\"id\":\"updateCampaignSegmentMember\",\"method\":\"PATCH\",\"path\":\"/api/v1/campaigns/segments/{segmentId}/members/{memberId}\",\"pathParams\":[\"segmentId\",\"memberId\"]},{\"id\":\"listCampaigns\",\"method\":\"GET\",\"path\":\"/api/v1/campaigns\",\"pathParams\":[]},{\"id\":\"createCampaign\",\"method\":\"POST\",\"path\":\"/api/v1/campaigns\",\"pathParams\":[]},{\"id\":\"getCampaign\",\"method\":\"GET\",\"path\":\"/api/v1/campaigns/{campaignId}\",\"pathParams\":[\"campaignId\"]},{\"id\":\"updateCampaign\",\"method\":\"PATCH\",\"path\":\"/api/v1/campaigns/{campaignId}\",\"pathParams\":[\"campaignId\"]},{\"id\":\"previewCampaign\",\"method\":\"GET\",\"path\":\"/api/v1/campaigns/{campaignId}/preview\",\"pathParams\":[\"campaignId\"]},{\"id\":\"sendCampaign\",\"method\":\"POST\",\"path\":\"/api/v1/campaigns/{campaignId}/send\",\"pathParams\":[\"campaignId\"]},{\"id\":\"scheduleCampaign\",\"method\":\"PATCH\",\"path\":\"/api/v1/campaigns/{campaignId}/schedule\",\"pathParams\":[\"campaignId\"]},{\"id\":\"unscheduleCampaign\",\"method\":\"POST\",\"path\":\"/api/v1/campaigns/{campaignId}/unschedule\",\"pathParams\":[\"campaignId\"]},{\"id\":\"pauseCampaign\",\"method\":\"POST\",\"path\":\"/api/v1/campaigns/{campaignId}/pause\",\"pathParams\":[\"campaignId\"]},{\"id\":\"resumeCampaign\",\"method\":\"POST\",\"path\":\"/api/v1/campaigns/{campaignId}/resume\",\"pathParams\":[\"campaignId\"]},{\"id\":\"completeCampaign\",\"method\":\"POST\",\"path\":\"/api/v1/campaigns/{campaignId}/complete\",\"pathParams\":[\"campaignId\"]},{\"id\":\"testCampaign\",\"method\":\"POST\",\"path\":\"/api/v1/campaigns/{campaignId}/test\",\"pathParams\":[\"campaignId\"]},{\"id\":\"getCampaignAnalytics\",\"method\":\"GET\",\"path\":\"/api/v1/campaigns/{campaignId}/analytics\",\"pathParams\":[\"campaignId\"]},{\"id\":\"listCampaignAnalyticsRecipients\",\"method\":\"GET\",\"path\":\"/api/v1/campaigns/{campaignId}/analytics/recipients\",\"pathParams\":[\"campaignId\"]},{\"id\":\"listCampaignAnalyticsReplies\",\"method\":\"GET\",\"path\":\"/api/v1/campaigns/{campaignId}/analytics/replies\",\"pathParams\":[\"campaignId\"]},{\"id\":\"listCampaignAnalyticsErrors\",\"method\":\"GET\",\"path\":\"/api/v1/campaigns/{campaignId}/analytics/errors\",\"pathParams\":[\"campaignId\"]}]").each { |operation| @operations[operation['id']] = operation }
23
+ end
24
+
25
+ def call(operation_id, path: nil, query: nil, body: nil)
26
+ spec = @operations[operation_id] or raise ArgumentError, "unknown platform operation #{operation_id}"
27
+ url_path = spec['path']
28
+ spec['pathParams'].each do |name|
29
+ value = path && path[name]
30
+ raise ArgumentError, "missing path param #{name}" if value.nil?
31
+ url_path = url_path.sub('{' + name + '}', URI.encode_www_form_component(value.to_s))
32
+ end
33
+ url = @base_url + url_path
34
+ url += '?' + URI.encode_www_form(query) if query && !query.empty?
35
+ uri = URI(url)
36
+ http = Net::HTTP.new(uri.host, uri.port)
37
+ http.use_ssl = uri.scheme == 'https'
38
+ request = Net::HTTPGenericRequest.new(spec['method'], !body.nil?, true, uri)
39
+ request['Authorization'] = "Bearer #{@api_key}"
40
+ request['Accept'] = 'application/json'
41
+ if body
42
+ request['Content-Type'] = 'application/json'
43
+ request.body = JSON.generate(body)
44
+ end
45
+ response = http.request(request)
46
+ text = response.body.to_s
47
+ raise PlatformError.new(response.code.to_i, text) unless response.is_a?(Net::HTTPSuccess)
48
+ return nil if text.empty?
49
+ JSON.parse(text)
50
+ end
51
+
52
+ def list_inbox_channels(path: nil, query: nil, body: nil)
53
+ call("listInboxChannels", path: path, query: query, body: body)
54
+ end
55
+ def list_inbox_channel_assignees(path: nil, query: nil, body: nil)
56
+ call("listInboxChannelAssignees", path: path, query: query, body: body)
57
+ end
58
+ def list_inbox_conversations(path: nil, query: nil, body: nil)
59
+ call("listInboxConversations", path: path, query: query, body: body)
60
+ end
61
+ def search_inbox_conversations(path: nil, query: nil, body: nil)
62
+ call("searchInboxConversations", path: path, query: query, body: body)
63
+ end
64
+ def count_inbox_conversations(path: nil, query: nil, body: nil)
65
+ call("countInboxConversations", path: path, query: query, body: body)
66
+ end
67
+ def get_inbox_conversation(path: nil, query: nil, body: nil)
68
+ call("getInboxConversation", path: path, query: query, body: body)
69
+ end
70
+ def update_inbox_conversation_status(path: nil, query: nil, body: nil)
71
+ call("updateInboxConversationStatus", path: path, query: query, body: body)
72
+ end
73
+ def update_inbox_conversation_assignee(path: nil, query: nil, body: nil)
74
+ call("updateInboxConversationAssignee", path: path, query: query, body: body)
75
+ end
76
+ def list_inbox_conversation_messages(path: nil, query: nil, body: nil)
77
+ call("listInboxConversationMessages", path: path, query: query, body: body)
78
+ end
79
+ def block_inbox_contact(path: nil, query: nil, body: nil)
80
+ call("blockInboxContact", path: path, query: query, body: body)
81
+ end
82
+ def unblock_inbox_contact(path: nil, query: nil, body: nil)
83
+ call("unblockInboxContact", path: path, query: query, body: body)
84
+ end
85
+ def rename_inbox_conversation(path: nil, query: nil, body: nil)
86
+ call("renameInboxConversation", path: path, query: query, body: body)
87
+ end
88
+ def list_inbox_contacts(path: nil, query: nil, body: nil)
89
+ call("listInboxContacts", path: path, query: query, body: body)
90
+ end
91
+ def get_inbox_webhook(path: nil, query: nil, body: nil)
92
+ call("getInboxWebhook", path: path, query: query, body: body)
93
+ end
94
+ def set_inbox_webhook(path: nil, query: nil, body: nil)
95
+ call("setInboxWebhook", path: path, query: query, body: body)
96
+ end
97
+ def delete_inbox_webhook(path: nil, query: nil, body: nil)
98
+ call("deleteInboxWebhook", path: path, query: query, body: body)
99
+ end
100
+ def rotate_inbox_webhook_secret(path: nil, query: nil, body: nil)
101
+ call("rotateInboxWebhookSecret", path: path, query: query, body: body)
102
+ end
103
+ def list_campaign_segments(path: nil, query: nil, body: nil)
104
+ call("listCampaignSegments", path: path, query: query, body: body)
105
+ end
106
+ def create_campaign_segment(path: nil, query: nil, body: nil)
107
+ call("createCampaignSegment", path: path, query: query, body: body)
108
+ end
109
+ def get_campaign_segment(path: nil, query: nil, body: nil)
110
+ call("getCampaignSegment", path: path, query: query, body: body)
111
+ end
112
+ def update_campaign_segment(path: nil, query: nil, body: nil)
113
+ call("updateCampaignSegment", path: path, query: query, body: body)
114
+ end
115
+ def delete_campaign_segment(path: nil, query: nil, body: nil)
116
+ call("deleteCampaignSegment", path: path, query: query, body: body)
117
+ end
118
+ def list_campaign_segment_members(path: nil, query: nil, body: nil)
119
+ call("listCampaignSegmentMembers", path: path, query: query, body: body)
120
+ end
121
+ def add_campaign_segment_members(path: nil, query: nil, body: nil)
122
+ call("addCampaignSegmentMembers", path: path, query: query, body: body)
123
+ end
124
+ def replace_campaign_segment_members(path: nil, query: nil, body: nil)
125
+ call("replaceCampaignSegmentMembers", path: path, query: query, body: body)
126
+ end
127
+ def remove_campaign_segment_members(path: nil, query: nil, body: nil)
128
+ call("removeCampaignSegmentMembers", path: path, query: query, body: body)
129
+ end
130
+ def update_campaign_segment_member(path: nil, query: nil, body: nil)
131
+ call("updateCampaignSegmentMember", path: path, query: query, body: body)
132
+ end
133
+ def list_campaigns(path: nil, query: nil, body: nil)
134
+ call("listCampaigns", path: path, query: query, body: body)
135
+ end
136
+ def create_campaign(path: nil, query: nil, body: nil)
137
+ call("createCampaign", path: path, query: query, body: body)
138
+ end
139
+ def get_campaign(path: nil, query: nil, body: nil)
140
+ call("getCampaign", path: path, query: query, body: body)
141
+ end
142
+ def update_campaign(path: nil, query: nil, body: nil)
143
+ call("updateCampaign", path: path, query: query, body: body)
144
+ end
145
+ def preview_campaign(path: nil, query: nil, body: nil)
146
+ call("previewCampaign", path: path, query: query, body: body)
147
+ end
148
+ def send_campaign(path: nil, query: nil, body: nil)
149
+ call("sendCampaign", path: path, query: query, body: body)
150
+ end
151
+ def schedule_campaign(path: nil, query: nil, body: nil)
152
+ call("scheduleCampaign", path: path, query: query, body: body)
153
+ end
154
+ def unschedule_campaign(path: nil, query: nil, body: nil)
155
+ call("unscheduleCampaign", path: path, query: query, body: body)
156
+ end
157
+ def pause_campaign(path: nil, query: nil, body: nil)
158
+ call("pauseCampaign", path: path, query: query, body: body)
159
+ end
160
+ def resume_campaign(path: nil, query: nil, body: nil)
161
+ call("resumeCampaign", path: path, query: query, body: body)
162
+ end
163
+ def complete_campaign(path: nil, query: nil, body: nil)
164
+ call("completeCampaign", path: path, query: query, body: body)
165
+ end
166
+ def test_campaign(path: nil, query: nil, body: nil)
167
+ call("testCampaign", path: path, query: query, body: body)
168
+ end
169
+ def get_campaign_analytics(path: nil, query: nil, body: nil)
170
+ call("getCampaignAnalytics", path: path, query: query, body: body)
171
+ end
172
+ def list_campaign_analytics_recipients(path: nil, query: nil, body: nil)
173
+ call("listCampaignAnalyticsRecipients", path: path, query: query, body: body)
174
+ end
175
+ def list_campaign_analytics_replies(path: nil, query: nil, body: nil)
176
+ call("listCampaignAnalyticsReplies", path: path, query: query, body: body)
177
+ end
178
+ def list_campaign_analytics_errors(path: nil, query: nil, body: nil)
179
+ call("listCampaignAnalyticsErrors", path: path, query: query, body: body)
180
+ end
181
+ end
182
+ end
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #1MSG WhatsApp Business API (Public)
3
3
 
4
- #Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** All requests require `token` query parameter with JWT or API key. **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
4
+ #Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** Pass the channel token in **one** place. The API checks JSON body (`token`), then query string (`?token=`), then `Authorization: Bearer` header (preferred in production). **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
5
5
 
6
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 2.0.0
7
7
  Contact: support@1msg.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -11,5 +11,5 @@ Generator version: 7.22.0
11
11
  =end
12
12
 
13
13
  module OneMsgSdk
14
- VERSION = '2.0.1'
14
+ VERSION = '2.0.3'
15
15
  end
data/lib/one_msg_sdk.rb CHANGED
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #1MSG WhatsApp Business API (Public)
3
3
 
4
- #Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** All requests require `token` query parameter with JWT or API key. **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
4
+ #Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** Pass the channel token in **one** place. The API checks JSON body (`token`), then query string (`?token=`), then `Authorization: Bearer` header (preferred in production). **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
5
5
 
6
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 2.0.0
7
7
  Contact: support@1msg.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -18,39 +18,69 @@ require 'one_msg_sdk/version'
18
18
  require 'one_msg_sdk/configuration'
19
19
 
20
20
  # Models
21
+ require 'one_msg_sdk/models/add_template200_response'
21
22
  require 'one_msg_sdk/models/add_template_request'
22
23
  require 'one_msg_sdk/models/block_user_request'
24
+ require 'one_msg_sdk/models/calling_settings'
25
+ require 'one_msg_sdk/models/calling_settings_calling'
26
+ require 'one_msg_sdk/models/calling_settings_calling_audio'
27
+ require 'one_msg_sdk/models/calling_settings_calling_call_hours'
28
+ require 'one_msg_sdk/models/calling_settings_calling_sip'
29
+ require 'one_msg_sdk/models/calling_settings_calling_sip_servers_inner'
30
+ require 'one_msg_sdk/models/calling_settings_calling_video'
23
31
  require 'one_msg_sdk/models/conversational_automation'
24
32
  require 'one_msg_sdk/models/conversational_automation_commands_inner'
25
33
  require 'one_msg_sdk/models/create_commerce200_response'
26
34
  require 'one_msg_sdk/models/create_commerce_request'
27
35
  require 'one_msg_sdk/models/create_commerce_request_params'
36
+ require 'one_msg_sdk/models/create_flows_request'
28
37
  require 'one_msg_sdk/models/create_groups200_response'
38
+ require 'one_msg_sdk/models/create_groups_group_id_request'
39
+ require 'one_msg_sdk/models/create_groups_request'
29
40
  require 'one_msg_sdk/models/create_read_message200_response'
30
41
  require 'one_msg_sdk/models/create_read_message401_response'
31
42
  require 'one_msg_sdk/models/create_read_message_request'
43
+ require 'one_msg_sdk/models/create_settings_request'
44
+ require 'one_msg_sdk/models/create_settings_request_webhook_url'
45
+ require 'one_msg_sdk/models/create_upload_media200_response'
46
+ require 'one_msg_sdk/models/create_upload_media_request'
32
47
  require 'one_msg_sdk/models/delete_flows_flow_id200_response'
33
48
  require 'one_msg_sdk/models/delete_groups_group_id200_response'
34
49
  require 'one_msg_sdk/models/delete_media_legacy_request'
35
50
  require 'one_msg_sdk/models/error_response'
36
51
  require 'one_msg_sdk/models/get_commerce200_response_inner'
37
52
  require 'one_msg_sdk/models/get_mm_lite_status200_response'
53
+ require 'one_msg_sdk/models/get_status200_response'
38
54
  require 'one_msg_sdk/models/get_webhook200_response'
55
+ require 'one_msg_sdk/models/get_webhook200_response_webhook_url'
39
56
  require 'one_msg_sdk/models/get_whatsapp_business_encryption200_response'
57
+ require 'one_msg_sdk/models/initiate_call_request'
58
+ require 'one_msg_sdk/models/initiate_call_request_session'
59
+ require 'one_msg_sdk/models/initiate_call_response'
60
+ require 'one_msg_sdk/models/initiate_call_response_calls_inner'
61
+ require 'one_msg_sdk/models/initiate_call_response_response'
40
62
  require 'one_msg_sdk/models/list_blocked_users200_response'
41
63
  require 'one_msg_sdk/models/list_flows200_response'
42
64
  require 'one_msg_sdk/models/list_messages200_response'
65
+ require 'one_msg_sdk/models/list_settings200_response'
66
+ require 'one_msg_sdk/models/list_settings200_response_webhook_url'
43
67
  require 'one_msg_sdk/models/list_templates200_response'
44
68
  require 'one_msg_sdk/models/message_sent_response'
45
69
  require 'one_msg_sdk/models/patch_flows_flow_id_assets200_response'
70
+ require 'one_msg_sdk/models/patch_flows_flow_id_assets_request'
71
+ require 'one_msg_sdk/models/patch_flows_flow_id_metadata_request'
46
72
  require 'one_msg_sdk/models/profile_info'
73
+ require 'one_msg_sdk/models/remove_template_request'
47
74
  require 'one_msg_sdk/models/retrieve_media200_response'
48
75
  require 'one_msg_sdk/models/send_address_message_request'
49
76
  require 'one_msg_sdk/models/send_button_request'
50
77
  require 'one_msg_sdk/models/send_button_request_sections_inner'
51
78
  require 'one_msg_sdk/models/send_button_request_sections_inner_reply'
52
79
  require 'one_msg_sdk/models/send_carousel_request1'
80
+ require 'one_msg_sdk/models/send_contact_info_request'
53
81
  require 'one_msg_sdk/models/send_contact_request'
82
+ require 'one_msg_sdk/models/send_contact_request_contact'
83
+ require 'one_msg_sdk/models/send_contact_request_contact_name'
54
84
  require 'one_msg_sdk/models/send_contact_request_contacts_inner'
55
85
  require 'one_msg_sdk/models/send_contact_request_contacts_inner_name'
56
86
  require 'one_msg_sdk/models/send_contact_request_contacts_inner_org'
@@ -66,19 +96,29 @@ require 'one_msg_sdk/models/send_list_request_sections_inner_rows_inner'
66
96
  require 'one_msg_sdk/models/send_location_request1'
67
97
  require 'one_msg_sdk/models/send_location_request_request'
68
98
  require 'one_msg_sdk/models/send_message_request'
99
+ require 'one_msg_sdk/models/send_message_request_direct_send'
69
100
  require 'one_msg_sdk/models/send_order_details_request'
70
101
  require 'one_msg_sdk/models/send_order_details_request_language'
71
102
  require 'one_msg_sdk/models/send_order_details_request_order'
72
103
  require 'one_msg_sdk/models/send_order_details_request_order_items_inner'
73
104
  require 'one_msg_sdk/models/send_order_details_request_order_items_inner_amount'
74
105
  require 'one_msg_sdk/models/send_payment_request_request'
106
+ require 'one_msg_sdk/models/send_product_request'
75
107
  require 'one_msg_sdk/models/send_reaction_request'
76
108
  require 'one_msg_sdk/models/send_sticker_request'
77
109
  require 'one_msg_sdk/models/send_template_request'
78
110
  require 'one_msg_sdk/models/send_template_request_language'
111
+ require 'one_msg_sdk/models/set_webhook200_response'
112
+ require 'one_msg_sdk/models/set_webhook200_response_webhook_url'
113
+ require 'one_msg_sdk/models/set_webhook_request'
114
+ require 'one_msg_sdk/models/set_webhook_request_webhook_url'
79
115
  require 'one_msg_sdk/models/set_whatsapp_business_encryption_request'
80
116
  require 'one_msg_sdk/models/success_response'
117
+ require 'one_msg_sdk/models/update_calling_settings200_response'
118
+ require 'one_msg_sdk/models/update_calling_settings200_response_response'
119
+ require 'one_msg_sdk/models/update_me200_response'
81
120
  require 'one_msg_sdk/models/update_me_request'
121
+ require 'one_msg_sdk/models/webhook_url_status'
82
122
 
83
123
  # APIs
84
124
  require 'one_msg_sdk/api/calling_api'
@@ -109,3 +149,5 @@ module OneMsgSdk
109
149
  end
110
150
  end
111
151
  end
152
+
153
+ require 'one_msg_sdk/platform_client'
data/one_msg_sdk.gemspec CHANGED
@@ -3,9 +3,9 @@
3
3
  =begin
4
4
  #1MSG WhatsApp Business API (Public)
5
5
 
6
- #Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** All requests require `token` query parameter with JWT or API key. **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
6
+ #Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** Pass the channel token in **one** place. The API checks JSON body (`token`), then query string (`?token=`), then `Authorization: Bearer` header (preferred in production). **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
7
7
 
8
- The version of the OpenAPI document: 1.0.0
8
+ The version of the OpenAPI document: 2.0.0
9
9
  Contact: support@1msg.io
10
10
  Generated by: https://openapi-generator.tech
11
11
  Generator version: 7.22.0
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #1MSG WhatsApp Business API (Public)
3
3
 
4
- #Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** All requests require `token` query parameter with JWT or API key. **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
4
+ #Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** Pass the channel token in **one** place. The API checks JSON body (`token`), then query string (`?token=`), then `Authorization: Bearer` header (preferred in production). **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
5
5
 
6
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 2.0.0
7
7
  Contact: support@1msg.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -34,10 +34,10 @@ describe 'CallingApi' do
34
34
 
35
35
  # unit tests for get_calling_settings
36
36
  # Get calling settings
37
- # WhatsApp Calling API settings (beta). Requires Meta Calling enablement on the WABA. Not production-complete — paths and webhook field names may change. Trial/subscription-limited channels are blocked.
37
+ # Return WhatsApp Calling API settings for this channel (beta). Proxies upstream &#x60;GET /calling/settings&#x60;. **Prerequisites** - Number must be eligible for Meta Calling (Cloud API; not COEX) - Trial / &#x60;subscriptionBlocked&#x60; channels receive **403** plain text - You need your own WebRTC or SIP stack; 1msg is a **signaling proxy** only and does **not** store call history or recordings See the **Calling** tag overview for inbound/outbound flows and webhooks.
38
38
  # @param token JWT token or API key for authorization
39
39
  # @param [Hash] opts the optional parameters
40
- # @return [Hash<String, Object>]
40
+ # @return [CallingSettings]
41
41
  describe 'get_calling_settings test' do
42
42
  it 'should work' do
43
43
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
@@ -45,12 +45,12 @@ describe 'CallingApi' do
45
45
  end
46
46
 
47
47
  # unit tests for initiate_call
48
- # Initiate WhatsApp call
49
- # Outbound Calling API (beta). Requires Meta Calling enablement and product consent. Not production-complete — verify on stage before relying on this in production. Trial/subscription-limited channels are blocked.
48
+ # Call action (connect / pre_accept / accept / reject / terminate)
49
+ # Perform a WhatsApp Calling action (beta). Proxies upstream &#x60;POST /calling/calls&#x60;. Despite the historical path name &#x60;/initiateCall&#x60;, this endpoint handles **all** call actions: | action | Use | Required | |--------|-----|----------| | &#x60;connect&#x60; | Outbound business → user | &#x60;to&#x60; + &#x60;session&#x60; (&#x60;sdp_type: offer&#x60;) | | &#x60;pre_accept&#x60; | Inbound (optional, reduces audio clipping) | &#x60;call_id&#x60; + &#x60;session&#x60; (&#x60;sdp_type: answer&#x60;) | | &#x60;accept&#x60; | Inbound answer | &#x60;call_id&#x60; + &#x60;session&#x60; (&#x60;sdp_type: answer&#x60;) | | &#x60;reject&#x60; | Decline inbound | &#x60;call_id&#x60; | | &#x60;terminate&#x60; | Hang up | &#x60;call_id&#x60; | **SDP / media (critical)** - &#x60;accept&#x60; / &#x60;pre_accept&#x60; require a **WebRTC-generated SDP answer**. - Do **not** send Meta&#39;s offer SDP back as the answer. - Postman (or curl) alone **cannot** establish real media — you need a WebRTC or SIP stack. 1msg only proxies signaling. Answer within ~**30–60 seconds** of an inbound &#x60;connect&#x60; webhook or Meta terminates as unanswered. Common Meta errors include Calling not enabled (&#x60;138000&#x60;), no permission (&#x60;138006&#x60;), SDP validation failures. **Outbound** requires a prior Call Permission Request (CPR) acceptance. See the **Calling** tag overview for the full outbound flow and CPR limits. Trial / &#x60;subscriptionBlocked&#x60; → **403** plain text. Upstream failures often return HTTP 200 with &#x60;{ \&quot;response\&quot;: { \&quot;error\&quot;: \&quot;&lt;upstream message&gt;\&quot; } }&#x60;. &#x60;Invalid API KEY&#x60; is used only when Meta/360 body actually indicates an invalid API key or token. Other upstream 401s (notably call permission &#x60;138006&#x60;) pass through &#x60;error.message&#x60; / &#x60;error_user_msg&#x60;.
50
50
  # @param token JWT token or API key for authorization
51
+ # @param initiate_call_request
51
52
  # @param [Hash] opts the optional parameters
52
- # @option opts [Hash<String, Object>] :request_body
53
- # @return [Hash<String, Object>]
53
+ # @return [InitiateCallResponse]
54
54
  describe 'initiate_call test' do
55
55
  it 'should work' do
56
56
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
@@ -59,11 +59,11 @@ describe 'CallingApi' do
59
59
 
60
60
  # unit tests for update_calling_settings
61
61
  # Update calling settings
62
- # Update WhatsApp Calling API settings (beta). Requires Meta Calling enablement. Trial/subscription-limited channels are blocked.
62
+ # Enable, disable, or update WhatsApp Calling settings (beta). Proxies upstream &#x60;POST /calling/settings&#x60;. Body is forwarded as-is (1msg does not validate fields). **Common fields under &#x60;calling&#x60;** - &#x60;status&#x60; (&#x60;ENABLED&#x60; | &#x60;DISABLED&#x60;) — required to turn calling on/off - &#x60;call_icon_visibility&#x60; (&#x60;DEFAULT&#x60; | &#x60;DISABLE_ALL&#x60;) — optional - &#x60;callback_permission_status&#x60; (&#x60;ENABLED&#x60; | &#x60;DISABLED&#x60;) — optional; when enabled, inbound user calls grant callback permission - &#x60;call_hours&#x60; — optional hours / timezone object - &#x60;sip&#x60; — optional SIP trunk; when SIP is ENABLED, Graph call actions and calling webhooks are not used - &#x60;srtp_key_exchange_protocol&#x60; (&#x60;DTLS&#x60; | &#x60;SDES&#x60;) — SDES only with SIP - &#x60;video.status&#x60; — optional Meta may accept only one feature group per request — prefer focused updates (e.g. enable status first, then SIP). Trial / &#x60;subscriptionBlocked&#x60; → **403** plain text.
63
63
  # @param token JWT token or API key for authorization
64
+ # @param calling_settings
64
65
  # @param [Hash] opts the optional parameters
65
- # @option opts [Hash<String, Object>] :request_body
66
- # @return [Hash<String, Object>]
66
+ # @return [UpdateCallingSettings200Response]
67
67
  describe 'update_calling_settings test' do
68
68
  it 'should work' do
69
69
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #1MSG WhatsApp Business API (Public)
3
3
 
4
- #Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** All requests require `token` query parameter with JWT or API key. **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
4
+ #Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** Pass the channel token in **one** place. The API checks JSON body (`token`), then query string (`?token=`), then `Authorization: Bearer` header (preferred in production). **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
5
5
 
6
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 2.0.0
7
7
  Contact: support@1msg.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -47,7 +47,7 @@ describe 'CatalogApi' do
47
47
 
48
48
  # unit tests for get_commerce
49
49
  # Get Commerce Settings
50
- # Returns catalog/cart commerce settings for the channel. - &#x60;is_catalog_visible&#x60; — show catalog storefront icon (&#x60;true&#x60;) or hide it (&#x60;false&#x60;). - &#x60;is_cart_enabled&#x60; — enable cart (&#x60;true&#x60;) or disable it (&#x60;false&#x60;).
50
+ # Returns catalog/cart commerce settings for the channel. Fails with a provider error when the WABA has no catalog linked — that is an API/account limitation, not an MCP schema bug. - &#x60;is_catalog_visible&#x60; — show catalog storefront icon (&#x60;true&#x60;) or hide it (&#x60;false&#x60;). - &#x60;is_cart_enabled&#x60; — enable cart (&#x60;true&#x60;) or disable it (&#x60;false&#x60;).
51
51
  # @param token JWT token or API key for authorization
52
52
  # @param [Hash] opts the optional parameters
53
53
  # @return [Array<GetCommerce200ResponseInner>]
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #1MSG WhatsApp Business API (Public)
3
3
 
4
- #Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** All requests require `token` query parameter with JWT or API key. **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
4
+ #Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** Pass the channel token in **one** place. The API checks JSON body (`token`), then query string (`?token=`), then `Authorization: Bearer` header (preferred in production). **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
5
5
 
6
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 2.0.0
7
7
  Contact: support@1msg.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -32,6 +32,19 @@ describe 'ChannelApi' do
32
32
  end
33
33
  end
34
34
 
35
+ # unit tests for create_settings
36
+ # Update channel settings
37
+ # Update channel settings. Only send fields you want to change. &#x60;webhookUrl&#x60; **replaces** the stored list (one URL string, or up to 5 URLs as an array). Passing an empty value clears webhooks. Repeating the same URL(s) also clears a sticky auto-disable. With several URLs, send the complete array to re-enable one of them — omitting a URL removes it from the channel.
38
+ # @param token JWT token or API key for authorization
39
+ # @param create_settings_request
40
+ # @param [Hash] opts the optional parameters
41
+ # @return [Hash<String, Object>]
42
+ describe 'create_settings test' do
43
+ it 'should work' do
44
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
45
+ end
46
+ end
47
+
35
48
  # unit tests for get_conversational_automation
36
49
  # Get conversational automation settings
37
50
  # Get WhatsApp conversational components for the channel (welcome message, ice-breaker prompts, and slash commands). Proxies Meta/360dialog &#x60;GET /conversational_automation&#x60;. When &#x60;enable_welcome_message&#x60; is true and a user opens chat for the first time, Meta delivers a webhook message with &#x60;type: request_welcome&#x60;. The inbound formatter exposes that as &#x60;type: \&quot;request_welcome\&quot;&#x60; and &#x60;meta.request_welcome: true&#x60; so your webhook can send a custom welcome reply.
@@ -46,16 +59,28 @@ describe 'ChannelApi' do
46
59
 
47
60
  # unit tests for get_status
48
61
  # Get channel status
49
- # Returns WhatsApp Business API client connection status.
62
+ # Return WhatsApp Cloud API connection status for this channel (&#x60;connected&#x60; when the number can send). May include &#x60;accountStatus&#x60;, messaging limit, and MM Lite availability. Optional &#x60;health_status_warning&#x60; appears only when Meta Graph health could not be loaded and a soft &#x60;connected&#x60; response is returned. Omitted on the normal path and when health details are not applicable for the channel — never an internal provider/transport name.
50
63
  # @param token JWT token or API key for authorization
51
64
  # @param [Hash] opts the optional parameters
52
- # @return [Hash<String, Object>]
65
+ # @return [GetStatus200Response]
53
66
  describe 'get_status test' do
54
67
  it 'should work' do
55
68
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
56
69
  end
57
70
  end
58
71
 
72
+ # unit tests for list_settings
73
+ # Get channel settings
74
+ # Return channel settings: webhook URL(s), delivery flags, and analytics toggles. Auto-disable / circuit state matches &#x60;GET /webhook&#x60;. **Prefer &#x60;webhookStatuses&#x60;** (one row per configured URL). The breaker is per URL, not per channel. Channel-level &#x60;haveDisabledWebhooks&#x60; is &#x60;true&#x60; when **at least one** URL in &#x60;webhookUrl&#x60; is sticky auto-disabled — not \&quot;the channel is dead\&quot;. Live URLs still receive events. Top-level &#x60;circuitState&#x60; / &#x60;reason&#x60; / &#x60;fails&#x60; / &#x60;trips&#x60; are a compatibility summary of one URL (first sticky-disabled, else first configured). This is the same &#x60;GET /settings&#x60; endpoint as the REST API (previously missing from MCP).
75
+ # @param token JWT token or API key for authorization
76
+ # @param [Hash] opts the optional parameters
77
+ # @return [ListSettings200Response]
78
+ describe 'list_settings test' do
79
+ it 'should work' do
80
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
81
+ end
82
+ end
83
+
59
84
  # unit tests for set_conversational_automation
60
85
  # Set conversational automation settings
61
86
  # Update WhatsApp conversational components. Allowed body fields (others are ignored): - &#x60;enable_welcome_message&#x60; (boolean) - &#x60;prompts&#x60; (string[], max 4, each ≤ 80 chars) - &#x60;commands&#x60; (&#x60;{ command_name, command_description }[]&#x60;) Proxies Meta/360dialog &#x60;POST /conversational_automation&#x60;.
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #1MSG WhatsApp Business API (Public)
3
3
 
4
- #Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** All requests require `token` query parameter with JWT or API key. **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
4
+ #Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** Pass the channel token in **one** place. The API checks JSON body (`token`), then query string (`?token=`), then `Authorization: Bearer` header (preferred in production). **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
5
5
 
6
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 2.0.0
7
7
  Contact: support@1msg.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -34,7 +34,9 @@ describe 'FlowsApi' do
34
34
 
35
35
  # unit tests for create_flows
36
36
  # Create Flow
37
+ # Create a WhatsApp Flow (&#x60;name&#x60; + &#x60;categories&#x60; required). Currently returns HTTP 501 until the Meta Graph Flows rewrite is available.
37
38
  # @param token JWT token or API key for authorization
39
+ # @param create_flows_request
38
40
  # @param [Hash] opts the optional parameters
39
41
  # @option opts [String] :waba_account_id
40
42
  # @return [CreateGroups200Response]
@@ -123,9 +125,11 @@ describe 'FlowsApi' do
123
125
 
124
126
  # unit tests for list_flows
125
127
  # List Flows
128
+ # List WhatsApp Flows for the WABA. Currently returns HTTP 501 until the Meta Graph Flows rewrite is available.
126
129
  # @param token JWT token or API key for authorization
127
130
  # @param [Hash] opts the optional parameters
128
131
  # @option opts [String] :waba_account_id
132
+ # @option opts [String] :fields Comma-separated Flow fields to return
129
133
  # @return [ListFlows200Response]
130
134
  describe 'list_flows test' do
131
135
  it 'should work' do
@@ -135,8 +139,10 @@ describe 'FlowsApi' do
135
139
 
136
140
  # unit tests for patch_flows_flow_id_assets
137
141
  # Update Flow Structure
142
+ # Replace the Flow JSON document (&#x60;flowJson&#x60;). Currently returns HTTP 501 until the Meta Graph Flows rewrite is available.
138
143
  # @param flow_id Flow ID
139
144
  # @param token JWT token or API key for authorization
145
+ # @param patch_flows_flow_id_assets_request
140
146
  # @param [Hash] opts the optional parameters
141
147
  # @option opts [String] :waba_account_id
142
148
  # @return [PatchFlowsFlowIdAssets200Response]
@@ -148,8 +154,10 @@ describe 'FlowsApi' do
148
154
 
149
155
  # unit tests for patch_flows_flow_id_metadata
150
156
  # Update Flow Metadata
157
+ # Update Flow &#x60;name&#x60;, &#x60;categories&#x60;, and/or &#x60;endpointUri&#x60;. Currently returns HTTP 501 until the Meta Graph Flows rewrite is available.
151
158
  # @param flow_id Flow ID
152
159
  # @param token JWT token or API key for authorization
160
+ # @param patch_flows_flow_id_metadata_request
153
161
  # @param [Hash] opts the optional parameters
154
162
  # @option opts [String] :waba_account_id
155
163
  # @return [Hash<String, Object>]
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #1MSG WhatsApp Business API (Public)
3
3
 
4
- #Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** All requests require `token` query parameter with JWT or API key. **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
4
+ #Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** Pass the channel token in **one** place. The API checks JSON body (`token`), then query string (`?token=`), then `Authorization: Bearer` header (preferred in production). **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
5
5
 
6
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 2.0.0
7
7
  Contact: support@1msg.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -35,6 +35,7 @@ describe 'GroupsApi' do
35
35
  # unit tests for create_groups
36
36
  # Create Group
37
37
  # @param token JWT token or API key for authorization
38
+ # @param create_groups_request
38
39
  # @param [Hash] opts the optional parameters
39
40
  # @return [CreateGroups200Response]
40
41
  describe 'create_groups test' do
@@ -45,8 +46,10 @@ describe 'GroupsApi' do
45
46
 
46
47
  # unit tests for create_groups_group_id
47
48
  # Update Group Info
49
+ # Update group subject, description, and/or profile picture. Path &#x60;groupId&#x60; is the WABA group id (without &#x60;@g.us&#x60;).
48
50
  # @param group_id
49
51
  # @param token JWT token or API key for authorization
52
+ # @param create_groups_group_id_request
50
53
  # @param [Hash] opts the optional parameters
51
54
  # @return [Hash<String, Object>]
52
55
  describe 'create_groups_group_id test' do
@@ -84,6 +87,7 @@ describe 'GroupsApi' do
84
87
  # @param group_id
85
88
  # @param token JWT token or API key for authorization
86
89
  # @param [Hash] opts the optional parameters
90
+ # @option opts [String] :fields Comma-separated group fields to return
87
91
  # @return [Hash<String, Object>]
88
92
  describe 'get_groups_group_id test' do
89
93
  it 'should work' do
@@ -105,8 +109,12 @@ describe 'GroupsApi' do
105
109
 
106
110
  # unit tests for list_groups
107
111
  # Get Groups List
112
+ # List WhatsApp groups for this channel. Paginate with &#x60;limit&#x60;, &#x60;before&#x60;, and &#x60;after&#x60;.
108
113
  # @param token JWT token or API key for authorization
109
114
  # @param [Hash] opts the optional parameters
115
+ # @option opts [Integer] :limit Max groups to return
116
+ # @option opts [String] :before Cursor for the previous page
117
+ # @option opts [String] :after Cursor for the next page
110
118
  # @return [Hash<String, Object>]
111
119
  describe 'list_groups test' do
112
120
  it 'should work' do