ultracart_api 4.1.203 → 4.1.205
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 +26 -2
- data/docs/SfvbApi.md +711 -7
- data/docs/SfvbApprovalParams.md +4 -0
- data/docs/SfvbCommsDnsRecord.md +24 -0
- data/docs/SfvbCommsSendingDomain.md +38 -0
- data/docs/SfvbCommsSendingDomainsResponse.md +18 -0
- data/docs/SfvbCommsTwilioAccount.md +38 -0
- data/docs/SfvbCommsTwilioAccountResponse.md +20 -0
- data/docs/SfvbEmailRenderRequest.md +24 -0
- data/docs/SfvbEmailRenderResponse.md +34 -0
- data/docs/SfvbSecretRequestCreate.md +1 -1
- data/docs/SfvbTransactionalEmail.md +24 -0
- data/docs/SfvbTransactionalEmailsResponse.md +18 -0
- data/lib/ultracart_api/api/sfvb_api.rb +906 -26
- data/lib/ultracart_api/models/sfvb_approval_params.rb +21 -1
- data/lib/ultracart_api/models/sfvb_comms_dns_record.rb +296 -0
- data/lib/ultracart_api/models/sfvb_comms_sending_domain.rb +356 -0
- data/lib/ultracart_api/models/sfvb_comms_sending_domains_response.rb +222 -0
- data/lib/ultracart_api/models/sfvb_comms_twilio_account.rb +322 -0
- data/lib/ultracart_api/models/sfvb_comms_twilio_account_response.rb +231 -0
- data/lib/ultracart_api/models/sfvb_email_render_request.rb +252 -0
- data/lib/ultracart_api/models/sfvb_email_render_response.rb +301 -0
- data/lib/ultracart_api/models/sfvb_secret_request_create.rb +1 -1
- data/lib/ultracart_api/models/sfvb_transactional_email.rb +250 -0
- data/lib/ultracart_api/models/sfvb_transactional_emails_response.rb +222 -0
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +9 -0
- metadata +19 -1
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#UltraCart Rest API V2
|
|
3
|
+
|
|
4
|
+
#UltraCart REST API Version 2
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
|
7
|
+
Contact: support@ultracart.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
OpenAPI Generator version: 6.0.1-SNAPSHOT
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module UltracartClient
|
|
17
|
+
class SfvbCommsTwilioAccount
|
|
18
|
+
# The Twilio account SID, AC followed by 32 hex digits. It names the account, so it is also the target_id of a secret request for its auth token. Required to create.
|
|
19
|
+
attr_accessor :account_sid
|
|
20
|
+
|
|
21
|
+
# The SID of the TwiML app UltraCart made for the AI agent. Set by the server.
|
|
22
|
+
attr_accessor :ai_twiml_app_sid
|
|
23
|
+
|
|
24
|
+
# The SID of the Twilio API key UltraCart made for this account. Set by the server. Its secret is never returned.
|
|
25
|
+
attr_accessor :api_key_id
|
|
26
|
+
|
|
27
|
+
# The name of the Twilio API key UltraCart made for this account. Set by the server.
|
|
28
|
+
attr_accessor :api_key_name
|
|
29
|
+
|
|
30
|
+
# The Twilio auth token. A secret field. Reads return a mask. To set it, send a secret handle (sec_...) made for this account SID by POST secrets with sink twilio.account.auth_token. Send the mask back, or leave it out, to keep it. Required to create.
|
|
31
|
+
attr_accessor :auth_token
|
|
32
|
+
|
|
33
|
+
# UltraCart's id for the Twilio account. Set by the server.
|
|
34
|
+
attr_accessor :esp_twilio_uuid
|
|
35
|
+
|
|
36
|
+
# The SID of the TwiML app UltraCart made for inbound calls and SMS. Set by the server.
|
|
37
|
+
attr_accessor :inbound_twiml_app_sid
|
|
38
|
+
|
|
39
|
+
# The SID of the TwiML app UltraCart made for outbound calls. Set by the server.
|
|
40
|
+
attr_accessor :outbound_twiml_app_sid
|
|
41
|
+
|
|
42
|
+
# The account's phone numbers UltraCart uses, in E.164 format. Leave it out of an update to keep them; an update that sends it replaces them all.
|
|
43
|
+
attr_accessor :phone_numbers
|
|
44
|
+
|
|
45
|
+
# The SID of the voice encryption public key UltraCart registered with Twilio. Set by the server. The keys themselves are never returned.
|
|
46
|
+
attr_accessor :public_key_sid
|
|
47
|
+
|
|
48
|
+
# The SID of the TaskRouter workspace the phone system uses, when it has one. Set by the server.
|
|
49
|
+
attr_accessor :twilio_workspace_sid
|
|
50
|
+
|
|
51
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
52
|
+
def self.attribute_map
|
|
53
|
+
{
|
|
54
|
+
:'account_sid' => :'account_sid',
|
|
55
|
+
:'ai_twiml_app_sid' => :'ai_twiml_app_sid',
|
|
56
|
+
:'api_key_id' => :'api_key_id',
|
|
57
|
+
:'api_key_name' => :'api_key_name',
|
|
58
|
+
:'auth_token' => :'auth_token',
|
|
59
|
+
:'esp_twilio_uuid' => :'esp_twilio_uuid',
|
|
60
|
+
:'inbound_twiml_app_sid' => :'inbound_twiml_app_sid',
|
|
61
|
+
:'outbound_twiml_app_sid' => :'outbound_twiml_app_sid',
|
|
62
|
+
:'phone_numbers' => :'phone_numbers',
|
|
63
|
+
:'public_key_sid' => :'public_key_sid',
|
|
64
|
+
:'twilio_workspace_sid' => :'twilio_workspace_sid'
|
|
65
|
+
}
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Returns all the JSON keys this model knows about
|
|
69
|
+
def self.acceptable_attributes
|
|
70
|
+
attribute_map.values
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Attribute type mapping.
|
|
74
|
+
def self.openapi_types
|
|
75
|
+
{
|
|
76
|
+
:'account_sid' => :'String',
|
|
77
|
+
:'ai_twiml_app_sid' => :'String',
|
|
78
|
+
:'api_key_id' => :'String',
|
|
79
|
+
:'api_key_name' => :'String',
|
|
80
|
+
:'auth_token' => :'String',
|
|
81
|
+
:'esp_twilio_uuid' => :'String',
|
|
82
|
+
:'inbound_twiml_app_sid' => :'String',
|
|
83
|
+
:'outbound_twiml_app_sid' => :'String',
|
|
84
|
+
:'phone_numbers' => :'Array<String>',
|
|
85
|
+
:'public_key_sid' => :'String',
|
|
86
|
+
:'twilio_workspace_sid' => :'String'
|
|
87
|
+
}
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# List of attributes with nullable: true
|
|
91
|
+
def self.openapi_nullable
|
|
92
|
+
Set.new([
|
|
93
|
+
])
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Initializes the object
|
|
97
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
98
|
+
def initialize(attributes = {})
|
|
99
|
+
if (!attributes.is_a?(Hash))
|
|
100
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbCommsTwilioAccount` initialize method"
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
104
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
105
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
106
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbCommsTwilioAccount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
107
|
+
end
|
|
108
|
+
h[k.to_sym] = v
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'account_sid')
|
|
112
|
+
self.account_sid = attributes[:'account_sid']
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if attributes.key?(:'ai_twiml_app_sid')
|
|
116
|
+
self.ai_twiml_app_sid = attributes[:'ai_twiml_app_sid']
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
if attributes.key?(:'api_key_id')
|
|
120
|
+
self.api_key_id = attributes[:'api_key_id']
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
if attributes.key?(:'api_key_name')
|
|
124
|
+
self.api_key_name = attributes[:'api_key_name']
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
if attributes.key?(:'auth_token')
|
|
128
|
+
self.auth_token = attributes[:'auth_token']
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
if attributes.key?(:'esp_twilio_uuid')
|
|
132
|
+
self.esp_twilio_uuid = attributes[:'esp_twilio_uuid']
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
if attributes.key?(:'inbound_twiml_app_sid')
|
|
136
|
+
self.inbound_twiml_app_sid = attributes[:'inbound_twiml_app_sid']
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
if attributes.key?(:'outbound_twiml_app_sid')
|
|
140
|
+
self.outbound_twiml_app_sid = attributes[:'outbound_twiml_app_sid']
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
if attributes.key?(:'phone_numbers')
|
|
144
|
+
if (value = attributes[:'phone_numbers']).is_a?(Array)
|
|
145
|
+
self.phone_numbers = value
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
if attributes.key?(:'public_key_sid')
|
|
150
|
+
self.public_key_sid = attributes[:'public_key_sid']
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
if attributes.key?(:'twilio_workspace_sid')
|
|
154
|
+
self.twilio_workspace_sid = attributes[:'twilio_workspace_sid']
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
159
|
+
# @return Array for valid properties with the reasons
|
|
160
|
+
def list_invalid_properties
|
|
161
|
+
invalid_properties = Array.new
|
|
162
|
+
invalid_properties
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Check to see if the all the properties in the model are valid
|
|
166
|
+
# @return true if the model is valid
|
|
167
|
+
def valid?
|
|
168
|
+
true
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Checks equality by comparing each attribute.
|
|
172
|
+
# @param [Object] Object to be compared
|
|
173
|
+
def ==(o)
|
|
174
|
+
return true if self.equal?(o)
|
|
175
|
+
self.class == o.class &&
|
|
176
|
+
account_sid == o.account_sid &&
|
|
177
|
+
ai_twiml_app_sid == o.ai_twiml_app_sid &&
|
|
178
|
+
api_key_id == o.api_key_id &&
|
|
179
|
+
api_key_name == o.api_key_name &&
|
|
180
|
+
auth_token == o.auth_token &&
|
|
181
|
+
esp_twilio_uuid == o.esp_twilio_uuid &&
|
|
182
|
+
inbound_twiml_app_sid == o.inbound_twiml_app_sid &&
|
|
183
|
+
outbound_twiml_app_sid == o.outbound_twiml_app_sid &&
|
|
184
|
+
phone_numbers == o.phone_numbers &&
|
|
185
|
+
public_key_sid == o.public_key_sid &&
|
|
186
|
+
twilio_workspace_sid == o.twilio_workspace_sid
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# @see the `==` method
|
|
190
|
+
# @param [Object] Object to be compared
|
|
191
|
+
def eql?(o)
|
|
192
|
+
self == o
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# Calculates hash code according to all attributes.
|
|
196
|
+
# @return [Integer] Hash code
|
|
197
|
+
def hash
|
|
198
|
+
[account_sid, ai_twiml_app_sid, api_key_id, api_key_name, auth_token, esp_twilio_uuid, inbound_twiml_app_sid, outbound_twiml_app_sid, phone_numbers, public_key_sid, twilio_workspace_sid].hash
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Builds the object from hash
|
|
202
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
203
|
+
# @return [Object] Returns the model itself
|
|
204
|
+
def self.build_from_hash(attributes)
|
|
205
|
+
new.build_from_hash(attributes)
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# Builds the object from hash
|
|
209
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
210
|
+
# @return [Object] Returns the model itself
|
|
211
|
+
def build_from_hash(attributes)
|
|
212
|
+
return nil unless attributes.is_a?(Hash)
|
|
213
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
214
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
215
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
216
|
+
self.send("#{key}=", nil)
|
|
217
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
218
|
+
# check to ensure the input is an array given that the attribute
|
|
219
|
+
# is documented as an array but the input is not
|
|
220
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
221
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
222
|
+
end
|
|
223
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
224
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
225
|
+
end
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
self
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# Deserializes the data based on type
|
|
232
|
+
# @param string type Data type
|
|
233
|
+
# @param string value Value to be deserialized
|
|
234
|
+
# @return [Object] Deserialized data
|
|
235
|
+
def _deserialize(type, value)
|
|
236
|
+
case type.to_sym
|
|
237
|
+
when :Time
|
|
238
|
+
Time.parse(value)
|
|
239
|
+
when :Date
|
|
240
|
+
Date.parse(value)
|
|
241
|
+
when :String
|
|
242
|
+
value.to_s
|
|
243
|
+
when :Integer
|
|
244
|
+
value.to_i
|
|
245
|
+
when :Float
|
|
246
|
+
value.to_f
|
|
247
|
+
when :Boolean
|
|
248
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
249
|
+
true
|
|
250
|
+
else
|
|
251
|
+
false
|
|
252
|
+
end
|
|
253
|
+
when :Object
|
|
254
|
+
# generic object (usually a Hash), return directly
|
|
255
|
+
value
|
|
256
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
257
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
258
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
259
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
260
|
+
k_type = Regexp.last_match[:k_type]
|
|
261
|
+
v_type = Regexp.last_match[:v_type]
|
|
262
|
+
{}.tap do |hash|
|
|
263
|
+
value.each do |k, v|
|
|
264
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
265
|
+
end
|
|
266
|
+
end
|
|
267
|
+
else # model
|
|
268
|
+
# models (e.g. Pet) or oneOf
|
|
269
|
+
klass = UltracartClient.const_get(type)
|
|
270
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
271
|
+
end
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# Returns the string representation of the object
|
|
275
|
+
# @return [String] String presentation of the object
|
|
276
|
+
def to_s
|
|
277
|
+
to_hash.to_s
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
281
|
+
# @return [Hash] Returns the object in the form of hash
|
|
282
|
+
def to_body
|
|
283
|
+
to_hash
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
# Returns the object in the form of hash
|
|
287
|
+
# @return [Hash] Returns the object in the form of hash
|
|
288
|
+
def to_hash
|
|
289
|
+
hash = {}
|
|
290
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
291
|
+
value = self.send(attr)
|
|
292
|
+
if value.nil?
|
|
293
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
294
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
hash[param] = _to_hash(value)
|
|
298
|
+
end
|
|
299
|
+
hash
|
|
300
|
+
end
|
|
301
|
+
|
|
302
|
+
# Outputs non-array value in the form of hash
|
|
303
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
304
|
+
# @param [Object] value Any valid value
|
|
305
|
+
# @return [Hash] Returns the value in the form of hash
|
|
306
|
+
def _to_hash(value)
|
|
307
|
+
if value.is_a?(Array)
|
|
308
|
+
value.compact.map { |v| _to_hash(v) }
|
|
309
|
+
elsif value.is_a?(Hash)
|
|
310
|
+
{}.tap do |hash|
|
|
311
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
312
|
+
end
|
|
313
|
+
elsif value.respond_to? :to_hash
|
|
314
|
+
value.to_hash
|
|
315
|
+
else
|
|
316
|
+
value
|
|
317
|
+
end
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
end
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#UltraCart Rest API V2
|
|
3
|
+
|
|
4
|
+
#UltraCart REST API Version 2
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
|
7
|
+
Contact: support@ultracart.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
OpenAPI Generator version: 6.0.1-SNAPSHOT
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module UltracartClient
|
|
17
|
+
class SfvbCommsTwilioAccountResponse
|
|
18
|
+
attr_accessor :twilio_account
|
|
19
|
+
|
|
20
|
+
# Anything worth knowing that did not stop the call, such as a second Twilio account left from before the admin allowed only one.
|
|
21
|
+
attr_accessor :warnings
|
|
22
|
+
|
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
24
|
+
def self.attribute_map
|
|
25
|
+
{
|
|
26
|
+
:'twilio_account' => :'twilio_account',
|
|
27
|
+
:'warnings' => :'warnings'
|
|
28
|
+
}
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Returns all the JSON keys this model knows about
|
|
32
|
+
def self.acceptable_attributes
|
|
33
|
+
attribute_map.values
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Attribute type mapping.
|
|
37
|
+
def self.openapi_types
|
|
38
|
+
{
|
|
39
|
+
:'twilio_account' => :'SfvbCommsTwilioAccount',
|
|
40
|
+
:'warnings' => :'Array<SfvbErrorDetail>'
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# List of attributes with nullable: true
|
|
45
|
+
def self.openapi_nullable
|
|
46
|
+
Set.new([
|
|
47
|
+
])
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Initializes the object
|
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
52
|
+
def initialize(attributes = {})
|
|
53
|
+
if (!attributes.is_a?(Hash))
|
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbCommsTwilioAccountResponse` initialize method"
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
58
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
59
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
60
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbCommsTwilioAccountResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
61
|
+
end
|
|
62
|
+
h[k.to_sym] = v
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if attributes.key?(:'twilio_account')
|
|
66
|
+
self.twilio_account = attributes[:'twilio_account']
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
if attributes.key?(:'warnings')
|
|
70
|
+
if (value = attributes[:'warnings']).is_a?(Array)
|
|
71
|
+
self.warnings = value
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
77
|
+
# @return Array for valid properties with the reasons
|
|
78
|
+
def list_invalid_properties
|
|
79
|
+
invalid_properties = Array.new
|
|
80
|
+
invalid_properties
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Check to see if the all the properties in the model are valid
|
|
84
|
+
# @return true if the model is valid
|
|
85
|
+
def valid?
|
|
86
|
+
true
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Checks equality by comparing each attribute.
|
|
90
|
+
# @param [Object] Object to be compared
|
|
91
|
+
def ==(o)
|
|
92
|
+
return true if self.equal?(o)
|
|
93
|
+
self.class == o.class &&
|
|
94
|
+
twilio_account == o.twilio_account &&
|
|
95
|
+
warnings == o.warnings
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# @see the `==` method
|
|
99
|
+
# @param [Object] Object to be compared
|
|
100
|
+
def eql?(o)
|
|
101
|
+
self == o
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Calculates hash code according to all attributes.
|
|
105
|
+
# @return [Integer] Hash code
|
|
106
|
+
def hash
|
|
107
|
+
[twilio_account, warnings].hash
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Builds the object from hash
|
|
111
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
112
|
+
# @return [Object] Returns the model itself
|
|
113
|
+
def self.build_from_hash(attributes)
|
|
114
|
+
new.build_from_hash(attributes)
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Builds the object from hash
|
|
118
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
119
|
+
# @return [Object] Returns the model itself
|
|
120
|
+
def build_from_hash(attributes)
|
|
121
|
+
return nil unless attributes.is_a?(Hash)
|
|
122
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
123
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
124
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
125
|
+
self.send("#{key}=", nil)
|
|
126
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
127
|
+
# check to ensure the input is an array given that the attribute
|
|
128
|
+
# is documented as an array but the input is not
|
|
129
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
130
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
131
|
+
end
|
|
132
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
133
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
self
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Deserializes the data based on type
|
|
141
|
+
# @param string type Data type
|
|
142
|
+
# @param string value Value to be deserialized
|
|
143
|
+
# @return [Object] Deserialized data
|
|
144
|
+
def _deserialize(type, value)
|
|
145
|
+
case type.to_sym
|
|
146
|
+
when :Time
|
|
147
|
+
Time.parse(value)
|
|
148
|
+
when :Date
|
|
149
|
+
Date.parse(value)
|
|
150
|
+
when :String
|
|
151
|
+
value.to_s
|
|
152
|
+
when :Integer
|
|
153
|
+
value.to_i
|
|
154
|
+
when :Float
|
|
155
|
+
value.to_f
|
|
156
|
+
when :Boolean
|
|
157
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
158
|
+
true
|
|
159
|
+
else
|
|
160
|
+
false
|
|
161
|
+
end
|
|
162
|
+
when :Object
|
|
163
|
+
# generic object (usually a Hash), return directly
|
|
164
|
+
value
|
|
165
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
166
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
167
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
168
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
169
|
+
k_type = Regexp.last_match[:k_type]
|
|
170
|
+
v_type = Regexp.last_match[:v_type]
|
|
171
|
+
{}.tap do |hash|
|
|
172
|
+
value.each do |k, v|
|
|
173
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
else # model
|
|
177
|
+
# models (e.g. Pet) or oneOf
|
|
178
|
+
klass = UltracartClient.const_get(type)
|
|
179
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Returns the string representation of the object
|
|
184
|
+
# @return [String] String presentation of the object
|
|
185
|
+
def to_s
|
|
186
|
+
to_hash.to_s
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
190
|
+
# @return [Hash] Returns the object in the form of hash
|
|
191
|
+
def to_body
|
|
192
|
+
to_hash
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# Returns the object in the form of hash
|
|
196
|
+
# @return [Hash] Returns the object in the form of hash
|
|
197
|
+
def to_hash
|
|
198
|
+
hash = {}
|
|
199
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
200
|
+
value = self.send(attr)
|
|
201
|
+
if value.nil?
|
|
202
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
203
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
hash[param] = _to_hash(value)
|
|
207
|
+
end
|
|
208
|
+
hash
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Outputs non-array value in the form of hash
|
|
212
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
213
|
+
# @param [Object] value Any valid value
|
|
214
|
+
# @return [Hash] Returns the value in the form of hash
|
|
215
|
+
def _to_hash(value)
|
|
216
|
+
if value.is_a?(Array)
|
|
217
|
+
value.compact.map { |v| _to_hash(v) }
|
|
218
|
+
elsif value.is_a?(Hash)
|
|
219
|
+
{}.tap do |hash|
|
|
220
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
221
|
+
end
|
|
222
|
+
elsif value.respond_to? :to_hash
|
|
223
|
+
value.to_hash
|
|
224
|
+
else
|
|
225
|
+
value
|
|
226
|
+
end
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
end
|