messente_api 1.4.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +24 -19
- data/docs/ViberVideo.md +24 -0
- 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 +55 -28
- data/lib/messente_api/models/viber_video.rb +274 -0
- 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 -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
|
# A container for errors
|
@@ -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[:'errors']).is_a?(Array)
|
58
64
|
self.errors = value
|
59
65
|
end
|
66
|
+
else
|
67
|
+
self.errors = 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 @errors.nil?
|
68
77
|
invalid_properties.push('invalid value for "errors", errors 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 @errors.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
|
@@ -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 errors
|
@@ -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[:'errors']).is_a?(Array)
|
58
64
|
self.errors = value
|
59
65
|
end
|
66
|
+
else
|
67
|
+
self.errors = 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 @errors.nil?
|
68
77
|
invalid_properties.push('invalid value for "errors", errors 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 @errors.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
|
@@ -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 errors
|
@@ -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[:'errors']).is_a?(Array)
|
58
64
|
self.errors = value
|
59
65
|
end
|
66
|
+
else
|
67
|
+
self.errors = 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 @errors.nil?
|
68
77
|
invalid_properties.push('invalid value for "errors", errors 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 @errors.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
|
@@ -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 ErrorTitleOmnichannel
|
@@ -22,6 +23,10 @@ module MessenteApi
|
|
22
23
|
MISSING_DATA = "Missing data".freeze
|
23
24
|
METHOD_NOT_ALLOWED = "Method not allowed".freeze
|
24
25
|
|
26
|
+
def self.all_vars
|
27
|
+
@all_vars ||= [NOT_FOUND, FORBIDDEN, UNAUTHORIZED, INVALID_DATA, INTERNAL_SERVER_ERROR, MISSING_DATA, METHOD_NOT_ALLOWED].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 #ErrorTitleOmnichannel"
|
38
|
-
value
|
41
|
+
return value if ErrorTitleOmnichannel.all_vars.include?(value)
|
42
|
+
raise "Invalid ENUM value #{value} for class #ErrorTitleOmnichannel"
|
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 ErrorTitlePhonebook
|
@@ -21,6 +22,10 @@ module MessenteApi
|
|
21
22
|
CLIENT_ERROR = "Client error".freeze
|
22
23
|
GENERAL_ERROR = "General error".freeze
|
23
24
|
|
25
|
+
def self.all_vars
|
26
|
+
@all_vars ||= [INVALID_DATA, UNAUTHORIZED, MISSING_RESOURCE, CONFLICT, CLIENT_ERROR, GENERAL_ERROR].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 #ErrorTitlePhonebook"
|
37
|
-
value
|
40
|
+
return value if ErrorTitlePhonebook.all_vars.include?(value)
|
41
|
+
raise "Invalid ENUM value #{value} for class #ErrorTitlePhonebook"
|
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
|
# A container for blacklisted numbers
|
@@ -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
|
{
|
@@ -63,6 +69,7 @@ module MessenteApi
|
|
63
69
|
# Show invalid properties with the reasons. Usually used together with valid?
|
64
70
|
# @return Array for valid properties with the reasons
|
65
71
|
def list_invalid_properties
|
72
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
66
73
|
invalid_properties = Array.new
|
67
74
|
invalid_properties
|
68
75
|
end
|
@@ -70,9 +77,20 @@ module MessenteApi
|
|
70
77
|
# Check to see if the all the properties in the model are valid
|
71
78
|
# @return true if the model is valid
|
72
79
|
def valid?
|
80
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
73
81
|
true
|
74
82
|
end
|
75
83
|
|
84
|
+
# Custom attribute writer method with validation
|
85
|
+
# @param [Object] phone_numbers Value to be assigned
|
86
|
+
def phone_numbers=(phone_numbers)
|
87
|
+
if phone_numbers.nil?
|
88
|
+
fail ArgumentError, 'phone_numbers cannot be nil'
|
89
|
+
end
|
90
|
+
|
91
|
+
@phone_numbers = phone_numbers
|
92
|
+
end
|
93
|
+
|
76
94
|
# Checks equality by comparing each attribute.
|
77
95
|
# @param [Object] Object to be compared
|
78
96
|
def ==(o)
|
@@ -97,37 +115,33 @@ module MessenteApi
|
|
97
115
|
# @param [Hash] attributes Model attributes in the form of hash
|
98
116
|
# @return [Object] Returns the model itself
|
99
117
|
def self.build_from_hash(attributes)
|
100
|
-
new.build_from_hash(attributes)
|
101
|
-
end
|
102
|
-
|
103
|
-
# Builds the object from hash
|
104
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
105
|
-
# @return [Object] Returns the model itself
|
106
|
-
def build_from_hash(attributes)
|
107
118
|
return nil unless attributes.is_a?(Hash)
|
108
|
-
|
109
|
-
|
119
|
+
attributes = attributes.transform_keys(&:to_sym)
|
120
|
+
transformed_hash = {}
|
121
|
+
openapi_types.each_pair do |key, type|
|
122
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
123
|
+
transformed_hash["#{key}"] = nil
|
124
|
+
elsif type =~ /\AArray<(.*)>/i
|
110
125
|
# check to ensure the input is an array given that the attribute
|
111
126
|
# is documented as an array but the input is not
|
112
|
-
if attributes[
|
113
|
-
|
127
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
128
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
114
129
|
end
|
115
|
-
elsif !attributes[
|
116
|
-
|
117
|
-
end
|
130
|
+
elsif !attributes[attribute_map[key]].nil?
|
131
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
132
|
+
end
|
118
133
|
end
|
119
|
-
|
120
|
-
self
|
134
|
+
new(transformed_hash)
|
121
135
|
end
|
122
136
|
|
123
137
|
# Deserializes the data based on type
|
124
138
|
# @param string type Data type
|
125
139
|
# @param string value Value to be deserialized
|
126
140
|
# @return [Object] Deserialized data
|
127
|
-
def _deserialize(type, value)
|
141
|
+
def self._deserialize(type, value)
|
128
142
|
case type.to_sym
|
129
|
-
when :
|
130
|
-
|
143
|
+
when :Time
|
144
|
+
Time.parse(value)
|
131
145
|
when :Date
|
132
146
|
Date.parse(value)
|
133
147
|
when :String
|
@@ -157,7 +171,9 @@ module MessenteApi
|
|
157
171
|
end
|
158
172
|
end
|
159
173
|
else # model
|
160
|
-
|
174
|
+
# models (e.g. Pet) or oneOf
|
175
|
+
klass = MessenteApi.const_get(type)
|
176
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
161
177
|
end
|
162
178
|
end
|
163
179
|
|
@@ -183,7 +199,7 @@ module MessenteApi
|
|
183
199
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
184
200
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
185
201
|
end
|
186
|
-
|
202
|
+
|
187
203
|
hash[param] = _to_hash(value)
|
188
204
|
end
|
189
205
|
hash
|
@@ -206,5 +222,7 @@ module MessenteApi
|
|
206
222
|
value
|
207
223
|
end
|
208
224
|
end
|
225
|
+
|
209
226
|
end
|
227
|
+
|
210
228
|
end
|