messente_api 1.1.0 → 1.3.1

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 (91) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +11 -3
  4. data/docs/ContactEnvelope.md +1 -1
  5. data/docs/ContactListEnvelope.md +1 -1
  6. data/docs/ContactResponseFields.md +37 -0
  7. data/docs/ErrorCodeStatistics.md +16 -0
  8. data/docs/ErrorItemNumberLookup.md +17 -0
  9. data/docs/ErrorItemNumberLookupError.md +19 -0
  10. data/docs/ErrorItemStatistics.md +21 -0
  11. data/docs/ErrorNumberLookup.md +17 -0
  12. data/docs/ErrorStatistics.md +17 -0
  13. data/docs/MobileNetwork.md +25 -0
  14. data/docs/NumberLookupApi.md +60 -0
  15. data/docs/NumbersToInvestigate.md +17 -0
  16. data/docs/OmnimessageApi.md +4 -3
  17. data/docs/StatisticsApi.md +60 -0
  18. data/docs/StatisticsReport.md +21 -0
  19. data/docs/StatisticsReportSettings.md +21 -0
  20. data/docs/StatisticsReportSuccess.md +17 -0
  21. data/docs/SyncNumberLookupResult.md +33 -0
  22. data/docs/SyncNumberLookupSuccess.md +19 -0
  23. data/git_push.sh +10 -7
  24. data/lib/messente_api.rb +19 -3
  25. data/lib/messente_api/api/blacklist_api.rb +3 -3
  26. data/lib/messente_api/api/contacts_api.rb +3 -3
  27. data/lib/messente_api/api/delivery_report_api.rb +3 -3
  28. data/lib/messente_api/api/groups_api.rb +3 -3
  29. data/lib/messente_api/api/number_lookup_api.rb +84 -0
  30. data/lib/messente_api/api/omnimessage_api.rb +8 -8
  31. data/lib/messente_api/api/statistics_api.rb +84 -0
  32. data/lib/messente_api/api_client.rb +38 -36
  33. data/lib/messente_api/api_error.rb +3 -3
  34. data/lib/messente_api/configuration.rb +4 -4
  35. data/lib/messente_api/models/channel.rb +3 -3
  36. data/lib/messente_api/models/contact_envelope.rb +15 -5
  37. data/lib/messente_api/models/contact_fields.rb +24 -5
  38. data/lib/messente_api/models/contact_list_envelope.rb +15 -5
  39. data/lib/messente_api/models/contact_response_fields.rb +318 -0
  40. data/lib/messente_api/models/contact_update_fields.rb +23 -4
  41. data/lib/messente_api/models/delivery_report_response.rb +14 -4
  42. data/lib/messente_api/models/delivery_result.rb +14 -4
  43. data/lib/messente_api/models/error_code_omnichannel.rb +3 -3
  44. data/lib/messente_api/models/error_code_omnichannel_machine.rb +3 -3
  45. data/lib/messente_api/models/error_code_phonebook.rb +3 -3
  46. data/lib/messente_api/models/error_code_statistics.rb +38 -0
  47. data/lib/messente_api/models/error_item_number_lookup.rb +212 -0
  48. data/lib/messente_api/models/error_item_number_lookup_error.rb +256 -0
  49. data/lib/messente_api/models/error_item_omnichannel.rb +15 -9
  50. data/lib/messente_api/models/error_item_phonebook.rb +14 -4
  51. data/lib/messente_api/models/error_item_statistics.rb +242 -0
  52. data/lib/messente_api/models/error_number_lookup.rb +215 -0
  53. data/lib/messente_api/models/error_omnichannel.rb +14 -4
  54. data/lib/messente_api/models/error_phonebook.rb +14 -4
  55. data/lib/messente_api/models/error_statistics.rb +215 -0
  56. data/lib/messente_api/models/error_title_omnichannel.rb +3 -3
  57. data/lib/messente_api/models/error_title_phonebook.rb +3 -3
  58. data/lib/messente_api/models/fetch_blacklist_success.rb +14 -4
  59. data/lib/messente_api/models/group_envelope.rb +14 -4
  60. data/lib/messente_api/models/group_list_envelope.rb +14 -4
  61. data/lib/messente_api/models/group_name.rb +14 -4
  62. data/lib/messente_api/models/group_response_fields.rb +15 -4
  63. data/lib/messente_api/models/message_result.rb +14 -4
  64. data/lib/messente_api/models/mobile_network.rb +248 -0
  65. data/lib/messente_api/models/number_to_blacklist.rb +14 -4
  66. data/lib/messente_api/models/numbers_to_investigate.rb +215 -0
  67. data/lib/messente_api/models/omni_message_create_success_response.rb +14 -4
  68. data/lib/messente_api/models/omnimessage.rb +14 -4
  69. data/lib/messente_api/models/sms.rb +14 -4
  70. data/lib/messente_api/models/statistics_report.rb +243 -0
  71. data/lib/messente_api/models/statistics_report_settings.rb +240 -0
  72. data/lib/messente_api/models/statistics_report_success.rb +215 -0
  73. data/lib/messente_api/models/status.rb +3 -3
  74. data/lib/messente_api/models/sync_number_lookup_result.rb +329 -0
  75. data/lib/messente_api/models/sync_number_lookup_success.rb +230 -0
  76. data/lib/messente_api/models/telegram.rb +14 -4
  77. data/lib/messente_api/models/text_store.rb +3 -3
  78. data/lib/messente_api/models/viber.rb +14 -4
  79. data/lib/messente_api/models/whats_app.rb +14 -4
  80. data/lib/messente_api/models/whats_app_audio.rb +14 -4
  81. data/lib/messente_api/models/whats_app_document.rb +14 -4
  82. data/lib/messente_api/models/whats_app_image.rb +14 -4
  83. data/lib/messente_api/models/whats_app_text.rb +14 -4
  84. data/lib/messente_api/version.rb +4 -4
  85. data/messente_api-1.3.0.gem +0 -0
  86. data/messente_api.gemspec +4 -10
  87. data/spec/api_client_spec.rb +4 -4
  88. data/spec/configuration_spec.rb +3 -3
  89. data/spec/spec_helper.rb +3 -3
  90. metadata +49 -136
  91. data/Gemfile.lock +0 -79
@@ -1,12 +1,12 @@
1
1
  =begin
2
2
  #Messente API
3
3
 
4
- #[Messente](https://messente.com) is a global provider of messaging and user verification services. Use Messente API library to send and receive SMS, Viber, WhatsApp and Telegram messages, blacklist phone numbers to make sure you're not sending any unwanted messages, manage contacts and groups. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.
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.1.0
6
+ The version of the OpenAPI document: 1.3.0
7
7
  Contact: messente@messente.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.3
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -32,6 +32,12 @@ module MessenteApi
32
32
  }
33
33
  end
34
34
 
35
+ # List of attributes with nullable: true
36
+ def self.openapi_nullable
37
+ Set.new([
38
+ ])
39
+ end
40
+
35
41
  # Initializes the object
36
42
  # @param [Hash] attributes Model attributes in the form of hash
37
43
  def initialize(attributes = {})
@@ -195,7 +201,11 @@ module MessenteApi
195
201
  hash = {}
196
202
  self.class.attribute_map.each_pair do |attr, param|
197
203
  value = self.send(attr)
198
- next if value.nil?
204
+ if value.nil?
205
+ is_nullable = self.class.openapi_nullable.include?(attr)
206
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
207
+ end
208
+
199
209
  hash[param] = _to_hash(value)
200
210
  end
201
211
  hash
@@ -1,12 +1,12 @@
1
1
  =begin
2
2
  #Messente API
3
3
 
4
- #[Messente](https://messente.com) is a global provider of messaging and user verification services. Use Messente API library to send and receive SMS, Viber, WhatsApp and Telegram messages, blacklist phone numbers to make sure you're not sending any unwanted messages, manage contacts and groups. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.
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.1.0
6
+ The version of the OpenAPI document: 1.3.0
7
7
  Contact: messente@messente.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.3
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -47,6 +47,13 @@ module MessenteApi
47
47
  }
48
48
  end
49
49
 
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ :'created_on',
54
+ ])
55
+ end
56
+
50
57
  # Initializes the object
51
58
  # @param [Hash] attributes Model attributes in the form of hash
52
59
  def initialize(attributes = {})
@@ -216,7 +223,11 @@ module MessenteApi
216
223
  hash = {}
217
224
  self.class.attribute_map.each_pair do |attr, param|
218
225
  value = self.send(attr)
219
- next if value.nil?
226
+ if value.nil?
227
+ is_nullable = self.class.openapi_nullable.include?(attr)
228
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
229
+ end
230
+
220
231
  hash[param] = _to_hash(value)
221
232
  end
222
233
  hash
@@ -1,12 +1,12 @@
1
1
  =begin
2
2
  #Messente API
3
3
 
4
- #[Messente](https://messente.com) is a global provider of messaging and user verification services. Use Messente API library to send and receive SMS, Viber, WhatsApp and Telegram messages, blacklist phone numbers to make sure you're not sending any unwanted messages, manage contacts and groups. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.
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.1.0
6
+ The version of the OpenAPI document: 1.3.0
7
7
  Contact: messente@messente.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.3
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -41,6 +41,12 @@ module MessenteApi
41
41
  }
42
42
  end
43
43
 
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
44
50
  # Initializes the object
45
51
  # @param [Hash] attributes Model attributes in the form of hash
46
52
  def initialize(attributes = {})
@@ -205,7 +211,11 @@ module MessenteApi
205
211
  hash = {}
206
212
  self.class.attribute_map.each_pair do |attr, param|
207
213
  value = self.send(attr)
208
- next if value.nil?
214
+ if value.nil?
215
+ is_nullable = self.class.openapi_nullable.include?(attr)
216
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
217
+ end
218
+
209
219
  hash[param] = _to_hash(value)
210
220
  end
211
221
  hash
@@ -0,0 +1,248 @@
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, 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
+
6
+ The version of the OpenAPI document: 1.3.0
7
+ Contact: messente@messente.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module MessenteApi
16
+ # Info about the network related to the phone number
17
+ class MobileNetwork
18
+ # Mobile country and mobile network code
19
+ attr_accessor :mccmnc
20
+
21
+ # Mobile network name
22
+ attr_accessor :network_name
23
+
24
+ # Country name
25
+ attr_accessor :country_name
26
+
27
+ # Country prefix
28
+ attr_accessor :country_prefix
29
+
30
+ # Country code
31
+ attr_accessor :country_code
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'mccmnc' => :'mccmnc',
37
+ :'network_name' => :'networkName',
38
+ :'country_name' => :'countryName',
39
+ :'country_prefix' => :'countryPrefix',
40
+ :'country_code' => :'countryCode'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'mccmnc' => :'String',
48
+ :'network_name' => :'String',
49
+ :'country_name' => :'String',
50
+ :'country_prefix' => :'String',
51
+ :'country_code' => :'String'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MessenteApi::MobileNetwork` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MessenteApi::MobileNetwork`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'mccmnc')
77
+ self.mccmnc = attributes[:'mccmnc']
78
+ end
79
+
80
+ if attributes.key?(:'network_name')
81
+ self.network_name = attributes[:'network_name']
82
+ end
83
+
84
+ if attributes.key?(:'country_name')
85
+ self.country_name = attributes[:'country_name']
86
+ end
87
+
88
+ if attributes.key?(:'country_prefix')
89
+ self.country_prefix = attributes[:'country_prefix']
90
+ end
91
+
92
+ if attributes.key?(:'country_code')
93
+ self.country_code = attributes[:'country_code']
94
+ end
95
+ end
96
+
97
+ # Show invalid properties with the reasons. Usually used together with valid?
98
+ # @return Array for valid properties with the reasons
99
+ def list_invalid_properties
100
+ invalid_properties = Array.new
101
+ invalid_properties
102
+ end
103
+
104
+ # Check to see if the all the properties in the model are valid
105
+ # @return true if the model is valid
106
+ def valid?
107
+ true
108
+ end
109
+
110
+ # Checks equality by comparing each attribute.
111
+ # @param [Object] Object to be compared
112
+ def ==(o)
113
+ return true if self.equal?(o)
114
+ self.class == o.class &&
115
+ mccmnc == o.mccmnc &&
116
+ network_name == o.network_name &&
117
+ country_name == o.country_name &&
118
+ country_prefix == o.country_prefix &&
119
+ country_code == o.country_code
120
+ end
121
+
122
+ # @see the `==` method
123
+ # @param [Object] Object to be compared
124
+ def eql?(o)
125
+ self == o
126
+ end
127
+
128
+ # Calculates hash code according to all attributes.
129
+ # @return [Integer] Hash code
130
+ def hash
131
+ [mccmnc, network_name, country_name, country_prefix, country_code].hash
132
+ end
133
+
134
+ # Builds the object from hash
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ # @return [Object] Returns the model itself
137
+ def self.build_from_hash(attributes)
138
+ new.build_from_hash(attributes)
139
+ end
140
+
141
+ # Builds the object from hash
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ # @return [Object] Returns the model itself
144
+ def build_from_hash(attributes)
145
+ return nil unless attributes.is_a?(Hash)
146
+ self.class.openapi_types.each_pair do |key, type|
147
+ if type =~ /\AArray<(.*)>/i
148
+ # check to ensure the input is an array given that the attribute
149
+ # is documented as an array but the input is not
150
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
151
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
152
+ end
153
+ elsif !attributes[self.class.attribute_map[key]].nil?
154
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
155
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
156
+ end
157
+
158
+ self
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 _deserialize(type, value)
166
+ case type.to_sym
167
+ when :DateTime
168
+ DateTime.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
+ MessenteApi.const_get(type).build_from_hash(value)
199
+ end
200
+ end
201
+
202
+ # Returns the string representation of the object
203
+ # @return [String] String presentation of the object
204
+ def to_s
205
+ to_hash.to_s
206
+ end
207
+
208
+ # to_body is an alias to to_hash (backward compatibility)
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_body
211
+ to_hash
212
+ end
213
+
214
+ # Returns the object in the form of hash
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_hash
217
+ hash = {}
218
+ self.class.attribute_map.each_pair do |attr, param|
219
+ value = self.send(attr)
220
+ if value.nil?
221
+ is_nullable = self.class.openapi_nullable.include?(attr)
222
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
223
+ end
224
+
225
+ hash[param] = _to_hash(value)
226
+ end
227
+ hash
228
+ end
229
+
230
+ # Outputs non-array value in the form of hash
231
+ # For object, use to_hash. Otherwise, just return the value
232
+ # @param [Object] value Any valid value
233
+ # @return [Hash] Returns the value in the form of hash
234
+ def _to_hash(value)
235
+ if value.is_a?(Array)
236
+ value.compact.map { |v| _to_hash(v) }
237
+ elsif value.is_a?(Hash)
238
+ {}.tap do |hash|
239
+ value.each { |k, v| hash[k] = _to_hash(v) }
240
+ end
241
+ elsif value.respond_to? :to_hash
242
+ value.to_hash
243
+ else
244
+ value
245
+ end
246
+ end
247
+ end
248
+ end
@@ -1,12 +1,12 @@
1
1
  =begin
2
2
  #Messente API
3
3
 
4
- #[Messente](https://messente.com) is a global provider of messaging and user verification services. Use Messente API library to send and receive SMS, Viber, WhatsApp and Telegram messages, blacklist phone numbers to make sure you're not sending any unwanted messages, manage contacts and groups. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.
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.1.0
6
+ The version of the OpenAPI document: 1.3.0
7
7
  Contact: messente@messente.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.3
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -32,6 +32,12 @@ module MessenteApi
32
32
  }
33
33
  end
34
34
 
35
+ # List of attributes with nullable: true
36
+ def self.openapi_nullable
37
+ Set.new([
38
+ ])
39
+ end
40
+
35
41
  # Initializes the object
36
42
  # @param [Hash] attributes Model attributes in the form of hash
37
43
  def initialize(attributes = {})
@@ -176,7 +182,11 @@ module MessenteApi
176
182
  hash = {}
177
183
  self.class.attribute_map.each_pair do |attr, param|
178
184
  value = self.send(attr)
179
- next if value.nil?
185
+ if value.nil?
186
+ is_nullable = self.class.openapi_nullable.include?(attr)
187
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
188
+ end
189
+
180
190
  hash[param] = _to_hash(value)
181
191
  end
182
192
  hash
@@ -0,0 +1,215 @@
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, 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
+
6
+ The version of the OpenAPI document: 1.3.0
7
+ Contact: messente@messente.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module MessenteApi
16
+ # A container for phone numbers
17
+ class NumbersToInvestigate
18
+ # Array of phone numbers
19
+ attr_accessor :numbers
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'numbers' => :'numbers'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.openapi_types
30
+ {
31
+ :'numbers' => :'Array<String>'
32
+ }
33
+ end
34
+
35
+ # List of attributes with nullable: true
36
+ def self.openapi_nullable
37
+ Set.new([
38
+ ])
39
+ end
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ def initialize(attributes = {})
44
+ if (!attributes.is_a?(Hash))
45
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MessenteApi::NumbersToInvestigate` initialize method"
46
+ end
47
+
48
+ # check to see if the attribute exists and convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}) { |(k, v), h|
50
+ if (!self.class.attribute_map.key?(k.to_sym))
51
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MessenteApi::NumbersToInvestigate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
52
+ end
53
+ h[k.to_sym] = v
54
+ }
55
+
56
+ if attributes.key?(:'numbers')
57
+ if (value = attributes[:'numbers']).is_a?(Array)
58
+ self.numbers = value
59
+ end
60
+ end
61
+ end
62
+
63
+ # Show invalid properties with the reasons. Usually used together with valid?
64
+ # @return Array for valid properties with the reasons
65
+ def list_invalid_properties
66
+ invalid_properties = Array.new
67
+ if @numbers.nil?
68
+ invalid_properties.push('invalid value for "numbers", numbers cannot be nil.')
69
+ end
70
+
71
+ invalid_properties
72
+ end
73
+
74
+ # Check to see if the all the properties in the model are valid
75
+ # @return true if the model is valid
76
+ def valid?
77
+ return false if @numbers.nil?
78
+ true
79
+ end
80
+
81
+ # Checks equality by comparing each attribute.
82
+ # @param [Object] Object to be compared
83
+ def ==(o)
84
+ return true if self.equal?(o)
85
+ self.class == o.class &&
86
+ numbers == o.numbers
87
+ end
88
+
89
+ # @see the `==` method
90
+ # @param [Object] Object to be compared
91
+ def eql?(o)
92
+ self == o
93
+ end
94
+
95
+ # Calculates hash code according to all attributes.
96
+ # @return [Integer] Hash code
97
+ def hash
98
+ [numbers].hash
99
+ end
100
+
101
+ # Builds the object from hash
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ # @return [Object] Returns the model itself
104
+ 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
+ return nil unless attributes.is_a?(Hash)
113
+ self.class.openapi_types.each_pair do |key, type|
114
+ if type =~ /\AArray<(.*)>/i
115
+ # check to ensure the input is an array given that the attribute
116
+ # 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) })
119
+ 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
123
+ end
124
+
125
+ self
126
+ end
127
+
128
+ # Deserializes the data based on type
129
+ # @param string type Data type
130
+ # @param string value Value to be deserialized
131
+ # @return [Object] Deserialized data
132
+ def _deserialize(type, value)
133
+ case type.to_sym
134
+ when :DateTime
135
+ DateTime.parse(value)
136
+ when :Date
137
+ Date.parse(value)
138
+ when :String
139
+ value.to_s
140
+ when :Integer
141
+ value.to_i
142
+ when :Float
143
+ value.to_f
144
+ when :Boolean
145
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
146
+ true
147
+ else
148
+ false
149
+ end
150
+ when :Object
151
+ # generic object (usually a Hash), return directly
152
+ value
153
+ when /\AArray<(?<inner_type>.+)>\z/
154
+ inner_type = Regexp.last_match[:inner_type]
155
+ value.map { |v| _deserialize(inner_type, v) }
156
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
157
+ k_type = Regexp.last_match[:k_type]
158
+ v_type = Regexp.last_match[:v_type]
159
+ {}.tap do |hash|
160
+ value.each do |k, v|
161
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
162
+ end
163
+ end
164
+ else # model
165
+ MessenteApi.const_get(type).build_from_hash(value)
166
+ end
167
+ end
168
+
169
+ # Returns the string representation of the object
170
+ # @return [String] String presentation of the object
171
+ def to_s
172
+ to_hash.to_s
173
+ end
174
+
175
+ # to_body is an alias to to_hash (backward compatibility)
176
+ # @return [Hash] Returns the object in the form of hash
177
+ def to_body
178
+ to_hash
179
+ end
180
+
181
+ # Returns the object in the form of hash
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_hash
184
+ hash = {}
185
+ self.class.attribute_map.each_pair do |attr, param|
186
+ value = self.send(attr)
187
+ if value.nil?
188
+ is_nullable = self.class.openapi_nullable.include?(attr)
189
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
190
+ end
191
+
192
+ hash[param] = _to_hash(value)
193
+ end
194
+ hash
195
+ end
196
+
197
+ # Outputs non-array value in the form of hash
198
+ # For object, use to_hash. Otherwise, just return the value
199
+ # @param [Object] value Any valid value
200
+ # @return [Hash] Returns the value in the form of hash
201
+ def _to_hash(value)
202
+ if value.is_a?(Array)
203
+ value.compact.map { |v| _to_hash(v) }
204
+ elsif value.is_a?(Hash)
205
+ {}.tap do |hash|
206
+ value.each { |k, v| hash[k] = _to_hash(v) }
207
+ end
208
+ elsif value.respond_to? :to_hash
209
+ value.to_hash
210
+ else
211
+ value
212
+ end
213
+ end
214
+ end
215
+ end