messente_api 1.4.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- 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 -17
- data/docs/OmnimessageApi.md +56 -23
- data/docs/OmnimessageMessagesInner.md +53 -0
- data/docs/PriceInfo.md +22 -0
- data/docs/Priority.md +4 -5
- 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 +59 -25
- 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 +9 -5
- 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 +15 -6
- data/messente_api.gemspec +5 -5
- data/spec/spec_helper.rb +2 -2
- metadata +33 -39
- 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/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
|
class Priority
|
@@ -18,6 +19,10 @@ module MessenteApi
|
|
18
19
|
REGULAR = "regular".freeze
|
19
20
|
HIGH = "high".freeze
|
20
21
|
|
22
|
+
def self.all_vars
|
23
|
+
@all_vars ||= [LOW, REGULAR, HIGH].freeze
|
24
|
+
end
|
25
|
+
|
21
26
|
# Builds the enum from string
|
22
27
|
# @param [String] The enum value in the form of the string
|
23
28
|
# @return [String] The enum value
|
@@ -29,9 +34,8 @@ module MessenteApi
|
|
29
34
|
# @param [String] The enum value in the form of the string
|
30
35
|
# @return [String] The enum value
|
31
36
|
def build_from_hash(value)
|
32
|
-
|
33
|
-
raise "Invalid ENUM value #{value} for class #Priority"
|
34
|
-
value
|
37
|
+
return value if Priority.all_vars.include?(value)
|
38
|
+
raise "Invalid ENUM value #{value} for class #Priority"
|
35
39
|
end
|
36
40
|
end
|
37
41
|
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
|
# SMS message content
|
@@ -21,9 +22,12 @@ module MessenteApi
|
|
21
22
|
# Phone number or alphanumeric sender name
|
22
23
|
attr_accessor :sender
|
23
24
|
|
24
|
-
# After how many minutes this channel is considered as failed and the next channel is attempted
|
25
|
+
# After how many minutes this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used.
|
25
26
|
attr_accessor :validity
|
26
27
|
|
28
|
+
# After how many seconds this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used.
|
29
|
+
attr_accessor :ttl
|
30
|
+
|
27
31
|
# Defines how non-GSM characters will be treated: - \"on\" Use replacement settings from the account's [API Auto Replace settings page](https://dashboard.messente.com/api-settings/auto-replace) (default) - \"full\" All non GSM 03.38 characters will be replaced with suitable alternatives - \"off\" Message content is not modified in any way
|
28
32
|
attr_accessor :autoconvert
|
29
33
|
|
@@ -61,18 +65,25 @@ module MessenteApi
|
|
61
65
|
:'text' => :'text',
|
62
66
|
:'sender' => :'sender',
|
63
67
|
:'validity' => :'validity',
|
68
|
+
:'ttl' => :'ttl',
|
64
69
|
:'autoconvert' => :'autoconvert',
|
65
70
|
:'udh' => :'udh',
|
66
71
|
:'channel' => :'channel'
|
67
72
|
}
|
68
73
|
end
|
69
74
|
|
75
|
+
# Returns all the JSON keys this model knows about
|
76
|
+
def self.acceptable_attributes
|
77
|
+
attribute_map.values
|
78
|
+
end
|
79
|
+
|
70
80
|
# Attribute type mapping.
|
71
81
|
def self.openapi_types
|
72
82
|
{
|
73
83
|
:'text' => :'String',
|
74
84
|
:'sender' => :'String',
|
75
85
|
:'validity' => :'Integer',
|
86
|
+
:'ttl' => :'Integer',
|
76
87
|
:'autoconvert' => :'String',
|
77
88
|
:'udh' => :'String',
|
78
89
|
:'channel' => :'String'
|
@@ -102,6 +113,8 @@ module MessenteApi
|
|
102
113
|
|
103
114
|
if attributes.key?(:'text')
|
104
115
|
self.text = attributes[:'text']
|
116
|
+
else
|
117
|
+
self.text = nil
|
105
118
|
end
|
106
119
|
|
107
120
|
if attributes.key?(:'sender')
|
@@ -112,6 +125,10 @@ module MessenteApi
|
|
112
125
|
self.validity = attributes[:'validity']
|
113
126
|
end
|
114
127
|
|
128
|
+
if attributes.key?(:'ttl')
|
129
|
+
self.ttl = attributes[:'ttl']
|
130
|
+
end
|
131
|
+
|
115
132
|
if attributes.key?(:'autoconvert')
|
116
133
|
self.autoconvert = attributes[:'autoconvert']
|
117
134
|
end
|
@@ -130,6 +147,7 @@ module MessenteApi
|
|
130
147
|
# Show invalid properties with the reasons. Usually used together with valid?
|
131
148
|
# @return Array for valid properties with the reasons
|
132
149
|
def list_invalid_properties
|
150
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
133
151
|
invalid_properties = Array.new
|
134
152
|
if @text.nil?
|
135
153
|
invalid_properties.push('invalid value for "text", text cannot be nil.')
|
@@ -141,6 +159,7 @@ module MessenteApi
|
|
141
159
|
# Check to see if the all the properties in the model are valid
|
142
160
|
# @return true if the model is valid
|
143
161
|
def valid?
|
162
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
144
163
|
return false if @text.nil?
|
145
164
|
autoconvert_validator = EnumAttributeValidator.new('String', ["full", "on", "off"])
|
146
165
|
return false unless autoconvert_validator.valid?(@autoconvert)
|
@@ -177,6 +196,7 @@ module MessenteApi
|
|
177
196
|
text == o.text &&
|
178
197
|
sender == o.sender &&
|
179
198
|
validity == o.validity &&
|
199
|
+
ttl == o.ttl &&
|
180
200
|
autoconvert == o.autoconvert &&
|
181
201
|
udh == o.udh &&
|
182
202
|
channel == o.channel
|
@@ -191,44 +211,40 @@ module MessenteApi
|
|
191
211
|
# Calculates hash code according to all attributes.
|
192
212
|
# @return [Integer] Hash code
|
193
213
|
def hash
|
194
|
-
[text, sender, validity, autoconvert, udh, channel].hash
|
214
|
+
[text, sender, validity, ttl, autoconvert, udh, channel].hash
|
195
215
|
end
|
196
216
|
|
197
217
|
# Builds the object from hash
|
198
218
|
# @param [Hash] attributes Model attributes in the form of hash
|
199
219
|
# @return [Object] Returns the model itself
|
200
220
|
def self.build_from_hash(attributes)
|
201
|
-
new.build_from_hash(attributes)
|
202
|
-
end
|
203
|
-
|
204
|
-
# Builds the object from hash
|
205
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
206
|
-
# @return [Object] Returns the model itself
|
207
|
-
def build_from_hash(attributes)
|
208
221
|
return nil unless attributes.is_a?(Hash)
|
209
|
-
|
210
|
-
|
222
|
+
attributes = attributes.transform_keys(&:to_sym)
|
223
|
+
transformed_hash = {}
|
224
|
+
openapi_types.each_pair do |key, type|
|
225
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
226
|
+
transformed_hash["#{key}"] = nil
|
227
|
+
elsif type =~ /\AArray<(.*)>/i
|
211
228
|
# check to ensure the input is an array given that the attribute
|
212
229
|
# is documented as an array but the input is not
|
213
|
-
if attributes[
|
214
|
-
|
230
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
231
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
215
232
|
end
|
216
|
-
elsif !attributes[
|
217
|
-
|
218
|
-
end
|
233
|
+
elsif !attributes[attribute_map[key]].nil?
|
234
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
235
|
+
end
|
219
236
|
end
|
220
|
-
|
221
|
-
self
|
237
|
+
new(transformed_hash)
|
222
238
|
end
|
223
239
|
|
224
240
|
# Deserializes the data based on type
|
225
241
|
# @param string type Data type
|
226
242
|
# @param string value Value to be deserialized
|
227
243
|
# @return [Object] Deserialized data
|
228
|
-
def _deserialize(type, value)
|
244
|
+
def self._deserialize(type, value)
|
229
245
|
case type.to_sym
|
230
|
-
when :
|
231
|
-
|
246
|
+
when :Time
|
247
|
+
Time.parse(value)
|
232
248
|
when :Date
|
233
249
|
Date.parse(value)
|
234
250
|
when :String
|
@@ -258,7 +274,9 @@ module MessenteApi
|
|
258
274
|
end
|
259
275
|
end
|
260
276
|
else # model
|
261
|
-
|
277
|
+
# models (e.g. Pet) or oneOf
|
278
|
+
klass = MessenteApi.const_get(type)
|
279
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
262
280
|
end
|
263
281
|
end
|
264
282
|
|
@@ -284,7 +302,7 @@ module MessenteApi
|
|
284
302
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
285
303
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
286
304
|
end
|
287
|
-
|
305
|
+
|
288
306
|
hash[param] = _to_hash(value)
|
289
307
|
end
|
290
308
|
hash
|
@@ -307,5 +325,7 @@ module MessenteApi
|
|
307
325
|
value
|
308
326
|
end
|
309
327
|
end
|
328
|
+
|
310
329
|
end
|
330
|
+
|
311
331
|
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
|
# Report for one country
|
@@ -33,6 +34,11 @@ module MessenteApi
|
|
33
34
|
}
|
34
35
|
end
|
35
36
|
|
37
|
+
# Returns all the JSON keys this model knows about
|
38
|
+
def self.acceptable_attributes
|
39
|
+
attribute_map.values
|
40
|
+
end
|
41
|
+
|
36
42
|
# Attribute type mapping.
|
37
43
|
def self.openapi_types
|
38
44
|
{
|
@@ -65,20 +71,27 @@ module MessenteApi
|
|
65
71
|
|
66
72
|
if attributes.key?(:'total_messages')
|
67
73
|
self.total_messages = attributes[:'total_messages']
|
74
|
+
else
|
75
|
+
self.total_messages = nil
|
68
76
|
end
|
69
77
|
|
70
78
|
if attributes.key?(:'total_price')
|
71
79
|
self.total_price = attributes[:'total_price']
|
80
|
+
else
|
81
|
+
self.total_price = nil
|
72
82
|
end
|
73
83
|
|
74
84
|
if attributes.key?(:'country')
|
75
85
|
self.country = attributes[:'country']
|
86
|
+
else
|
87
|
+
self.country = nil
|
76
88
|
end
|
77
89
|
end
|
78
90
|
|
79
91
|
# Show invalid properties with the reasons. Usually used together with valid?
|
80
92
|
# @return Array for valid properties with the reasons
|
81
93
|
def list_invalid_properties
|
94
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
82
95
|
invalid_properties = Array.new
|
83
96
|
if @total_messages.nil?
|
84
97
|
invalid_properties.push('invalid value for "total_messages", total_messages cannot be nil.')
|
@@ -98,6 +111,7 @@ module MessenteApi
|
|
98
111
|
# Check to see if the all the properties in the model are valid
|
99
112
|
# @return true if the model is valid
|
100
113
|
def valid?
|
114
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
101
115
|
return false if @total_messages.nil?
|
102
116
|
return false if @total_price.nil?
|
103
117
|
return false if @country.nil?
|
@@ -130,37 +144,33 @@ module MessenteApi
|
|
130
144
|
# @param [Hash] attributes Model attributes in the form of hash
|
131
145
|
# @return [Object] Returns the model itself
|
132
146
|
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
147
|
return nil unless attributes.is_a?(Hash)
|
141
|
-
|
142
|
-
|
148
|
+
attributes = attributes.transform_keys(&:to_sym)
|
149
|
+
transformed_hash = {}
|
150
|
+
openapi_types.each_pair do |key, type|
|
151
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
152
|
+
transformed_hash["#{key}"] = nil
|
153
|
+
elsif type =~ /\AArray<(.*)>/i
|
143
154
|
# check to ensure the input is an array given that the attribute
|
144
155
|
# is documented as an array but the input is not
|
145
|
-
if attributes[
|
146
|
-
|
156
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
157
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
147
158
|
end
|
148
|
-
elsif !attributes[
|
149
|
-
|
150
|
-
end
|
159
|
+
elsif !attributes[attribute_map[key]].nil?
|
160
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
161
|
+
end
|
151
162
|
end
|
152
|
-
|
153
|
-
self
|
163
|
+
new(transformed_hash)
|
154
164
|
end
|
155
165
|
|
156
166
|
# Deserializes the data based on type
|
157
167
|
# @param string type Data type
|
158
168
|
# @param string value Value to be deserialized
|
159
169
|
# @return [Object] Deserialized data
|
160
|
-
def _deserialize(type, value)
|
170
|
+
def self._deserialize(type, value)
|
161
171
|
case type.to_sym
|
162
|
-
when :
|
163
|
-
|
172
|
+
when :Time
|
173
|
+
Time.parse(value)
|
164
174
|
when :Date
|
165
175
|
Date.parse(value)
|
166
176
|
when :String
|
@@ -190,7 +200,9 @@ module MessenteApi
|
|
190
200
|
end
|
191
201
|
end
|
192
202
|
else # model
|
193
|
-
|
203
|
+
# models (e.g. Pet) or oneOf
|
204
|
+
klass = MessenteApi.const_get(type)
|
205
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
194
206
|
end
|
195
207
|
end
|
196
208
|
|
@@ -216,7 +228,7 @@ module MessenteApi
|
|
216
228
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
217
229
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
218
230
|
end
|
219
|
-
|
231
|
+
|
220
232
|
hash[param] = _to_hash(value)
|
221
233
|
end
|
222
234
|
hash
|
@@ -239,5 +251,7 @@ module MessenteApi
|
|
239
251
|
value
|
240
252
|
end
|
241
253
|
end
|
254
|
+
|
242
255
|
end
|
256
|
+
|
243
257
|
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 statistics report settings
|
@@ -33,6 +34,11 @@ module MessenteApi
|
|
33
34
|
}
|
34
35
|
end
|
35
36
|
|
37
|
+
# Returns all the JSON keys this model knows about
|
38
|
+
def self.acceptable_attributes
|
39
|
+
attribute_map.values
|
40
|
+
end
|
41
|
+
|
36
42
|
# Attribute type mapping.
|
37
43
|
def self.openapi_types
|
38
44
|
{
|
@@ -65,10 +71,14 @@ module MessenteApi
|
|
65
71
|
|
66
72
|
if attributes.key?(:'start_date')
|
67
73
|
self.start_date = attributes[:'start_date']
|
74
|
+
else
|
75
|
+
self.start_date = nil
|
68
76
|
end
|
69
77
|
|
70
78
|
if attributes.key?(:'end_date')
|
71
79
|
self.end_date = attributes[:'end_date']
|
80
|
+
else
|
81
|
+
self.end_date = nil
|
72
82
|
end
|
73
83
|
|
74
84
|
if attributes.key?(:'message_types')
|
@@ -81,6 +91,7 @@ module MessenteApi
|
|
81
91
|
# Show invalid properties with the reasons. Usually used together with valid?
|
82
92
|
# @return Array for valid properties with the reasons
|
83
93
|
def list_invalid_properties
|
94
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
84
95
|
invalid_properties = Array.new
|
85
96
|
if @start_date.nil?
|
86
97
|
invalid_properties.push('invalid value for "start_date", start_date cannot be nil.')
|
@@ -96,6 +107,7 @@ module MessenteApi
|
|
96
107
|
# Check to see if the all the properties in the model are valid
|
97
108
|
# @return true if the model is valid
|
98
109
|
def valid?
|
110
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
99
111
|
return false if @start_date.nil?
|
100
112
|
return false if @end_date.nil?
|
101
113
|
true
|
@@ -127,37 +139,33 @@ module MessenteApi
|
|
127
139
|
# @param [Hash] attributes Model attributes in the form of hash
|
128
140
|
# @return [Object] Returns the model itself
|
129
141
|
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
142
|
return nil unless attributes.is_a?(Hash)
|
138
|
-
|
139
|
-
|
143
|
+
attributes = attributes.transform_keys(&:to_sym)
|
144
|
+
transformed_hash = {}
|
145
|
+
openapi_types.each_pair do |key, type|
|
146
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
147
|
+
transformed_hash["#{key}"] = nil
|
148
|
+
elsif type =~ /\AArray<(.*)>/i
|
140
149
|
# check to ensure the input is an array given that the attribute
|
141
150
|
# is documented as an array but the input is not
|
142
|
-
if attributes[
|
143
|
-
|
151
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
152
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
144
153
|
end
|
145
|
-
elsif !attributes[
|
146
|
-
|
147
|
-
end
|
154
|
+
elsif !attributes[attribute_map[key]].nil?
|
155
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
156
|
+
end
|
148
157
|
end
|
149
|
-
|
150
|
-
self
|
158
|
+
new(transformed_hash)
|
151
159
|
end
|
152
160
|
|
153
161
|
# Deserializes the data based on type
|
154
162
|
# @param string type Data type
|
155
163
|
# @param string value Value to be deserialized
|
156
164
|
# @return [Object] Deserialized data
|
157
|
-
def _deserialize(type, value)
|
165
|
+
def self._deserialize(type, value)
|
158
166
|
case type.to_sym
|
159
|
-
when :
|
160
|
-
|
167
|
+
when :Time
|
168
|
+
Time.parse(value)
|
161
169
|
when :Date
|
162
170
|
Date.parse(value)
|
163
171
|
when :String
|
@@ -187,7 +195,9 @@ module MessenteApi
|
|
187
195
|
end
|
188
196
|
end
|
189
197
|
else # model
|
190
|
-
|
198
|
+
# models (e.g. Pet) or oneOf
|
199
|
+
klass = MessenteApi.const_get(type)
|
200
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
191
201
|
end
|
192
202
|
end
|
193
203
|
|
@@ -213,7 +223,7 @@ module MessenteApi
|
|
213
223
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
214
224
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
215
225
|
end
|
216
|
-
|
226
|
+
|
217
227
|
hash[param] = _to_hash(value)
|
218
228
|
end
|
219
229
|
hash
|
@@ -236,5 +246,7 @@ module MessenteApi
|
|
236
246
|
value
|
237
247
|
end
|
238
248
|
end
|
249
|
+
|
239
250
|
end
|
251
|
+
|
240
252
|
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 statistics reports
|
@@ -25,6 +26,11 @@ module MessenteApi
|
|
25
26
|
}
|
26
27
|
end
|
27
28
|
|
29
|
+
# Returns all the JSON keys this model knows about
|
30
|
+
def self.acceptable_attributes
|
31
|
+
attribute_map.values
|
32
|
+
end
|
33
|
+
|
28
34
|
# Attribute type mapping.
|
29
35
|
def self.openapi_types
|
30
36
|
{
|
@@ -57,12 +63,15 @@ module MessenteApi
|
|
57
63
|
if (value = attributes[:'reports']).is_a?(Array)
|
58
64
|
self.reports = value
|
59
65
|
end
|
66
|
+
else
|
67
|
+
self.reports = nil
|
60
68
|
end
|
61
69
|
end
|
62
70
|
|
63
71
|
# Show invalid properties with the reasons. Usually used together with valid?
|
64
72
|
# @return Array for valid properties with the reasons
|
65
73
|
def list_invalid_properties
|
74
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
66
75
|
invalid_properties = Array.new
|
67
76
|
if @reports.nil?
|
68
77
|
invalid_properties.push('invalid value for "reports", reports cannot be nil.')
|
@@ -74,6 +83,7 @@ module MessenteApi
|
|
74
83
|
# Check to see if the all the properties in the model are valid
|
75
84
|
# @return true if the model is valid
|
76
85
|
def valid?
|
86
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
77
87
|
return false if @reports.nil?
|
78
88
|
true
|
79
89
|
end
|
@@ -102,37 +112,33 @@ module MessenteApi
|
|
102
112
|
# @param [Hash] attributes Model attributes in the form of hash
|
103
113
|
# @return [Object] Returns the model itself
|
104
114
|
def self.build_from_hash(attributes)
|
105
|
-
new.build_from_hash(attributes)
|
106
|
-
end
|
107
|
-
|
108
|
-
# Builds the object from hash
|
109
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
110
|
-
# @return [Object] Returns the model itself
|
111
|
-
def build_from_hash(attributes)
|
112
115
|
return nil unless attributes.is_a?(Hash)
|
113
|
-
|
114
|
-
|
116
|
+
attributes = attributes.transform_keys(&:to_sym)
|
117
|
+
transformed_hash = {}
|
118
|
+
openapi_types.each_pair do |key, type|
|
119
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
120
|
+
transformed_hash["#{key}"] = nil
|
121
|
+
elsif type =~ /\AArray<(.*)>/i
|
115
122
|
# check to ensure the input is an array given that the attribute
|
116
123
|
# is documented as an array but the input is not
|
117
|
-
if attributes[
|
118
|
-
|
124
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
125
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
119
126
|
end
|
120
|
-
elsif !attributes[
|
121
|
-
|
122
|
-
end
|
127
|
+
elsif !attributes[attribute_map[key]].nil?
|
128
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
129
|
+
end
|
123
130
|
end
|
124
|
-
|
125
|
-
self
|
131
|
+
new(transformed_hash)
|
126
132
|
end
|
127
133
|
|
128
134
|
# Deserializes the data based on type
|
129
135
|
# @param string type Data type
|
130
136
|
# @param string value Value to be deserialized
|
131
137
|
# @return [Object] Deserialized data
|
132
|
-
def _deserialize(type, value)
|
138
|
+
def self._deserialize(type, value)
|
133
139
|
case type.to_sym
|
134
|
-
when :
|
135
|
-
|
140
|
+
when :Time
|
141
|
+
Time.parse(value)
|
136
142
|
when :Date
|
137
143
|
Date.parse(value)
|
138
144
|
when :String
|
@@ -162,7 +168,9 @@ module MessenteApi
|
|
162
168
|
end
|
163
169
|
end
|
164
170
|
else # model
|
165
|
-
|
171
|
+
# models (e.g. Pet) or oneOf
|
172
|
+
klass = MessenteApi.const_get(type)
|
173
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
166
174
|
end
|
167
175
|
end
|
168
176
|
|
@@ -188,7 +196,7 @@ module MessenteApi
|
|
188
196
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
189
197
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
190
198
|
end
|
191
|
-
|
199
|
+
|
192
200
|
hash[param] = _to_hash(value)
|
193
201
|
end
|
194
202
|
hash
|
@@ -211,5 +219,7 @@ module MessenteApi
|
|
211
219
|
value
|
212
220
|
end
|
213
221
|
end
|
222
|
+
|
214
223
|
end
|
224
|
+
|
215
225
|
end
|