one_msg_chat_api 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/LICENSE.txt +21 -0
  4. data/Rakefile +10 -0
  5. data/docs/AddTemplateRequest.md +24 -0
  6. data/docs/BlockUserRequest.md +18 -0
  7. data/docs/CallingApi.md +231 -0
  8. data/docs/CatalogApi.md +153 -0
  9. data/docs/ChannelApi.md +225 -0
  10. data/docs/ConversationalAutomation.md +22 -0
  11. data/docs/ConversationalAutomationCommandsInner.md +20 -0
  12. data/docs/CreateCommerce200Response.md +18 -0
  13. data/docs/CreateCommerceRequest.md +18 -0
  14. data/docs/CreateCommerceRequestParams.md +20 -0
  15. data/docs/CreateGroups200Response.md +18 -0
  16. data/docs/CreateReadMessage200Response.md +18 -0
  17. data/docs/CreateReadMessage401Response.md +18 -0
  18. data/docs/CreateReadMessageRequest.md +22 -0
  19. data/docs/DeleteFlowsFlowId200Response.md +20 -0
  20. data/docs/DeleteGroupsGroupId200Response.md +20 -0
  21. data/docs/DeleteMediaLegacyRequest.md +18 -0
  22. data/docs/ErrorResponse.md +18 -0
  23. data/docs/FlowsApi.md +836 -0
  24. data/docs/GetCommerce200ResponseInner.md +22 -0
  25. data/docs/GetMmLiteStatus200Response.md +22 -0
  26. data/docs/GetWebhook200Response.md +18 -0
  27. data/docs/GetWhatsappBusinessEncryption200Response.md +22 -0
  28. data/docs/GroupsApi.md +507 -0
  29. data/docs/ListBlockedUsers200Response.md +18 -0
  30. data/docs/ListFlows200Response.md +26 -0
  31. data/docs/ListMessages200Response.md +20 -0
  32. data/docs/ListTemplates200Response.md +22 -0
  33. data/docs/MessageSentResponse.md +24 -0
  34. data/docs/MessagingApi.md +1784 -0
  35. data/docs/PatchFlowsFlowIdAssets200Response.md +22 -0
  36. data/docs/ProfileApi.md +155 -0
  37. data/docs/ProfileInfo.md +32 -0
  38. data/docs/RetrieveMedia200Response.md +26 -0
  39. data/docs/SendAddressMessageRequest.md +32 -0
  40. data/docs/SendButtonRequest.md +24 -0
  41. data/docs/SendButtonRequestSectionsInner.md +20 -0
  42. data/docs/SendButtonRequestSectionsInnerReply.md +20 -0
  43. data/docs/SendCarouselRequest1.md +26 -0
  44. data/docs/SendContactRequest.md +20 -0
  45. data/docs/SendContactRequestContactsInner.md +30 -0
  46. data/docs/SendContactRequestContactsInnerName.md +28 -0
  47. data/docs/SendContactRequestContactsInnerOrg.md +22 -0
  48. data/docs/SendContactRequestContactsInnerPhonesInner.md +22 -0
  49. data/docs/SendCtaUrlRequest.md +32 -0
  50. data/docs/SendFileRequest.md +34 -0
  51. data/docs/SendFlowRequest1.md +46 -0
  52. data/docs/SendFlowRequest1Header.md +49 -0
  53. data/docs/SendFlowRequestHeader.md +49 -0
  54. data/docs/SendListRequest.md +26 -0
  55. data/docs/SendListRequestSectionsInner.md +20 -0
  56. data/docs/SendListRequestSectionsInnerRowsInner.md +22 -0
  57. data/docs/SendLocationRequest1.md +30 -0
  58. data/docs/SendLocationRequestRequest.md +20 -0
  59. data/docs/SendMessageRequest.md +24 -0
  60. data/docs/SendOrderDetailsRequest.md +36 -0
  61. data/docs/SendOrderDetailsRequestLanguage.md +20 -0
  62. data/docs/SendOrderDetailsRequestOrder.md +28 -0
  63. data/docs/SendOrderDetailsRequestOrderItemsInner.md +24 -0
  64. data/docs/SendOrderDetailsRequestOrderItemsInnerAmount.md +20 -0
  65. data/docs/SendPaymentRequestRequest.md +26 -0
  66. data/docs/SendReactionRequest.md +22 -0
  67. data/docs/SendStickerRequest.md +26 -0
  68. data/docs/SendTemplateRequest.md +32 -0
  69. data/docs/SendTemplateRequestLanguage.md +20 -0
  70. data/docs/SetWhatsappBusinessEncryptionRequest.md +21 -0
  71. data/docs/SuccessResponse.md +18 -0
  72. data/docs/TemplatesApi.md +301 -0
  73. data/docs/UpdateMeRequest.md +30 -0
  74. data/docs/UsersApi.md +223 -0
  75. data/docs/WebhooksApi.md +155 -0
  76. data/git_push.sh +57 -0
  77. data/lib/one_msg_chat_api/api/calling_api.rb +228 -0
  78. data/lib/one_msg_chat_api/api/catalog_api.rb +161 -0
  79. data/lib/one_msg_chat_api/api/channel_api.rb +225 -0
  80. data/lib/one_msg_chat_api/api/flows_api.rb +788 -0
  81. data/lib/one_msg_chat_api/api/groups_api.rb +486 -0
  82. data/lib/one_msg_chat_api/api/messaging_api.rb +1833 -0
  83. data/lib/one_msg_chat_api/api/profile_api.rb +157 -0
  84. data/lib/one_msg_chat_api/api/templates_api.rb +293 -0
  85. data/lib/one_msg_chat_api/api/users_api.rb +232 -0
  86. data/lib/one_msg_chat_api/api/webhooks_api.rb +157 -0
  87. data/lib/one_msg_chat_api/api_client.rb +441 -0
  88. data/lib/one_msg_chat_api/api_error.rb +58 -0
  89. data/lib/one_msg_chat_api/api_model_base.rb +88 -0
  90. data/lib/one_msg_chat_api/configuration.rb +400 -0
  91. data/lib/one_msg_chat_api/models/add_template_request.rb +176 -0
  92. data/lib/one_msg_chat_api/models/block_user_request.rb +164 -0
  93. data/lib/one_msg_chat_api/models/conversational_automation.rb +210 -0
  94. data/lib/one_msg_chat_api/models/conversational_automation_commands_inner.rb +208 -0
  95. data/lib/one_msg_chat_api/models/create_commerce200_response.rb +147 -0
  96. data/lib/one_msg_chat_api/models/create_commerce_request.rb +164 -0
  97. data/lib/one_msg_chat_api/models/create_commerce_request_params.rb +192 -0
  98. data/lib/one_msg_chat_api/models/create_groups200_response.rb +149 -0
  99. data/lib/one_msg_chat_api/models/create_read_message200_response.rb +147 -0
  100. data/lib/one_msg_chat_api/models/create_read_message401_response.rb +147 -0
  101. data/lib/one_msg_chat_api/models/create_read_message_request.rb +168 -0
  102. data/lib/one_msg_chat_api/models/delete_flows_flow_id200_response.rb +158 -0
  103. data/lib/one_msg_chat_api/models/delete_groups_group_id200_response.rb +158 -0
  104. data/lib/one_msg_chat_api/models/delete_media_legacy_request.rb +165 -0
  105. data/lib/one_msg_chat_api/models/error_response.rb +149 -0
  106. data/lib/one_msg_chat_api/models/get_commerce200_response_inner.rb +168 -0
  107. data/lib/one_msg_chat_api/models/get_mm_lite_status200_response.rb +165 -0
  108. data/lib/one_msg_chat_api/models/get_webhook200_response.rb +147 -0
  109. data/lib/one_msg_chat_api/models/get_whatsapp_business_encryption200_response.rb +202 -0
  110. data/lib/one_msg_chat_api/models/list_blocked_users200_response.rb +149 -0
  111. data/lib/one_msg_chat_api/models/list_flows200_response.rb +189 -0
  112. data/lib/one_msg_chat_api/models/list_messages200_response.rb +158 -0
  113. data/lib/one_msg_chat_api/models/list_templates200_response.rb +169 -0
  114. data/lib/one_msg_chat_api/models/message_sent_response.rb +179 -0
  115. data/lib/one_msg_chat_api/models/patch_flows_flow_id_assets200_response.rb +169 -0
  116. data/lib/one_msg_chat_api/models/profile_info.rb +254 -0
  117. data/lib/one_msg_chat_api/models/retrieve_media200_response.rb +183 -0
  118. data/lib/one_msg_chat_api/models/send_address_message_request.rb +273 -0
  119. data/lib/one_msg_chat_api/models/send_button_request.rb +176 -0
  120. data/lib/one_msg_chat_api/models/send_button_request_sections_inner.rb +156 -0
  121. data/lib/one_msg_chat_api/models/send_button_request_sections_inner_reply.rb +156 -0
  122. data/lib/one_msg_chat_api/models/send_carousel_request1.rb +202 -0
  123. data/lib/one_msg_chat_api/models/send_contact_request.rb +158 -0
  124. data/lib/one_msg_chat_api/models/send_contact_request_contacts_inner.rb +209 -0
  125. data/lib/one_msg_chat_api/models/send_contact_request_contacts_inner_name.rb +192 -0
  126. data/lib/one_msg_chat_api/models/send_contact_request_contacts_inner_org.rb +165 -0
  127. data/lib/one_msg_chat_api/models/send_contact_request_contacts_inner_phones_inner.rb +165 -0
  128. data/lib/one_msg_chat_api/models/send_cta_url_request.rb +264 -0
  129. data/lib/one_msg_chat_api/models/send_file_request.rb +278 -0
  130. data/lib/one_msg_chat_api/models/send_flow_request1.rb +387 -0
  131. data/lib/one_msg_chat_api/models/send_flow_request1_header.rb +104 -0
  132. data/lib/one_msg_chat_api/models/send_flow_request_header.rb +105 -0
  133. data/lib/one_msg_chat_api/models/send_list_request.rb +185 -0
  134. data/lib/one_msg_chat_api/models/send_list_request_sections_inner.rb +158 -0
  135. data/lib/one_msg_chat_api/models/send_list_request_sections_inner_rows_inner.rb +165 -0
  136. data/lib/one_msg_chat_api/models/send_location_request1.rb +235 -0
  137. data/lib/one_msg_chat_api/models/send_location_request_request.rb +156 -0
  138. data/lib/one_msg_chat_api/models/send_message_request.rb +284 -0
  139. data/lib/one_msg_chat_api/models/send_order_details_request.rb +308 -0
  140. data/lib/one_msg_chat_api/models/send_order_details_request_language.rb +176 -0
  141. data/lib/one_msg_chat_api/models/send_order_details_request_order.rb +220 -0
  142. data/lib/one_msg_chat_api/models/send_order_details_request_order_items_inner.rb +174 -0
  143. data/lib/one_msg_chat_api/models/send_order_details_request_order_items_inner_amount.rb +156 -0
  144. data/lib/one_msg_chat_api/models/send_payment_request_request.rb +245 -0
  145. data/lib/one_msg_chat_api/models/send_reaction_request.rb +165 -0
  146. data/lib/one_msg_chat_api/models/send_sticker_request.rb +185 -0
  147. data/lib/one_msg_chat_api/models/send_template_request.rb +215 -0
  148. data/lib/one_msg_chat_api/models/send_template_request_language.rb +156 -0
  149. data/lib/one_msg_chat_api/models/set_whatsapp_business_encryption_request.rb +165 -0
  150. data/lib/one_msg_chat_api/models/success_response.rb +149 -0
  151. data/lib/one_msg_chat_api/models/update_me_request.rb +207 -0
  152. data/lib/one_msg_chat_api/version.rb +15 -0
  153. data/lib/one_msg_chat_api.rb +111 -0
  154. data/one_msg_chat_api.gemspec +41 -0
  155. data/spec/api/calling_api_spec.rb +73 -0
  156. data/spec/api/catalog_api_spec.rb +60 -0
  157. data/spec/api/channel_api_spec.rb +72 -0
  158. data/spec/api/flows_api_spec.rb +175 -0
  159. data/spec/api/groups_api_spec.rb +117 -0
  160. data/spec/api/messaging_api_spec.rb +359 -0
  161. data/spec/api/profile_api_spec.rb +60 -0
  162. data/spec/api/templates_api_spec.rb +83 -0
  163. data/spec/api/users_api_spec.rb +71 -0
  164. data/spec/api/webhooks_api_spec.rb +60 -0
  165. data/spec/models/add_template_request_spec.rb +54 -0
  166. data/spec/models/block_user_request_spec.rb +36 -0
  167. data/spec/models/conversational_automation_commands_inner_spec.rb +42 -0
  168. data/spec/models/conversational_automation_spec.rb +48 -0
  169. data/spec/models/create_commerce200_response_spec.rb +36 -0
  170. data/spec/models/create_commerce_request_params_spec.rb +42 -0
  171. data/spec/models/create_commerce_request_spec.rb +36 -0
  172. data/spec/models/create_groups200_response_spec.rb +36 -0
  173. data/spec/models/create_read_message200_response_spec.rb +36 -0
  174. data/spec/models/create_read_message401_response_spec.rb +36 -0
  175. data/spec/models/create_read_message_request_spec.rb +48 -0
  176. data/spec/models/delete_flows_flow_id200_response_spec.rb +42 -0
  177. data/spec/models/delete_groups_group_id200_response_spec.rb +42 -0
  178. data/spec/models/delete_media_legacy_request_spec.rb +36 -0
  179. data/spec/models/error_response_spec.rb +36 -0
  180. data/spec/models/get_commerce200_response_inner_spec.rb +48 -0
  181. data/spec/models/get_mm_lite_status200_response_spec.rb +48 -0
  182. data/spec/models/get_webhook200_response_spec.rb +36 -0
  183. data/spec/models/get_whatsapp_business_encryption200_response_spec.rb +52 -0
  184. data/spec/models/list_blocked_users200_response_spec.rb +36 -0
  185. data/spec/models/list_flows200_response_spec.rb +60 -0
  186. data/spec/models/list_messages200_response_spec.rb +42 -0
  187. data/spec/models/list_templates200_response_spec.rb +48 -0
  188. data/spec/models/message_sent_response_spec.rb +54 -0
  189. data/spec/models/patch_flows_flow_id_assets200_response_spec.rb +48 -0
  190. data/spec/models/profile_info_spec.rb +82 -0
  191. data/spec/models/retrieve_media200_response_spec.rb +60 -0
  192. data/spec/models/send_address_message_request_spec.rb +82 -0
  193. data/spec/models/send_button_request_sections_inner_reply_spec.rb +42 -0
  194. data/spec/models/send_button_request_sections_inner_spec.rb +42 -0
  195. data/spec/models/send_button_request_spec.rb +54 -0
  196. data/spec/models/send_carousel_request1_spec.rb +60 -0
  197. data/spec/models/send_contact_request_contacts_inner_name_spec.rb +66 -0
  198. data/spec/models/send_contact_request_contacts_inner_org_spec.rb +48 -0
  199. data/spec/models/send_contact_request_contacts_inner_phones_inner_spec.rb +48 -0
  200. data/spec/models/send_contact_request_contacts_inner_spec.rb +72 -0
  201. data/spec/models/send_contact_request_spec.rb +42 -0
  202. data/spec/models/send_cta_url_request_spec.rb +78 -0
  203. data/spec/models/send_file_request_spec.rb +88 -0
  204. data/spec/models/send_flow_request1_header_spec.rb +32 -0
  205. data/spec/models/send_flow_request1_spec.rb +128 -0
  206. data/spec/models/send_flow_request_header_spec.rb +32 -0
  207. data/spec/models/send_list_request_sections_inner_rows_inner_spec.rb +48 -0
  208. data/spec/models/send_list_request_sections_inner_spec.rb +42 -0
  209. data/spec/models/send_list_request_spec.rb +60 -0
  210. data/spec/models/send_location_request1_spec.rb +72 -0
  211. data/spec/models/send_location_request_request_spec.rb +42 -0
  212. data/spec/models/send_message_request_spec.rb +54 -0
  213. data/spec/models/send_order_details_request_language_spec.rb +42 -0
  214. data/spec/models/send_order_details_request_order_items_inner_amount_spec.rb +42 -0
  215. data/spec/models/send_order_details_request_order_items_inner_spec.rb +54 -0
  216. data/spec/models/send_order_details_request_order_spec.rb +66 -0
  217. data/spec/models/send_order_details_request_spec.rb +90 -0
  218. data/spec/models/send_payment_request_request_spec.rb +64 -0
  219. data/spec/models/send_reaction_request_spec.rb +48 -0
  220. data/spec/models/send_sticker_request_spec.rb +60 -0
  221. data/spec/models/send_template_request_language_spec.rb +42 -0
  222. data/spec/models/send_template_request_spec.rb +78 -0
  223. data/spec/models/set_whatsapp_business_encryption_request_spec.rb +36 -0
  224. data/spec/models/success_response_spec.rb +36 -0
  225. data/spec/models/update_me_request_spec.rb +72 -0
  226. data/spec/spec_helper.rb +111 -0
  227. metadata +408 -0
@@ -0,0 +1,165 @@
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:** 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/
5
+
6
+ The version of the OpenAPI document: 1.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 OneMsgChatApi
17
+ class SendReactionRequest < ApiModelBase
18
+ attr_accessor :phone
19
+
20
+ attr_accessor :body
21
+
22
+ attr_accessor :quoted_msg_id
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'phone' => :'phone',
28
+ :'body' => :'body',
29
+ :'quoted_msg_id' => :'quotedMsgId'
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
+ :'phone' => :'String',
47
+ :'body' => :'String',
48
+ :'quoted_msg_id' => :'String'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OneMsgChatApi::SendReactionRequest` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OneMsgChatApi::SendReactionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'phone')
75
+ self.phone = attributes[:'phone']
76
+ end
77
+
78
+ if attributes.key?(:'body')
79
+ self.body = attributes[:'body']
80
+ end
81
+
82
+ if attributes.key?(:'quoted_msg_id')
83
+ self.quoted_msg_id = attributes[:'quoted_msg_id']
84
+ end
85
+ end
86
+
87
+ # Show invalid properties with the reasons. Usually used together with valid?
88
+ # @return Array for valid properties with the reasons
89
+ def list_invalid_properties
90
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
91
+ invalid_properties = Array.new
92
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ warn '[DEPRECATED] the `valid?` method is obsolete'
99
+ true
100
+ end
101
+
102
+ # Checks equality by comparing each attribute.
103
+ # @param [Object] Object to be compared
104
+ def ==(o)
105
+ return true if self.equal?(o)
106
+ self.class == o.class &&
107
+ phone == o.phone &&
108
+ body == o.body &&
109
+ quoted_msg_id == o.quoted_msg_id
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ def hash
121
+ [phone, body, quoted_msg_id].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def self.build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ attributes = attributes.transform_keys(&:to_sym)
130
+ transformed_hash = {}
131
+ openapi_types.each_pair do |key, type|
132
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = nil
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[attribute_map[key]].is_a?(Array)
138
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
139
+ end
140
+ elsif !attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
142
+ end
143
+ end
144
+ new(transformed_hash)
145
+ end
146
+
147
+ # Returns the object in the form of hash
148
+ # @return [Hash] Returns the object in the form of hash
149
+ def to_hash
150
+ hash = {}
151
+ self.class.attribute_map.each_pair do |attr, param|
152
+ value = self.send(attr)
153
+ if value.nil?
154
+ is_nullable = self.class.openapi_nullable.include?(attr)
155
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
156
+ end
157
+
158
+ hash[param] = _to_hash(value)
159
+ end
160
+ hash
161
+ end
162
+
163
+ end
164
+
165
+ end
@@ -0,0 +1,185 @@
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:** 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/
5
+
6
+ The version of the OpenAPI document: 1.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 OneMsgChatApi
17
+ class SendStickerRequest < ApiModelBase
18
+ attr_accessor :phone
19
+
20
+ attr_accessor :chat_id
21
+
22
+ # WABA media id from uploadMedia
23
+ attr_accessor :media_id
24
+
25
+ # Public URL to webp sticker
26
+ attr_accessor :link
27
+
28
+ attr_accessor :quoted_msg_id
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'phone' => :'phone',
34
+ :'chat_id' => :'chatId',
35
+ :'media_id' => :'mediaId',
36
+ :'link' => :'link',
37
+ :'quoted_msg_id' => :'quotedMsgId'
38
+ }
39
+ end
40
+
41
+ # Returns attribute mapping this model knows about
42
+ def self.acceptable_attribute_map
43
+ attribute_map
44
+ end
45
+
46
+ # Returns all the JSON keys this model knows about
47
+ def self.acceptable_attributes
48
+ acceptable_attribute_map.values
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'phone' => :'Integer',
55
+ :'chat_id' => :'String',
56
+ :'media_id' => :'String',
57
+ :'link' => :'String',
58
+ :'quoted_msg_id' => :'String'
59
+ }
60
+ end
61
+
62
+ # List of attributes with nullable: true
63
+ def self.openapi_nullable
64
+ Set.new([
65
+ ])
66
+ end
67
+
68
+ # Initializes the object
69
+ # @param [Hash] attributes Model attributes in the form of hash
70
+ def initialize(attributes = {})
71
+ if (!attributes.is_a?(Hash))
72
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OneMsgChatApi::SendStickerRequest` initialize method"
73
+ end
74
+
75
+ # check to see if the attribute exists and convert string to symbol for hash key
76
+ acceptable_attribute_map = self.class.acceptable_attribute_map
77
+ attributes = attributes.each_with_object({}) { |(k, v), h|
78
+ if (!acceptable_attribute_map.key?(k.to_sym))
79
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OneMsgChatApi::SendStickerRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
80
+ end
81
+ h[k.to_sym] = v
82
+ }
83
+
84
+ if attributes.key?(:'phone')
85
+ self.phone = attributes[:'phone']
86
+ end
87
+
88
+ if attributes.key?(:'chat_id')
89
+ self.chat_id = attributes[:'chat_id']
90
+ end
91
+
92
+ if attributes.key?(:'media_id')
93
+ self.media_id = attributes[:'media_id']
94
+ end
95
+
96
+ if attributes.key?(:'link')
97
+ self.link = attributes[:'link']
98
+ end
99
+
100
+ if attributes.key?(:'quoted_msg_id')
101
+ self.quoted_msg_id = attributes[:'quoted_msg_id']
102
+ end
103
+ end
104
+
105
+ # Show invalid properties with the reasons. Usually used together with valid?
106
+ # @return Array for valid properties with the reasons
107
+ def list_invalid_properties
108
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
109
+ invalid_properties = Array.new
110
+ invalid_properties
111
+ end
112
+
113
+ # Check to see if the all the properties in the model are valid
114
+ # @return true if the model is valid
115
+ def valid?
116
+ warn '[DEPRECATED] the `valid?` method is obsolete'
117
+ true
118
+ end
119
+
120
+ # Checks equality by comparing each attribute.
121
+ # @param [Object] Object to be compared
122
+ def ==(o)
123
+ return true if self.equal?(o)
124
+ self.class == o.class &&
125
+ phone == o.phone &&
126
+ chat_id == o.chat_id &&
127
+ media_id == o.media_id &&
128
+ link == o.link &&
129
+ quoted_msg_id == o.quoted_msg_id
130
+ end
131
+
132
+ # @see the `==` method
133
+ # @param [Object] Object to be compared
134
+ def eql?(o)
135
+ self == o
136
+ end
137
+
138
+ # Calculates hash code according to all attributes.
139
+ # @return [Integer] Hash code
140
+ def hash
141
+ [phone, chat_id, media_id, link, quoted_msg_id].hash
142
+ end
143
+
144
+ # Builds the object from hash
145
+ # @param [Hash] attributes Model attributes in the form of hash
146
+ # @return [Object] Returns the model itself
147
+ def self.build_from_hash(attributes)
148
+ return nil unless attributes.is_a?(Hash)
149
+ attributes = attributes.transform_keys(&:to_sym)
150
+ transformed_hash = {}
151
+ openapi_types.each_pair do |key, type|
152
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
153
+ transformed_hash["#{key}"] = nil
154
+ elsif type =~ /\AArray<(.*)>/i
155
+ # check to ensure the input is an array given that the attribute
156
+ # is documented as an array but the input is not
157
+ if attributes[attribute_map[key]].is_a?(Array)
158
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
159
+ end
160
+ elsif !attributes[attribute_map[key]].nil?
161
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
162
+ end
163
+ end
164
+ new(transformed_hash)
165
+ end
166
+
167
+ # Returns the object in the form of hash
168
+ # @return [Hash] Returns the object in the form of hash
169
+ def to_hash
170
+ hash = {}
171
+ self.class.attribute_map.each_pair do |attr, param|
172
+ value = self.send(attr)
173
+ if value.nil?
174
+ is_nullable = self.class.openapi_nullable.include?(attr)
175
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
176
+ end
177
+
178
+ hash[param] = _to_hash(value)
179
+ end
180
+ hash
181
+ end
182
+
183
+ end
184
+
185
+ end
@@ -0,0 +1,215 @@
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:** 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/
5
+
6
+ The version of the OpenAPI document: 1.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 OneMsgChatApi
17
+ class SendTemplateRequest < ApiModelBase
18
+ attr_accessor :template
19
+
20
+ attr_accessor :language
21
+
22
+ attr_accessor :namespace
23
+
24
+ attr_accessor :params
25
+
26
+ attr_accessor :phone
27
+
28
+ # Force Marketing Messages API (POST marketing_messages). If omitted: auto for MARKETING category when channel has mm_lite_enabled and mm_lite_available service settings.
29
+ attr_accessor :use_m_mlite
30
+
31
+ # Sets message_activity_sharing on WABA payload. Enables click tracking webhooks. Requires MM Lite path. Ignored on Cloud API fallback.
32
+ attr_accessor :message_activity_sharing
33
+
34
+ # Template message TTL in seconds (message_send_ttl_seconds). MARKETING via MM Lite: 43200–2592000. AUTHENTICATION: 30–900. UTILITY: 30–43200. AUTH/UTILITY also accept -1 (30-day custom TTL).
35
+ attr_accessor :message_send_ttl_seconds
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'template' => :'template',
41
+ :'language' => :'language',
42
+ :'namespace' => :'namespace',
43
+ :'params' => :'params',
44
+ :'phone' => :'phone',
45
+ :'use_m_mlite' => :'useMMlite',
46
+ :'message_activity_sharing' => :'messageActivitySharing',
47
+ :'message_send_ttl_seconds' => :'messageSendTtlSeconds'
48
+ }
49
+ end
50
+
51
+ # Returns attribute mapping this model knows about
52
+ def self.acceptable_attribute_map
53
+ attribute_map
54
+ end
55
+
56
+ # Returns all the JSON keys this model knows about
57
+ def self.acceptable_attributes
58
+ acceptable_attribute_map.values
59
+ end
60
+
61
+ # Attribute type mapping.
62
+ def self.openapi_types
63
+ {
64
+ :'template' => :'String',
65
+ :'language' => :'SendTemplateRequestLanguage',
66
+ :'namespace' => :'String',
67
+ :'params' => :'Array<Object>',
68
+ :'phone' => :'String',
69
+ :'use_m_mlite' => :'Boolean',
70
+ :'message_activity_sharing' => :'Boolean',
71
+ :'message_send_ttl_seconds' => :'Integer'
72
+ }
73
+ end
74
+
75
+ # List of attributes with nullable: true
76
+ def self.openapi_nullable
77
+ Set.new([
78
+ ])
79
+ end
80
+
81
+ # Initializes the object
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ def initialize(attributes = {})
84
+ if (!attributes.is_a?(Hash))
85
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OneMsgChatApi::SendTemplateRequest` initialize method"
86
+ end
87
+
88
+ # check to see if the attribute exists and convert string to symbol for hash key
89
+ acceptable_attribute_map = self.class.acceptable_attribute_map
90
+ attributes = attributes.each_with_object({}) { |(k, v), h|
91
+ if (!acceptable_attribute_map.key?(k.to_sym))
92
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OneMsgChatApi::SendTemplateRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
93
+ end
94
+ h[k.to_sym] = v
95
+ }
96
+
97
+ if attributes.key?(:'template')
98
+ self.template = attributes[:'template']
99
+ end
100
+
101
+ if attributes.key?(:'language')
102
+ self.language = attributes[:'language']
103
+ end
104
+
105
+ if attributes.key?(:'namespace')
106
+ self.namespace = attributes[:'namespace']
107
+ end
108
+
109
+ if attributes.key?(:'params')
110
+ if (value = attributes[:'params']).is_a?(Array)
111
+ self.params = value
112
+ end
113
+ end
114
+
115
+ if attributes.key?(:'phone')
116
+ self.phone = attributes[:'phone']
117
+ end
118
+
119
+ if attributes.key?(:'use_m_mlite')
120
+ self.use_m_mlite = attributes[:'use_m_mlite']
121
+ end
122
+
123
+ if attributes.key?(:'message_activity_sharing')
124
+ self.message_activity_sharing = attributes[:'message_activity_sharing']
125
+ end
126
+
127
+ if attributes.key?(:'message_send_ttl_seconds')
128
+ self.message_send_ttl_seconds = attributes[:'message_send_ttl_seconds']
129
+ end
130
+ end
131
+
132
+ # Show invalid properties with the reasons. Usually used together with valid?
133
+ # @return Array for valid properties with the reasons
134
+ def list_invalid_properties
135
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
136
+ invalid_properties = Array.new
137
+ invalid_properties
138
+ end
139
+
140
+ # Check to see if the all the properties in the model are valid
141
+ # @return true if the model is valid
142
+ def valid?
143
+ warn '[DEPRECATED] the `valid?` method is obsolete'
144
+ true
145
+ end
146
+
147
+ # Checks equality by comparing each attribute.
148
+ # @param [Object] Object to be compared
149
+ def ==(o)
150
+ return true if self.equal?(o)
151
+ self.class == o.class &&
152
+ template == o.template &&
153
+ language == o.language &&
154
+ namespace == o.namespace &&
155
+ params == o.params &&
156
+ phone == o.phone &&
157
+ use_m_mlite == o.use_m_mlite &&
158
+ message_activity_sharing == o.message_activity_sharing &&
159
+ message_send_ttl_seconds == o.message_send_ttl_seconds
160
+ end
161
+
162
+ # @see the `==` method
163
+ # @param [Object] Object to be compared
164
+ def eql?(o)
165
+ self == o
166
+ end
167
+
168
+ # Calculates hash code according to all attributes.
169
+ # @return [Integer] Hash code
170
+ def hash
171
+ [template, language, namespace, params, phone, use_m_mlite, message_activity_sharing, message_send_ttl_seconds].hash
172
+ end
173
+
174
+ # Builds the object from hash
175
+ # @param [Hash] attributes Model attributes in the form of hash
176
+ # @return [Object] Returns the model itself
177
+ def self.build_from_hash(attributes)
178
+ return nil unless attributes.is_a?(Hash)
179
+ attributes = attributes.transform_keys(&:to_sym)
180
+ transformed_hash = {}
181
+ openapi_types.each_pair do |key, type|
182
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
183
+ transformed_hash["#{key}"] = nil
184
+ elsif type =~ /\AArray<(.*)>/i
185
+ # check to ensure the input is an array given that the attribute
186
+ # is documented as an array but the input is not
187
+ if attributes[attribute_map[key]].is_a?(Array)
188
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
189
+ end
190
+ elsif !attributes[attribute_map[key]].nil?
191
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
192
+ end
193
+ end
194
+ new(transformed_hash)
195
+ end
196
+
197
+ # Returns the object in the form of hash
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_hash
200
+ hash = {}
201
+ self.class.attribute_map.each_pair do |attr, param|
202
+ value = self.send(attr)
203
+ if value.nil?
204
+ is_nullable = self.class.openapi_nullable.include?(attr)
205
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
206
+ end
207
+
208
+ hash[param] = _to_hash(value)
209
+ end
210
+ hash
211
+ end
212
+
213
+ end
214
+
215
+ end