messente_api 1.3.1 → 2.1.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.
- checksums.yaml +4 -4
- data/README.md +33 -30
- data/docs/BlacklistApi.md +105 -37
- data/docs/BulkMessagingApi.md +76 -0
- data/docs/BulkOmniMessageCreateSuccessResponse.md +18 -0
- data/docs/BulkOmniMessageCreateSuccessResponseMessagesInner.md +49 -0
- data/docs/BulkOmnimessage.md +18 -0
- data/docs/Channel.md +4 -5
- data/docs/ContactEnvelope.md +8 -7
- data/docs/ContactFields.md +26 -25
- data/docs/ContactListEnvelope.md +8 -7
- data/docs/ContactResponseFields.md +28 -27
- data/docs/ContactUpdateFields.md +24 -23
- data/docs/ContactsApi.md +221 -86
- data/docs/DeliveryReportApi.md +29 -13
- data/docs/DeliveryReportResponse.md +12 -11
- data/docs/DeliveryResult.md +22 -17
- data/docs/ErrorCodeOmnichannel.md +4 -5
- data/docs/ErrorCodeOmnichannelMachine.md +4 -5
- data/docs/ErrorCodePhonebook.md +4 -5
- data/docs/ErrorCodeStatistics.md +4 -5
- data/docs/ErrorItemNumberLookup.md +8 -7
- data/docs/ErrorItemNumberLookupError.md +10 -9
- data/docs/ErrorItemOmnichannel.md +14 -13
- data/docs/ErrorItemPhonebook.md +12 -11
- data/docs/ErrorItemStatistics.md +12 -11
- data/docs/ErrorNumberLookup.md +8 -7
- data/docs/ErrorOmnichannel.md +8 -7
- data/docs/ErrorPhonebook.md +8 -7
- data/docs/ErrorStatistics.md +8 -7
- data/docs/ErrorTitleOmnichannel.md +4 -5
- data/docs/ErrorTitlePhonebook.md +4 -5
- data/docs/FetchBlacklistSuccess.md +8 -7
- data/docs/GroupEnvelope.md +8 -7
- data/docs/GroupListEnvelope.md +8 -7
- data/docs/GroupName.md +8 -7
- data/docs/GroupResponseFields.md +14 -13
- data/docs/GroupsApi.md +136 -51
- data/docs/MessageResult.md +12 -11
- data/docs/MobileNetwork.md +16 -15
- data/docs/NumberLookupApi.md +30 -14
- data/docs/NumberToBlacklist.md +8 -7
- data/docs/NumbersToInvestigate.md +8 -7
- data/docs/OmniMessageCreateSuccessResponse.md +12 -11
- data/docs/Omnimessage.md +18 -15
- data/docs/OmnimessageApi.md +56 -23
- data/docs/OmnimessageMessagesInner.md +53 -0
- data/docs/PriceInfo.md +22 -0
- data/docs/Priority.md +15 -0
- data/docs/SMS.md +20 -17
- data/docs/StatisticsApi.md +30 -14
- data/docs/StatisticsReport.md +12 -11
- data/docs/StatisticsReportSettings.md +12 -11
- data/docs/StatisticsReportSuccess.md +8 -7
- data/docs/Status.md +4 -5
- data/docs/SyncNumberLookupResult.md +24 -23
- data/docs/SyncNumberLookupSuccess.md +10 -9
- data/docs/Telegram.md +20 -19
- data/docs/TextStore.md +4 -5
- data/docs/Viber.md +22 -19
- data/docs/WhatsApp.md +16 -19
- data/docs/WhatsAppComponent.md +24 -0
- data/docs/WhatsAppCurrency.md +22 -0
- data/docs/WhatsAppDatetime.md +18 -0
- data/docs/WhatsAppLanguage.md +20 -0
- data/docs/WhatsAppMedia.md +24 -0
- data/docs/WhatsAppParameter.md +30 -0
- data/docs/WhatsAppTemplate.md +22 -0
- data/git_push.sh +3 -4
- data/lib/messente_api/api/blacklist_api.rb +22 -15
- data/lib/messente_api/api/bulk_messaging_api.rb +88 -0
- data/lib/messente_api/api/contacts_api.rb +42 -28
- data/lib/messente_api/api/delivery_report_api.rb +6 -5
- data/lib/messente_api/api/groups_api.rb +30 -19
- data/lib/messente_api/api/number_lookup_api.rb +10 -6
- data/lib/messente_api/api/omnimessage_api.rb +14 -9
- data/lib/messente_api/api/statistics_api.rb +10 -6
- data/lib/messente_api/api_client.rb +72 -66
- data/lib/messente_api/api_error.rb +3 -2
- data/lib/messente_api/configuration.rb +64 -14
- data/lib/messente_api/models/{whats_app_audio.rb → bulk_omni_message_create_success_response.rb} +50 -38
- data/lib/messente_api/models/bulk_omni_message_create_success_response_messages_inner.rb +105 -0
- data/lib/messente_api/models/{whats_app_text.rb → bulk_omnimessage.rb} +49 -49
- data/lib/messente_api/models/channel.rb +9 -5
- data/lib/messente_api/models/contact_envelope.rb +31 -23
- data/lib/messente_api/models/contact_fields.rb +33 -23
- data/lib/messente_api/models/contact_list_envelope.rb +41 -23
- data/lib/messente_api/models/contact_response_fields.rb +31 -23
- data/lib/messente_api/models/contact_update_fields.rb +31 -23
- data/lib/messente_api/models/delivery_report_response.rb +37 -23
- data/lib/messente_api/models/delivery_result.rb +77 -27
- data/lib/messente_api/models/error_code_omnichannel.rb +9 -5
- data/lib/messente_api/models/error_code_omnichannel_machine.rb +9 -5
- data/lib/messente_api/models/error_code_phonebook.rb +9 -5
- data/lib/messente_api/models/error_code_statistics.rb +9 -5
- data/lib/messente_api/models/error_item_number_lookup.rb +33 -23
- data/lib/messente_api/models/error_item_number_lookup_error.rb +35 -23
- data/lib/messente_api/models/error_item_omnichannel.rb +61 -23
- data/lib/messente_api/models/error_item_phonebook.rb +59 -23
- data/lib/messente_api/models/error_item_statistics.rb +59 -23
- data/lib/messente_api/models/error_number_lookup.rb +33 -23
- data/lib/messente_api/models/error_omnichannel.rb +33 -23
- data/lib/messente_api/models/error_phonebook.rb +33 -23
- data/lib/messente_api/models/error_statistics.rb +33 -23
- data/lib/messente_api/models/error_title_omnichannel.rb +9 -5
- data/lib/messente_api/models/error_title_phonebook.rb +9 -5
- data/lib/messente_api/models/fetch_blacklist_success.rb +41 -23
- data/lib/messente_api/models/group_envelope.rb +31 -23
- data/lib/messente_api/models/group_list_envelope.rb +41 -23
- data/lib/messente_api/models/group_name.rb +33 -23
- data/lib/messente_api/models/group_response_fields.rb +37 -23
- data/lib/messente_api/models/message_result.rb +59 -23
- data/lib/messente_api/models/mobile_network.rb +31 -23
- data/lib/messente_api/models/number_to_blacklist.rb +33 -23
- data/lib/messente_api/models/numbers_to_investigate.rb +62 -24
- data/lib/messente_api/models/omni_message_create_success_response.rb +37 -23
- data/lib/messente_api/models/omnimessage.rb +71 -28
- data/lib/messente_api/models/omnimessage_messages_inner.rb +107 -0
- data/lib/messente_api/models/price_info.rb +257 -0
- data/lib/messente_api/models/priority.rb +41 -0
- data/lib/messente_api/models/sms.rb +45 -25
- data/lib/messente_api/models/statistics_report.rb +37 -23
- data/lib/messente_api/models/statistics_report_settings.rb +35 -23
- data/lib/messente_api/models/statistics_report_success.rb +33 -23
- data/lib/messente_api/models/status.rb +9 -5
- data/lib/messente_api/models/sync_number_lookup_result.rb +35 -24
- data/lib/messente_api/models/sync_number_lookup_success.rb +35 -23
- data/lib/messente_api/models/telegram.rb +31 -23
- data/lib/messente_api/models/text_store.rb +9 -5
- data/lib/messente_api/models/viber.rb +43 -25
- data/lib/messente_api/models/whats_app.rb +45 -54
- data/lib/messente_api/models/whats_app_component.rb +255 -0
- data/lib/messente_api/models/whats_app_currency.rb +257 -0
- data/lib/messente_api/models/{whats_app_document.rb → whats_app_datetime.rb} +48 -48
- data/lib/messente_api/models/{whats_app_image.rb → whats_app_language.rb} +55 -45
- data/lib/messente_api/models/whats_app_media.rb +246 -0
- data/lib/messente_api/models/whats_app_parameter.rb +278 -0
- data/lib/messente_api/models/whats_app_template.rb +251 -0
- data/lib/messente_api/version.rb +3 -3
- data/lib/messente_api.rb +16 -6
- data/messente_api.gemspec +5 -5
- data/spec/spec_helper.rb +2 -2
- metadata +35 -40
- data/docs/WhatsAppAudio.md +0 -17
- data/docs/WhatsAppDocument.md +0 -19
- data/docs/WhatsAppImage.md +0 -19
- data/docs/WhatsAppText.md +0 -19
- data/messente_api-1.3.0.gem +0 -0
- data/spec/api_client_spec.rb +0 -226
- 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:
|
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
|
-
|
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 delivery report
|
@@ -30,6 +31,33 @@ module MessenteApi
|
|
30
31
|
# When this status was received by Omnichannel API
|
31
32
|
attr_accessor :timestamp
|
32
33
|
|
34
|
+
attr_accessor :price_info
|
35
|
+
|
36
|
+
# the sender of the message
|
37
|
+
attr_accessor :sender
|
38
|
+
|
39
|
+
class EnumAttributeValidator
|
40
|
+
attr_reader :datatype
|
41
|
+
attr_reader :allowable_values
|
42
|
+
|
43
|
+
def initialize(datatype, allowable_values)
|
44
|
+
@allowable_values = allowable_values.map do |value|
|
45
|
+
case datatype.to_s
|
46
|
+
when /Integer/i
|
47
|
+
value.to_i
|
48
|
+
when /Float/i
|
49
|
+
value.to_f
|
50
|
+
else
|
51
|
+
value
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def valid?(value)
|
57
|
+
!value || allowable_values.include?(value)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
33
61
|
# Attribute mapping from ruby-style variable name to JSON key.
|
34
62
|
def self.attribute_map
|
35
63
|
{
|
@@ -38,10 +66,17 @@ module MessenteApi
|
|
38
66
|
:'message_id' => :'message_id',
|
39
67
|
:'error' => :'error',
|
40
68
|
:'err' => :'err',
|
41
|
-
:'timestamp' => :'timestamp'
|
69
|
+
:'timestamp' => :'timestamp',
|
70
|
+
:'price_info' => :'price_info',
|
71
|
+
:'sender' => :'sender'
|
42
72
|
}
|
43
73
|
end
|
44
74
|
|
75
|
+
# Returns all the JSON keys this model knows about
|
76
|
+
def self.acceptable_attributes
|
77
|
+
attribute_map.values
|
78
|
+
end
|
79
|
+
|
45
80
|
# Attribute type mapping.
|
46
81
|
def self.openapi_types
|
47
82
|
{
|
@@ -50,13 +85,16 @@ module MessenteApi
|
|
50
85
|
:'message_id' => :'String',
|
51
86
|
:'error' => :'String',
|
52
87
|
:'err' => :'ErrorCodeOmnichannelMachine',
|
53
|
-
:'timestamp' => :'
|
88
|
+
:'timestamp' => :'Time',
|
89
|
+
:'price_info' => :'PriceInfo',
|
90
|
+
:'sender' => :'String'
|
54
91
|
}
|
55
92
|
end
|
56
93
|
|
57
94
|
# List of attributes with nullable: true
|
58
95
|
def self.openapi_nullable
|
59
96
|
Set.new([
|
97
|
+
:'error',
|
60
98
|
])
|
61
99
|
end
|
62
100
|
|
@@ -98,11 +136,20 @@ module MessenteApi
|
|
98
136
|
if attributes.key?(:'timestamp')
|
99
137
|
self.timestamp = attributes[:'timestamp']
|
100
138
|
end
|
139
|
+
|
140
|
+
if attributes.key?(:'price_info')
|
141
|
+
self.price_info = attributes[:'price_info']
|
142
|
+
end
|
143
|
+
|
144
|
+
if attributes.key?(:'sender')
|
145
|
+
self.sender = attributes[:'sender']
|
146
|
+
end
|
101
147
|
end
|
102
148
|
|
103
149
|
# Show invalid properties with the reasons. Usually used together with valid?
|
104
150
|
# @return Array for valid properties with the reasons
|
105
151
|
def list_invalid_properties
|
152
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
106
153
|
invalid_properties = Array.new
|
107
154
|
invalid_properties
|
108
155
|
end
|
@@ -110,6 +157,7 @@ module MessenteApi
|
|
110
157
|
# Check to see if the all the properties in the model are valid
|
111
158
|
# @return true if the model is valid
|
112
159
|
def valid?
|
160
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
113
161
|
true
|
114
162
|
end
|
115
163
|
|
@@ -123,7 +171,9 @@ module MessenteApi
|
|
123
171
|
message_id == o.message_id &&
|
124
172
|
error == o.error &&
|
125
173
|
err == o.err &&
|
126
|
-
timestamp == o.timestamp
|
174
|
+
timestamp == o.timestamp &&
|
175
|
+
price_info == o.price_info &&
|
176
|
+
sender == o.sender
|
127
177
|
end
|
128
178
|
|
129
179
|
# @see the `==` method
|
@@ -135,44 +185,40 @@ module MessenteApi
|
|
135
185
|
# Calculates hash code according to all attributes.
|
136
186
|
# @return [Integer] Hash code
|
137
187
|
def hash
|
138
|
-
[status, channel, message_id, error, err, timestamp].hash
|
188
|
+
[status, channel, message_id, error, err, timestamp, price_info, sender].hash
|
139
189
|
end
|
140
190
|
|
141
191
|
# Builds the object from hash
|
142
192
|
# @param [Hash] attributes Model attributes in the form of hash
|
143
193
|
# @return [Object] Returns the model itself
|
144
194
|
def self.build_from_hash(attributes)
|
145
|
-
new.build_from_hash(attributes)
|
146
|
-
end
|
147
|
-
|
148
|
-
# Builds the object from hash
|
149
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
150
|
-
# @return [Object] Returns the model itself
|
151
|
-
def build_from_hash(attributes)
|
152
195
|
return nil unless attributes.is_a?(Hash)
|
153
|
-
|
154
|
-
|
196
|
+
attributes = attributes.transform_keys(&:to_sym)
|
197
|
+
transformed_hash = {}
|
198
|
+
openapi_types.each_pair do |key, type|
|
199
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
200
|
+
transformed_hash["#{key}"] = nil
|
201
|
+
elsif type =~ /\AArray<(.*)>/i
|
155
202
|
# check to ensure the input is an array given that the attribute
|
156
203
|
# is documented as an array but the input is not
|
157
|
-
if attributes[
|
158
|
-
|
204
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
205
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
159
206
|
end
|
160
|
-
elsif !attributes[
|
161
|
-
|
162
|
-
end
|
207
|
+
elsif !attributes[attribute_map[key]].nil?
|
208
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
209
|
+
end
|
163
210
|
end
|
164
|
-
|
165
|
-
self
|
211
|
+
new(transformed_hash)
|
166
212
|
end
|
167
213
|
|
168
214
|
# Deserializes the data based on type
|
169
215
|
# @param string type Data type
|
170
216
|
# @param string value Value to be deserialized
|
171
217
|
# @return [Object] Deserialized data
|
172
|
-
def _deserialize(type, value)
|
218
|
+
def self._deserialize(type, value)
|
173
219
|
case type.to_sym
|
174
|
-
when :
|
175
|
-
|
220
|
+
when :Time
|
221
|
+
Time.parse(value)
|
176
222
|
when :Date
|
177
223
|
Date.parse(value)
|
178
224
|
when :String
|
@@ -202,7 +248,9 @@ module MessenteApi
|
|
202
248
|
end
|
203
249
|
end
|
204
250
|
else # model
|
205
|
-
|
251
|
+
# models (e.g. Pet) or oneOf
|
252
|
+
klass = MessenteApi.const_get(type)
|
253
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
206
254
|
end
|
207
255
|
end
|
208
256
|
|
@@ -228,7 +276,7 @@ module MessenteApi
|
|
228
276
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
229
277
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
230
278
|
end
|
231
|
-
|
279
|
+
|
232
280
|
hash[param] = _to_hash(value)
|
233
281
|
end
|
234
282
|
hash
|
@@ -251,5 +299,7 @@ module MessenteApi
|
|
251
299
|
value
|
252
300
|
end
|
253
301
|
end
|
302
|
+
|
254
303
|
end
|
304
|
+
|
255
305
|
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:
|
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
|
-
|
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 ErrorCodeOmnichannel
|
@@ -22,6 +23,10 @@ module MessenteApi
|
|
22
23
|
N106 = "106".freeze
|
23
24
|
N107 = "107".freeze
|
24
25
|
|
26
|
+
def self.all_vars
|
27
|
+
@all_vars ||= [N101, N102, N103, N104, N105, N106, N107].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
|
-
|
37
|
-
raise "Invalid ENUM value #{value} for class #ErrorCodeOmnichannel"
|
38
|
-
value
|
41
|
+
return value if ErrorCodeOmnichannel.all_vars.include?(value)
|
42
|
+
raise "Invalid ENUM value #{value} for class #ErrorCodeOmnichannel"
|
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:
|
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
|
-
|
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 ErrorCodeOmnichannelMachine
|
@@ -27,6 +28,10 @@ module MessenteApi
|
|
27
28
|
N10 = 10.freeze
|
28
29
|
N999 = 999.freeze
|
29
30
|
|
31
|
+
def self.all_vars
|
32
|
+
@all_vars ||= [N0, N1, N2, N3, N4, N5, N6, N7, N8, N9, N10, N999].freeze
|
33
|
+
end
|
34
|
+
|
30
35
|
# Builds the enum from string
|
31
36
|
# @param [String] The enum value in the form of the string
|
32
37
|
# @return [String] The enum value
|
@@ -38,9 +43,8 @@ module MessenteApi
|
|
38
43
|
# @param [String] The enum value in the form of the string
|
39
44
|
# @return [String] The enum value
|
40
45
|
def build_from_hash(value)
|
41
|
-
|
42
|
-
raise "Invalid ENUM value #{value} for class #ErrorCodeOmnichannelMachine"
|
43
|
-
value
|
46
|
+
return value if ErrorCodeOmnichannelMachine.all_vars.include?(value)
|
47
|
+
raise "Invalid ENUM value #{value} for class #ErrorCodeOmnichannelMachine"
|
44
48
|
end
|
45
49
|
end
|
46
50
|
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:
|
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
|
-
|
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 ErrorCodePhonebook
|
@@ -21,6 +22,10 @@ module MessenteApi
|
|
21
22
|
N244 = "244".freeze
|
22
23
|
N205 = "205".freeze
|
23
24
|
|
25
|
+
def self.all_vars
|
26
|
+
@all_vars ||= [N201, N202, N203, N204, N244, N205].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
|
-
|
36
|
-
raise "Invalid ENUM value #{value} for class #ErrorCodePhonebook"
|
37
|
-
value
|
40
|
+
return value if ErrorCodePhonebook.all_vars.include?(value)
|
41
|
+
raise "Invalid ENUM value #{value} for class #ErrorCodePhonebook"
|
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:
|
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
|
-
|
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 ErrorCodeStatistics
|
@@ -19,6 +20,10 @@ module MessenteApi
|
|
19
20
|
N104 = "104".freeze
|
20
21
|
N105 = "105".freeze
|
21
22
|
|
23
|
+
def self.all_vars
|
24
|
+
@all_vars ||= [N100, N103, N104, N105].freeze
|
25
|
+
end
|
26
|
+
|
22
27
|
# Builds the enum from string
|
23
28
|
# @param [String] The enum value in the form of the string
|
24
29
|
# @return [String] The enum value
|
@@ -30,9 +35,8 @@ module MessenteApi
|
|
30
35
|
# @param [String] The enum value in the form of the string
|
31
36
|
# @return [String] The enum value
|
32
37
|
def build_from_hash(value)
|
33
|
-
|
34
|
-
raise "Invalid ENUM value #{value} for class #ErrorCodeStatistics"
|
35
|
-
value
|
38
|
+
return value if ErrorCodeStatistics.all_vars.include?(value)
|
39
|
+
raise "Invalid ENUM value #{value} for class #ErrorCodeStatistics"
|
36
40
|
end
|
37
41
|
end
|
38
42
|
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:
|
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
|
-
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
|
+
require 'time'
|
14
15
|
|
15
16
|
module MessenteApi
|
16
17
|
# A container for Number Lookup API error
|
@@ -24,6 +25,11 @@ module MessenteApi
|
|
24
25
|
}
|
25
26
|
end
|
26
27
|
|
28
|
+
# Returns all the JSON keys this model knows about
|
29
|
+
def self.acceptable_attributes
|
30
|
+
attribute_map.values
|
31
|
+
end
|
32
|
+
|
27
33
|
# Attribute type mapping.
|
28
34
|
def self.openapi_types
|
29
35
|
{
|
@@ -54,12 +60,15 @@ module MessenteApi
|
|
54
60
|
|
55
61
|
if attributes.key?(:'error')
|
56
62
|
self.error = attributes[:'error']
|
63
|
+
else
|
64
|
+
self.error = nil
|
57
65
|
end
|
58
66
|
end
|
59
67
|
|
60
68
|
# Show invalid properties with the reasons. Usually used together with valid?
|
61
69
|
# @return Array for valid properties with the reasons
|
62
70
|
def list_invalid_properties
|
71
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
63
72
|
invalid_properties = Array.new
|
64
73
|
if @error.nil?
|
65
74
|
invalid_properties.push('invalid value for "error", error cannot be nil.')
|
@@ -71,6 +80,7 @@ module MessenteApi
|
|
71
80
|
# Check to see if the all the properties in the model are valid
|
72
81
|
# @return true if the model is valid
|
73
82
|
def valid?
|
83
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
74
84
|
return false if @error.nil?
|
75
85
|
true
|
76
86
|
end
|
@@ -99,37 +109,33 @@ module MessenteApi
|
|
99
109
|
# @param [Hash] attributes Model attributes in the form of hash
|
100
110
|
# @return [Object] Returns the model itself
|
101
111
|
def self.build_from_hash(attributes)
|
102
|
-
new.build_from_hash(attributes)
|
103
|
-
end
|
104
|
-
|
105
|
-
# Builds the object from hash
|
106
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
107
|
-
# @return [Object] Returns the model itself
|
108
|
-
def build_from_hash(attributes)
|
109
112
|
return nil unless attributes.is_a?(Hash)
|
110
|
-
|
111
|
-
|
113
|
+
attributes = attributes.transform_keys(&:to_sym)
|
114
|
+
transformed_hash = {}
|
115
|
+
openapi_types.each_pair do |key, type|
|
116
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
117
|
+
transformed_hash["#{key}"] = nil
|
118
|
+
elsif type =~ /\AArray<(.*)>/i
|
112
119
|
# check to ensure the input is an array given that the attribute
|
113
120
|
# is documented as an array but the input is not
|
114
|
-
if attributes[
|
115
|
-
|
121
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
122
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
116
123
|
end
|
117
|
-
elsif !attributes[
|
118
|
-
|
119
|
-
end
|
124
|
+
elsif !attributes[attribute_map[key]].nil?
|
125
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
126
|
+
end
|
120
127
|
end
|
121
|
-
|
122
|
-
self
|
128
|
+
new(transformed_hash)
|
123
129
|
end
|
124
130
|
|
125
131
|
# Deserializes the data based on type
|
126
132
|
# @param string type Data type
|
127
133
|
# @param string value Value to be deserialized
|
128
134
|
# @return [Object] Deserialized data
|
129
|
-
def _deserialize(type, value)
|
135
|
+
def self._deserialize(type, value)
|
130
136
|
case type.to_sym
|
131
|
-
when :
|
132
|
-
|
137
|
+
when :Time
|
138
|
+
Time.parse(value)
|
133
139
|
when :Date
|
134
140
|
Date.parse(value)
|
135
141
|
when :String
|
@@ -159,7 +165,9 @@ module MessenteApi
|
|
159
165
|
end
|
160
166
|
end
|
161
167
|
else # model
|
162
|
-
|
168
|
+
# models (e.g. Pet) or oneOf
|
169
|
+
klass = MessenteApi.const_get(type)
|
170
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
163
171
|
end
|
164
172
|
end
|
165
173
|
|
@@ -185,7 +193,7 @@ module MessenteApi
|
|
185
193
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
186
194
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
187
195
|
end
|
188
|
-
|
196
|
+
|
189
197
|
hash[param] = _to_hash(value)
|
190
198
|
end
|
191
199
|
hash
|
@@ -208,5 +216,7 @@ module MessenteApi
|
|
208
216
|
value
|
209
217
|
end
|
210
218
|
end
|
219
|
+
|
211
220
|
end
|
221
|
+
|
212
222
|
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:
|
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
|
-
|
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
|
# Error fields container
|
@@ -29,6 +30,11 @@ module MessenteApi
|
|
29
30
|
}
|
30
31
|
end
|
31
32
|
|
33
|
+
# Returns all the JSON keys this model knows about
|
34
|
+
def self.acceptable_attributes
|
35
|
+
attribute_map.values
|
36
|
+
end
|
37
|
+
|
32
38
|
# Attribute type mapping.
|
33
39
|
def self.openapi_types
|
34
40
|
{
|
@@ -60,16 +66,21 @@ module MessenteApi
|
|
60
66
|
|
61
67
|
if attributes.key?(:'description')
|
62
68
|
self.description = attributes[:'description']
|
69
|
+
else
|
70
|
+
self.description = nil
|
63
71
|
end
|
64
72
|
|
65
73
|
if attributes.key?(:'code')
|
66
74
|
self.code = attributes[:'code']
|
75
|
+
else
|
76
|
+
self.code = nil
|
67
77
|
end
|
68
78
|
end
|
69
79
|
|
70
80
|
# Show invalid properties with the reasons. Usually used together with valid?
|
71
81
|
# @return Array for valid properties with the reasons
|
72
82
|
def list_invalid_properties
|
83
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
73
84
|
invalid_properties = Array.new
|
74
85
|
if @description.nil?
|
75
86
|
invalid_properties.push('invalid value for "description", description cannot be nil.')
|
@@ -93,6 +104,7 @@ module MessenteApi
|
|
93
104
|
# Check to see if the all the properties in the model are valid
|
94
105
|
# @return true if the model is valid
|
95
106
|
def valid?
|
107
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
96
108
|
return false if @description.nil?
|
97
109
|
return false if @code.nil?
|
98
110
|
return false if @code > 106
|
@@ -143,37 +155,33 @@ module MessenteApi
|
|
143
155
|
# @param [Hash] attributes Model attributes in the form of hash
|
144
156
|
# @return [Object] Returns the model itself
|
145
157
|
def self.build_from_hash(attributes)
|
146
|
-
new.build_from_hash(attributes)
|
147
|
-
end
|
148
|
-
|
149
|
-
# Builds the object from hash
|
150
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
151
|
-
# @return [Object] Returns the model itself
|
152
|
-
def build_from_hash(attributes)
|
153
158
|
return nil unless attributes.is_a?(Hash)
|
154
|
-
|
155
|
-
|
159
|
+
attributes = attributes.transform_keys(&:to_sym)
|
160
|
+
transformed_hash = {}
|
161
|
+
openapi_types.each_pair do |key, type|
|
162
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
163
|
+
transformed_hash["#{key}"] = nil
|
164
|
+
elsif type =~ /\AArray<(.*)>/i
|
156
165
|
# check to ensure the input is an array given that the attribute
|
157
166
|
# is documented as an array but the input is not
|
158
|
-
if attributes[
|
159
|
-
|
167
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
168
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
160
169
|
end
|
161
|
-
elsif !attributes[
|
162
|
-
|
163
|
-
end
|
170
|
+
elsif !attributes[attribute_map[key]].nil?
|
171
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
172
|
+
end
|
164
173
|
end
|
165
|
-
|
166
|
-
self
|
174
|
+
new(transformed_hash)
|
167
175
|
end
|
168
176
|
|
169
177
|
# Deserializes the data based on type
|
170
178
|
# @param string type Data type
|
171
179
|
# @param string value Value to be deserialized
|
172
180
|
# @return [Object] Deserialized data
|
173
|
-
def _deserialize(type, value)
|
181
|
+
def self._deserialize(type, value)
|
174
182
|
case type.to_sym
|
175
|
-
when :
|
176
|
-
|
183
|
+
when :Time
|
184
|
+
Time.parse(value)
|
177
185
|
when :Date
|
178
186
|
Date.parse(value)
|
179
187
|
when :String
|
@@ -203,7 +211,9 @@ module MessenteApi
|
|
203
211
|
end
|
204
212
|
end
|
205
213
|
else # model
|
206
|
-
|
214
|
+
# models (e.g. Pet) or oneOf
|
215
|
+
klass = MessenteApi.const_get(type)
|
216
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
207
217
|
end
|
208
218
|
end
|
209
219
|
|
@@ -229,7 +239,7 @@ module MessenteApi
|
|
229
239
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
230
240
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
231
241
|
end
|
232
|
-
|
242
|
+
|
233
243
|
hash[param] = _to_hash(value)
|
234
244
|
end
|
235
245
|
hash
|
@@ -252,5 +262,7 @@ module MessenteApi
|
|
252
262
|
value
|
253
263
|
end
|
254
264
|
end
|
265
|
+
|
255
266
|
end
|
267
|
+
|
256
268
|
end
|