messente_api 1.4.0 → 2.2.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 (151) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +33 -30
  3. data/docs/BlacklistApi.md +105 -37
  4. data/docs/BulkMessagingApi.md +76 -0
  5. data/docs/BulkOmniMessageCreateSuccessResponse.md +18 -0
  6. data/docs/BulkOmniMessageCreateSuccessResponseMessagesInner.md +49 -0
  7. data/docs/BulkOmnimessage.md +18 -0
  8. data/docs/Channel.md +4 -5
  9. data/docs/ContactEnvelope.md +8 -7
  10. data/docs/ContactFields.md +26 -25
  11. data/docs/ContactListEnvelope.md +8 -7
  12. data/docs/ContactResponseFields.md +28 -27
  13. data/docs/ContactUpdateFields.md +24 -23
  14. data/docs/ContactsApi.md +221 -86
  15. data/docs/DeliveryReportApi.md +29 -13
  16. data/docs/DeliveryReportResponse.md +12 -11
  17. data/docs/DeliveryResult.md +22 -17
  18. data/docs/ErrorCodeOmnichannel.md +4 -5
  19. data/docs/ErrorCodeOmnichannelMachine.md +4 -5
  20. data/docs/ErrorCodePhonebook.md +4 -5
  21. data/docs/ErrorCodeStatistics.md +4 -5
  22. data/docs/ErrorItemNumberLookup.md +8 -7
  23. data/docs/ErrorItemNumberLookupError.md +10 -9
  24. data/docs/ErrorItemOmnichannel.md +14 -13
  25. data/docs/ErrorItemPhonebook.md +12 -11
  26. data/docs/ErrorItemStatistics.md +12 -11
  27. data/docs/ErrorNumberLookup.md +8 -7
  28. data/docs/ErrorOmnichannel.md +8 -7
  29. data/docs/ErrorPhonebook.md +8 -7
  30. data/docs/ErrorStatistics.md +8 -7
  31. data/docs/ErrorTitleOmnichannel.md +4 -5
  32. data/docs/ErrorTitlePhonebook.md +4 -5
  33. data/docs/FetchBlacklistSuccess.md +8 -7
  34. data/docs/GroupEnvelope.md +8 -7
  35. data/docs/GroupListEnvelope.md +8 -7
  36. data/docs/GroupName.md +8 -7
  37. data/docs/GroupResponseFields.md +14 -13
  38. data/docs/GroupsApi.md +136 -51
  39. data/docs/MessageResult.md +12 -11
  40. data/docs/MobileNetwork.md +16 -15
  41. data/docs/NumberLookupApi.md +30 -14
  42. data/docs/NumberToBlacklist.md +8 -7
  43. data/docs/NumbersToInvestigate.md +8 -7
  44. data/docs/OmniMessageCreateSuccessResponse.md +12 -11
  45. data/docs/Omnimessage.md +18 -17
  46. data/docs/OmnimessageApi.md +56 -23
  47. data/docs/OmnimessageMessagesInner.md +53 -0
  48. data/docs/PriceInfo.md +22 -0
  49. data/docs/Priority.md +4 -5
  50. data/docs/SMS.md +20 -17
  51. data/docs/StatisticsApi.md +30 -14
  52. data/docs/StatisticsReport.md +12 -11
  53. data/docs/StatisticsReportSettings.md +12 -11
  54. data/docs/StatisticsReportSuccess.md +8 -7
  55. data/docs/Status.md +4 -5
  56. data/docs/SyncNumberLookupResult.md +24 -23
  57. data/docs/SyncNumberLookupSuccess.md +10 -9
  58. data/docs/Telegram.md +20 -19
  59. data/docs/TextStore.md +4 -5
  60. data/docs/Viber.md +24 -19
  61. data/docs/ViberVideo.md +24 -0
  62. data/docs/WhatsApp.md +16 -19
  63. data/docs/WhatsAppComponent.md +24 -0
  64. data/docs/WhatsAppCurrency.md +22 -0
  65. data/docs/WhatsAppDatetime.md +18 -0
  66. data/docs/WhatsAppLanguage.md +20 -0
  67. data/docs/WhatsAppMedia.md +24 -0
  68. data/docs/WhatsAppParameter.md +30 -0
  69. data/docs/WhatsAppTemplate.md +22 -0
  70. data/git_push.sh +3 -4
  71. data/lib/messente_api/api/blacklist_api.rb +22 -15
  72. data/lib/messente_api/api/bulk_messaging_api.rb +88 -0
  73. data/lib/messente_api/api/contacts_api.rb +42 -28
  74. data/lib/messente_api/api/delivery_report_api.rb +6 -5
  75. data/lib/messente_api/api/groups_api.rb +30 -19
  76. data/lib/messente_api/api/number_lookup_api.rb +10 -6
  77. data/lib/messente_api/api/omnimessage_api.rb +14 -9
  78. data/lib/messente_api/api/statistics_api.rb +10 -6
  79. data/lib/messente_api/api_client.rb +72 -66
  80. data/lib/messente_api/api_error.rb +3 -2
  81. data/lib/messente_api/configuration.rb +64 -14
  82. data/lib/messente_api/models/{whats_app_audio.rb → bulk_omni_message_create_success_response.rb} +50 -38
  83. data/lib/messente_api/models/bulk_omni_message_create_success_response_messages_inner.rb +105 -0
  84. data/lib/messente_api/models/{whats_app_text.rb → bulk_omnimessage.rb} +49 -49
  85. data/lib/messente_api/models/channel.rb +9 -5
  86. data/lib/messente_api/models/contact_envelope.rb +31 -23
  87. data/lib/messente_api/models/contact_fields.rb +33 -23
  88. data/lib/messente_api/models/contact_list_envelope.rb +41 -23
  89. data/lib/messente_api/models/contact_response_fields.rb +31 -23
  90. data/lib/messente_api/models/contact_update_fields.rb +31 -23
  91. data/lib/messente_api/models/delivery_report_response.rb +37 -23
  92. data/lib/messente_api/models/delivery_result.rb +77 -27
  93. data/lib/messente_api/models/error_code_omnichannel.rb +9 -5
  94. data/lib/messente_api/models/error_code_omnichannel_machine.rb +9 -5
  95. data/lib/messente_api/models/error_code_phonebook.rb +9 -5
  96. data/lib/messente_api/models/error_code_statistics.rb +9 -5
  97. data/lib/messente_api/models/error_item_number_lookup.rb +33 -23
  98. data/lib/messente_api/models/error_item_number_lookup_error.rb +35 -23
  99. data/lib/messente_api/models/error_item_omnichannel.rb +61 -23
  100. data/lib/messente_api/models/error_item_phonebook.rb +59 -23
  101. data/lib/messente_api/models/error_item_statistics.rb +59 -23
  102. data/lib/messente_api/models/error_number_lookup.rb +33 -23
  103. data/lib/messente_api/models/error_omnichannel.rb +33 -23
  104. data/lib/messente_api/models/error_phonebook.rb +33 -23
  105. data/lib/messente_api/models/error_statistics.rb +33 -23
  106. data/lib/messente_api/models/error_title_omnichannel.rb +9 -5
  107. data/lib/messente_api/models/error_title_phonebook.rb +9 -5
  108. data/lib/messente_api/models/fetch_blacklist_success.rb +41 -23
  109. data/lib/messente_api/models/group_envelope.rb +31 -23
  110. data/lib/messente_api/models/group_list_envelope.rb +41 -23
  111. data/lib/messente_api/models/group_name.rb +33 -23
  112. data/lib/messente_api/models/group_response_fields.rb +37 -23
  113. data/lib/messente_api/models/message_result.rb +59 -23
  114. data/lib/messente_api/models/mobile_network.rb +31 -23
  115. data/lib/messente_api/models/number_to_blacklist.rb +33 -23
  116. data/lib/messente_api/models/numbers_to_investigate.rb +62 -24
  117. data/lib/messente_api/models/omni_message_create_success_response.rb +37 -23
  118. data/lib/messente_api/models/omnimessage.rb +59 -25
  119. data/lib/messente_api/models/omnimessage_messages_inner.rb +107 -0
  120. data/lib/messente_api/models/price_info.rb +257 -0
  121. data/lib/messente_api/models/priority.rb +9 -5
  122. data/lib/messente_api/models/sms.rb +45 -25
  123. data/lib/messente_api/models/statistics_report.rb +37 -23
  124. data/lib/messente_api/models/statistics_report_settings.rb +35 -23
  125. data/lib/messente_api/models/statistics_report_success.rb +33 -23
  126. data/lib/messente_api/models/status.rb +9 -5
  127. data/lib/messente_api/models/sync_number_lookup_result.rb +35 -24
  128. data/lib/messente_api/models/sync_number_lookup_success.rb +35 -23
  129. data/lib/messente_api/models/telegram.rb +31 -23
  130. data/lib/messente_api/models/text_store.rb +9 -5
  131. data/lib/messente_api/models/viber.rb +55 -28
  132. data/lib/messente_api/models/viber_video.rb +274 -0
  133. data/lib/messente_api/models/whats_app.rb +45 -54
  134. data/lib/messente_api/models/whats_app_component.rb +255 -0
  135. data/lib/messente_api/models/whats_app_currency.rb +257 -0
  136. data/lib/messente_api/models/{whats_app_document.rb → whats_app_datetime.rb} +48 -48
  137. data/lib/messente_api/models/{whats_app_image.rb → whats_app_language.rb} +55 -45
  138. data/lib/messente_api/models/whats_app_media.rb +246 -0
  139. data/lib/messente_api/models/whats_app_parameter.rb +278 -0
  140. data/lib/messente_api/models/whats_app_template.rb +251 -0
  141. data/lib/messente_api/version.rb +3 -3
  142. data/lib/messente_api.rb +16 -6
  143. data/messente_api.gemspec +5 -5
  144. data/spec/spec_helper.rb +2 -2
  145. metadata +35 -39
  146. data/docs/WhatsAppAudio.md +0 -17
  147. data/docs/WhatsAppDocument.md +0 -19
  148. data/docs/WhatsAppImage.md +0 -19
  149. data/docs/WhatsAppText.md +0 -19
  150. data/spec/api_client_spec.rb +0 -226
  151. data/spec/configuration_spec.rb +0 -42
@@ -3,14 +3,15 @@
3
3
 
4
4
  #[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram 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: 1.4.0
6
+ The version of the OpenAPI document: 2.0.0
7
7
  Contact: messente@messente.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module MessenteApi
16
17
  class Status
@@ -26,6 +27,10 @@ module MessenteApi
26
27
  NACK = "NACK".freeze
27
28
  SEEN = "SEEN".freeze
28
29
 
30
+ def self.all_vars
31
+ @all_vars ||= [ACK, DELIVRD, UNDELIV, FAILED, UNKNOWN, ACCEPTD, REJECTD, DELETED, EXPIRED, NACK, SEEN].freeze
32
+ end
33
+
29
34
  # Builds the enum from string
30
35
  # @param [String] The enum value in the form of the string
31
36
  # @return [String] The enum value
@@ -37,9 +42,8 @@ module MessenteApi
37
42
  # @param [String] The enum value in the form of the string
38
43
  # @return [String] The enum value
39
44
  def build_from_hash(value)
40
- constantValues = Status.constants.select { |c| Status::const_get(c) == value }
41
- raise "Invalid ENUM value #{value} for class #Status" if constantValues.empty?
42
- value
45
+ return value if Status.all_vars.include?(value)
46
+ raise "Invalid ENUM value #{value} for class #Status"
43
47
  end
44
48
  end
45
49
  end
@@ -3,14 +3,15 @@
3
3
 
4
4
  #[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram 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: 1.4.0
6
+ The version of the OpenAPI document: 2.0.0
7
7
  Contact: messente@messente.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module MessenteApi
16
17
  # Info about a phone number
@@ -75,6 +76,11 @@ module MessenteApi
75
76
  }
76
77
  end
77
78
 
79
+ # Returns all the JSON keys this model knows about
80
+ def self.acceptable_attributes
81
+ attribute_map.values
82
+ end
83
+
78
84
  # Attribute type mapping.
79
85
  def self.openapi_types
80
86
  {
@@ -86,7 +92,7 @@ module MessenteApi
86
92
  :'original_network' => :'MobileNetwork',
87
93
  :'ported_network' => :'MobileNetwork',
88
94
  :'status' => :'String',
89
- :'error' => :'AnyType'
95
+ :'error' => :'Object'
90
96
  }
91
97
  end
92
98
 
@@ -99,6 +105,7 @@ module MessenteApi
99
105
  :'current_network',
100
106
  :'original_network',
101
107
  :'ported_network',
108
+ :'error'
102
109
  ])
103
110
  end
104
111
 
@@ -119,6 +126,8 @@ module MessenteApi
119
126
 
120
127
  if attributes.key?(:'number')
121
128
  self.number = attributes[:'number']
129
+ else
130
+ self.number = nil
122
131
  end
123
132
 
124
133
  if attributes.key?(:'roaming')
@@ -157,6 +166,7 @@ module MessenteApi
157
166
  # Show invalid properties with the reasons. Usually used together with valid?
158
167
  # @return Array for valid properties with the reasons
159
168
  def list_invalid_properties
169
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
160
170
  invalid_properties = Array.new
161
171
  if @number.nil?
162
172
  invalid_properties.push('invalid value for "number", number cannot be nil.')
@@ -168,6 +178,7 @@ module MessenteApi
168
178
  # Check to see if the all the properties in the model are valid
169
179
  # @return true if the model is valid
170
180
  def valid?
181
+ warn '[DEPRECATED] the `valid?` method is obsolete'
171
182
  return false if @number.nil?
172
183
  status_validator = EnumAttributeValidator.new('String', ["ON", "OFF", "INVALID", "UNKNOWN"])
173
184
  return false unless status_validator.valid?(@status)
@@ -216,37 +227,33 @@ module MessenteApi
216
227
  # @param [Hash] attributes Model attributes in the form of hash
217
228
  # @return [Object] Returns the model itself
218
229
  def self.build_from_hash(attributes)
219
- new.build_from_hash(attributes)
220
- end
221
-
222
- # Builds the object from hash
223
- # @param [Hash] attributes Model attributes in the form of hash
224
- # @return [Object] Returns the model itself
225
- def build_from_hash(attributes)
226
230
  return nil unless attributes.is_a?(Hash)
227
- self.class.openapi_types.each_pair do |key, type|
228
- if type =~ /\AArray<(.*)>/i
231
+ attributes = attributes.transform_keys(&:to_sym)
232
+ transformed_hash = {}
233
+ openapi_types.each_pair do |key, type|
234
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
235
+ transformed_hash["#{key}"] = nil
236
+ elsif type =~ /\AArray<(.*)>/i
229
237
  # check to ensure the input is an array given that the attribute
230
238
  # is documented as an array but the input is not
231
- if attributes[self.class.attribute_map[key]].is_a?(Array)
232
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
239
+ if attributes[attribute_map[key]].is_a?(Array)
240
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
233
241
  end
234
- elsif !attributes[self.class.attribute_map[key]].nil?
235
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
236
- end # or else data not found in attributes(hash), not an issue as the data can be optional
242
+ elsif !attributes[attribute_map[key]].nil?
243
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
244
+ end
237
245
  end
238
-
239
- self
246
+ new(transformed_hash)
240
247
  end
241
248
 
242
249
  # Deserializes the data based on type
243
250
  # @param string type Data type
244
251
  # @param string value Value to be deserialized
245
252
  # @return [Object] Deserialized data
246
- def _deserialize(type, value)
253
+ def self._deserialize(type, value)
247
254
  case type.to_sym
248
- when :DateTime
249
- DateTime.parse(value)
255
+ when :Time
256
+ Time.parse(value)
250
257
  when :Date
251
258
  Date.parse(value)
252
259
  when :String
@@ -276,7 +283,9 @@ module MessenteApi
276
283
  end
277
284
  end
278
285
  else # model
279
- MessenteApi.const_get(type).build_from_hash(value)
286
+ # models (e.g. Pet) or oneOf
287
+ klass = MessenteApi.const_get(type)
288
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
280
289
  end
281
290
  end
282
291
 
@@ -302,7 +311,7 @@ module MessenteApi
302
311
  is_nullable = self.class.openapi_nullable.include?(attr)
303
312
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
304
313
  end
305
-
314
+
306
315
  hash[param] = _to_hash(value)
307
316
  end
308
317
  hash
@@ -325,5 +334,7 @@ module MessenteApi
325
334
  value
326
335
  end
327
336
  end
337
+
328
338
  end
339
+
329
340
  end
@@ -3,14 +3,15 @@
3
3
 
4
4
  #[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram 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: 1.4.0
6
+ The version of the OpenAPI document: 2.0.0
7
7
  Contact: messente@messente.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module MessenteApi
16
17
  # A container for number lookup response
@@ -29,6 +30,11 @@ module MessenteApi
29
30
  }
30
31
  end
31
32
 
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
32
38
  # Attribute type mapping.
33
39
  def self.openapi_types
34
40
  {
@@ -60,18 +66,23 @@ module MessenteApi
60
66
 
61
67
  if attributes.key?(:'request_id')
62
68
  self.request_id = attributes[:'request_id']
69
+ else
70
+ self.request_id = nil
63
71
  end
64
72
 
65
73
  if attributes.key?(:'result')
66
74
  if (value = attributes[:'result']).is_a?(Array)
67
75
  self.result = value
68
76
  end
77
+ else
78
+ self.result = nil
69
79
  end
70
80
  end
71
81
 
72
82
  # Show invalid properties with the reasons. Usually used together with valid?
73
83
  # @return Array for valid properties with the reasons
74
84
  def list_invalid_properties
85
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
75
86
  invalid_properties = Array.new
76
87
  if @request_id.nil?
77
88
  invalid_properties.push('invalid value for "request_id", request_id cannot be nil.')
@@ -87,6 +98,7 @@ module MessenteApi
87
98
  # Check to see if the all the properties in the model are valid
88
99
  # @return true if the model is valid
89
100
  def valid?
101
+ warn '[DEPRECATED] the `valid?` method is obsolete'
90
102
  return false if @request_id.nil?
91
103
  return false if @result.nil?
92
104
  true
@@ -117,37 +129,33 @@ module MessenteApi
117
129
  # @param [Hash] attributes Model attributes in the form of hash
118
130
  # @return [Object] Returns the model itself
119
131
  def self.build_from_hash(attributes)
120
- new.build_from_hash(attributes)
121
- end
122
-
123
- # Builds the object from hash
124
- # @param [Hash] attributes Model attributes in the form of hash
125
- # @return [Object] Returns the model itself
126
- def build_from_hash(attributes)
127
132
  return nil unless attributes.is_a?(Hash)
128
- self.class.openapi_types.each_pair do |key, type|
129
- if type =~ /\AArray<(.*)>/i
133
+ attributes = attributes.transform_keys(&:to_sym)
134
+ transformed_hash = {}
135
+ openapi_types.each_pair do |key, type|
136
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
137
+ transformed_hash["#{key}"] = nil
138
+ elsif type =~ /\AArray<(.*)>/i
130
139
  # check to ensure the input is an array given that the attribute
131
140
  # is documented as an array but the input is not
132
- if attributes[self.class.attribute_map[key]].is_a?(Array)
133
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
141
+ if attributes[attribute_map[key]].is_a?(Array)
142
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
134
143
  end
135
- elsif !attributes[self.class.attribute_map[key]].nil?
136
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
137
- end # or else data not found in attributes(hash), not an issue as the data can be optional
144
+ elsif !attributes[attribute_map[key]].nil?
145
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
146
+ end
138
147
  end
139
-
140
- self
148
+ new(transformed_hash)
141
149
  end
142
150
 
143
151
  # Deserializes the data based on type
144
152
  # @param string type Data type
145
153
  # @param string value Value to be deserialized
146
154
  # @return [Object] Deserialized data
147
- def _deserialize(type, value)
155
+ def self._deserialize(type, value)
148
156
  case type.to_sym
149
- when :DateTime
150
- DateTime.parse(value)
157
+ when :Time
158
+ Time.parse(value)
151
159
  when :Date
152
160
  Date.parse(value)
153
161
  when :String
@@ -177,7 +185,9 @@ module MessenteApi
177
185
  end
178
186
  end
179
187
  else # model
180
- MessenteApi.const_get(type).build_from_hash(value)
188
+ # models (e.g. Pet) or oneOf
189
+ klass = MessenteApi.const_get(type)
190
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
181
191
  end
182
192
  end
183
193
 
@@ -203,7 +213,7 @@ module MessenteApi
203
213
  is_nullable = self.class.openapi_nullable.include?(attr)
204
214
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
205
215
  end
206
-
216
+
207
217
  hash[param] = _to_hash(value)
208
218
  end
209
219
  hash
@@ -226,5 +236,7 @@ module MessenteApi
226
236
  value
227
237
  end
228
238
  end
239
+
229
240
  end
241
+
230
242
  end
@@ -3,14 +3,15 @@
3
3
 
4
4
  #[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram 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: 1.4.0
6
+ The version of the OpenAPI document: 2.0.0
7
7
  Contact: messente@messente.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module MessenteApi
16
17
  # Telegram message content
@@ -71,6 +72,11 @@ module MessenteApi
71
72
  }
72
73
  end
73
74
 
75
+ # Returns all the JSON keys this model knows about
76
+ def self.acceptable_attributes
77
+ attribute_map.values
78
+ end
79
+
74
80
  # Attribute type mapping.
75
81
  def self.openapi_types
76
82
  {
@@ -139,6 +145,7 @@ module MessenteApi
139
145
  # Show invalid properties with the reasons. Usually used together with valid?
140
146
  # @return Array for valid properties with the reasons
141
147
  def list_invalid_properties
148
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
142
149
  invalid_properties = Array.new
143
150
  invalid_properties
144
151
  end
@@ -146,6 +153,7 @@ module MessenteApi
146
153
  # Check to see if the all the properties in the model are valid
147
154
  # @return true if the model is valid
148
155
  def valid?
156
+ warn '[DEPRECATED] the `valid?` method is obsolete'
149
157
  channel_validator = EnumAttributeValidator.new('String', ["telegram"])
150
158
  return false unless channel_validator.valid?(@channel)
151
159
  true
@@ -191,37 +199,33 @@ module MessenteApi
191
199
  # @param [Hash] attributes Model attributes in the form of hash
192
200
  # @return [Object] Returns the model itself
193
201
  def self.build_from_hash(attributes)
194
- new.build_from_hash(attributes)
195
- end
196
-
197
- # Builds the object from hash
198
- # @param [Hash] attributes Model attributes in the form of hash
199
- # @return [Object] Returns the model itself
200
- def build_from_hash(attributes)
201
202
  return nil unless attributes.is_a?(Hash)
202
- self.class.openapi_types.each_pair do |key, type|
203
- if type =~ /\AArray<(.*)>/i
203
+ attributes = attributes.transform_keys(&:to_sym)
204
+ transformed_hash = {}
205
+ openapi_types.each_pair do |key, type|
206
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
207
+ transformed_hash["#{key}"] = nil
208
+ elsif type =~ /\AArray<(.*)>/i
204
209
  # check to ensure the input is an array given that the attribute
205
210
  # is documented as an array but the input is not
206
- if attributes[self.class.attribute_map[key]].is_a?(Array)
207
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
211
+ if attributes[attribute_map[key]].is_a?(Array)
212
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
208
213
  end
209
- elsif !attributes[self.class.attribute_map[key]].nil?
210
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
211
- end # or else data not found in attributes(hash), not an issue as the data can be optional
214
+ elsif !attributes[attribute_map[key]].nil?
215
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
216
+ end
212
217
  end
213
-
214
- self
218
+ new(transformed_hash)
215
219
  end
216
220
 
217
221
  # Deserializes the data based on type
218
222
  # @param string type Data type
219
223
  # @param string value Value to be deserialized
220
224
  # @return [Object] Deserialized data
221
- def _deserialize(type, value)
225
+ def self._deserialize(type, value)
222
226
  case type.to_sym
223
- when :DateTime
224
- DateTime.parse(value)
227
+ when :Time
228
+ Time.parse(value)
225
229
  when :Date
226
230
  Date.parse(value)
227
231
  when :String
@@ -251,7 +255,9 @@ module MessenteApi
251
255
  end
252
256
  end
253
257
  else # model
254
- MessenteApi.const_get(type).build_from_hash(value)
258
+ # models (e.g. Pet) or oneOf
259
+ klass = MessenteApi.const_get(type)
260
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
255
261
  end
256
262
  end
257
263
 
@@ -277,7 +283,7 @@ module MessenteApi
277
283
  is_nullable = self.class.openapi_nullable.include?(attr)
278
284
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
279
285
  end
280
-
286
+
281
287
  hash[param] = _to_hash(value)
282
288
  end
283
289
  hash
@@ -300,5 +306,7 @@ module MessenteApi
300
306
  value
301
307
  end
302
308
  end
309
+
303
310
  end
311
+
304
312
  end
@@ -3,14 +3,15 @@
3
3
 
4
4
  #[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram 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: 1.4.0
6
+ The version of the OpenAPI document: 2.0.0
7
7
  Contact: messente@messente.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module MessenteApi
16
17
  class TextStore
@@ -18,6 +19,10 @@ module MessenteApi
18
19
  PLAINTEXT = "plaintext".freeze
19
20
  SHA256 = "sha256".freeze
20
21
 
22
+ def self.all_vars
23
+ @all_vars ||= [NOSTORE, PLAINTEXT, SHA256].freeze
24
+ end
25
+
21
26
  # Builds the enum from string
22
27
  # @param [String] The enum value in the form of the string
23
28
  # @return [String] The enum value
@@ -29,9 +34,8 @@ module MessenteApi
29
34
  # @param [String] The enum value in the form of the string
30
35
  # @return [String] The enum value
31
36
  def build_from_hash(value)
32
- constantValues = TextStore.constants.select { |c| TextStore::const_get(c) == value }
33
- raise "Invalid ENUM value #{value} for class #TextStore" if constantValues.empty?
34
- value
37
+ return value if TextStore.all_vars.include?(value)
38
+ raise "Invalid ENUM value #{value} for class #TextStore"
35
39
  end
36
40
  end
37
41
  end