one_msg_sdk 2.0.2 → 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 (284) hide show
  1. checksums.yaml +4 -4
  2. data/AGENTS.md +62 -16
  3. data/README.md +97 -29
  4. data/docs/AddTemplate200Response.md +18 -0
  5. data/docs/AddTemplateRequest.md +7 -7
  6. data/docs/CallingApi.md +1 -1
  7. data/docs/CatalogApi.md +1 -1
  8. data/docs/ChannelApi.md +151 -5
  9. data/docs/CreateFlowsRequest.md +26 -0
  10. data/docs/CreateGroupsGroupIdRequest.md +22 -0
  11. data/docs/CreateGroupsRequest.md +20 -0
  12. data/docs/CreateSettingsRequest.md +28 -0
  13. data/docs/CreateSettingsRequestWebhookUrl.md +49 -0
  14. data/docs/CreateUploadMedia200Response.md +18 -0
  15. data/docs/CreateUploadMediaRequest.md +20 -0
  16. data/docs/FlowsApi.md +32 -16
  17. data/docs/GetStatus200Response.md +26 -0
  18. data/docs/GetWebhook200Response.md +24 -2
  19. data/docs/GetWebhook200ResponseWebhookUrl.md +49 -0
  20. data/docs/GroupsApi.md +38 -18
  21. data/docs/ListSettings200Response.md +52 -0
  22. data/docs/ListSettings200ResponseWebhookUrl.md +49 -0
  23. data/docs/MessagingApi.md +140 -35
  24. data/docs/PatchFlowsFlowIdAssetsRequest.md +18 -0
  25. data/docs/PatchFlowsFlowIdMetadataRequest.md +22 -0
  26. data/docs/ProfileApi.md +9 -11
  27. data/docs/RemoveTemplateRequest.md +18 -0
  28. data/docs/SendButtonRequest.md +9 -1
  29. data/docs/SendCarouselRequest1.md +4 -2
  30. data/docs/SendContactInfoRequest.md +26 -0
  31. data/docs/SendContactRequest.md +7 -1
  32. data/docs/SendContactRequestContact.md +26 -0
  33. data/docs/SendContactRequestContactName.md +49 -0
  34. data/docs/SendContactRequestContactsInner.md +3 -3
  35. data/docs/SendContactRequestContactsInnerPhonesInner.md +1 -1
  36. data/docs/SendListRequest.md +5 -1
  37. data/docs/SendLocationRequestRequest.md +5 -1
  38. data/docs/SendMessageRequest.md +6 -2
  39. data/docs/SendMessageRequestDirectSend.md +20 -0
  40. data/docs/SendProductRequest.md +30 -0
  41. data/docs/SendReactionRequest.md +3 -1
  42. data/docs/SendTemplateRequest.md +9 -5
  43. data/docs/SendTemplateRequestLanguage.md +3 -3
  44. data/docs/SetWebhook200Response.md +20 -0
  45. data/docs/SetWebhook200ResponseWebhookUrl.md +49 -0
  46. data/docs/SetWebhookRequest.md +18 -0
  47. data/docs/SetWebhookRequestWebhookUrl.md +49 -0
  48. data/docs/TemplatesApi.md +29 -17
  49. data/docs/UpdateMe200Response.md +18 -0
  50. data/docs/UpdateMeRequest.md +6 -6
  51. data/docs/WebhookUrlStatus.md +34 -0
  52. data/docs/WebhooksApi.md +10 -12
  53. data/lib/one_msg_sdk/api/calling_api.rb +4 -4
  54. data/lib/one_msg_sdk/api/catalog_api.rb +4 -4
  55. data/lib/one_msg_sdk/api/channel_api.rb +146 -7
  56. data/lib/one_msg_sdk/api/flows_api.rb +58 -14
  57. data/lib/one_msg_sdk/api/groups_api.rb +48 -10
  58. data/lib/one_msg_sdk/api/messaging_api.rb +163 -38
  59. data/lib/one_msg_sdk/api/profile_api.rb +17 -13
  60. data/lib/one_msg_sdk/api/templates_api.rb +36 -13
  61. data/lib/one_msg_sdk/api/users_api.rb +2 -2
  62. data/lib/one_msg_sdk/api/webhooks_api.rb +19 -15
  63. data/lib/one_msg_sdk/api_client.rb +2 -2
  64. data/lib/one_msg_sdk/api_error.rb +2 -2
  65. data/lib/one_msg_sdk/api_model_base.rb +2 -2
  66. data/lib/one_msg_sdk/configuration.rb +2 -2
  67. data/lib/one_msg_sdk/models/add_template200_response.rb +150 -0
  68. data/lib/one_msg_sdk/models/add_template_request.rb +6 -2
  69. data/lib/one_msg_sdk/models/block_user_request.rb +2 -2
  70. data/lib/one_msg_sdk/models/calling_settings.rb +2 -2
  71. data/lib/one_msg_sdk/models/calling_settings_calling.rb +2 -2
  72. data/lib/one_msg_sdk/models/calling_settings_calling_audio.rb +2 -2
  73. data/lib/one_msg_sdk/models/calling_settings_calling_call_hours.rb +2 -2
  74. data/lib/one_msg_sdk/models/calling_settings_calling_sip.rb +2 -2
  75. data/lib/one_msg_sdk/models/calling_settings_calling_sip_servers_inner.rb +2 -2
  76. data/lib/one_msg_sdk/models/calling_settings_calling_video.rb +2 -2
  77. data/lib/one_msg_sdk/models/conversational_automation.rb +2 -2
  78. data/lib/one_msg_sdk/models/conversational_automation_commands_inner.rb +2 -2
  79. data/lib/one_msg_sdk/models/create_commerce200_response.rb +2 -2
  80. data/lib/one_msg_sdk/models/create_commerce_request.rb +2 -2
  81. data/lib/one_msg_sdk/models/create_commerce_request_params.rb +2 -2
  82. data/lib/one_msg_sdk/models/create_flows_request.rb +238 -0
  83. data/lib/one_msg_sdk/models/create_groups200_response.rb +2 -2
  84. data/lib/one_msg_sdk/models/create_groups_group_id_request.rb +168 -0
  85. data/lib/one_msg_sdk/models/create_groups_request.rb +175 -0
  86. data/lib/one_msg_sdk/models/create_read_message200_response.rb +2 -2
  87. data/lib/one_msg_sdk/models/create_read_message401_response.rb +2 -2
  88. data/lib/one_msg_sdk/models/create_read_message_request.rb +2 -2
  89. data/lib/one_msg_sdk/models/create_settings_request.rb +192 -0
  90. data/lib/one_msg_sdk/models/create_settings_request_webhook_url.rb +105 -0
  91. data/lib/one_msg_sdk/models/create_upload_media200_response.rb +147 -0
  92. data/lib/one_msg_sdk/models/create_upload_media_request.rb +158 -0
  93. data/lib/one_msg_sdk/models/delete_flows_flow_id200_response.rb +2 -2
  94. data/lib/one_msg_sdk/models/delete_groups_group_id200_response.rb +2 -2
  95. data/lib/one_msg_sdk/models/delete_media_legacy_request.rb +2 -2
  96. data/lib/one_msg_sdk/models/error_response.rb +2 -2
  97. data/lib/one_msg_sdk/models/get_commerce200_response_inner.rb +2 -2
  98. data/lib/one_msg_sdk/models/get_mm_lite_status200_response.rb +2 -2
  99. data/lib/one_msg_sdk/models/get_status200_response.rb +185 -0
  100. data/lib/one_msg_sdk/models/get_webhook200_response.rb +155 -6
  101. data/lib/one_msg_sdk/models/get_webhook200_response_webhook_url.rb +105 -0
  102. data/lib/one_msg_sdk/models/get_whatsapp_business_encryption200_response.rb +2 -2
  103. data/lib/one_msg_sdk/models/initiate_call_request.rb +2 -2
  104. data/lib/one_msg_sdk/models/initiate_call_request_session.rb +2 -2
  105. data/lib/one_msg_sdk/models/initiate_call_response.rb +2 -2
  106. data/lib/one_msg_sdk/models/initiate_call_response_calls_inner.rb +2 -2
  107. data/lib/one_msg_sdk/models/initiate_call_response_response.rb +2 -2
  108. data/lib/one_msg_sdk/models/list_blocked_users200_response.rb +2 -2
  109. data/lib/one_msg_sdk/models/list_flows200_response.rb +2 -2
  110. data/lib/one_msg_sdk/models/list_messages200_response.rb +2 -2
  111. data/lib/one_msg_sdk/models/list_settings200_response.rb +352 -0
  112. data/lib/one_msg_sdk/models/list_settings200_response_webhook_url.rb +105 -0
  113. data/lib/one_msg_sdk/models/list_templates200_response.rb +2 -2
  114. data/lib/one_msg_sdk/models/message_sent_response.rb +2 -2
  115. data/lib/one_msg_sdk/models/patch_flows_flow_id_assets200_response.rb +2 -2
  116. data/lib/one_msg_sdk/models/patch_flows_flow_id_assets_request.rb +167 -0
  117. data/lib/one_msg_sdk/models/patch_flows_flow_id_metadata_request.rb +190 -0
  118. data/lib/one_msg_sdk/models/profile_info.rb +2 -2
  119. data/lib/one_msg_sdk/models/remove_template_request.rb +165 -0
  120. data/lib/one_msg_sdk/models/retrieve_media200_response.rb +2 -2
  121. data/lib/one_msg_sdk/models/send_address_message_request.rb +2 -2
  122. data/lib/one_msg_sdk/models/send_button_request.rb +48 -3
  123. data/lib/one_msg_sdk/models/send_button_request_sections_inner.rb +2 -2
  124. data/lib/one_msg_sdk/models/send_button_request_sections_inner_reply.rb +2 -2
  125. data/lib/one_msg_sdk/models/send_carousel_request1.rb +38 -13
  126. data/lib/one_msg_sdk/models/send_contact_info_request.rb +222 -0
  127. data/lib/one_msg_sdk/models/send_contact_request.rb +32 -3
  128. data/lib/one_msg_sdk/models/send_contact_request_contact.rb +221 -0
  129. data/lib/one_msg_sdk/models/send_contact_request_contact_name.rb +105 -0
  130. data/lib/one_msg_sdk/models/send_contact_request_contacts_inner.rb +5 -5
  131. data/lib/one_msg_sdk/models/send_contact_request_contacts_inner_name.rb +2 -2
  132. data/lib/one_msg_sdk/models/send_contact_request_contacts_inner_org.rb +2 -2
  133. data/lib/one_msg_sdk/models/send_contact_request_contacts_inner_phones_inner.rb +3 -2
  134. data/lib/one_msg_sdk/models/send_cta_url_request.rb +2 -2
  135. data/lib/one_msg_sdk/models/send_file_request.rb +2 -2
  136. data/lib/one_msg_sdk/models/send_flow_request1.rb +2 -2
  137. data/lib/one_msg_sdk/models/send_flow_request1_header.rb +2 -2
  138. data/lib/one_msg_sdk/models/send_flow_request_header.rb +2 -2
  139. data/lib/one_msg_sdk/models/send_list_request.rb +23 -3
  140. data/lib/one_msg_sdk/models/send_list_request_sections_inner.rb +2 -2
  141. data/lib/one_msg_sdk/models/send_list_request_sections_inner_rows_inner.rb +2 -2
  142. data/lib/one_msg_sdk/models/send_location_request1.rb +2 -2
  143. data/lib/one_msg_sdk/models/send_location_request_request.rb +23 -3
  144. data/lib/one_msg_sdk/models/send_message_request.rb +60 -28
  145. data/lib/one_msg_sdk/models/send_message_request_direct_send.rb +189 -0
  146. data/lib/one_msg_sdk/models/send_order_details_request.rb +2 -2
  147. data/lib/one_msg_sdk/models/send_order_details_request_language.rb +2 -2
  148. data/lib/one_msg_sdk/models/send_order_details_request_order.rb +2 -2
  149. data/lib/one_msg_sdk/models/send_order_details_request_order_items_inner.rb +2 -2
  150. data/lib/one_msg_sdk/models/send_order_details_request_order_items_inner_amount.rb +2 -2
  151. data/lib/one_msg_sdk/models/send_payment_request_request.rb +2 -2
  152. data/lib/one_msg_sdk/models/send_product_request.rb +225 -0
  153. data/lib/one_msg_sdk/models/send_reaction_request.rb +14 -3
  154. data/lib/one_msg_sdk/models/send_sticker_request.rb +2 -2
  155. data/lib/one_msg_sdk/models/send_template_request.rb +29 -5
  156. data/lib/one_msg_sdk/models/send_template_request_language.rb +6 -2
  157. data/lib/one_msg_sdk/models/set_webhook200_response.rb +157 -0
  158. data/lib/one_msg_sdk/models/set_webhook200_response_webhook_url.rb +105 -0
  159. data/lib/one_msg_sdk/models/set_webhook_request.rb +164 -0
  160. data/lib/one_msg_sdk/models/set_webhook_request_webhook_url.rb +105 -0
  161. data/lib/one_msg_sdk/models/set_whatsapp_business_encryption_request.rb +2 -2
  162. data/lib/one_msg_sdk/models/success_response.rb +2 -2
  163. data/lib/one_msg_sdk/models/update_calling_settings200_response.rb +2 -2
  164. data/lib/one_msg_sdk/models/update_calling_settings200_response_response.rb +2 -2
  165. data/lib/one_msg_sdk/models/update_me200_response.rb +147 -0
  166. data/lib/one_msg_sdk/models/update_me_request.rb +6 -3
  167. data/lib/one_msg_sdk/models/webhook_url_status.rb +287 -0
  168. data/lib/one_msg_sdk/platform_client.rb +182 -0
  169. data/lib/one_msg_sdk/version.rb +3 -3
  170. data/lib/one_msg_sdk.rb +30 -2
  171. data/one_msg_sdk.gemspec +2 -2
  172. data/spec/api/calling_api_spec.rb +3 -3
  173. data/spec/api/catalog_api_spec.rb +3 -3
  174. data/spec/api/channel_api_spec.rb +29 -4
  175. data/spec/api/flows_api_spec.rb +10 -2
  176. data/spec/api/groups_api_spec.rb +10 -2
  177. data/spec/api/messaging_api_spec.rb +37 -9
  178. data/spec/api/profile_api_spec.rb +5 -5
  179. data/spec/api/templates_api_spec.rb +11 -5
  180. data/spec/api/users_api_spec.rb +2 -2
  181. data/spec/api/webhooks_api_spec.rb +6 -6
  182. data/spec/models/add_template200_response_spec.rb +36 -0
  183. data/spec/models/add_template_request_spec.rb +2 -2
  184. data/spec/models/block_user_request_spec.rb +2 -2
  185. data/spec/models/calling_settings_calling_audio_spec.rb +2 -2
  186. data/spec/models/calling_settings_calling_call_hours_spec.rb +2 -2
  187. data/spec/models/calling_settings_calling_sip_servers_inner_spec.rb +2 -2
  188. data/spec/models/calling_settings_calling_sip_spec.rb +2 -2
  189. data/spec/models/calling_settings_calling_spec.rb +2 -2
  190. data/spec/models/calling_settings_calling_video_spec.rb +2 -2
  191. data/spec/models/calling_settings_spec.rb +2 -2
  192. data/spec/models/conversational_automation_commands_inner_spec.rb +2 -2
  193. data/spec/models/conversational_automation_spec.rb +2 -2
  194. data/spec/models/create_commerce200_response_spec.rb +2 -2
  195. data/spec/models/create_commerce_request_params_spec.rb +2 -2
  196. data/spec/models/create_commerce_request_spec.rb +2 -2
  197. data/spec/models/create_flows_request_spec.rb +64 -0
  198. data/spec/models/create_groups200_response_spec.rb +2 -2
  199. data/spec/models/create_groups_group_id_request_spec.rb +48 -0
  200. data/spec/models/create_groups_request_spec.rb +42 -0
  201. data/spec/models/create_read_message200_response_spec.rb +2 -2
  202. data/spec/models/create_read_message401_response_spec.rb +2 -2
  203. data/spec/models/create_read_message_request_spec.rb +2 -2
  204. data/spec/models/create_settings_request_spec.rb +66 -0
  205. data/spec/models/create_settings_request_webhook_url_spec.rb +32 -0
  206. data/spec/models/create_upload_media200_response_spec.rb +36 -0
  207. data/spec/models/create_upload_media_request_spec.rb +42 -0
  208. data/spec/models/delete_flows_flow_id200_response_spec.rb +2 -2
  209. data/spec/models/delete_groups_group_id200_response_spec.rb +2 -2
  210. data/spec/models/delete_media_legacy_request_spec.rb +2 -2
  211. data/spec/models/error_response_spec.rb +2 -2
  212. data/spec/models/get_commerce200_response_inner_spec.rb +2 -2
  213. data/spec/models/get_mm_lite_status200_response_spec.rb +2 -2
  214. data/spec/models/get_status200_response_spec.rb +60 -0
  215. data/spec/models/get_webhook200_response_spec.rb +72 -2
  216. data/spec/models/get_webhook200_response_webhook_url_spec.rb +32 -0
  217. data/spec/models/get_whatsapp_business_encryption200_response_spec.rb +2 -2
  218. data/spec/models/initiate_call_request_session_spec.rb +2 -2
  219. data/spec/models/initiate_call_request_spec.rb +2 -2
  220. data/spec/models/initiate_call_response_calls_inner_spec.rb +2 -2
  221. data/spec/models/initiate_call_response_response_spec.rb +2 -2
  222. data/spec/models/initiate_call_response_spec.rb +2 -2
  223. data/spec/models/list_blocked_users200_response_spec.rb +2 -2
  224. data/spec/models/list_flows200_response_spec.rb +2 -2
  225. data/spec/models/list_messages200_response_spec.rb +2 -2
  226. data/spec/models/list_settings200_response_spec.rb +142 -0
  227. data/spec/models/list_settings200_response_webhook_url_spec.rb +32 -0
  228. data/spec/models/list_templates200_response_spec.rb +2 -2
  229. data/spec/models/message_sent_response_spec.rb +2 -2
  230. data/spec/models/patch_flows_flow_id_assets200_response_spec.rb +2 -2
  231. data/spec/models/patch_flows_flow_id_assets_request_spec.rb +36 -0
  232. data/spec/models/patch_flows_flow_id_metadata_request_spec.rb +52 -0
  233. data/spec/models/profile_info_spec.rb +2 -2
  234. data/spec/models/remove_template_request_spec.rb +36 -0
  235. data/spec/models/retrieve_media200_response_spec.rb +2 -2
  236. data/spec/models/send_address_message_request_spec.rb +2 -2
  237. data/spec/models/send_button_request_sections_inner_reply_spec.rb +2 -2
  238. data/spec/models/send_button_request_sections_inner_spec.rb +2 -2
  239. data/spec/models/send_button_request_spec.rb +26 -2
  240. data/spec/models/send_carousel_request1_spec.rb +8 -2
  241. data/spec/models/send_contact_info_request_spec.rb +60 -0
  242. data/spec/models/send_contact_request_contact_name_spec.rb +32 -0
  243. data/spec/models/send_contact_request_contact_spec.rb +60 -0
  244. data/spec/models/send_contact_request_contacts_inner_name_spec.rb +2 -2
  245. data/spec/models/send_contact_request_contacts_inner_org_spec.rb +2 -2
  246. data/spec/models/send_contact_request_contacts_inner_phones_inner_spec.rb +2 -2
  247. data/spec/models/send_contact_request_contacts_inner_spec.rb +2 -2
  248. data/spec/models/send_contact_request_spec.rb +20 -2
  249. data/spec/models/send_cta_url_request_spec.rb +2 -2
  250. data/spec/models/send_file_request_spec.rb +2 -2
  251. data/spec/models/send_flow_request1_header_spec.rb +2 -2
  252. data/spec/models/send_flow_request1_spec.rb +2 -2
  253. data/spec/models/send_flow_request_header_spec.rb +2 -2
  254. data/spec/models/send_list_request_sections_inner_rows_inner_spec.rb +2 -2
  255. data/spec/models/send_list_request_sections_inner_spec.rb +2 -2
  256. data/spec/models/send_list_request_spec.rb +14 -2
  257. data/spec/models/send_location_request1_spec.rb +2 -2
  258. data/spec/models/send_location_request_request_spec.rb +14 -2
  259. data/spec/models/send_message_request_direct_send_spec.rb +42 -0
  260. data/spec/models/send_message_request_spec.rb +18 -2
  261. data/spec/models/send_order_details_request_language_spec.rb +2 -2
  262. data/spec/models/send_order_details_request_order_items_inner_amount_spec.rb +2 -2
  263. data/spec/models/send_order_details_request_order_items_inner_spec.rb +2 -2
  264. data/spec/models/send_order_details_request_order_spec.rb +2 -2
  265. data/spec/models/send_order_details_request_spec.rb +2 -2
  266. data/spec/models/send_payment_request_request_spec.rb +2 -2
  267. data/spec/models/send_product_request_spec.rb +72 -0
  268. data/spec/models/send_reaction_request_spec.rb +8 -2
  269. data/spec/models/send_sticker_request_spec.rb +2 -2
  270. data/spec/models/send_template_request_language_spec.rb +2 -2
  271. data/spec/models/send_template_request_spec.rb +14 -2
  272. data/spec/models/set_webhook200_response_spec.rb +42 -0
  273. data/spec/models/set_webhook200_response_webhook_url_spec.rb +32 -0
  274. data/spec/models/set_webhook_request_spec.rb +36 -0
  275. data/spec/models/set_webhook_request_webhook_url_spec.rb +32 -0
  276. data/spec/models/set_whatsapp_business_encryption_request_spec.rb +2 -2
  277. data/spec/models/success_response_spec.rb +2 -2
  278. data/spec/models/update_calling_settings200_response_response_spec.rb +2 -2
  279. data/spec/models/update_calling_settings200_response_spec.rb +2 -2
  280. data/spec/models/update_me200_response_spec.rb +36 -0
  281. data/spec/models/update_me_request_spec.rb +2 -2
  282. data/spec/models/webhook_url_status_spec.rb +88 -0
  283. data/spec/spec_helper.rb +2 -2
  284. metadata +204 -31
@@ -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
@@ -15,14 +15,22 @@ require 'time'
15
15
 
16
16
  module OneMsgSdk
17
17
  class SendLocationRequestRequest < ApiModelBase
18
+ # Recipient phone with country code. Use phone or chatId.
18
19
  attr_accessor :phone
19
20
 
21
+ # Recipient chat ID (`phone@c.us`, group `@g.us`, or BSUID `@lid`). Use phone or chatId.
22
+ attr_accessor :chat_id
23
+
24
+ attr_accessor :quoted_msg_id
25
+
20
26
  attr_accessor :body
21
27
 
22
28
  # Attribute mapping from ruby-style variable name to JSON key.
23
29
  def self.attribute_map
24
30
  {
25
31
  :'phone' => :'phone',
32
+ :'chat_id' => :'chatId',
33
+ :'quoted_msg_id' => :'quotedMsgId',
26
34
  :'body' => :'body'
27
35
  }
28
36
  end
@@ -41,6 +49,8 @@ module OneMsgSdk
41
49
  def self.openapi_types
42
50
  {
43
51
  :'phone' => :'String',
52
+ :'chat_id' => :'String',
53
+ :'quoted_msg_id' => :'String',
44
54
  :'body' => :'String'
45
55
  }
46
56
  end
@@ -71,6 +81,14 @@ module OneMsgSdk
71
81
  self.phone = attributes[:'phone']
72
82
  end
73
83
 
84
+ if attributes.key?(:'chat_id')
85
+ self.chat_id = attributes[:'chat_id']
86
+ end
87
+
88
+ if attributes.key?(:'quoted_msg_id')
89
+ self.quoted_msg_id = attributes[:'quoted_msg_id']
90
+ end
91
+
74
92
  if attributes.key?(:'body')
75
93
  self.body = attributes[:'body']
76
94
  end
@@ -97,6 +115,8 @@ module OneMsgSdk
97
115
  return true if self.equal?(o)
98
116
  self.class == o.class &&
99
117
  phone == o.phone &&
118
+ chat_id == o.chat_id &&
119
+ quoted_msg_id == o.quoted_msg_id &&
100
120
  body == o.body
101
121
  end
102
122
 
@@ -109,7 +129,7 @@ module OneMsgSdk
109
129
  # Calculates hash code according to all attributes.
110
130
  # @return [Integer] Hash code
111
131
  def hash
112
- [phone, body].hash
132
+ [phone, chat_id, quoted_msg_id, body].hash
113
133
  end
114
134
 
115
135
  # Builds the object from hash
@@ -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
@@ -22,19 +22,48 @@ module OneMsgSdk
22
22
  # Message ID to quote/reply to (Cloud API wamid)
23
23
  attr_accessor :quoted_msg_id
24
24
 
25
- # Chat ID in format: phone@c.us (individual) or phone@g.us (group)
25
+ # Recipient chat ID: phone@c.us, group@g.us, or BSUID@lid
26
26
  attr_accessor :chat_id
27
27
 
28
28
  # Phone number starting with country code (alternative to chatId)
29
29
  attr_accessor :phone
30
30
 
31
+ # Optional Direct Send category. Direct Send is in beta: Meta has not enabled it on every business portfolio. `utility` or `authentication` enables it. `authentication` is part of that beta and is not recommended. Omit or `service` keeps a normal service message (and the marketing auto-template outside the 24-hour window). `marketing` is rejected.
32
+ attr_accessor :category
33
+
34
+ attr_accessor :direct_send
35
+
36
+ class EnumAttributeValidator
37
+ attr_reader :datatype
38
+ attr_reader :allowable_values
39
+
40
+ def initialize(datatype, allowable_values)
41
+ @allowable_values = allowable_values.map do |value|
42
+ case datatype.to_s
43
+ when /Integer/i
44
+ value.to_i
45
+ when /Float/i
46
+ value.to_f
47
+ else
48
+ value
49
+ end
50
+ end
51
+ end
52
+
53
+ def valid?(value)
54
+ !value || allowable_values.include?(value)
55
+ end
56
+ end
57
+
31
58
  # Attribute mapping from ruby-style variable name to JSON key.
32
59
  def self.attribute_map
33
60
  {
34
61
  :'body' => :'body',
35
62
  :'quoted_msg_id' => :'quotedMsgId',
36
63
  :'chat_id' => :'chatId',
37
- :'phone' => :'phone'
64
+ :'phone' => :'phone',
65
+ :'category' => :'category',
66
+ :'direct_send' => :'directSend'
38
67
  }
39
68
  end
40
69
 
@@ -54,7 +83,9 @@ module OneMsgSdk
54
83
  :'body' => :'String',
55
84
  :'quoted_msg_id' => :'String',
56
85
  :'chat_id' => :'String',
57
- :'phone' => :'Integer'
86
+ :'phone' => :'Integer',
87
+ :'category' => :'String',
88
+ :'direct_send' => :'SendMessageRequestDirectSend'
58
89
  }
59
90
  end
60
91
 
@@ -97,6 +128,14 @@ module OneMsgSdk
97
128
  if attributes.key?(:'phone')
98
129
  self.phone = attributes[:'phone']
99
130
  end
131
+
132
+ if attributes.key?(:'category')
133
+ self.category = attributes[:'category']
134
+ end
135
+
136
+ if attributes.key?(:'direct_send')
137
+ self.direct_send = attributes[:'direct_send']
138
+ end
100
139
  end
101
140
 
102
141
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -121,11 +160,6 @@ module OneMsgSdk
121
160
  invalid_properties.push("invalid value for \"quoted_msg_id\", must conform to the pattern #{pattern}.")
122
161
  end
123
162
 
124
- pattern = Regexp.new(/^[0-9]+@[cg]\.us$/)
125
- if !@chat_id.nil? && @chat_id !~ pattern
126
- invalid_properties.push("invalid value for \"chat_id\", must conform to the pattern #{pattern}.")
127
- end
128
-
129
163
  if !@phone.nil? && @phone > 999999999999999
130
164
  invalid_properties.push('invalid value for "phone", must be smaller than or equal to 999999999999999.')
131
165
  end
@@ -145,9 +179,10 @@ module OneMsgSdk
145
179
  return false if @body.to_s.length > 4096
146
180
  return false if @body.to_s.length < 1
147
181
  return false if !@quoted_msg_id.nil? && @quoted_msg_id !~ Regexp.new(/^wamid\..+$/)
148
- return false if !@chat_id.nil? && @chat_id !~ Regexp.new(/^[0-9]+@[cg]\.us$/)
149
182
  return false if !@phone.nil? && @phone > 999999999999999
150
183
  return false if !@phone.nil? && @phone < 1000000000
184
+ category_validator = EnumAttributeValidator.new('String', ["utility", "authentication", "service"])
185
+ return false unless category_validator.valid?(@category)
151
186
  true
152
187
  end
153
188
 
@@ -184,21 +219,6 @@ module OneMsgSdk
184
219
  @quoted_msg_id = quoted_msg_id
185
220
  end
186
221
 
187
- # Custom attribute writer method with validation
188
- # @param [Object] chat_id Value to be assigned
189
- def chat_id=(chat_id)
190
- if chat_id.nil?
191
- fail ArgumentError, 'chat_id cannot be nil'
192
- end
193
-
194
- pattern = Regexp.new(/^[0-9]+@[cg]\.us$/)
195
- if chat_id !~ pattern
196
- fail ArgumentError, "invalid value for \"chat_id\", must conform to the pattern #{pattern}."
197
- end
198
-
199
- @chat_id = chat_id
200
- end
201
-
202
222
  # Custom attribute writer method with validation
203
223
  # @param [Object] phone Value to be assigned
204
224
  def phone=(phone)
@@ -217,6 +237,16 @@ module OneMsgSdk
217
237
  @phone = phone
218
238
  end
219
239
 
240
+ # Custom attribute writer method checking allowed values (enum).
241
+ # @param [Object] category Object to be assigned
242
+ def category=(category)
243
+ validator = EnumAttributeValidator.new('String', ["utility", "authentication", "service"])
244
+ unless validator.valid?(category)
245
+ fail ArgumentError, "invalid value for \"category\", must be one of #{validator.allowable_values}."
246
+ end
247
+ @category = category
248
+ end
249
+
220
250
  # Checks equality by comparing each attribute.
221
251
  # @param [Object] Object to be compared
222
252
  def ==(o)
@@ -225,7 +255,9 @@ module OneMsgSdk
225
255
  body == o.body &&
226
256
  quoted_msg_id == o.quoted_msg_id &&
227
257
  chat_id == o.chat_id &&
228
- phone == o.phone
258
+ phone == o.phone &&
259
+ category == o.category &&
260
+ direct_send == o.direct_send
229
261
  end
230
262
 
231
263
  # @see the `==` method
@@ -237,7 +269,7 @@ module OneMsgSdk
237
269
  # Calculates hash code according to all attributes.
238
270
  # @return [Integer] Hash code
239
271
  def hash
240
- [body, quoted_msg_id, chat_id, phone].hash
272
+ [body, quoted_msg_id, chat_id, phone, category, direct_send].hash
241
273
  end
242
274
 
243
275
  # Builds the object from hash
@@ -0,0 +1,189 @@
1
+ =begin
2
+ #1MSG WhatsApp Business API (Public)
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:** 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
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@1msg.io
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module OneMsgSdk
17
+ # Optional. Ignored unless `category` is `utility` or `authentication`. `serviceFirst` is not forwarded to Meta.
18
+ class SendMessageRequestDirectSend < ApiModelBase
19
+ # When true, send a service message first. Success stops there. A closed-window error (131047) retries as Direct Send. Any other error is returned and Direct Send is not attempted. Omit or false to send Direct Send immediately, even inside an open window.
20
+ attr_accessor :service_first
21
+
22
+ # Utility only. Meta creates or reuses a Direct Send template with this exact name (`^[a-z0-9_]+$`, max 512). Do not reuse a template created by hand.
23
+ attr_accessor :template_name
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'service_first' => :'serviceFirst',
29
+ :'template_name' => :'templateName'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'service_first' => :'Boolean',
47
+ :'template_name' => :'String'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OneMsgSdk::SendMessageRequestDirectSend` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ acceptable_attribute_map = self.class.acceptable_attribute_map
66
+ attributes = attributes.each_with_object({}) { |(k, v), h|
67
+ if (!acceptable_attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OneMsgSdk::SendMessageRequestDirectSend`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
69
+ end
70
+ h[k.to_sym] = v
71
+ }
72
+
73
+ if attributes.key?(:'service_first')
74
+ self.service_first = attributes[:'service_first']
75
+ end
76
+
77
+ if attributes.key?(:'template_name')
78
+ self.template_name = attributes[:'template_name']
79
+ end
80
+ end
81
+
82
+ # Show invalid properties with the reasons. Usually used together with valid?
83
+ # @return Array for valid properties with the reasons
84
+ def list_invalid_properties
85
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
86
+ invalid_properties = Array.new
87
+ if !@template_name.nil? && @template_name.to_s.length > 512
88
+ invalid_properties.push('invalid value for "template_name", the character length must be smaller than or equal to 512.')
89
+ end
90
+
91
+ pattern = Regexp.new(/^[a-z0-9_]+$/)
92
+ if !@template_name.nil? && @template_name !~ pattern
93
+ invalid_properties.push("invalid value for \"template_name\", must conform to the pattern #{pattern}.")
94
+ end
95
+
96
+ invalid_properties
97
+ end
98
+
99
+ # Check to see if the all the properties in the model are valid
100
+ # @return true if the model is valid
101
+ def valid?
102
+ warn '[DEPRECATED] the `valid?` method is obsolete'
103
+ return false if !@template_name.nil? && @template_name.to_s.length > 512
104
+ return false if !@template_name.nil? && @template_name !~ Regexp.new(/^[a-z0-9_]+$/)
105
+ true
106
+ end
107
+
108
+ # Custom attribute writer method with validation
109
+ # @param [Object] template_name Value to be assigned
110
+ def template_name=(template_name)
111
+ if template_name.nil?
112
+ fail ArgumentError, 'template_name cannot be nil'
113
+ end
114
+
115
+ if template_name.to_s.length > 512
116
+ fail ArgumentError, 'invalid value for "template_name", the character length must be smaller than or equal to 512.'
117
+ end
118
+
119
+ pattern = Regexp.new(/^[a-z0-9_]+$/)
120
+ if template_name !~ pattern
121
+ fail ArgumentError, "invalid value for \"template_name\", must conform to the pattern #{pattern}."
122
+ end
123
+
124
+ @template_name = template_name
125
+ end
126
+
127
+ # Checks equality by comparing each attribute.
128
+ # @param [Object] Object to be compared
129
+ def ==(o)
130
+ return true if self.equal?(o)
131
+ self.class == o.class &&
132
+ service_first == o.service_first &&
133
+ template_name == o.template_name
134
+ end
135
+
136
+ # @see the `==` method
137
+ # @param [Object] Object to be compared
138
+ def eql?(o)
139
+ self == o
140
+ end
141
+
142
+ # Calculates hash code according to all attributes.
143
+ # @return [Integer] Hash code
144
+ def hash
145
+ [service_first, template_name].hash
146
+ end
147
+
148
+ # Builds the object from hash
149
+ # @param [Hash] attributes Model attributes in the form of hash
150
+ # @return [Object] Returns the model itself
151
+ def self.build_from_hash(attributes)
152
+ return nil unless attributes.is_a?(Hash)
153
+ attributes = attributes.transform_keys(&:to_sym)
154
+ transformed_hash = {}
155
+ openapi_types.each_pair do |key, type|
156
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
157
+ transformed_hash["#{key}"] = nil
158
+ elsif type =~ /\AArray<(.*)>/i
159
+ # check to ensure the input is an array given that the attribute
160
+ # is documented as an array but the input is not
161
+ if attributes[attribute_map[key]].is_a?(Array)
162
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
163
+ end
164
+ elsif !attributes[attribute_map[key]].nil?
165
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
166
+ end
167
+ end
168
+ new(transformed_hash)
169
+ end
170
+
171
+ # Returns the object in the form of hash
172
+ # @return [Hash] Returns the object in the form of hash
173
+ def to_hash
174
+ hash = {}
175
+ self.class.attribute_map.each_pair do |attr, param|
176
+ value = self.send(attr)
177
+ if value.nil?
178
+ is_nullable = self.class.openapi_nullable.include?(attr)
179
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
180
+ end
181
+
182
+ hash[param] = _to_hash(value)
183
+ end
184
+ hash
185
+ end
186
+
187
+ end
188
+
189
+ 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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