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
 
@@ -42,6 +42,12 @@ module MessenteApi
42
42
  }
43
43
  end
44
44
 
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
45
51
  # Initializes the object
46
52
  # @param [Hash] attributes Model attributes in the form of hash
47
53
  def initialize(attributes = {})
@@ -208,7 +214,11 @@ module MessenteApi
208
214
  hash = {}
209
215
  self.class.attribute_map.each_pair do |attr, param|
210
216
  value = self.send(attr)
211
- next if value.nil?
217
+ if value.nil?
218
+ is_nullable = self.class.openapi_nullable.include?(attr)
219
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
220
+ end
221
+
212
222
  hash[param] = _to_hash(value)
213
223
  end
214
224
  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
 
@@ -51,6 +51,12 @@ module MessenteApi
51
51
  }
52
52
  end
53
53
 
54
+ # List of attributes with nullable: true
55
+ def self.openapi_nullable
56
+ Set.new([
57
+ ])
58
+ end
59
+
54
60
  # Initializes the object
55
61
  # @param [Hash] attributes Model attributes in the form of hash
56
62
  def initialize(attributes = {})
@@ -222,7 +228,11 @@ module MessenteApi
222
228
  hash = {}
223
229
  self.class.attribute_map.each_pair do |attr, param|
224
230
  value = self.send(attr)
225
- next if value.nil?
231
+ if value.nil?
232
+ is_nullable = self.class.openapi_nullable.include?(attr)
233
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
234
+ end
235
+
226
236
  hash[param] = _to_hash(value)
227
237
  end
228
238
  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
 
@@ -79,6 +79,12 @@ module MessenteApi
79
79
  }
80
80
  end
81
81
 
82
+ # List of attributes with nullable: true
83
+ def self.openapi_nullable
84
+ Set.new([
85
+ ])
86
+ end
87
+
82
88
  # Initializes the object
83
89
  # @param [Hash] attributes Model attributes in the form of hash
84
90
  def initialize(attributes = {})
@@ -274,7 +280,11 @@ module MessenteApi
274
280
  hash = {}
275
281
  self.class.attribute_map.each_pair do |attr, param|
276
282
  value = self.send(attr)
277
- next if value.nil?
283
+ if value.nil?
284
+ is_nullable = self.class.openapi_nullable.include?(attr)
285
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
286
+ end
287
+
278
288
  hash[param] = _to_hash(value)
279
289
  end
280
290
  hash
@@ -0,0 +1,243 @@
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
+ # Report for one country
17
+ class StatisticsReport
18
+ # Sum of all messages
19
+ attr_accessor :total_messages
20
+
21
+ # Price for all messages
22
+ attr_accessor :total_price
23
+
24
+ # Target country of all messages
25
+ attr_accessor :country
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'total_messages' => :'total_messages',
31
+ :'total_price' => :'total_price',
32
+ :'country' => :'country'
33
+ }
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.openapi_types
38
+ {
39
+ :'total_messages' => :'Integer',
40
+ :'total_price' => :'String',
41
+ :'country' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MessenteApi::StatisticsReport` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MessenteApi::StatisticsReport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'total_messages')
67
+ self.total_messages = attributes[:'total_messages']
68
+ end
69
+
70
+ if attributes.key?(:'total_price')
71
+ self.total_price = attributes[:'total_price']
72
+ end
73
+
74
+ if attributes.key?(:'country')
75
+ self.country = attributes[:'country']
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ invalid_properties = Array.new
83
+ if @total_messages.nil?
84
+ invalid_properties.push('invalid value for "total_messages", total_messages cannot be nil.')
85
+ end
86
+
87
+ if @total_price.nil?
88
+ invalid_properties.push('invalid value for "total_price", total_price cannot be nil.')
89
+ end
90
+
91
+ if @country.nil?
92
+ invalid_properties.push('invalid value for "country", country cannot be nil.')
93
+ end
94
+
95
+ invalid_properties
96
+ end
97
+
98
+ # Check to see if the all the properties in the model are valid
99
+ # @return true if the model is valid
100
+ def valid?
101
+ return false if @total_messages.nil?
102
+ return false if @total_price.nil?
103
+ return false if @country.nil?
104
+ true
105
+ end
106
+
107
+ # Checks equality by comparing each attribute.
108
+ # @param [Object] Object to be compared
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ total_messages == o.total_messages &&
113
+ total_price == o.total_price &&
114
+ country == o.country
115
+ end
116
+
117
+ # @see the `==` method
118
+ # @param [Object] Object to be compared
119
+ def eql?(o)
120
+ self == o
121
+ end
122
+
123
+ # Calculates hash code according to all attributes.
124
+ # @return [Integer] Hash code
125
+ def hash
126
+ [total_messages, total_price, country].hash
127
+ end
128
+
129
+ # Builds the object from hash
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ # @return [Object] Returns the model itself
132
+ def self.build_from_hash(attributes)
133
+ new.build_from_hash(attributes)
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ self.class.openapi_types.each_pair do |key, type|
142
+ if type =~ /\AArray<(.*)>/i
143
+ # check to ensure the input is an array given that the attribute
144
+ # is documented as an array but the input is not
145
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
146
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
147
+ end
148
+ elsif !attributes[self.class.attribute_map[key]].nil?
149
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
150
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
151
+ end
152
+
153
+ self
154
+ end
155
+
156
+ # Deserializes the data based on type
157
+ # @param string type Data type
158
+ # @param string value Value to be deserialized
159
+ # @return [Object] Deserialized data
160
+ def _deserialize(type, value)
161
+ case type.to_sym
162
+ when :DateTime
163
+ DateTime.parse(value)
164
+ when :Date
165
+ Date.parse(value)
166
+ when :String
167
+ value.to_s
168
+ when :Integer
169
+ value.to_i
170
+ when :Float
171
+ value.to_f
172
+ when :Boolean
173
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
174
+ true
175
+ else
176
+ false
177
+ end
178
+ when :Object
179
+ # generic object (usually a Hash), return directly
180
+ value
181
+ when /\AArray<(?<inner_type>.+)>\z/
182
+ inner_type = Regexp.last_match[:inner_type]
183
+ value.map { |v| _deserialize(inner_type, v) }
184
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
185
+ k_type = Regexp.last_match[:k_type]
186
+ v_type = Regexp.last_match[:v_type]
187
+ {}.tap do |hash|
188
+ value.each do |k, v|
189
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
190
+ end
191
+ end
192
+ else # model
193
+ MessenteApi.const_get(type).build_from_hash(value)
194
+ end
195
+ end
196
+
197
+ # Returns the string representation of the object
198
+ # @return [String] String presentation of the object
199
+ def to_s
200
+ to_hash.to_s
201
+ end
202
+
203
+ # to_body is an alias to to_hash (backward compatibility)
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_body
206
+ to_hash
207
+ end
208
+
209
+ # Returns the object in the form of hash
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_hash
212
+ hash = {}
213
+ self.class.attribute_map.each_pair do |attr, param|
214
+ value = self.send(attr)
215
+ if value.nil?
216
+ is_nullable = self.class.openapi_nullable.include?(attr)
217
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
218
+ end
219
+
220
+ hash[param] = _to_hash(value)
221
+ end
222
+ hash
223
+ end
224
+
225
+ # Outputs non-array value in the form of hash
226
+ # For object, use to_hash. Otherwise, just return the value
227
+ # @param [Object] value Any valid value
228
+ # @return [Hash] Returns the value in the form of hash
229
+ def _to_hash(value)
230
+ if value.is_a?(Array)
231
+ value.compact.map { |v| _to_hash(v) }
232
+ elsif value.is_a?(Hash)
233
+ {}.tap do |hash|
234
+ value.each { |k, v| hash[k] = _to_hash(v) }
235
+ end
236
+ elsif value.respond_to? :to_hash
237
+ value.to_hash
238
+ else
239
+ value
240
+ end
241
+ end
242
+ end
243
+ end
@@ -0,0 +1,240 @@
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 statistics report settings
17
+ class StatisticsReportSettings
18
+ # Start date for the report
19
+ attr_accessor :start_date
20
+
21
+ # End date for the report
22
+ attr_accessor :end_date
23
+
24
+ # Optional list of message types (sms, viber, whatsapp, hlr, telegram)
25
+ attr_accessor :message_types
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'start_date' => :'start_date',
31
+ :'end_date' => :'end_date',
32
+ :'message_types' => :'message_types'
33
+ }
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.openapi_types
38
+ {
39
+ :'start_date' => :'Date',
40
+ :'end_date' => :'Date',
41
+ :'message_types' => :'Array<String>'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MessenteApi::StatisticsReportSettings` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MessenteApi::StatisticsReportSettings`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'start_date')
67
+ self.start_date = attributes[:'start_date']
68
+ end
69
+
70
+ if attributes.key?(:'end_date')
71
+ self.end_date = attributes[:'end_date']
72
+ end
73
+
74
+ if attributes.key?(:'message_types')
75
+ if (value = attributes[:'message_types']).is_a?(Array)
76
+ self.message_types = value
77
+ end
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ invalid_properties = Array.new
85
+ if @start_date.nil?
86
+ invalid_properties.push('invalid value for "start_date", start_date cannot be nil.')
87
+ end
88
+
89
+ if @end_date.nil?
90
+ invalid_properties.push('invalid value for "end_date", end_date cannot be nil.')
91
+ end
92
+
93
+ invalid_properties
94
+ end
95
+
96
+ # Check to see if the all the properties in the model are valid
97
+ # @return true if the model is valid
98
+ def valid?
99
+ return false if @start_date.nil?
100
+ return false if @end_date.nil?
101
+ true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ start_date == o.start_date &&
110
+ end_date == o.end_date &&
111
+ message_types == o.message_types
112
+ end
113
+
114
+ # @see the `==` method
115
+ # @param [Object] Object to be compared
116
+ def eql?(o)
117
+ self == o
118
+ end
119
+
120
+ # Calculates hash code according to all attributes.
121
+ # @return [Integer] Hash code
122
+ def hash
123
+ [start_date, end_date, message_types].hash
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def self.build_from_hash(attributes)
130
+ new.build_from_hash(attributes)
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def build_from_hash(attributes)
137
+ return nil unless attributes.is_a?(Hash)
138
+ self.class.openapi_types.each_pair do |key, type|
139
+ if type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the attribute
141
+ # is documented as an array but the input is not
142
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
143
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
144
+ end
145
+ elsif !attributes[self.class.attribute_map[key]].nil?
146
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
147
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
148
+ end
149
+
150
+ self
151
+ end
152
+
153
+ # Deserializes the data based on type
154
+ # @param string type Data type
155
+ # @param string value Value to be deserialized
156
+ # @return [Object] Deserialized data
157
+ def _deserialize(type, value)
158
+ case type.to_sym
159
+ when :DateTime
160
+ DateTime.parse(value)
161
+ when :Date
162
+ Date.parse(value)
163
+ when :String
164
+ value.to_s
165
+ when :Integer
166
+ value.to_i
167
+ when :Float
168
+ value.to_f
169
+ when :Boolean
170
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
171
+ true
172
+ else
173
+ false
174
+ end
175
+ when :Object
176
+ # generic object (usually a Hash), return directly
177
+ value
178
+ when /\AArray<(?<inner_type>.+)>\z/
179
+ inner_type = Regexp.last_match[:inner_type]
180
+ value.map { |v| _deserialize(inner_type, v) }
181
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
182
+ k_type = Regexp.last_match[:k_type]
183
+ v_type = Regexp.last_match[:v_type]
184
+ {}.tap do |hash|
185
+ value.each do |k, v|
186
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
187
+ end
188
+ end
189
+ else # model
190
+ MessenteApi.const_get(type).build_from_hash(value)
191
+ end
192
+ end
193
+
194
+ # Returns the string representation of the object
195
+ # @return [String] String presentation of the object
196
+ def to_s
197
+ to_hash.to_s
198
+ end
199
+
200
+ # to_body is an alias to to_hash (backward compatibility)
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_body
203
+ to_hash
204
+ end
205
+
206
+ # Returns the object in the form of hash
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_hash
209
+ hash = {}
210
+ self.class.attribute_map.each_pair do |attr, param|
211
+ value = self.send(attr)
212
+ if value.nil?
213
+ is_nullable = self.class.openapi_nullable.include?(attr)
214
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
215
+ end
216
+
217
+ hash[param] = _to_hash(value)
218
+ end
219
+ hash
220
+ end
221
+
222
+ # Outputs non-array value in the form of hash
223
+ # For object, use to_hash. Otherwise, just return the value
224
+ # @param [Object] value Any valid value
225
+ # @return [Hash] Returns the value in the form of hash
226
+ def _to_hash(value)
227
+ if value.is_a?(Array)
228
+ value.compact.map { |v| _to_hash(v) }
229
+ elsif value.is_a?(Hash)
230
+ {}.tap do |hash|
231
+ value.each { |k, v| hash[k] = _to_hash(v) }
232
+ end
233
+ elsif value.respond_to? :to_hash
234
+ value.to_hash
235
+ else
236
+ value
237
+ end
238
+ end
239
+ end
240
+ end