messente_api 2.4.1 → 2.5.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/Gemfile.lock +13 -13
- data/README.md +1 -1
- data/docs/BulkMessagingApi.md +1 -1
- data/docs/OmnimessageApi.md +1 -1
- data/docs/OmnimessageMessagesInner.md +46 -45
- data/docs/Rcs.md +32 -0
- data/docs/RcsCardContent.md +24 -0
- data/docs/RcsCardOrientation.md +15 -0
- data/docs/RcsCardWidth.md +15 -0
- data/docs/RcsCarouselCard.md +20 -0
- data/docs/RcsContentInfo.md +22 -0
- data/docs/RcsCreateCalendarEventAction.md +24 -0
- data/docs/RcsDialAction.md +18 -0
- data/docs/RcsImageAlignment.md +15 -0
- data/docs/RcsLatLng.md +20 -0
- data/docs/RcsMedia.md +20 -0
- data/docs/RcsMediaHeight.md +15 -0
- data/docs/RcsOpenUrlAction.md +24 -0
- data/docs/RcsOpenUrlApplication.md +15 -0
- data/docs/RcsRichCard.md +20 -0
- data/docs/RcsStandaloneCard.md +22 -0
- data/docs/RcsSuggestedAction.md +32 -0
- data/docs/RcsSuggestedReply.md +20 -0
- data/docs/RcsSuggestion.md +20 -0
- data/docs/RcsViewLocationAction.md +22 -0
- data/docs/RcsWebviewViewMode.md +15 -0
- data/docs/StatisticsReportSettings.md +1 -1
- data/lib/messente_api/models/channel.rb +2 -2
- data/lib/messente_api/models/omnimessage_messages_inner.rb +8 -9
- data/lib/messente_api/models/{telegram.rb → rcs.rb} +97 -42
- data/lib/messente_api/models/rcs_card_content.rb +298 -0
- data/lib/messente_api/models/rcs_card_orientation.rb +40 -0
- data/lib/messente_api/models/rcs_card_width.rb +40 -0
- data/lib/messente_api/models/rcs_carousel_card.rb +291 -0
- data/lib/messente_api/models/rcs_content_info.rb +251 -0
- data/lib/messente_api/models/rcs_create_calendar_event_action.rb +312 -0
- data/lib/messente_api/models/rcs_dial_action.rb +223 -0
- data/lib/messente_api/models/rcs_image_alignment.rb +40 -0
- data/lib/messente_api/models/rcs_lat_lng.rb +240 -0
- data/lib/messente_api/models/rcs_media.rb +260 -0
- data/lib/messente_api/models/rcs_media_height.rb +41 -0
- data/lib/messente_api/models/rcs_open_url_action.rb +299 -0
- data/lib/messente_api/models/rcs_open_url_application.rb +40 -0
- data/lib/messente_api/models/rcs_rich_card.rb +224 -0
- data/lib/messente_api/models/rcs_standalone_card.rb +276 -0
- data/lib/messente_api/models/rcs_suggested_action.rb +350 -0
- data/lib/messente_api/models/rcs_suggested_reply.rb +278 -0
- data/lib/messente_api/models/rcs_suggestion.rb +224 -0
- data/lib/messente_api/models/rcs_view_location_action.rb +237 -0
- data/lib/messente_api/models/rcs_webview_view_mode.rb +41 -0
- data/lib/messente_api/models/statistics_report_settings.rb +1 -1
- data/lib/messente_api/version.rb +1 -1
- data/lib/messente_api.rb +21 -1
- metadata +44 -4
- data/docs/Telegram.md +0 -30
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# MessenteApi::RcsWebviewViewMode
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
|
|
8
|
+
## Example
|
|
9
|
+
|
|
10
|
+
```ruby
|
|
11
|
+
require 'messente_api'
|
|
12
|
+
|
|
13
|
+
instance = MessenteApi::RcsWebviewViewMode.new()
|
|
14
|
+
```
|
|
15
|
+
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **start_date** | **Date** | Start date for the report | |
|
|
8
8
|
| **end_date** | **Date** | End date for the report | |
|
|
9
|
-
| **message_types** | **Array<String>** | Optional list of message types (sms, viber, whatsapp,
|
|
9
|
+
| **message_types** | **Array<String>** | Optional list of message types (sms, viber, whatsapp, rcs, hlr) | [optional] |
|
|
10
10
|
|
|
11
11
|
## Example
|
|
12
12
|
|
|
@@ -18,10 +18,10 @@ module MessenteApi
|
|
|
18
18
|
SMS = "sms".freeze
|
|
19
19
|
VIBER = "viber".freeze
|
|
20
20
|
WHATSAPP = "whatsapp".freeze
|
|
21
|
-
|
|
21
|
+
RCS = "rcs".freeze
|
|
22
22
|
|
|
23
23
|
def self.all_vars
|
|
24
|
-
@all_vars ||= [SMS, VIBER, WHATSAPP,
|
|
24
|
+
@all_vars ||= [SMS, VIBER, WHATSAPP, RCS].freeze
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
# Builds the enum from string
|
|
@@ -16,28 +16,27 @@ require 'time'
|
|
|
16
16
|
module MessenteApi
|
|
17
17
|
module OmnimessageMessagesInner
|
|
18
18
|
class << self
|
|
19
|
-
# List of class defined in
|
|
20
|
-
def
|
|
19
|
+
# List of class defined in anyOf (OpenAPI v3)
|
|
20
|
+
def openapi_any_of
|
|
21
21
|
[
|
|
22
|
+
:'Rcs',
|
|
22
23
|
:'SMS',
|
|
23
|
-
:'Telegram',
|
|
24
24
|
:'Viber',
|
|
25
25
|
:'WhatsApp'
|
|
26
26
|
]
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
# Builds the object
|
|
30
|
-
# @param [Mixed] Data to be matched against the list of
|
|
30
|
+
# @param [Mixed] Data to be matched against the list of anyOf items
|
|
31
31
|
# @return [Object] Returns the model or the data itself
|
|
32
32
|
def build(data)
|
|
33
|
-
# Go through the list of
|
|
33
|
+
# Go through the list of anyOf items and attempt to identify the appropriate one.
|
|
34
34
|
# Note:
|
|
35
|
-
# - We do not attempt to check whether exactly one item matches.
|
|
36
35
|
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
|
37
36
|
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
|
38
37
|
# - TODO: scalar values are de facto behaving as if they were nullable.
|
|
39
38
|
# - TODO: logging when debugging is set.
|
|
40
|
-
|
|
39
|
+
openapi_any_of.each do |klass|
|
|
41
40
|
begin
|
|
42
41
|
next if klass == :AnyType # "nullable: true"
|
|
43
42
|
typed_data = find_and_cast_into_type(klass, data)
|
|
@@ -46,7 +45,7 @@ module MessenteApi
|
|
|
46
45
|
end
|
|
47
46
|
end
|
|
48
47
|
|
|
49
|
-
|
|
48
|
+
openapi_any_of.include?(:AnyType) ? data : nil
|
|
50
49
|
end
|
|
51
50
|
|
|
52
51
|
private
|
|
@@ -85,7 +84,7 @@ module MessenteApi
|
|
|
85
84
|
else # model
|
|
86
85
|
const = MessenteApi.const_get(klass)
|
|
87
86
|
if const
|
|
88
|
-
if const.respond_to?(:
|
|
87
|
+
if const.respond_to?(:openapi_any_of) # nested anyOf model
|
|
89
88
|
model = const.build(data)
|
|
90
89
|
return model if model
|
|
91
90
|
else
|
|
@@ -14,28 +14,29 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module MessenteApi
|
|
17
|
-
#
|
|
18
|
-
class
|
|
17
|
+
# RCS message object. Exactly one of 'text', 'content_info' or 'rich_card' must be provided.
|
|
18
|
+
class Rcs
|
|
19
|
+
# The channel used to deliver the message
|
|
20
|
+
attr_accessor :channel
|
|
21
|
+
|
|
19
22
|
# Phone number or alphanumeric sender name
|
|
20
23
|
attr_accessor :sender
|
|
21
24
|
|
|
22
|
-
# 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.
|
|
23
26
|
attr_accessor :validity
|
|
24
27
|
|
|
25
|
-
#
|
|
26
|
-
attr_accessor :
|
|
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
|
|
27
30
|
|
|
28
|
-
#
|
|
29
|
-
attr_accessor :
|
|
31
|
+
# Text content of the RCS message
|
|
32
|
+
attr_accessor :text
|
|
30
33
|
|
|
31
|
-
#
|
|
32
|
-
attr_accessor :
|
|
34
|
+
# List of suggestions to include with the message
|
|
35
|
+
attr_accessor :suggestions
|
|
33
36
|
|
|
34
|
-
|
|
35
|
-
attr_accessor :audio_url
|
|
37
|
+
attr_accessor :rich_card
|
|
36
38
|
|
|
37
|
-
|
|
38
|
-
attr_accessor :channel
|
|
39
|
+
attr_accessor :content_info
|
|
39
40
|
|
|
40
41
|
class EnumAttributeValidator
|
|
41
42
|
attr_reader :datatype
|
|
@@ -62,13 +63,14 @@ module MessenteApi
|
|
|
62
63
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
63
64
|
def self.attribute_map
|
|
64
65
|
{
|
|
66
|
+
:'channel' => :'channel',
|
|
65
67
|
:'sender' => :'sender',
|
|
66
68
|
:'validity' => :'validity',
|
|
69
|
+
:'ttl' => :'ttl',
|
|
67
70
|
:'text' => :'text',
|
|
68
|
-
:'
|
|
69
|
-
:'
|
|
70
|
-
:'
|
|
71
|
-
:'channel' => :'channel'
|
|
71
|
+
:'suggestions' => :'suggestions',
|
|
72
|
+
:'rich_card' => :'rich_card',
|
|
73
|
+
:'content_info' => :'content_info'
|
|
72
74
|
}
|
|
73
75
|
end
|
|
74
76
|
|
|
@@ -80,13 +82,14 @@ module MessenteApi
|
|
|
80
82
|
# Attribute type mapping.
|
|
81
83
|
def self.openapi_types
|
|
82
84
|
{
|
|
85
|
+
:'channel' => :'String',
|
|
83
86
|
:'sender' => :'String',
|
|
84
87
|
:'validity' => :'Integer',
|
|
88
|
+
:'ttl' => :'Integer',
|
|
85
89
|
:'text' => :'String',
|
|
86
|
-
:'
|
|
87
|
-
:'
|
|
88
|
-
:'
|
|
89
|
-
:'channel' => :'String'
|
|
90
|
+
:'suggestions' => :'Array<RcsSuggestion>',
|
|
91
|
+
:'rich_card' => :'RcsRichCard',
|
|
92
|
+
:'content_info' => :'RcsContentInfo'
|
|
90
93
|
}
|
|
91
94
|
end
|
|
92
95
|
|
|
@@ -100,45 +103,53 @@ module MessenteApi
|
|
|
100
103
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
101
104
|
def initialize(attributes = {})
|
|
102
105
|
if (!attributes.is_a?(Hash))
|
|
103
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `MessenteApi::
|
|
106
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MessenteApi::Rcs` initialize method"
|
|
104
107
|
end
|
|
105
108
|
|
|
106
109
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
107
110
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
108
111
|
if (!self.class.attribute_map.key?(k.to_sym))
|
|
109
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `MessenteApi::
|
|
112
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MessenteApi::Rcs`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
110
113
|
end
|
|
111
114
|
h[k.to_sym] = v
|
|
112
115
|
}
|
|
113
116
|
|
|
117
|
+
if attributes.key?(:'channel')
|
|
118
|
+
self.channel = attributes[:'channel']
|
|
119
|
+
else
|
|
120
|
+
self.channel = 'rcs'
|
|
121
|
+
end
|
|
122
|
+
|
|
114
123
|
if attributes.key?(:'sender')
|
|
115
124
|
self.sender = attributes[:'sender']
|
|
125
|
+
else
|
|
126
|
+
self.sender = nil
|
|
116
127
|
end
|
|
117
128
|
|
|
118
129
|
if attributes.key?(:'validity')
|
|
119
130
|
self.validity = attributes[:'validity']
|
|
120
131
|
end
|
|
121
132
|
|
|
133
|
+
if attributes.key?(:'ttl')
|
|
134
|
+
self.ttl = attributes[:'ttl']
|
|
135
|
+
end
|
|
136
|
+
|
|
122
137
|
if attributes.key?(:'text')
|
|
123
138
|
self.text = attributes[:'text']
|
|
124
139
|
end
|
|
125
140
|
|
|
126
|
-
if attributes.key?(:'
|
|
127
|
-
|
|
141
|
+
if attributes.key?(:'suggestions')
|
|
142
|
+
if (value = attributes[:'suggestions']).is_a?(Array)
|
|
143
|
+
self.suggestions = value
|
|
144
|
+
end
|
|
128
145
|
end
|
|
129
146
|
|
|
130
|
-
if attributes.key?(:'
|
|
131
|
-
self.
|
|
147
|
+
if attributes.key?(:'rich_card')
|
|
148
|
+
self.rich_card = attributes[:'rich_card']
|
|
132
149
|
end
|
|
133
150
|
|
|
134
|
-
if attributes.key?(:'
|
|
135
|
-
self.
|
|
136
|
-
end
|
|
137
|
-
|
|
138
|
-
if attributes.key?(:'channel')
|
|
139
|
-
self.channel = attributes[:'channel']
|
|
140
|
-
else
|
|
141
|
-
self.channel = 'telegram'
|
|
151
|
+
if attributes.key?(:'content_info')
|
|
152
|
+
self.content_info = attributes[:'content_info']
|
|
142
153
|
end
|
|
143
154
|
end
|
|
144
155
|
|
|
@@ -147,6 +158,18 @@ module MessenteApi
|
|
|
147
158
|
def list_invalid_properties
|
|
148
159
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
149
160
|
invalid_properties = Array.new
|
|
161
|
+
if @sender.nil?
|
|
162
|
+
invalid_properties.push('invalid value for "sender", sender cannot be nil.')
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
if !@text.nil? && @text.to_s.length > 3072
|
|
166
|
+
invalid_properties.push('invalid value for "text", the character length must be smaller than or equal to 3072.')
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
if !@suggestions.nil? && @suggestions.length > 11
|
|
170
|
+
invalid_properties.push('invalid value for "suggestions", number of items must be less than or equal to 11.')
|
|
171
|
+
end
|
|
172
|
+
|
|
150
173
|
invalid_properties
|
|
151
174
|
end
|
|
152
175
|
|
|
@@ -154,33 +177,65 @@ module MessenteApi
|
|
|
154
177
|
# @return true if the model is valid
|
|
155
178
|
def valid?
|
|
156
179
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
157
|
-
channel_validator = EnumAttributeValidator.new('String', ["
|
|
180
|
+
channel_validator = EnumAttributeValidator.new('String', ["rcs"])
|
|
158
181
|
return false unless channel_validator.valid?(@channel)
|
|
182
|
+
return false if @sender.nil?
|
|
183
|
+
return false if !@text.nil? && @text.to_s.length > 3072
|
|
184
|
+
return false if !@suggestions.nil? && @suggestions.length > 11
|
|
159
185
|
true
|
|
160
186
|
end
|
|
161
187
|
|
|
162
188
|
# Custom attribute writer method checking allowed values (enum).
|
|
163
189
|
# @param [Object] channel Object to be assigned
|
|
164
190
|
def channel=(channel)
|
|
165
|
-
validator = EnumAttributeValidator.new('String', ["
|
|
191
|
+
validator = EnumAttributeValidator.new('String', ["rcs"])
|
|
166
192
|
unless validator.valid?(channel)
|
|
167
193
|
fail ArgumentError, "invalid value for \"channel\", must be one of #{validator.allowable_values}."
|
|
168
194
|
end
|
|
169
195
|
@channel = channel
|
|
170
196
|
end
|
|
171
197
|
|
|
198
|
+
# Custom attribute writer method with validation
|
|
199
|
+
# @param [Object] text Value to be assigned
|
|
200
|
+
def text=(text)
|
|
201
|
+
if text.nil?
|
|
202
|
+
fail ArgumentError, 'text cannot be nil'
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
if text.to_s.length > 3072
|
|
206
|
+
fail ArgumentError, 'invalid value for "text", the character length must be smaller than or equal to 3072.'
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
@text = text
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
# Custom attribute writer method with validation
|
|
213
|
+
# @param [Object] suggestions Value to be assigned
|
|
214
|
+
def suggestions=(suggestions)
|
|
215
|
+
if suggestions.nil?
|
|
216
|
+
fail ArgumentError, 'suggestions cannot be nil'
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
if suggestions.length > 11
|
|
220
|
+
fail ArgumentError, 'invalid value for "suggestions", number of items must be less than or equal to 11.'
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
@suggestions = suggestions
|
|
224
|
+
end
|
|
225
|
+
|
|
172
226
|
# Checks equality by comparing each attribute.
|
|
173
227
|
# @param [Object] Object to be compared
|
|
174
228
|
def ==(o)
|
|
175
229
|
return true if self.equal?(o)
|
|
176
230
|
self.class == o.class &&
|
|
231
|
+
channel == o.channel &&
|
|
177
232
|
sender == o.sender &&
|
|
178
233
|
validity == o.validity &&
|
|
234
|
+
ttl == o.ttl &&
|
|
179
235
|
text == o.text &&
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
channel == o.channel
|
|
236
|
+
suggestions == o.suggestions &&
|
|
237
|
+
rich_card == o.rich_card &&
|
|
238
|
+
content_info == o.content_info
|
|
184
239
|
end
|
|
185
240
|
|
|
186
241
|
# @see the `==` method
|
|
@@ -192,7 +247,7 @@ module MessenteApi
|
|
|
192
247
|
# Calculates hash code according to all attributes.
|
|
193
248
|
# @return [Integer] Hash code
|
|
194
249
|
def hash
|
|
195
|
-
[sender, validity,
|
|
250
|
+
[channel, sender, validity, ttl, text, suggestions, rich_card, content_info].hash
|
|
196
251
|
end
|
|
197
252
|
|
|
198
253
|
# Builds the object from hash
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Messente API
|
|
3
|
+
|
|
4
|
+
#[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber and WhatsApp messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
|
7
|
+
Contact: messente@messente.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.11.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module MessenteApi
|
|
17
|
+
# RCS Card Content
|
|
18
|
+
class RcsCardContent
|
|
19
|
+
# Title of the card content
|
|
20
|
+
attr_accessor :title
|
|
21
|
+
|
|
22
|
+
# Description of the card content
|
|
23
|
+
attr_accessor :description
|
|
24
|
+
|
|
25
|
+
attr_accessor :media
|
|
26
|
+
|
|
27
|
+
# List of suggestions that the recipient can use to respond.
|
|
28
|
+
attr_accessor :suggestions
|
|
29
|
+
|
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
31
|
+
def self.attribute_map
|
|
32
|
+
{
|
|
33
|
+
:'title' => :'title',
|
|
34
|
+
:'description' => :'description',
|
|
35
|
+
:'media' => :'media',
|
|
36
|
+
:'suggestions' => :'suggestions'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Returns all the JSON keys this model knows about
|
|
41
|
+
def self.acceptable_attributes
|
|
42
|
+
attribute_map.values
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Attribute type mapping.
|
|
46
|
+
def self.openapi_types
|
|
47
|
+
{
|
|
48
|
+
:'title' => :'String',
|
|
49
|
+
:'description' => :'String',
|
|
50
|
+
:'media' => :'RcsMedia',
|
|
51
|
+
:'suggestions' => :'Array<RcsSuggestion>'
|
|
52
|
+
}
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# List of attributes with nullable: true
|
|
56
|
+
def self.openapi_nullable
|
|
57
|
+
Set.new([
|
|
58
|
+
:'title',
|
|
59
|
+
:'description',
|
|
60
|
+
])
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Initializes the object
|
|
64
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
65
|
+
def initialize(attributes = {})
|
|
66
|
+
if (!attributes.is_a?(Hash))
|
|
67
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MessenteApi::RcsCardContent` initialize method"
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
71
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
72
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MessenteApi::RcsCardContent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
74
|
+
end
|
|
75
|
+
h[k.to_sym] = v
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'title')
|
|
79
|
+
self.title = attributes[:'title']
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
if attributes.key?(:'description')
|
|
83
|
+
self.description = attributes[:'description']
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
if attributes.key?(:'media')
|
|
87
|
+
self.media = attributes[:'media']
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
if attributes.key?(:'suggestions')
|
|
91
|
+
if (value = attributes[:'suggestions']).is_a?(Array)
|
|
92
|
+
self.suggestions = value
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
98
|
+
# @return Array for valid properties with the reasons
|
|
99
|
+
def list_invalid_properties
|
|
100
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
101
|
+
invalid_properties = Array.new
|
|
102
|
+
if !@title.nil? && @title.to_s.length > 200
|
|
103
|
+
invalid_properties.push('invalid value for "title", the character length must be smaller than or equal to 200.')
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if !@description.nil? && @description.to_s.length > 2000
|
|
107
|
+
invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 2000.')
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if !@suggestions.nil? && @suggestions.length > 4
|
|
111
|
+
invalid_properties.push('invalid value for "suggestions", number of items must be less than or equal to 4.')
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
invalid_properties
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Check to see if the all the properties in the model are valid
|
|
118
|
+
# @return true if the model is valid
|
|
119
|
+
def valid?
|
|
120
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
121
|
+
return false if !@title.nil? && @title.to_s.length > 200
|
|
122
|
+
return false if !@description.nil? && @description.to_s.length > 2000
|
|
123
|
+
return false if !@suggestions.nil? && @suggestions.length > 4
|
|
124
|
+
true
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Custom attribute writer method with validation
|
|
128
|
+
# @param [Object] title Value to be assigned
|
|
129
|
+
def title=(title)
|
|
130
|
+
if !title.nil? && title.to_s.length > 200
|
|
131
|
+
fail ArgumentError, 'invalid value for "title", the character length must be smaller than or equal to 200.'
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
@title = title
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Custom attribute writer method with validation
|
|
138
|
+
# @param [Object] description Value to be assigned
|
|
139
|
+
def description=(description)
|
|
140
|
+
if !description.nil? && description.to_s.length > 2000
|
|
141
|
+
fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 2000.'
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
@description = description
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Custom attribute writer method with validation
|
|
148
|
+
# @param [Object] suggestions Value to be assigned
|
|
149
|
+
def suggestions=(suggestions)
|
|
150
|
+
if suggestions.nil?
|
|
151
|
+
fail ArgumentError, 'suggestions cannot be nil'
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
if suggestions.length > 4
|
|
155
|
+
fail ArgumentError, 'invalid value for "suggestions", number of items must be less than or equal to 4.'
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
@suggestions = suggestions
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Checks equality by comparing each attribute.
|
|
162
|
+
# @param [Object] Object to be compared
|
|
163
|
+
def ==(o)
|
|
164
|
+
return true if self.equal?(o)
|
|
165
|
+
self.class == o.class &&
|
|
166
|
+
title == o.title &&
|
|
167
|
+
description == o.description &&
|
|
168
|
+
media == o.media &&
|
|
169
|
+
suggestions == o.suggestions
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# @see the `==` method
|
|
173
|
+
# @param [Object] Object to be compared
|
|
174
|
+
def eql?(o)
|
|
175
|
+
self == o
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Calculates hash code according to all attributes.
|
|
179
|
+
# @return [Integer] Hash code
|
|
180
|
+
def hash
|
|
181
|
+
[title, description, media, suggestions].hash
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# Builds the object from hash
|
|
185
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
186
|
+
# @return [Object] Returns the model itself
|
|
187
|
+
def self.build_from_hash(attributes)
|
|
188
|
+
return nil unless attributes.is_a?(Hash)
|
|
189
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
190
|
+
transformed_hash = {}
|
|
191
|
+
openapi_types.each_pair do |key, type|
|
|
192
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
193
|
+
transformed_hash["#{key}"] = nil
|
|
194
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
195
|
+
# check to ensure the input is an array given that the attribute
|
|
196
|
+
# is documented as an array but the input is not
|
|
197
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
198
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
199
|
+
end
|
|
200
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
201
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
202
|
+
end
|
|
203
|
+
end
|
|
204
|
+
new(transformed_hash)
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# Deserializes the data based on type
|
|
208
|
+
# @param string type Data type
|
|
209
|
+
# @param string value Value to be deserialized
|
|
210
|
+
# @return [Object] Deserialized data
|
|
211
|
+
def self._deserialize(type, value)
|
|
212
|
+
case type.to_sym
|
|
213
|
+
when :Time
|
|
214
|
+
Time.parse(value)
|
|
215
|
+
when :Date
|
|
216
|
+
Date.parse(value)
|
|
217
|
+
when :String
|
|
218
|
+
value.to_s
|
|
219
|
+
when :Integer
|
|
220
|
+
value.to_i
|
|
221
|
+
when :Float
|
|
222
|
+
value.to_f
|
|
223
|
+
when :Boolean
|
|
224
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
225
|
+
true
|
|
226
|
+
else
|
|
227
|
+
false
|
|
228
|
+
end
|
|
229
|
+
when :Object
|
|
230
|
+
# generic object (usually a Hash), return directly
|
|
231
|
+
value
|
|
232
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
233
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
234
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
235
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
236
|
+
k_type = Regexp.last_match[:k_type]
|
|
237
|
+
v_type = Regexp.last_match[:v_type]
|
|
238
|
+
{}.tap do |hash|
|
|
239
|
+
value.each do |k, v|
|
|
240
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
241
|
+
end
|
|
242
|
+
end
|
|
243
|
+
else # model
|
|
244
|
+
# models (e.g. Pet) or oneOf
|
|
245
|
+
klass = MessenteApi.const_get(type)
|
|
246
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
247
|
+
end
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# Returns the string representation of the object
|
|
251
|
+
# @return [String] String presentation of the object
|
|
252
|
+
def to_s
|
|
253
|
+
to_hash.to_s
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
257
|
+
# @return [Hash] Returns the object in the form of hash
|
|
258
|
+
def to_body
|
|
259
|
+
to_hash
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
# Returns the object in the form of hash
|
|
263
|
+
# @return [Hash] Returns the object in the form of hash
|
|
264
|
+
def to_hash
|
|
265
|
+
hash = {}
|
|
266
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
267
|
+
value = self.send(attr)
|
|
268
|
+
if value.nil?
|
|
269
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
270
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
hash[param] = _to_hash(value)
|
|
274
|
+
end
|
|
275
|
+
hash
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
# Outputs non-array value in the form of hash
|
|
279
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
280
|
+
# @param [Object] value Any valid value
|
|
281
|
+
# @return [Hash] Returns the value in the form of hash
|
|
282
|
+
def _to_hash(value)
|
|
283
|
+
if value.is_a?(Array)
|
|
284
|
+
value.compact.map { |v| _to_hash(v) }
|
|
285
|
+
elsif value.is_a?(Hash)
|
|
286
|
+
{}.tap do |hash|
|
|
287
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
288
|
+
end
|
|
289
|
+
elsif value.respond_to? :to_hash
|
|
290
|
+
value.to_hash
|
|
291
|
+
else
|
|
292
|
+
value
|
|
293
|
+
end
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Messente API
|
|
3
|
+
|
|
4
|
+
#[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber and WhatsApp messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
|
7
|
+
Contact: messente@messente.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.11.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module MessenteApi
|
|
17
|
+
class RcsCardOrientation
|
|
18
|
+
VERTICAL = "VERTICAL".freeze
|
|
19
|
+
HORIZONTAL = "HORIZONTAL".freeze
|
|
20
|
+
|
|
21
|
+
def self.all_vars
|
|
22
|
+
@all_vars ||= [VERTICAL, HORIZONTAL].freeze
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Builds the enum from string
|
|
26
|
+
# @param [String] The enum value in the form of the string
|
|
27
|
+
# @return [String] The enum value
|
|
28
|
+
def self.build_from_hash(value)
|
|
29
|
+
new.build_from_hash(value)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Builds the enum from string
|
|
33
|
+
# @param [String] The enum value in the form of the string
|
|
34
|
+
# @return [String] The enum value
|
|
35
|
+
def build_from_hash(value)
|
|
36
|
+
return value if RcsCardOrientation.all_vars.include?(value)
|
|
37
|
+
raise "Invalid ENUM value #{value} for class #RcsCardOrientation"
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|