messente_api 1.4.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) 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 +22 -19
  61. data/docs/WhatsApp.md +16 -19
  62. data/docs/WhatsAppComponent.md +24 -0
  63. data/docs/WhatsAppCurrency.md +22 -0
  64. data/docs/WhatsAppDatetime.md +18 -0
  65. data/docs/WhatsAppLanguage.md +20 -0
  66. data/docs/WhatsAppMedia.md +24 -0
  67. data/docs/WhatsAppParameter.md +30 -0
  68. data/docs/WhatsAppTemplate.md +22 -0
  69. data/git_push.sh +3 -4
  70. data/lib/messente_api/api/blacklist_api.rb +22 -15
  71. data/lib/messente_api/api/bulk_messaging_api.rb +88 -0
  72. data/lib/messente_api/api/contacts_api.rb +42 -28
  73. data/lib/messente_api/api/delivery_report_api.rb +6 -5
  74. data/lib/messente_api/api/groups_api.rb +30 -19
  75. data/lib/messente_api/api/number_lookup_api.rb +10 -6
  76. data/lib/messente_api/api/omnimessage_api.rb +14 -9
  77. data/lib/messente_api/api/statistics_api.rb +10 -6
  78. data/lib/messente_api/api_client.rb +72 -66
  79. data/lib/messente_api/api_error.rb +3 -2
  80. data/lib/messente_api/configuration.rb +64 -14
  81. data/lib/messente_api/models/{whats_app_audio.rb → bulk_omni_message_create_success_response.rb} +50 -38
  82. data/lib/messente_api/models/bulk_omni_message_create_success_response_messages_inner.rb +105 -0
  83. data/lib/messente_api/models/{whats_app_text.rb → bulk_omnimessage.rb} +49 -49
  84. data/lib/messente_api/models/channel.rb +9 -5
  85. data/lib/messente_api/models/contact_envelope.rb +31 -23
  86. data/lib/messente_api/models/contact_fields.rb +33 -23
  87. data/lib/messente_api/models/contact_list_envelope.rb +41 -23
  88. data/lib/messente_api/models/contact_response_fields.rb +31 -23
  89. data/lib/messente_api/models/contact_update_fields.rb +31 -23
  90. data/lib/messente_api/models/delivery_report_response.rb +37 -23
  91. data/lib/messente_api/models/delivery_result.rb +77 -27
  92. data/lib/messente_api/models/error_code_omnichannel.rb +9 -5
  93. data/lib/messente_api/models/error_code_omnichannel_machine.rb +9 -5
  94. data/lib/messente_api/models/error_code_phonebook.rb +9 -5
  95. data/lib/messente_api/models/error_code_statistics.rb +9 -5
  96. data/lib/messente_api/models/error_item_number_lookup.rb +33 -23
  97. data/lib/messente_api/models/error_item_number_lookup_error.rb +35 -23
  98. data/lib/messente_api/models/error_item_omnichannel.rb +61 -23
  99. data/lib/messente_api/models/error_item_phonebook.rb +59 -23
  100. data/lib/messente_api/models/error_item_statistics.rb +59 -23
  101. data/lib/messente_api/models/error_number_lookup.rb +33 -23
  102. data/lib/messente_api/models/error_omnichannel.rb +33 -23
  103. data/lib/messente_api/models/error_phonebook.rb +33 -23
  104. data/lib/messente_api/models/error_statistics.rb +33 -23
  105. data/lib/messente_api/models/error_title_omnichannel.rb +9 -5
  106. data/lib/messente_api/models/error_title_phonebook.rb +9 -5
  107. data/lib/messente_api/models/fetch_blacklist_success.rb +41 -23
  108. data/lib/messente_api/models/group_envelope.rb +31 -23
  109. data/lib/messente_api/models/group_list_envelope.rb +41 -23
  110. data/lib/messente_api/models/group_name.rb +33 -23
  111. data/lib/messente_api/models/group_response_fields.rb +37 -23
  112. data/lib/messente_api/models/message_result.rb +59 -23
  113. data/lib/messente_api/models/mobile_network.rb +31 -23
  114. data/lib/messente_api/models/number_to_blacklist.rb +33 -23
  115. data/lib/messente_api/models/numbers_to_investigate.rb +62 -24
  116. data/lib/messente_api/models/omni_message_create_success_response.rb +37 -23
  117. data/lib/messente_api/models/omnimessage.rb +59 -25
  118. data/lib/messente_api/models/omnimessage_messages_inner.rb +107 -0
  119. data/lib/messente_api/models/price_info.rb +257 -0
  120. data/lib/messente_api/models/priority.rb +9 -5
  121. data/lib/messente_api/models/sms.rb +45 -25
  122. data/lib/messente_api/models/statistics_report.rb +37 -23
  123. data/lib/messente_api/models/statistics_report_settings.rb +35 -23
  124. data/lib/messente_api/models/statistics_report_success.rb +33 -23
  125. data/lib/messente_api/models/status.rb +9 -5
  126. data/lib/messente_api/models/sync_number_lookup_result.rb +35 -24
  127. data/lib/messente_api/models/sync_number_lookup_success.rb +35 -23
  128. data/lib/messente_api/models/telegram.rb +31 -23
  129. data/lib/messente_api/models/text_store.rb +9 -5
  130. data/lib/messente_api/models/viber.rb +43 -25
  131. data/lib/messente_api/models/whats_app.rb +45 -54
  132. data/lib/messente_api/models/whats_app_component.rb +255 -0
  133. data/lib/messente_api/models/whats_app_currency.rb +257 -0
  134. data/lib/messente_api/models/{whats_app_document.rb → whats_app_datetime.rb} +48 -48
  135. data/lib/messente_api/models/{whats_app_image.rb → whats_app_language.rb} +55 -45
  136. data/lib/messente_api/models/whats_app_media.rb +246 -0
  137. data/lib/messente_api/models/whats_app_parameter.rb +278 -0
  138. data/lib/messente_api/models/whats_app_template.rb +251 -0
  139. data/lib/messente_api/version.rb +3 -3
  140. data/lib/messente_api.rb +15 -6
  141. data/messente_api.gemspec +5 -5
  142. data/spec/spec_helper.rb +2 -2
  143. metadata +33 -39
  144. data/docs/WhatsAppAudio.md +0 -17
  145. data/docs/WhatsAppDocument.md +0 -19
  146. data/docs/WhatsAppImage.md +0 -19
  147. data/docs/WhatsAppText.md +0 -19
  148. data/spec/api_client_spec.rb +0 -226
  149. 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
  # A container for errors
@@ -25,6 +26,11 @@ module MessenteApi
25
26
  }
26
27
  end
27
28
 
29
+ # Returns all the JSON keys this model knows about
30
+ def self.acceptable_attributes
31
+ attribute_map.values
32
+ end
33
+
28
34
  # Attribute type mapping.
29
35
  def self.openapi_types
30
36
  {
@@ -57,12 +63,15 @@ module MessenteApi
57
63
  if (value = attributes[:'errors']).is_a?(Array)
58
64
  self.errors = value
59
65
  end
66
+ else
67
+ self.errors = nil
60
68
  end
61
69
  end
62
70
 
63
71
  # Show invalid properties with the reasons. Usually used together with valid?
64
72
  # @return Array for valid properties with the reasons
65
73
  def list_invalid_properties
74
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
66
75
  invalid_properties = Array.new
67
76
  if @errors.nil?
68
77
  invalid_properties.push('invalid value for "errors", errors cannot be nil.')
@@ -74,6 +83,7 @@ module MessenteApi
74
83
  # Check to see if the all the properties in the model are valid
75
84
  # @return true if the model is valid
76
85
  def valid?
86
+ warn '[DEPRECATED] the `valid?` method is obsolete'
77
87
  return false if @errors.nil?
78
88
  true
79
89
  end
@@ -102,37 +112,33 @@ module MessenteApi
102
112
  # @param [Hash] attributes Model attributes in the form of hash
103
113
  # @return [Object] Returns the model itself
104
114
  def self.build_from_hash(attributes)
105
- new.build_from_hash(attributes)
106
- end
107
-
108
- # Builds the object from hash
109
- # @param [Hash] attributes Model attributes in the form of hash
110
- # @return [Object] Returns the model itself
111
- def build_from_hash(attributes)
112
115
  return nil unless attributes.is_a?(Hash)
113
- self.class.openapi_types.each_pair do |key, type|
114
- if type =~ /\AArray<(.*)>/i
116
+ attributes = attributes.transform_keys(&:to_sym)
117
+ transformed_hash = {}
118
+ openapi_types.each_pair do |key, type|
119
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
120
+ transformed_hash["#{key}"] = nil
121
+ elsif type =~ /\AArray<(.*)>/i
115
122
  # check to ensure the input is an array given that the attribute
116
123
  # is documented as an array but the input is not
117
- if attributes[self.class.attribute_map[key]].is_a?(Array)
118
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
124
+ if attributes[attribute_map[key]].is_a?(Array)
125
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
119
126
  end
120
- elsif !attributes[self.class.attribute_map[key]].nil?
121
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
122
- end # or else data not found in attributes(hash), not an issue as the data can be optional
127
+ elsif !attributes[attribute_map[key]].nil?
128
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
129
+ end
123
130
  end
124
-
125
- self
131
+ new(transformed_hash)
126
132
  end
127
133
 
128
134
  # Deserializes the data based on type
129
135
  # @param string type Data type
130
136
  # @param string value Value to be deserialized
131
137
  # @return [Object] Deserialized data
132
- def _deserialize(type, value)
138
+ def self._deserialize(type, value)
133
139
  case type.to_sym
134
- when :DateTime
135
- DateTime.parse(value)
140
+ when :Time
141
+ Time.parse(value)
136
142
  when :Date
137
143
  Date.parse(value)
138
144
  when :String
@@ -162,7 +168,9 @@ module MessenteApi
162
168
  end
163
169
  end
164
170
  else # model
165
- MessenteApi.const_get(type).build_from_hash(value)
171
+ # models (e.g. Pet) or oneOf
172
+ klass = MessenteApi.const_get(type)
173
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
166
174
  end
167
175
  end
168
176
 
@@ -188,7 +196,7 @@ module MessenteApi
188
196
  is_nullable = self.class.openapi_nullable.include?(attr)
189
197
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
190
198
  end
191
-
199
+
192
200
  hash[param] = _to_hash(value)
193
201
  end
194
202
  hash
@@ -211,5 +219,7 @@ module MessenteApi
211
219
  value
212
220
  end
213
221
  end
222
+
214
223
  end
224
+
215
225
  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 errors
@@ -25,6 +26,11 @@ module MessenteApi
25
26
  }
26
27
  end
27
28
 
29
+ # Returns all the JSON keys this model knows about
30
+ def self.acceptable_attributes
31
+ attribute_map.values
32
+ end
33
+
28
34
  # Attribute type mapping.
29
35
  def self.openapi_types
30
36
  {
@@ -57,12 +63,15 @@ module MessenteApi
57
63
  if (value = attributes[:'errors']).is_a?(Array)
58
64
  self.errors = value
59
65
  end
66
+ else
67
+ self.errors = nil
60
68
  end
61
69
  end
62
70
 
63
71
  # Show invalid properties with the reasons. Usually used together with valid?
64
72
  # @return Array for valid properties with the reasons
65
73
  def list_invalid_properties
74
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
66
75
  invalid_properties = Array.new
67
76
  if @errors.nil?
68
77
  invalid_properties.push('invalid value for "errors", errors cannot be nil.')
@@ -74,6 +83,7 @@ module MessenteApi
74
83
  # Check to see if the all the properties in the model are valid
75
84
  # @return true if the model is valid
76
85
  def valid?
86
+ warn '[DEPRECATED] the `valid?` method is obsolete'
77
87
  return false if @errors.nil?
78
88
  true
79
89
  end
@@ -102,37 +112,33 @@ module MessenteApi
102
112
  # @param [Hash] attributes Model attributes in the form of hash
103
113
  # @return [Object] Returns the model itself
104
114
  def self.build_from_hash(attributes)
105
- new.build_from_hash(attributes)
106
- end
107
-
108
- # Builds the object from hash
109
- # @param [Hash] attributes Model attributes in the form of hash
110
- # @return [Object] Returns the model itself
111
- def build_from_hash(attributes)
112
115
  return nil unless attributes.is_a?(Hash)
113
- self.class.openapi_types.each_pair do |key, type|
114
- if type =~ /\AArray<(.*)>/i
116
+ attributes = attributes.transform_keys(&:to_sym)
117
+ transformed_hash = {}
118
+ openapi_types.each_pair do |key, type|
119
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
120
+ transformed_hash["#{key}"] = nil
121
+ elsif type =~ /\AArray<(.*)>/i
115
122
  # check to ensure the input is an array given that the attribute
116
123
  # is documented as an array but the input is not
117
- if attributes[self.class.attribute_map[key]].is_a?(Array)
118
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
124
+ if attributes[attribute_map[key]].is_a?(Array)
125
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
119
126
  end
120
- elsif !attributes[self.class.attribute_map[key]].nil?
121
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
122
- end # or else data not found in attributes(hash), not an issue as the data can be optional
127
+ elsif !attributes[attribute_map[key]].nil?
128
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
129
+ end
123
130
  end
124
-
125
- self
131
+ new(transformed_hash)
126
132
  end
127
133
 
128
134
  # Deserializes the data based on type
129
135
  # @param string type Data type
130
136
  # @param string value Value to be deserialized
131
137
  # @return [Object] Deserialized data
132
- def _deserialize(type, value)
138
+ def self._deserialize(type, value)
133
139
  case type.to_sym
134
- when :DateTime
135
- DateTime.parse(value)
140
+ when :Time
141
+ Time.parse(value)
136
142
  when :Date
137
143
  Date.parse(value)
138
144
  when :String
@@ -162,7 +168,9 @@ module MessenteApi
162
168
  end
163
169
  end
164
170
  else # model
165
- MessenteApi.const_get(type).build_from_hash(value)
171
+ # models (e.g. Pet) or oneOf
172
+ klass = MessenteApi.const_get(type)
173
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
166
174
  end
167
175
  end
168
176
 
@@ -188,7 +196,7 @@ module MessenteApi
188
196
  is_nullable = self.class.openapi_nullable.include?(attr)
189
197
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
190
198
  end
191
-
199
+
192
200
  hash[param] = _to_hash(value)
193
201
  end
194
202
  hash
@@ -211,5 +219,7 @@ module MessenteApi
211
219
  value
212
220
  end
213
221
  end
222
+
214
223
  end
224
+
215
225
  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 errors
@@ -25,6 +26,11 @@ module MessenteApi
25
26
  }
26
27
  end
27
28
 
29
+ # Returns all the JSON keys this model knows about
30
+ def self.acceptable_attributes
31
+ attribute_map.values
32
+ end
33
+
28
34
  # Attribute type mapping.
29
35
  def self.openapi_types
30
36
  {
@@ -57,12 +63,15 @@ module MessenteApi
57
63
  if (value = attributes[:'errors']).is_a?(Array)
58
64
  self.errors = value
59
65
  end
66
+ else
67
+ self.errors = nil
60
68
  end
61
69
  end
62
70
 
63
71
  # Show invalid properties with the reasons. Usually used together with valid?
64
72
  # @return Array for valid properties with the reasons
65
73
  def list_invalid_properties
74
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
66
75
  invalid_properties = Array.new
67
76
  if @errors.nil?
68
77
  invalid_properties.push('invalid value for "errors", errors cannot be nil.')
@@ -74,6 +83,7 @@ module MessenteApi
74
83
  # Check to see if the all the properties in the model are valid
75
84
  # @return true if the model is valid
76
85
  def valid?
86
+ warn '[DEPRECATED] the `valid?` method is obsolete'
77
87
  return false if @errors.nil?
78
88
  true
79
89
  end
@@ -102,37 +112,33 @@ module MessenteApi
102
112
  # @param [Hash] attributes Model attributes in the form of hash
103
113
  # @return [Object] Returns the model itself
104
114
  def self.build_from_hash(attributes)
105
- new.build_from_hash(attributes)
106
- end
107
-
108
- # Builds the object from hash
109
- # @param [Hash] attributes Model attributes in the form of hash
110
- # @return [Object] Returns the model itself
111
- def build_from_hash(attributes)
112
115
  return nil unless attributes.is_a?(Hash)
113
- self.class.openapi_types.each_pair do |key, type|
114
- if type =~ /\AArray<(.*)>/i
116
+ attributes = attributes.transform_keys(&:to_sym)
117
+ transformed_hash = {}
118
+ openapi_types.each_pair do |key, type|
119
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
120
+ transformed_hash["#{key}"] = nil
121
+ elsif type =~ /\AArray<(.*)>/i
115
122
  # check to ensure the input is an array given that the attribute
116
123
  # is documented as an array but the input is not
117
- if attributes[self.class.attribute_map[key]].is_a?(Array)
118
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
124
+ if attributes[attribute_map[key]].is_a?(Array)
125
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
119
126
  end
120
- elsif !attributes[self.class.attribute_map[key]].nil?
121
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
122
- end # or else data not found in attributes(hash), not an issue as the data can be optional
127
+ elsif !attributes[attribute_map[key]].nil?
128
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
129
+ end
123
130
  end
124
-
125
- self
131
+ new(transformed_hash)
126
132
  end
127
133
 
128
134
  # Deserializes the data based on type
129
135
  # @param string type Data type
130
136
  # @param string value Value to be deserialized
131
137
  # @return [Object] Deserialized data
132
- def _deserialize(type, value)
138
+ def self._deserialize(type, value)
133
139
  case type.to_sym
134
- when :DateTime
135
- DateTime.parse(value)
140
+ when :Time
141
+ Time.parse(value)
136
142
  when :Date
137
143
  Date.parse(value)
138
144
  when :String
@@ -162,7 +168,9 @@ module MessenteApi
162
168
  end
163
169
  end
164
170
  else # model
165
- MessenteApi.const_get(type).build_from_hash(value)
171
+ # models (e.g. Pet) or oneOf
172
+ klass = MessenteApi.const_get(type)
173
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
166
174
  end
167
175
  end
168
176
 
@@ -188,7 +196,7 @@ module MessenteApi
188
196
  is_nullable = self.class.openapi_nullable.include?(attr)
189
197
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
190
198
  end
191
-
199
+
192
200
  hash[param] = _to_hash(value)
193
201
  end
194
202
  hash
@@ -211,5 +219,7 @@ module MessenteApi
211
219
  value
212
220
  end
213
221
  end
222
+
214
223
  end
224
+
215
225
  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 ErrorTitleOmnichannel
@@ -22,6 +23,10 @@ module MessenteApi
22
23
  MISSING_DATA = "Missing data".freeze
23
24
  METHOD_NOT_ALLOWED = "Method not allowed".freeze
24
25
 
26
+ def self.all_vars
27
+ @all_vars ||= [NOT_FOUND, FORBIDDEN, UNAUTHORIZED, INVALID_DATA, INTERNAL_SERVER_ERROR, MISSING_DATA, METHOD_NOT_ALLOWED].freeze
28
+ end
29
+
25
30
  # Builds the enum from string
26
31
  # @param [String] The enum value in the form of the string
27
32
  # @return [String] The enum value
@@ -33,9 +38,8 @@ module MessenteApi
33
38
  # @param [String] The enum value in the form of the string
34
39
  # @return [String] The enum value
35
40
  def build_from_hash(value)
36
- constantValues = ErrorTitleOmnichannel.constants.select { |c| ErrorTitleOmnichannel::const_get(c) == value }
37
- raise "Invalid ENUM value #{value} for class #ErrorTitleOmnichannel" if constantValues.empty?
38
- value
41
+ return value if ErrorTitleOmnichannel.all_vars.include?(value)
42
+ raise "Invalid ENUM value #{value} for class #ErrorTitleOmnichannel"
39
43
  end
40
44
  end
41
45
  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 ErrorTitlePhonebook
@@ -21,6 +22,10 @@ module MessenteApi
21
22
  CLIENT_ERROR = "Client error".freeze
22
23
  GENERAL_ERROR = "General error".freeze
23
24
 
25
+ def self.all_vars
26
+ @all_vars ||= [INVALID_DATA, UNAUTHORIZED, MISSING_RESOURCE, CONFLICT, CLIENT_ERROR, GENERAL_ERROR].freeze
27
+ end
28
+
24
29
  # Builds the enum from string
25
30
  # @param [String] The enum value in the form of the string
26
31
  # @return [String] The enum value
@@ -32,9 +37,8 @@ module MessenteApi
32
37
  # @param [String] The enum value in the form of the string
33
38
  # @return [String] The enum value
34
39
  def build_from_hash(value)
35
- constantValues = ErrorTitlePhonebook.constants.select { |c| ErrorTitlePhonebook::const_get(c) == value }
36
- raise "Invalid ENUM value #{value} for class #ErrorTitlePhonebook" if constantValues.empty?
37
- value
40
+ return value if ErrorTitlePhonebook.all_vars.include?(value)
41
+ raise "Invalid ENUM value #{value} for class #ErrorTitlePhonebook"
38
42
  end
39
43
  end
40
44
  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 blacklisted numbers
@@ -25,6 +26,11 @@ module MessenteApi
25
26
  }
26
27
  end
27
28
 
29
+ # Returns all the JSON keys this model knows about
30
+ def self.acceptable_attributes
31
+ attribute_map.values
32
+ end
33
+
28
34
  # Attribute type mapping.
29
35
  def self.openapi_types
30
36
  {
@@ -63,6 +69,7 @@ module MessenteApi
63
69
  # Show invalid properties with the reasons. Usually used together with valid?
64
70
  # @return Array for valid properties with the reasons
65
71
  def list_invalid_properties
72
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
66
73
  invalid_properties = Array.new
67
74
  invalid_properties
68
75
  end
@@ -70,9 +77,20 @@ module MessenteApi
70
77
  # Check to see if the all the properties in the model are valid
71
78
  # @return true if the model is valid
72
79
  def valid?
80
+ warn '[DEPRECATED] the `valid?` method is obsolete'
73
81
  true
74
82
  end
75
83
 
84
+ # Custom attribute writer method with validation
85
+ # @param [Object] phone_numbers Value to be assigned
86
+ def phone_numbers=(phone_numbers)
87
+ if phone_numbers.nil?
88
+ fail ArgumentError, 'phone_numbers cannot be nil'
89
+ end
90
+
91
+ @phone_numbers = phone_numbers
92
+ end
93
+
76
94
  # Checks equality by comparing each attribute.
77
95
  # @param [Object] Object to be compared
78
96
  def ==(o)
@@ -97,37 +115,33 @@ module MessenteApi
97
115
  # @param [Hash] attributes Model attributes in the form of hash
98
116
  # @return [Object] Returns the model itself
99
117
  def self.build_from_hash(attributes)
100
- new.build_from_hash(attributes)
101
- end
102
-
103
- # Builds the object from hash
104
- # @param [Hash] attributes Model attributes in the form of hash
105
- # @return [Object] Returns the model itself
106
- def build_from_hash(attributes)
107
118
  return nil unless attributes.is_a?(Hash)
108
- self.class.openapi_types.each_pair do |key, type|
109
- if type =~ /\AArray<(.*)>/i
119
+ attributes = attributes.transform_keys(&:to_sym)
120
+ transformed_hash = {}
121
+ openapi_types.each_pair do |key, type|
122
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
123
+ transformed_hash["#{key}"] = nil
124
+ elsif type =~ /\AArray<(.*)>/i
110
125
  # check to ensure the input is an array given that the attribute
111
126
  # is documented as an array but the input is not
112
- if attributes[self.class.attribute_map[key]].is_a?(Array)
113
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
127
+ if attributes[attribute_map[key]].is_a?(Array)
128
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
114
129
  end
115
- elsif !attributes[self.class.attribute_map[key]].nil?
116
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
117
- end # or else data not found in attributes(hash), not an issue as the data can be optional
130
+ elsif !attributes[attribute_map[key]].nil?
131
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
132
+ end
118
133
  end
119
-
120
- self
134
+ new(transformed_hash)
121
135
  end
122
136
 
123
137
  # Deserializes the data based on type
124
138
  # @param string type Data type
125
139
  # @param string value Value to be deserialized
126
140
  # @return [Object] Deserialized data
127
- def _deserialize(type, value)
141
+ def self._deserialize(type, value)
128
142
  case type.to_sym
129
- when :DateTime
130
- DateTime.parse(value)
143
+ when :Time
144
+ Time.parse(value)
131
145
  when :Date
132
146
  Date.parse(value)
133
147
  when :String
@@ -157,7 +171,9 @@ module MessenteApi
157
171
  end
158
172
  end
159
173
  else # model
160
- MessenteApi.const_get(type).build_from_hash(value)
174
+ # models (e.g. Pet) or oneOf
175
+ klass = MessenteApi.const_get(type)
176
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
161
177
  end
162
178
  end
163
179
 
@@ -183,7 +199,7 @@ module MessenteApi
183
199
  is_nullable = self.class.openapi_nullable.include?(attr)
184
200
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
185
201
  end
186
-
202
+
187
203
  hash[param] = _to_hash(value)
188
204
  end
189
205
  hash
@@ -206,5 +222,7 @@ module MessenteApi
206
222
  value
207
223
  end
208
224
  end
225
+
209
226
  end
227
+
210
228
  end