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