messente_api 2.4.1 → 2.6.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 (162) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +26 -19
  3. data/README.md +2 -2
  4. data/docs/BulkMessagingApi.md +1 -1
  5. data/docs/OmnimessageApi.md +1 -1
  6. data/docs/OmnimessageMessagesInner.md +48 -45
  7. data/docs/Rcs.md +32 -0
  8. data/docs/RcsCardContent.md +24 -0
  9. data/docs/RcsCardOrientation.md +15 -0
  10. data/docs/RcsCardWidth.md +15 -0
  11. data/docs/RcsCarouselCard.md +20 -0
  12. data/docs/RcsContentInfo.md +22 -0
  13. data/docs/RcsCreateCalendarEventAction.md +24 -0
  14. data/docs/RcsDialAction.md +18 -0
  15. data/docs/RcsImageAlignment.md +15 -0
  16. data/docs/RcsLatLng.md +20 -0
  17. data/docs/RcsMedia.md +20 -0
  18. data/docs/RcsMediaHeight.md +15 -0
  19. data/docs/RcsOpenUrlAction.md +24 -0
  20. data/docs/RcsOpenUrlApplication.md +15 -0
  21. data/docs/RcsRichCard.md +20 -0
  22. data/docs/RcsStandaloneCard.md +22 -0
  23. data/docs/RcsSuggestedAction.md +32 -0
  24. data/docs/RcsSuggestedReply.md +20 -0
  25. data/docs/RcsSuggestion.md +20 -0
  26. data/docs/RcsViewLocationAction.md +22 -0
  27. data/docs/RcsWebviewViewMode.md +15 -0
  28. data/docs/StatisticsReportSettings.md +1 -1
  29. data/docs/Viber.md +6 -2
  30. data/docs/ViberCarousel.md +18 -0
  31. data/docs/ViberCarouselButton.md +20 -0
  32. data/docs/ViberCarouselItem.md +24 -0
  33. data/docs/ViberTemplate.md +22 -0
  34. data/lib/messente_api/api/account_balance_api.rb +1 -1
  35. data/lib/messente_api/api/blacklist_api.rb +1 -1
  36. data/lib/messente_api/api/bulk_messaging_api.rb +1 -1
  37. data/lib/messente_api/api/contacts_api.rb +1 -1
  38. data/lib/messente_api/api/delivery_report_api.rb +1 -1
  39. data/lib/messente_api/api/groups_api.rb +1 -1
  40. data/lib/messente_api/api/number_lookup_api.rb +1 -1
  41. data/lib/messente_api/api/number_verification_api.rb +1 -1
  42. data/lib/messente_api/api/omnimessage_api.rb +1 -1
  43. data/lib/messente_api/api/pricing_api.rb +1 -1
  44. data/lib/messente_api/api/statistics_api.rb +1 -1
  45. data/lib/messente_api/api/whats_app_templates_api.rb +1 -1
  46. data/lib/messente_api/api_client.rb +1 -1
  47. data/lib/messente_api/api_error.rb +1 -1
  48. data/lib/messente_api/configuration.rb +1 -1
  49. data/lib/messente_api/models/bulk_omni_message_create_success_response.rb +1 -1
  50. data/lib/messente_api/models/bulk_omni_message_create_success_response_messages_inner.rb +1 -1
  51. data/lib/messente_api/models/bulk_omnimessage.rb +1 -1
  52. data/lib/messente_api/models/channel.rb +3 -3
  53. data/lib/messente_api/models/contact_envelope.rb +1 -1
  54. data/lib/messente_api/models/contact_fields.rb +1 -1
  55. data/lib/messente_api/models/contact_list_envelope.rb +1 -1
  56. data/lib/messente_api/models/contact_response_fields.rb +1 -1
  57. data/lib/messente_api/models/contact_update_fields.rb +1 -1
  58. data/lib/messente_api/models/delivery_report_response.rb +1 -1
  59. data/lib/messente_api/models/delivery_result.rb +1 -1
  60. data/lib/messente_api/models/error_code_omnichannel.rb +1 -1
  61. data/lib/messente_api/models/error_code_omnichannel_machine.rb +1 -1
  62. data/lib/messente_api/models/error_code_phonebook.rb +1 -1
  63. data/lib/messente_api/models/error_code_statistics.rb +1 -1
  64. data/lib/messente_api/models/error_item_number_lookup.rb +1 -1
  65. data/lib/messente_api/models/error_item_number_lookup_error.rb +1 -1
  66. data/lib/messente_api/models/error_item_omnichannel.rb +1 -1
  67. data/lib/messente_api/models/error_item_phonebook.rb +1 -1
  68. data/lib/messente_api/models/error_item_statistics.rb +1 -1
  69. data/lib/messente_api/models/error_number_lookup.rb +1 -1
  70. data/lib/messente_api/models/error_omnichannel.rb +1 -1
  71. data/lib/messente_api/models/error_phonebook.rb +1 -1
  72. data/lib/messente_api/models/error_statistics.rb +1 -1
  73. data/lib/messente_api/models/error_title_omnichannel.rb +1 -1
  74. data/lib/messente_api/models/error_title_phonebook.rb +1 -1
  75. data/lib/messente_api/models/fetch_blacklist_success.rb +1 -1
  76. data/lib/messente_api/models/group_envelope.rb +1 -1
  77. data/lib/messente_api/models/group_list_envelope.rb +1 -1
  78. data/lib/messente_api/models/group_name.rb +1 -1
  79. data/lib/messente_api/models/group_response_fields.rb +1 -1
  80. data/lib/messente_api/models/message_result.rb +1 -1
  81. data/lib/messente_api/models/mobile_network.rb +1 -1
  82. data/lib/messente_api/models/number_to_blacklist.rb +1 -1
  83. data/lib/messente_api/models/numbers_to_investigate.rb +1 -1
  84. data/lib/messente_api/models/omni_message_create_success_response.rb +1 -1
  85. data/lib/messente_api/models/omnimessage.rb +1 -1
  86. data/lib/messente_api/models/omnimessage_messages_inner.rb +9 -10
  87. data/lib/messente_api/models/price.rb +1 -1
  88. data/lib/messente_api/models/price_info.rb +1 -1
  89. data/lib/messente_api/models/price_networks_inner.rb +1 -1
  90. data/lib/messente_api/models/priority.rb +1 -1
  91. data/lib/messente_api/models/{telegram.rb → rcs.rb} +98 -43
  92. data/lib/messente_api/models/rcs_card_content.rb +298 -0
  93. data/lib/messente_api/models/rcs_card_orientation.rb +40 -0
  94. data/lib/messente_api/models/rcs_card_width.rb +40 -0
  95. data/lib/messente_api/models/rcs_carousel_card.rb +291 -0
  96. data/lib/messente_api/models/rcs_content_info.rb +251 -0
  97. data/lib/messente_api/models/rcs_create_calendar_event_action.rb +312 -0
  98. data/lib/messente_api/models/rcs_dial_action.rb +223 -0
  99. data/lib/messente_api/models/rcs_image_alignment.rb +40 -0
  100. data/lib/messente_api/models/rcs_lat_lng.rb +240 -0
  101. data/lib/messente_api/models/rcs_media.rb +260 -0
  102. data/lib/messente_api/models/rcs_media_height.rb +41 -0
  103. data/lib/messente_api/models/rcs_open_url_action.rb +299 -0
  104. data/lib/messente_api/models/rcs_open_url_application.rb +40 -0
  105. data/lib/messente_api/models/rcs_rich_card.rb +224 -0
  106. data/lib/messente_api/models/rcs_standalone_card.rb +276 -0
  107. data/lib/messente_api/models/rcs_suggested_action.rb +350 -0
  108. data/lib/messente_api/models/rcs_suggested_reply.rb +278 -0
  109. data/lib/messente_api/models/rcs_suggestion.rb +224 -0
  110. data/lib/messente_api/models/rcs_view_location_action.rb +237 -0
  111. data/lib/messente_api/models/rcs_webview_view_mode.rb +41 -0
  112. data/lib/messente_api/models/sms.rb +3 -3
  113. data/lib/messente_api/models/statistics_report.rb +1 -1
  114. data/lib/messente_api/models/statistics_report_settings.rb +2 -2
  115. data/lib/messente_api/models/statistics_report_success.rb +1 -1
  116. data/lib/messente_api/models/status.rb +1 -1
  117. data/lib/messente_api/models/sync_number_lookup_result.rb +3 -3
  118. data/lib/messente_api/models/sync_number_lookup_success.rb +1 -1
  119. data/lib/messente_api/models/text_store.rb +1 -1
  120. data/lib/messente_api/models/viber.rb +25 -7
  121. data/lib/messente_api/models/viber_carousel.rb +253 -0
  122. data/lib/messente_api/models/viber_carousel_button.rb +259 -0
  123. data/lib/messente_api/models/viber_carousel_item.rb +293 -0
  124. data/lib/messente_api/models/viber_template.rb +252 -0
  125. data/lib/messente_api/models/viber_video.rb +1 -1
  126. data/lib/messente_api/models/whats_app.rb +1 -1
  127. data/lib/messente_api/models/whats_app_audio.rb +1 -1
  128. data/lib/messente_api/models/whats_app_component.rb +1 -1
  129. data/lib/messente_api/models/whats_app_currency.rb +1 -1
  130. data/lib/messente_api/models/whats_app_datetime.rb +1 -1
  131. data/lib/messente_api/models/whats_app_document.rb +1 -1
  132. data/lib/messente_api/models/whats_app_image.rb +1 -1
  133. data/lib/messente_api/models/whats_app_language.rb +1 -1
  134. data/lib/messente_api/models/whats_app_media.rb +1 -1
  135. data/lib/messente_api/models/whats_app_parameter.rb +1 -1
  136. data/lib/messente_api/models/whats_app_sticker.rb +1 -1
  137. data/lib/messente_api/models/whats_app_template.rb +1 -1
  138. data/lib/messente_api/models/whats_app_text.rb +1 -1
  139. data/lib/messente_api/models/whats_app_video.rb +1 -1
  140. data/lib/messente_api/models/whatsapp_button_type.rb +1 -1
  141. data/lib/messente_api/models/whatsapp_component_type.rb +1 -1
  142. data/lib/messente_api/models/whatsapp_create_template_request.rb +1 -1
  143. data/lib/messente_api/models/whatsapp_create_template_response.rb +1 -1
  144. data/lib/messente_api/models/whatsapp_header_format.rb +1 -1
  145. data/lib/messente_api/models/whatsapp_list_templates_response.rb +1 -1
  146. data/lib/messente_api/models/whatsapp_otp_button_type.rb +1 -1
  147. data/lib/messente_api/models/whatsapp_pagination.rb +1 -1
  148. data/lib/messente_api/models/whatsapp_paging_cursors.rb +1 -1
  149. data/lib/messente_api/models/whatsapp_supported_app.rb +1 -1
  150. data/lib/messente_api/models/whatsapp_template_button.rb +1 -1
  151. data/lib/messente_api/models/whatsapp_template_category.rb +1 -1
  152. data/lib/messente_api/models/whatsapp_template_component.rb +1 -1
  153. data/lib/messente_api/models/whatsapp_template_example.rb +1 -1
  154. data/lib/messente_api/models/whatsapp_template_response.rb +1 -1
  155. data/lib/messente_api/models/whatsapp_template_status.rb +1 -1
  156. data/lib/messente_api/models/whatsapp_update_template_request.rb +1 -1
  157. data/lib/messente_api/version.rb +2 -2
  158. data/lib/messente_api.rb +26 -2
  159. data/messente_api.gemspec +1 -1
  160. data/spec/spec_helper.rb +1 -1
  161. metadata +52 -4
  162. data/docs/Telegram.md +0 -30
@@ -0,0 +1,293 @@
1
+ =begin
2
+ #Messente API
3
+
4
+ #[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber and WhatsApp messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.
5
+
6
+ The version of the OpenAPI document: 2.1.0
7
+ Contact: messente@messente.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.11.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module MessenteApi
17
+ # Viber carousel item object.
18
+ class ViberCarouselItem
19
+ # Carousel item title.
20
+ attr_accessor :title
21
+
22
+ # URL of the carousel item image.
23
+ attr_accessor :image_url
24
+
25
+ attr_accessor :primary_button
26
+
27
+ attr_accessor :secondary_button
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'title' => :'title',
33
+ :'image_url' => :'image_url',
34
+ :'primary_button' => :'primary_button',
35
+ :'secondary_button' => :'secondary_button'
36
+ }
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'title' => :'String',
48
+ :'image_url' => :'String',
49
+ :'primary_button' => :'ViberCarouselButton',
50
+ :'secondary_button' => :'ViberCarouselButton'
51
+ }
52
+ end
53
+
54
+ # List of attributes with nullable: true
55
+ def self.openapi_nullable
56
+ Set.new([
57
+ ])
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ def initialize(attributes = {})
63
+ if (!attributes.is_a?(Hash))
64
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MessenteApi::ViberCarouselItem` initialize method"
65
+ end
66
+
67
+ # check to see if the attribute exists and convert string to symbol for hash key
68
+ attributes = attributes.each_with_object({}) { |(k, v), h|
69
+ if (!self.class.attribute_map.key?(k.to_sym))
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MessenteApi::ViberCarouselItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
71
+ end
72
+ h[k.to_sym] = v
73
+ }
74
+
75
+ if attributes.key?(:'title')
76
+ self.title = attributes[:'title']
77
+ else
78
+ self.title = nil
79
+ end
80
+
81
+ if attributes.key?(:'image_url')
82
+ self.image_url = attributes[:'image_url']
83
+ else
84
+ self.image_url = nil
85
+ end
86
+
87
+ if attributes.key?(:'primary_button')
88
+ self.primary_button = attributes[:'primary_button']
89
+ else
90
+ self.primary_button = nil
91
+ end
92
+
93
+ if attributes.key?(:'secondary_button')
94
+ self.secondary_button = attributes[:'secondary_button']
95
+ end
96
+ end
97
+
98
+ # Show invalid properties with the reasons. Usually used together with valid?
99
+ # @return Array for valid properties with the reasons
100
+ def list_invalid_properties
101
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
102
+ invalid_properties = Array.new
103
+ if @title.nil?
104
+ invalid_properties.push('invalid value for "title", title cannot be nil.')
105
+ end
106
+
107
+ if @title.to_s.length > 38
108
+ invalid_properties.push('invalid value for "title", the character length must be smaller than or equal to 38.')
109
+ end
110
+
111
+ if @title.to_s.length < 2
112
+ invalid_properties.push('invalid value for "title", the character length must be great than or equal to 2.')
113
+ end
114
+
115
+ if @image_url.nil?
116
+ invalid_properties.push('invalid value for "image_url", image_url cannot be nil.')
117
+ end
118
+
119
+ if @primary_button.nil?
120
+ invalid_properties.push('invalid value for "primary_button", primary_button cannot be nil.')
121
+ end
122
+
123
+ invalid_properties
124
+ end
125
+
126
+ # Check to see if the all the properties in the model are valid
127
+ # @return true if the model is valid
128
+ def valid?
129
+ warn '[DEPRECATED] the `valid?` method is obsolete'
130
+ return false if @title.nil?
131
+ return false if @title.to_s.length > 38
132
+ return false if @title.to_s.length < 2
133
+ return false if @image_url.nil?
134
+ return false if @primary_button.nil?
135
+ true
136
+ end
137
+
138
+ # Custom attribute writer method with validation
139
+ # @param [Object] title Value to be assigned
140
+ def title=(title)
141
+ if title.nil?
142
+ fail ArgumentError, 'title cannot be nil'
143
+ end
144
+
145
+ if title.to_s.length > 38
146
+ fail ArgumentError, 'invalid value for "title", the character length must be smaller than or equal to 38.'
147
+ end
148
+
149
+ if title.to_s.length < 2
150
+ fail ArgumentError, 'invalid value for "title", the character length must be great than or equal to 2.'
151
+ end
152
+
153
+ @title = title
154
+ end
155
+
156
+ # Checks equality by comparing each attribute.
157
+ # @param [Object] Object to be compared
158
+ def ==(o)
159
+ return true if self.equal?(o)
160
+ self.class == o.class &&
161
+ title == o.title &&
162
+ image_url == o.image_url &&
163
+ primary_button == o.primary_button &&
164
+ secondary_button == o.secondary_button
165
+ end
166
+
167
+ # @see the `==` method
168
+ # @param [Object] Object to be compared
169
+ def eql?(o)
170
+ self == o
171
+ end
172
+
173
+ # Calculates hash code according to all attributes.
174
+ # @return [Integer] Hash code
175
+ def hash
176
+ [title, image_url, primary_button, secondary_button].hash
177
+ end
178
+
179
+ # Builds the object from hash
180
+ # @param [Hash] attributes Model attributes in the form of hash
181
+ # @return [Object] Returns the model itself
182
+ def self.build_from_hash(attributes)
183
+ return nil unless attributes.is_a?(Hash)
184
+ attributes = attributes.transform_keys(&:to_sym)
185
+ transformed_hash = {}
186
+ openapi_types.each_pair do |key, type|
187
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
188
+ transformed_hash["#{key}"] = nil
189
+ elsif type =~ /\AArray<(.*)>/i
190
+ # check to ensure the input is an array given that the attribute
191
+ # is documented as an array but the input is not
192
+ if attributes[attribute_map[key]].is_a?(Array)
193
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
194
+ end
195
+ elsif !attributes[attribute_map[key]].nil?
196
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
197
+ end
198
+ end
199
+ new(transformed_hash)
200
+ end
201
+
202
+ # Deserializes the data based on type
203
+ # @param string type Data type
204
+ # @param string value Value to be deserialized
205
+ # @return [Object] Deserialized data
206
+ def self._deserialize(type, value)
207
+ case type.to_sym
208
+ when :Time
209
+ Time.parse(value)
210
+ when :Date
211
+ Date.parse(value)
212
+ when :String
213
+ value.to_s
214
+ when :Integer
215
+ value.to_i
216
+ when :Float
217
+ value.to_f
218
+ when :Boolean
219
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
220
+ true
221
+ else
222
+ false
223
+ end
224
+ when :Object
225
+ # generic object (usually a Hash), return directly
226
+ value
227
+ when /\AArray<(?<inner_type>.+)>\z/
228
+ inner_type = Regexp.last_match[:inner_type]
229
+ value.map { |v| _deserialize(inner_type, v) }
230
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
231
+ k_type = Regexp.last_match[:k_type]
232
+ v_type = Regexp.last_match[:v_type]
233
+ {}.tap do |hash|
234
+ value.each do |k, v|
235
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
236
+ end
237
+ end
238
+ else # model
239
+ # models (e.g. Pet) or oneOf
240
+ klass = MessenteApi.const_get(type)
241
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
242
+ end
243
+ end
244
+
245
+ # Returns the string representation of the object
246
+ # @return [String] String presentation of the object
247
+ def to_s
248
+ to_hash.to_s
249
+ end
250
+
251
+ # to_body is an alias to to_hash (backward compatibility)
252
+ # @return [Hash] Returns the object in the form of hash
253
+ def to_body
254
+ to_hash
255
+ end
256
+
257
+ # Returns the object in the form of hash
258
+ # @return [Hash] Returns the object in the form of hash
259
+ def to_hash
260
+ hash = {}
261
+ self.class.attribute_map.each_pair do |attr, param|
262
+ value = self.send(attr)
263
+ if value.nil?
264
+ is_nullable = self.class.openapi_nullable.include?(attr)
265
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
266
+ end
267
+
268
+ hash[param] = _to_hash(value)
269
+ end
270
+ hash
271
+ end
272
+
273
+ # Outputs non-array value in the form of hash
274
+ # For object, use to_hash. Otherwise, just return the value
275
+ # @param [Object] value Any valid value
276
+ # @return [Hash] Returns the value in the form of hash
277
+ def _to_hash(value)
278
+ if value.is_a?(Array)
279
+ value.compact.map { |v| _to_hash(v) }
280
+ elsif value.is_a?(Hash)
281
+ {}.tap do |hash|
282
+ value.each { |k, v| hash[k] = _to_hash(v) }
283
+ end
284
+ elsif value.respond_to? :to_hash
285
+ value.to_hash
286
+ else
287
+ value
288
+ end
289
+ end
290
+
291
+ end
292
+
293
+ end
@@ -0,0 +1,252 @@
1
+ =begin
2
+ #Messente API
3
+
4
+ #[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber and WhatsApp messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.
5
+
6
+ The version of the OpenAPI document: 2.1.0
7
+ Contact: messente@messente.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.11.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module MessenteApi
17
+ # Viber template object.
18
+ class ViberTemplate
19
+ # Template ID.
20
+ attr_accessor :id
21
+
22
+ # Template language code.
23
+ attr_accessor :lang
24
+
25
+ # Optional template parameters as key-value string pairs.
26
+ attr_accessor :params
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'id' => :'id',
32
+ :'lang' => :'lang',
33
+ :'params' => :'params'
34
+ }
35
+ end
36
+
37
+ # Returns all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ attribute_map.values
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'id' => :'String',
46
+ :'lang' => :'String',
47
+ :'params' => :'Hash<String, 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 `MessenteApi::ViberTemplate` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MessenteApi::ViberTemplate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'id')
73
+ self.id = attributes[:'id']
74
+ else
75
+ self.id = nil
76
+ end
77
+
78
+ if attributes.key?(:'lang')
79
+ self.lang = attributes[:'lang']
80
+ else
81
+ self.lang = nil
82
+ end
83
+
84
+ if attributes.key?(:'params')
85
+ if (value = attributes[:'params']).is_a?(Hash)
86
+ self.params = value
87
+ end
88
+ end
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properties with the reasons
93
+ def list_invalid_properties
94
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
95
+ invalid_properties = Array.new
96
+ if @id.nil?
97
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
98
+ end
99
+
100
+ if @lang.nil?
101
+ invalid_properties.push('invalid value for "lang", lang cannot be nil.')
102
+ end
103
+
104
+ invalid_properties
105
+ end
106
+
107
+ # Check to see if the all the properties in the model are valid
108
+ # @return true if the model is valid
109
+ def valid?
110
+ warn '[DEPRECATED] the `valid?` method is obsolete'
111
+ return false if @id.nil?
112
+ return false if @lang.nil?
113
+ true
114
+ end
115
+
116
+ # Checks equality by comparing each attribute.
117
+ # @param [Object] Object to be compared
118
+ def ==(o)
119
+ return true if self.equal?(o)
120
+ self.class == o.class &&
121
+ id == o.id &&
122
+ lang == o.lang &&
123
+ params == o.params
124
+ end
125
+
126
+ # @see the `==` method
127
+ # @param [Object] Object to be compared
128
+ def eql?(o)
129
+ self == o
130
+ end
131
+
132
+ # Calculates hash code according to all attributes.
133
+ # @return [Integer] Hash code
134
+ def hash
135
+ [id, lang, params].hash
136
+ end
137
+
138
+ # Builds the object from hash
139
+ # @param [Hash] attributes Model attributes in the form of hash
140
+ # @return [Object] Returns the model itself
141
+ def self.build_from_hash(attributes)
142
+ return nil unless attributes.is_a?(Hash)
143
+ attributes = attributes.transform_keys(&:to_sym)
144
+ transformed_hash = {}
145
+ openapi_types.each_pair do |key, type|
146
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
147
+ transformed_hash["#{key}"] = nil
148
+ elsif type =~ /\AArray<(.*)>/i
149
+ # check to ensure the input is an array given that the attribute
150
+ # is documented as an array but the input is not
151
+ if attributes[attribute_map[key]].is_a?(Array)
152
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
153
+ end
154
+ elsif !attributes[attribute_map[key]].nil?
155
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
156
+ end
157
+ end
158
+ new(transformed_hash)
159
+ end
160
+
161
+ # Deserializes the data based on type
162
+ # @param string type Data type
163
+ # @param string value Value to be deserialized
164
+ # @return [Object] Deserialized data
165
+ def self._deserialize(type, value)
166
+ case type.to_sym
167
+ when :Time
168
+ Time.parse(value)
169
+ when :Date
170
+ Date.parse(value)
171
+ when :String
172
+ value.to_s
173
+ when :Integer
174
+ value.to_i
175
+ when :Float
176
+ value.to_f
177
+ when :Boolean
178
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
179
+ true
180
+ else
181
+ false
182
+ end
183
+ when :Object
184
+ # generic object (usually a Hash), return directly
185
+ value
186
+ when /\AArray<(?<inner_type>.+)>\z/
187
+ inner_type = Regexp.last_match[:inner_type]
188
+ value.map { |v| _deserialize(inner_type, v) }
189
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
190
+ k_type = Regexp.last_match[:k_type]
191
+ v_type = Regexp.last_match[:v_type]
192
+ {}.tap do |hash|
193
+ value.each do |k, v|
194
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
195
+ end
196
+ end
197
+ else # model
198
+ # models (e.g. Pet) or oneOf
199
+ klass = MessenteApi.const_get(type)
200
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
201
+ end
202
+ end
203
+
204
+ # Returns the string representation of the object
205
+ # @return [String] String presentation of the object
206
+ def to_s
207
+ to_hash.to_s
208
+ end
209
+
210
+ # to_body is an alias to to_hash (backward compatibility)
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_body
213
+ to_hash
214
+ end
215
+
216
+ # Returns the object in the form of hash
217
+ # @return [Hash] Returns the object in the form of hash
218
+ def to_hash
219
+ hash = {}
220
+ self.class.attribute_map.each_pair do |attr, param|
221
+ value = self.send(attr)
222
+ if value.nil?
223
+ is_nullable = self.class.openapi_nullable.include?(attr)
224
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
225
+ end
226
+
227
+ hash[param] = _to_hash(value)
228
+ end
229
+ hash
230
+ end
231
+
232
+ # Outputs non-array value in the form of hash
233
+ # For object, use to_hash. Otherwise, just return the value
234
+ # @param [Object] value Any valid value
235
+ # @return [Hash] Returns the value in the form of hash
236
+ def _to_hash(value)
237
+ if value.is_a?(Array)
238
+ value.compact.map { |v| _to_hash(v) }
239
+ elsif value.is_a?(Hash)
240
+ {}.tap do |hash|
241
+ value.each { |k, v| hash[k] = _to_hash(v) }
242
+ end
243
+ elsif value.respond_to? :to_hash
244
+ value.to_hash
245
+ else
246
+ value
247
+ end
248
+ end
249
+
250
+ end
251
+
252
+ end
@@ -3,7 +3,7 @@
3
3
 
4
4
  #[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber and WhatsApp messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.1.0
7
7
  Contact: messente@messente.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.11.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber and WhatsApp messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.1.0
7
7
  Contact: messente@messente.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.11.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber and WhatsApp messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.1.0
7
7
  Contact: messente@messente.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.11.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber and WhatsApp messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.1.0
7
7
  Contact: messente@messente.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.11.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber and WhatsApp messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.1.0
7
7
  Contact: messente@messente.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.11.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber and WhatsApp messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.1.0
7
7
  Contact: messente@messente.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.11.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber and WhatsApp messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.1.0
7
7
  Contact: messente@messente.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.11.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber and WhatsApp messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.1.0
7
7
  Contact: messente@messente.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.11.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber and WhatsApp messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.1.0
7
7
  Contact: messente@messente.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.11.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber and WhatsApp messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.1.0
7
7
  Contact: messente@messente.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.11.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber and WhatsApp messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.1.0
7
7
  Contact: messente@messente.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.11.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber and WhatsApp messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.1.0
7
7
  Contact: messente@messente.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.11.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber and WhatsApp messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.1.0
7
7
  Contact: messente@messente.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.11.0