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
|
# Telegram message content
|
@@ -71,6 +72,11 @@ module MessenteApi
|
|
71
72
|
}
|
72
73
|
end
|
73
74
|
|
75
|
+
# Returns all the JSON keys this model knows about
|
76
|
+
def self.acceptable_attributes
|
77
|
+
attribute_map.values
|
78
|
+
end
|
79
|
+
|
74
80
|
# Attribute type mapping.
|
75
81
|
def self.openapi_types
|
76
82
|
{
|
@@ -139,6 +145,7 @@ module MessenteApi
|
|
139
145
|
# Show invalid properties with the reasons. Usually used together with valid?
|
140
146
|
# @return Array for valid properties with the reasons
|
141
147
|
def list_invalid_properties
|
148
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
142
149
|
invalid_properties = Array.new
|
143
150
|
invalid_properties
|
144
151
|
end
|
@@ -146,6 +153,7 @@ module MessenteApi
|
|
146
153
|
# Check to see if the all the properties in the model are valid
|
147
154
|
# @return true if the model is valid
|
148
155
|
def valid?
|
156
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
149
157
|
channel_validator = EnumAttributeValidator.new('String', ["telegram"])
|
150
158
|
return false unless channel_validator.valid?(@channel)
|
151
159
|
true
|
@@ -191,37 +199,33 @@ module MessenteApi
|
|
191
199
|
# @param [Hash] attributes Model attributes in the form of hash
|
192
200
|
# @return [Object] Returns the model itself
|
193
201
|
def self.build_from_hash(attributes)
|
194
|
-
new.build_from_hash(attributes)
|
195
|
-
end
|
196
|
-
|
197
|
-
# Builds the object from hash
|
198
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
199
|
-
# @return [Object] Returns the model itself
|
200
|
-
def build_from_hash(attributes)
|
201
202
|
return nil unless attributes.is_a?(Hash)
|
202
|
-
|
203
|
-
|
203
|
+
attributes = attributes.transform_keys(&:to_sym)
|
204
|
+
transformed_hash = {}
|
205
|
+
openapi_types.each_pair do |key, type|
|
206
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
207
|
+
transformed_hash["#{key}"] = nil
|
208
|
+
elsif type =~ /\AArray<(.*)>/i
|
204
209
|
# check to ensure the input is an array given that the attribute
|
205
210
|
# is documented as an array but the input is not
|
206
|
-
if attributes[
|
207
|
-
|
211
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
212
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
208
213
|
end
|
209
|
-
elsif !attributes[
|
210
|
-
|
211
|
-
end
|
214
|
+
elsif !attributes[attribute_map[key]].nil?
|
215
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
216
|
+
end
|
212
217
|
end
|
213
|
-
|
214
|
-
self
|
218
|
+
new(transformed_hash)
|
215
219
|
end
|
216
220
|
|
217
221
|
# Deserializes the data based on type
|
218
222
|
# @param string type Data type
|
219
223
|
# @param string value Value to be deserialized
|
220
224
|
# @return [Object] Deserialized data
|
221
|
-
def _deserialize(type, value)
|
225
|
+
def self._deserialize(type, value)
|
222
226
|
case type.to_sym
|
223
|
-
when :
|
224
|
-
|
227
|
+
when :Time
|
228
|
+
Time.parse(value)
|
225
229
|
when :Date
|
226
230
|
Date.parse(value)
|
227
231
|
when :String
|
@@ -251,7 +255,9 @@ module MessenteApi
|
|
251
255
|
end
|
252
256
|
end
|
253
257
|
else # model
|
254
|
-
|
258
|
+
# models (e.g. Pet) or oneOf
|
259
|
+
klass = MessenteApi.const_get(type)
|
260
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
255
261
|
end
|
256
262
|
end
|
257
263
|
|
@@ -277,7 +283,7 @@ module MessenteApi
|
|
277
283
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
278
284
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
279
285
|
end
|
280
|
-
|
286
|
+
|
281
287
|
hash[param] = _to_hash(value)
|
282
288
|
end
|
283
289
|
hash
|
@@ -300,5 +306,7 @@ module MessenteApi
|
|
300
306
|
value
|
301
307
|
end
|
302
308
|
end
|
309
|
+
|
303
310
|
end
|
311
|
+
|
304
312
|
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 TextStore
|
@@ -18,6 +19,10 @@ module MessenteApi
|
|
18
19
|
PLAINTEXT = "plaintext".freeze
|
19
20
|
SHA256 = "sha256".freeze
|
20
21
|
|
22
|
+
def self.all_vars
|
23
|
+
@all_vars ||= [NOSTORE, PLAINTEXT, SHA256].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 #TextStore"
|
34
|
-
value
|
37
|
+
return value if TextStore.all_vars.include?(value)
|
38
|
+
raise "Invalid ENUM value #{value} for class #TextStore"
|
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
|
# Viber message content
|
@@ -18,9 +19,12 @@ module MessenteApi
|
|
18
19
|
# Phone number or alphanumeric sender name
|
19
20
|
attr_accessor :sender
|
20
21
|
|
21
|
-
# After how many minutes this channel is considered as failed and the next channel is attempted
|
22
|
+
# 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.
|
22
23
|
attr_accessor :validity
|
23
24
|
|
25
|
+
# 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.
|
26
|
+
attr_accessor :ttl
|
27
|
+
|
24
28
|
# Plaintext content for Viber
|
25
29
|
attr_accessor :text
|
26
30
|
|
@@ -63,6 +67,7 @@ module MessenteApi
|
|
63
67
|
{
|
64
68
|
:'sender' => :'sender',
|
65
69
|
:'validity' => :'validity',
|
70
|
+
:'ttl' => :'ttl',
|
66
71
|
:'text' => :'text',
|
67
72
|
:'image_url' => :'image_url',
|
68
73
|
:'button_url' => :'button_url',
|
@@ -71,11 +76,17 @@ module MessenteApi
|
|
71
76
|
}
|
72
77
|
end
|
73
78
|
|
79
|
+
# Returns all the JSON keys this model knows about
|
80
|
+
def self.acceptable_attributes
|
81
|
+
attribute_map.values
|
82
|
+
end
|
83
|
+
|
74
84
|
# Attribute type mapping.
|
75
85
|
def self.openapi_types
|
76
86
|
{
|
77
87
|
:'sender' => :'String',
|
78
88
|
:'validity' => :'Integer',
|
89
|
+
:'ttl' => :'Integer',
|
79
90
|
:'text' => :'String',
|
80
91
|
:'image_url' => :'String',
|
81
92
|
:'button_url' => :'String',
|
@@ -113,6 +124,10 @@ module MessenteApi
|
|
113
124
|
self.validity = attributes[:'validity']
|
114
125
|
end
|
115
126
|
|
127
|
+
if attributes.key?(:'ttl')
|
128
|
+
self.ttl = attributes[:'ttl']
|
129
|
+
end
|
130
|
+
|
116
131
|
if attributes.key?(:'text')
|
117
132
|
self.text = attributes[:'text']
|
118
133
|
end
|
@@ -139,6 +154,7 @@ module MessenteApi
|
|
139
154
|
# Show invalid properties with the reasons. Usually used together with valid?
|
140
155
|
# @return Array for valid properties with the reasons
|
141
156
|
def list_invalid_properties
|
157
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
142
158
|
invalid_properties = Array.new
|
143
159
|
invalid_properties
|
144
160
|
end
|
@@ -146,6 +162,7 @@ module MessenteApi
|
|
146
162
|
# Check to see if the all the properties in the model are valid
|
147
163
|
# @return true if the model is valid
|
148
164
|
def valid?
|
165
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
149
166
|
channel_validator = EnumAttributeValidator.new('String', ["viber"])
|
150
167
|
return false unless channel_validator.valid?(@channel)
|
151
168
|
true
|
@@ -168,6 +185,7 @@ module MessenteApi
|
|
168
185
|
self.class == o.class &&
|
169
186
|
sender == o.sender &&
|
170
187
|
validity == o.validity &&
|
188
|
+
ttl == o.ttl &&
|
171
189
|
text == o.text &&
|
172
190
|
image_url == o.image_url &&
|
173
191
|
button_url == o.button_url &&
|
@@ -184,44 +202,40 @@ module MessenteApi
|
|
184
202
|
# Calculates hash code according to all attributes.
|
185
203
|
# @return [Integer] Hash code
|
186
204
|
def hash
|
187
|
-
[sender, validity, text, image_url, button_url, button_text, channel].hash
|
205
|
+
[sender, validity, ttl, text, image_url, button_url, button_text, channel].hash
|
188
206
|
end
|
189
207
|
|
190
208
|
# Builds the object from hash
|
191
209
|
# @param [Hash] attributes Model attributes in the form of hash
|
192
210
|
# @return [Object] Returns the model itself
|
193
211
|
def self.build_from_hash(attributes)
|
194
|
-
new.build_from_hash(attributes)
|
195
|
-
end
|
196
|
-
|
197
|
-
# Builds the object from hash
|
198
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
199
|
-
# @return [Object] Returns the model itself
|
200
|
-
def build_from_hash(attributes)
|
201
212
|
return nil unless attributes.is_a?(Hash)
|
202
|
-
|
203
|
-
|
213
|
+
attributes = attributes.transform_keys(&:to_sym)
|
214
|
+
transformed_hash = {}
|
215
|
+
openapi_types.each_pair do |key, type|
|
216
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
217
|
+
transformed_hash["#{key}"] = nil
|
218
|
+
elsif type =~ /\AArray<(.*)>/i
|
204
219
|
# check to ensure the input is an array given that the attribute
|
205
220
|
# is documented as an array but the input is not
|
206
|
-
if attributes[
|
207
|
-
|
221
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
222
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
208
223
|
end
|
209
|
-
elsif !attributes[
|
210
|
-
|
211
|
-
end
|
224
|
+
elsif !attributes[attribute_map[key]].nil?
|
225
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
226
|
+
end
|
212
227
|
end
|
213
|
-
|
214
|
-
self
|
228
|
+
new(transformed_hash)
|
215
229
|
end
|
216
230
|
|
217
231
|
# Deserializes the data based on type
|
218
232
|
# @param string type Data type
|
219
233
|
# @param string value Value to be deserialized
|
220
234
|
# @return [Object] Deserialized data
|
221
|
-
def _deserialize(type, value)
|
235
|
+
def self._deserialize(type, value)
|
222
236
|
case type.to_sym
|
223
|
-
when :
|
224
|
-
|
237
|
+
when :Time
|
238
|
+
Time.parse(value)
|
225
239
|
when :Date
|
226
240
|
Date.parse(value)
|
227
241
|
when :String
|
@@ -251,7 +265,9 @@ module MessenteApi
|
|
251
265
|
end
|
252
266
|
end
|
253
267
|
else # model
|
254
|
-
|
268
|
+
# models (e.g. Pet) or oneOf
|
269
|
+
klass = MessenteApi.const_get(type)
|
270
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
255
271
|
end
|
256
272
|
end
|
257
273
|
|
@@ -277,7 +293,7 @@ module MessenteApi
|
|
277
293
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
278
294
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
279
295
|
end
|
280
|
-
|
296
|
+
|
281
297
|
hash[param] = _to_hash(value)
|
282
298
|
end
|
283
299
|
hash
|
@@ -300,5 +316,7 @@ module MessenteApi
|
|
300
316
|
value
|
301
317
|
end
|
302
318
|
end
|
319
|
+
|
303
320
|
end
|
321
|
+
|
304
322
|
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
|
# WhatsApp message content. Only one of \"text\", \"image\", \"document\" or \"audio\" can be provided
|
@@ -21,13 +22,10 @@ module MessenteApi
|
|
21
22
|
# After how many minutes this channel is considered as failed and the next channel is attempted
|
22
23
|
attr_accessor :validity
|
23
24
|
|
24
|
-
|
25
|
+
# 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.
|
26
|
+
attr_accessor :ttl
|
25
27
|
|
26
|
-
attr_accessor :
|
27
|
-
|
28
|
-
attr_accessor :document
|
29
|
-
|
30
|
-
attr_accessor :audio
|
28
|
+
attr_accessor :template
|
31
29
|
|
32
30
|
# The channel used to deliver the message
|
33
31
|
attr_accessor :channel
|
@@ -59,23 +57,24 @@ module MessenteApi
|
|
59
57
|
{
|
60
58
|
:'sender' => :'sender',
|
61
59
|
:'validity' => :'validity',
|
62
|
-
:'
|
63
|
-
:'
|
64
|
-
:'document' => :'document',
|
65
|
-
:'audio' => :'audio',
|
60
|
+
:'ttl' => :'ttl',
|
61
|
+
:'template' => :'template',
|
66
62
|
:'channel' => :'channel'
|
67
63
|
}
|
68
64
|
end
|
69
65
|
|
66
|
+
# Returns all the JSON keys this model knows about
|
67
|
+
def self.acceptable_attributes
|
68
|
+
attribute_map.values
|
69
|
+
end
|
70
|
+
|
70
71
|
# Attribute type mapping.
|
71
72
|
def self.openapi_types
|
72
73
|
{
|
73
74
|
:'sender' => :'String',
|
74
75
|
:'validity' => :'Integer',
|
75
|
-
:'
|
76
|
-
:'
|
77
|
-
:'document' => :'WhatsAppDocument',
|
78
|
-
:'audio' => :'WhatsAppAudio',
|
76
|
+
:'ttl' => :'Integer',
|
77
|
+
:'template' => :'WhatsAppTemplate',
|
79
78
|
:'channel' => :'String'
|
80
79
|
}
|
81
80
|
end
|
@@ -109,20 +108,12 @@ module MessenteApi
|
|
109
108
|
self.validity = attributes[:'validity']
|
110
109
|
end
|
111
110
|
|
112
|
-
if attributes.key?(:'
|
113
|
-
self.
|
111
|
+
if attributes.key?(:'ttl')
|
112
|
+
self.ttl = attributes[:'ttl']
|
114
113
|
end
|
115
114
|
|
116
|
-
if attributes.key?(:'
|
117
|
-
self.
|
118
|
-
end
|
119
|
-
|
120
|
-
if attributes.key?(:'document')
|
121
|
-
self.document = attributes[:'document']
|
122
|
-
end
|
123
|
-
|
124
|
-
if attributes.key?(:'audio')
|
125
|
-
self.audio = attributes[:'audio']
|
115
|
+
if attributes.key?(:'template')
|
116
|
+
self.template = attributes[:'template']
|
126
117
|
end
|
127
118
|
|
128
119
|
if attributes.key?(:'channel')
|
@@ -135,6 +126,7 @@ module MessenteApi
|
|
135
126
|
# Show invalid properties with the reasons. Usually used together with valid?
|
136
127
|
# @return Array for valid properties with the reasons
|
137
128
|
def list_invalid_properties
|
129
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
138
130
|
invalid_properties = Array.new
|
139
131
|
invalid_properties
|
140
132
|
end
|
@@ -142,6 +134,7 @@ module MessenteApi
|
|
142
134
|
# Check to see if the all the properties in the model are valid
|
143
135
|
# @return true if the model is valid
|
144
136
|
def valid?
|
137
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
145
138
|
channel_validator = EnumAttributeValidator.new('String', ["whatsapp"])
|
146
139
|
return false unless channel_validator.valid?(@channel)
|
147
140
|
true
|
@@ -164,10 +157,8 @@ module MessenteApi
|
|
164
157
|
self.class == o.class &&
|
165
158
|
sender == o.sender &&
|
166
159
|
validity == o.validity &&
|
167
|
-
|
168
|
-
|
169
|
-
document == o.document &&
|
170
|
-
audio == o.audio &&
|
160
|
+
ttl == o.ttl &&
|
161
|
+
template == o.template &&
|
171
162
|
channel == o.channel
|
172
163
|
end
|
173
164
|
|
@@ -180,44 +171,40 @@ module MessenteApi
|
|
180
171
|
# Calculates hash code according to all attributes.
|
181
172
|
# @return [Integer] Hash code
|
182
173
|
def hash
|
183
|
-
[sender, validity,
|
174
|
+
[sender, validity, ttl, template, channel].hash
|
184
175
|
end
|
185
176
|
|
186
177
|
# Builds the object from hash
|
187
178
|
# @param [Hash] attributes Model attributes in the form of hash
|
188
179
|
# @return [Object] Returns the model itself
|
189
180
|
def self.build_from_hash(attributes)
|
190
|
-
new.build_from_hash(attributes)
|
191
|
-
end
|
192
|
-
|
193
|
-
# Builds the object from hash
|
194
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
195
|
-
# @return [Object] Returns the model itself
|
196
|
-
def build_from_hash(attributes)
|
197
181
|
return nil unless attributes.is_a?(Hash)
|
198
|
-
|
199
|
-
|
182
|
+
attributes = attributes.transform_keys(&:to_sym)
|
183
|
+
transformed_hash = {}
|
184
|
+
openapi_types.each_pair do |key, type|
|
185
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
186
|
+
transformed_hash["#{key}"] = nil
|
187
|
+
elsif type =~ /\AArray<(.*)>/i
|
200
188
|
# check to ensure the input is an array given that the attribute
|
201
189
|
# is documented as an array but the input is not
|
202
|
-
if attributes[
|
203
|
-
|
190
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
191
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
204
192
|
end
|
205
|
-
elsif !attributes[
|
206
|
-
|
207
|
-
end
|
193
|
+
elsif !attributes[attribute_map[key]].nil?
|
194
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
195
|
+
end
|
208
196
|
end
|
209
|
-
|
210
|
-
self
|
197
|
+
new(transformed_hash)
|
211
198
|
end
|
212
199
|
|
213
200
|
# Deserializes the data based on type
|
214
201
|
# @param string type Data type
|
215
202
|
# @param string value Value to be deserialized
|
216
203
|
# @return [Object] Deserialized data
|
217
|
-
def _deserialize(type, value)
|
204
|
+
def self._deserialize(type, value)
|
218
205
|
case type.to_sym
|
219
|
-
when :
|
220
|
-
|
206
|
+
when :Time
|
207
|
+
Time.parse(value)
|
221
208
|
when :Date
|
222
209
|
Date.parse(value)
|
223
210
|
when :String
|
@@ -247,7 +234,9 @@ module MessenteApi
|
|
247
234
|
end
|
248
235
|
end
|
249
236
|
else # model
|
250
|
-
|
237
|
+
# models (e.g. Pet) or oneOf
|
238
|
+
klass = MessenteApi.const_get(type)
|
239
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
251
240
|
end
|
252
241
|
end
|
253
242
|
|
@@ -273,7 +262,7 @@ module MessenteApi
|
|
273
262
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
274
263
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
275
264
|
end
|
276
|
-
|
265
|
+
|
277
266
|
hash[param] = _to_hash(value)
|
278
267
|
end
|
279
268
|
hash
|
@@ -296,5 +285,7 @@ module MessenteApi
|
|
296
285
|
value
|
297
286
|
end
|
298
287
|
end
|
288
|
+
|
299
289
|
end
|
290
|
+
|
300
291
|
end
|