ultracart_api 4.1.39 → 4.1.41
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 +19 -2
- data/docs/ConversationAgentProfile.md +4 -0
- data/docs/ConversationApi.md +492 -0
- data/docs/ConversationPbxAddress.md +40 -0
- data/docs/ConversationPbxAddressResponse.md +26 -0
- data/docs/ConversationPbxAddressesResponse.md +18 -0
- data/docs/ConversationPbxAvailablePhoneNumber.md +34 -0
- data/docs/ConversationPbxAvailablePhoneNumbersResponse.md +26 -0
- data/docs/ConversationPbxPhoneNumber.md +2 -0
- data/docs/ConversationPbxPhoneNumberPurchaseRequest.md +26 -0
- data/lib/ultracart_api/api/conversation_api.rb +610 -0
- data/lib/ultracart_api/models/conversation_agent_profile.rb +33 -1
- data/lib/ultracart_api/models/conversation_pbx_address.rb +480 -0
- data/lib/ultracart_api/models/conversation_pbx_address_response.rb +256 -0
- data/lib/ultracart_api/models/conversation_pbx_addresses_response.rb +221 -0
- data/lib/ultracart_api/models/conversation_pbx_available_phone_number.rb +409 -0
- data/lib/ultracart_api/models/conversation_pbx_available_phone_numbers_response.rb +258 -0
- data/lib/ultracart_api/models/conversation_pbx_phone_number.rb +11 -1
- data/lib/ultracart_api/models/conversation_pbx_phone_number_purchase_request.rb +359 -0
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +6 -0
- metadata +14 -2
|
@@ -32,6 +32,12 @@ module UltracartClient
|
|
|
32
32
|
# Additional instructions for this AI when handling ticket draft replies
|
|
33
33
|
attr_accessor :ai_ticket_instructions
|
|
34
34
|
|
|
35
|
+
# Additional voice instructions for this AI when handling voice calls
|
|
36
|
+
attr_accessor :ai_voice_instructions
|
|
37
|
+
|
|
38
|
+
# Which AI voice personality to use when handling the call.
|
|
39
|
+
attr_accessor :ai_voice_personality
|
|
40
|
+
|
|
35
41
|
# The number of engagement chats that can be pushed on them at any given time.
|
|
36
42
|
attr_accessor :chat_limit
|
|
37
43
|
|
|
@@ -93,6 +99,8 @@ module UltracartClient
|
|
|
93
99
|
:'ai_persona' => :'ai_persona',
|
|
94
100
|
:'ai_sms_instructions' => :'ai_sms_instructions',
|
|
95
101
|
:'ai_ticket_instructions' => :'ai_ticket_instructions',
|
|
102
|
+
:'ai_voice_instructions' => :'ai_voice_instructions',
|
|
103
|
+
:'ai_voice_personality' => :'ai_voice_personality',
|
|
96
104
|
:'chat_limit' => :'chat_limit',
|
|
97
105
|
:'default_language_iso_code' => :'default_language_iso_code',
|
|
98
106
|
:'default_status' => :'default_status',
|
|
@@ -120,6 +128,8 @@ module UltracartClient
|
|
|
120
128
|
:'ai_persona' => :'String',
|
|
121
129
|
:'ai_sms_instructions' => :'String',
|
|
122
130
|
:'ai_ticket_instructions' => :'String',
|
|
131
|
+
:'ai_voice_instructions' => :'String',
|
|
132
|
+
:'ai_voice_personality' => :'String',
|
|
123
133
|
:'chat_limit' => :'Integer',
|
|
124
134
|
:'default_language_iso_code' => :'String',
|
|
125
135
|
:'default_status' => :'String',
|
|
@@ -178,6 +188,14 @@ module UltracartClient
|
|
|
178
188
|
self.ai_ticket_instructions = attributes[:'ai_ticket_instructions']
|
|
179
189
|
end
|
|
180
190
|
|
|
191
|
+
if attributes.key?(:'ai_voice_instructions')
|
|
192
|
+
self.ai_voice_instructions = attributes[:'ai_voice_instructions']
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
if attributes.key?(:'ai_voice_personality')
|
|
196
|
+
self.ai_voice_personality = attributes[:'ai_voice_personality']
|
|
197
|
+
end
|
|
198
|
+
|
|
181
199
|
if attributes.key?(:'chat_limit')
|
|
182
200
|
self.chat_limit = attributes[:'chat_limit']
|
|
183
201
|
end
|
|
@@ -233,11 +251,23 @@ module UltracartClient
|
|
|
233
251
|
# Check to see if the all the properties in the model are valid
|
|
234
252
|
# @return true if the model is valid
|
|
235
253
|
def valid?
|
|
254
|
+
ai_voice_personality_validator = EnumAttributeValidator.new('String', ["Ara", "Rex", "Sal", "Eve", "Leo"])
|
|
255
|
+
return false unless ai_voice_personality_validator.valid?(@ai_voice_personality)
|
|
236
256
|
default_status_validator = EnumAttributeValidator.new('String', ["available", "busy", "unavailable"])
|
|
237
257
|
return false unless default_status_validator.valid?(@default_status)
|
|
238
258
|
true
|
|
239
259
|
end
|
|
240
260
|
|
|
261
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
262
|
+
# @param [Object] ai_voice_personality Object to be assigned
|
|
263
|
+
def ai_voice_personality=(ai_voice_personality)
|
|
264
|
+
validator = EnumAttributeValidator.new('String', ["Ara", "Rex", "Sal", "Eve", "Leo"])
|
|
265
|
+
unless validator.valid?(ai_voice_personality)
|
|
266
|
+
fail ArgumentError, "invalid value for \"ai_voice_personality\", must be one of #{validator.allowable_values}."
|
|
267
|
+
end
|
|
268
|
+
@ai_voice_personality = ai_voice_personality
|
|
269
|
+
end
|
|
270
|
+
|
|
241
271
|
# Custom attribute writer method checking allowed values (enum).
|
|
242
272
|
# @param [Object] default_status Object to be assigned
|
|
243
273
|
def default_status=(default_status)
|
|
@@ -259,6 +289,8 @@ module UltracartClient
|
|
|
259
289
|
ai_persona == o.ai_persona &&
|
|
260
290
|
ai_sms_instructions == o.ai_sms_instructions &&
|
|
261
291
|
ai_ticket_instructions == o.ai_ticket_instructions &&
|
|
292
|
+
ai_voice_instructions == o.ai_voice_instructions &&
|
|
293
|
+
ai_voice_personality == o.ai_voice_personality &&
|
|
262
294
|
chat_limit == o.chat_limit &&
|
|
263
295
|
default_language_iso_code == o.default_language_iso_code &&
|
|
264
296
|
default_status == o.default_status &&
|
|
@@ -280,7 +312,7 @@ module UltracartClient
|
|
|
280
312
|
# Calculates hash code according to all attributes.
|
|
281
313
|
# @return [Integer] Hash code
|
|
282
314
|
def hash
|
|
283
|
-
[ai, ai_capabilities, ai_chat_instructions, ai_persona, ai_sms_instructions, ai_ticket_instructions, chat_limit, default_language_iso_code, default_status, display_name, name, profile_image_upload_key, profile_image_url, user_id, zohodesk_classifications, zohodesk_departments].hash
|
|
315
|
+
[ai, ai_capabilities, ai_chat_instructions, ai_persona, ai_sms_instructions, ai_ticket_instructions, ai_voice_instructions, ai_voice_personality, chat_limit, default_language_iso_code, default_status, display_name, name, profile_image_upload_key, profile_image_url, user_id, zohodesk_classifications, zohodesk_departments].hash
|
|
284
316
|
end
|
|
285
317
|
|
|
286
318
|
# Builds the object from hash
|
|
@@ -0,0 +1,480 @@
|
|
|
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 ConversationPbxAddress
|
|
18
|
+
# Twilio Address SID
|
|
19
|
+
attr_accessor :address_sid
|
|
20
|
+
|
|
21
|
+
# City
|
|
22
|
+
attr_accessor :city
|
|
23
|
+
|
|
24
|
+
# Conversation Pbx Address UUID
|
|
25
|
+
attr_accessor :conversation_pbx_address_uuid
|
|
26
|
+
|
|
27
|
+
# ISO country code (2 characters)
|
|
28
|
+
attr_accessor :country_code
|
|
29
|
+
|
|
30
|
+
# Customer name
|
|
31
|
+
attr_accessor :customer_name
|
|
32
|
+
|
|
33
|
+
# Friendly name for the address
|
|
34
|
+
attr_accessor :friendly_name
|
|
35
|
+
|
|
36
|
+
# Merchant Id
|
|
37
|
+
attr_accessor :merchant_id
|
|
38
|
+
|
|
39
|
+
# Postal code
|
|
40
|
+
attr_accessor :postal_code
|
|
41
|
+
|
|
42
|
+
# State/Province/Region
|
|
43
|
+
attr_accessor :region
|
|
44
|
+
|
|
45
|
+
# Street address
|
|
46
|
+
attr_accessor :street
|
|
47
|
+
|
|
48
|
+
# Whether the address has been validated by Twilio
|
|
49
|
+
attr_accessor :validated
|
|
50
|
+
|
|
51
|
+
# Whether the address has been verified by Twilio
|
|
52
|
+
attr_accessor :verified
|
|
53
|
+
|
|
54
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
55
|
+
def self.attribute_map
|
|
56
|
+
{
|
|
57
|
+
:'address_sid' => :'address_sid',
|
|
58
|
+
:'city' => :'city',
|
|
59
|
+
:'conversation_pbx_address_uuid' => :'conversation_pbx_address_uuid',
|
|
60
|
+
:'country_code' => :'country_code',
|
|
61
|
+
:'customer_name' => :'customer_name',
|
|
62
|
+
:'friendly_name' => :'friendly_name',
|
|
63
|
+
:'merchant_id' => :'merchant_id',
|
|
64
|
+
:'postal_code' => :'postal_code',
|
|
65
|
+
:'region' => :'region',
|
|
66
|
+
:'street' => :'street',
|
|
67
|
+
:'validated' => :'validated',
|
|
68
|
+
:'verified' => :'verified'
|
|
69
|
+
}
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Returns all the JSON keys this model knows about
|
|
73
|
+
def self.acceptable_attributes
|
|
74
|
+
attribute_map.values
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Attribute type mapping.
|
|
78
|
+
def self.openapi_types
|
|
79
|
+
{
|
|
80
|
+
:'address_sid' => :'String',
|
|
81
|
+
:'city' => :'String',
|
|
82
|
+
:'conversation_pbx_address_uuid' => :'String',
|
|
83
|
+
:'country_code' => :'String',
|
|
84
|
+
:'customer_name' => :'String',
|
|
85
|
+
:'friendly_name' => :'String',
|
|
86
|
+
:'merchant_id' => :'String',
|
|
87
|
+
:'postal_code' => :'String',
|
|
88
|
+
:'region' => :'String',
|
|
89
|
+
:'street' => :'String',
|
|
90
|
+
:'validated' => :'Boolean',
|
|
91
|
+
:'verified' => :'Boolean'
|
|
92
|
+
}
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# List of attributes with nullable: true
|
|
96
|
+
def self.openapi_nullable
|
|
97
|
+
Set.new([
|
|
98
|
+
])
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Initializes the object
|
|
102
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
103
|
+
def initialize(attributes = {})
|
|
104
|
+
if (!attributes.is_a?(Hash))
|
|
105
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationPbxAddress` initialize method"
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
109
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
110
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
111
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationPbxAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
112
|
+
end
|
|
113
|
+
h[k.to_sym] = v
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if attributes.key?(:'address_sid')
|
|
117
|
+
self.address_sid = attributes[:'address_sid']
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'city')
|
|
121
|
+
self.city = attributes[:'city']
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'conversation_pbx_address_uuid')
|
|
125
|
+
self.conversation_pbx_address_uuid = attributes[:'conversation_pbx_address_uuid']
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if attributes.key?(:'country_code')
|
|
129
|
+
self.country_code = attributes[:'country_code']
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:'customer_name')
|
|
133
|
+
self.customer_name = attributes[:'customer_name']
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'friendly_name')
|
|
137
|
+
self.friendly_name = attributes[:'friendly_name']
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if attributes.key?(:'merchant_id')
|
|
141
|
+
self.merchant_id = attributes[:'merchant_id']
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if attributes.key?(:'postal_code')
|
|
145
|
+
self.postal_code = attributes[:'postal_code']
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if attributes.key?(:'region')
|
|
149
|
+
self.region = attributes[:'region']
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if attributes.key?(:'street')
|
|
153
|
+
self.street = attributes[:'street']
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if attributes.key?(:'validated')
|
|
157
|
+
self.validated = attributes[:'validated']
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if attributes.key?(:'verified')
|
|
161
|
+
self.verified = attributes[:'verified']
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
166
|
+
# @return Array for valid properties with the reasons
|
|
167
|
+
def list_invalid_properties
|
|
168
|
+
invalid_properties = Array.new
|
|
169
|
+
if !@address_sid.nil? && @address_sid.to_s.length > 50
|
|
170
|
+
invalid_properties.push('invalid value for "address_sid", the character length must be smaller than or equal to 50.')
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
if !@city.nil? && @city.to_s.length > 100
|
|
174
|
+
invalid_properties.push('invalid value for "city", the character length must be smaller than or equal to 100.')
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
if !@conversation_pbx_address_uuid.nil? && @conversation_pbx_address_uuid.to_s.length > 50
|
|
178
|
+
invalid_properties.push('invalid value for "conversation_pbx_address_uuid", the character length must be smaller than or equal to 50.')
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
if !@country_code.nil? && @country_code.to_s.length > 2
|
|
182
|
+
invalid_properties.push('invalid value for "country_code", the character length must be smaller than or equal to 2.')
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
if !@customer_name.nil? && @customer_name.to_s.length > 100
|
|
186
|
+
invalid_properties.push('invalid value for "customer_name", the character length must be smaller than or equal to 100.')
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
if !@friendly_name.nil? && @friendly_name.to_s.length > 100
|
|
190
|
+
invalid_properties.push('invalid value for "friendly_name", the character length must be smaller than or equal to 100.')
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
if !@merchant_id.nil? && @merchant_id.to_s.length > 5
|
|
194
|
+
invalid_properties.push('invalid value for "merchant_id", the character length must be smaller than or equal to 5.')
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
if !@postal_code.nil? && @postal_code.to_s.length > 20
|
|
198
|
+
invalid_properties.push('invalid value for "postal_code", the character length must be smaller than or equal to 20.')
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
if !@region.nil? && @region.to_s.length > 50
|
|
202
|
+
invalid_properties.push('invalid value for "region", the character length must be smaller than or equal to 50.')
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
if !@street.nil? && @street.to_s.length > 200
|
|
206
|
+
invalid_properties.push('invalid value for "street", the character length must be smaller than or equal to 200.')
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
invalid_properties
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
# Check to see if the all the properties in the model are valid
|
|
213
|
+
# @return true if the model is valid
|
|
214
|
+
def valid?
|
|
215
|
+
return false if !@address_sid.nil? && @address_sid.to_s.length > 50
|
|
216
|
+
return false if !@city.nil? && @city.to_s.length > 100
|
|
217
|
+
return false if !@conversation_pbx_address_uuid.nil? && @conversation_pbx_address_uuid.to_s.length > 50
|
|
218
|
+
return false if !@country_code.nil? && @country_code.to_s.length > 2
|
|
219
|
+
return false if !@customer_name.nil? && @customer_name.to_s.length > 100
|
|
220
|
+
return false if !@friendly_name.nil? && @friendly_name.to_s.length > 100
|
|
221
|
+
return false if !@merchant_id.nil? && @merchant_id.to_s.length > 5
|
|
222
|
+
return false if !@postal_code.nil? && @postal_code.to_s.length > 20
|
|
223
|
+
return false if !@region.nil? && @region.to_s.length > 50
|
|
224
|
+
return false if !@street.nil? && @street.to_s.length > 200
|
|
225
|
+
true
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Custom attribute writer method with validation
|
|
229
|
+
# @param [Object] address_sid Value to be assigned
|
|
230
|
+
def address_sid=(address_sid)
|
|
231
|
+
if !address_sid.nil? && address_sid.to_s.length > 50
|
|
232
|
+
fail ArgumentError, 'invalid value for "address_sid", the character length must be smaller than or equal to 50.'
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
@address_sid = address_sid
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
# Custom attribute writer method with validation
|
|
239
|
+
# @param [Object] city Value to be assigned
|
|
240
|
+
def city=(city)
|
|
241
|
+
if !city.nil? && city.to_s.length > 100
|
|
242
|
+
fail ArgumentError, 'invalid value for "city", the character length must be smaller than or equal to 100.'
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
@city = city
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
# Custom attribute writer method with validation
|
|
249
|
+
# @param [Object] conversation_pbx_address_uuid Value to be assigned
|
|
250
|
+
def conversation_pbx_address_uuid=(conversation_pbx_address_uuid)
|
|
251
|
+
if !conversation_pbx_address_uuid.nil? && conversation_pbx_address_uuid.to_s.length > 50
|
|
252
|
+
fail ArgumentError, 'invalid value for "conversation_pbx_address_uuid", the character length must be smaller than or equal to 50.'
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
@conversation_pbx_address_uuid = conversation_pbx_address_uuid
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# Custom attribute writer method with validation
|
|
259
|
+
# @param [Object] country_code Value to be assigned
|
|
260
|
+
def country_code=(country_code)
|
|
261
|
+
if !country_code.nil? && country_code.to_s.length > 2
|
|
262
|
+
fail ArgumentError, 'invalid value for "country_code", the character length must be smaller than or equal to 2.'
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
@country_code = country_code
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
# Custom attribute writer method with validation
|
|
269
|
+
# @param [Object] customer_name Value to be assigned
|
|
270
|
+
def customer_name=(customer_name)
|
|
271
|
+
if !customer_name.nil? && customer_name.to_s.length > 100
|
|
272
|
+
fail ArgumentError, 'invalid value for "customer_name", the character length must be smaller than or equal to 100.'
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
@customer_name = customer_name
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
# Custom attribute writer method with validation
|
|
279
|
+
# @param [Object] friendly_name Value to be assigned
|
|
280
|
+
def friendly_name=(friendly_name)
|
|
281
|
+
if !friendly_name.nil? && friendly_name.to_s.length > 100
|
|
282
|
+
fail ArgumentError, 'invalid value for "friendly_name", the character length must be smaller than or equal to 100.'
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
@friendly_name = friendly_name
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
# Custom attribute writer method with validation
|
|
289
|
+
# @param [Object] merchant_id Value to be assigned
|
|
290
|
+
def merchant_id=(merchant_id)
|
|
291
|
+
if !merchant_id.nil? && merchant_id.to_s.length > 5
|
|
292
|
+
fail ArgumentError, 'invalid value for "merchant_id", the character length must be smaller than or equal to 5.'
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
@merchant_id = merchant_id
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
# Custom attribute writer method with validation
|
|
299
|
+
# @param [Object] postal_code Value to be assigned
|
|
300
|
+
def postal_code=(postal_code)
|
|
301
|
+
if !postal_code.nil? && postal_code.to_s.length > 20
|
|
302
|
+
fail ArgumentError, 'invalid value for "postal_code", the character length must be smaller than or equal to 20.'
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
@postal_code = postal_code
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
# Custom attribute writer method with validation
|
|
309
|
+
# @param [Object] region Value to be assigned
|
|
310
|
+
def region=(region)
|
|
311
|
+
if !region.nil? && region.to_s.length > 50
|
|
312
|
+
fail ArgumentError, 'invalid value for "region", the character length must be smaller than or equal to 50.'
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
@region = region
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
# Custom attribute writer method with validation
|
|
319
|
+
# @param [Object] street Value to be assigned
|
|
320
|
+
def street=(street)
|
|
321
|
+
if !street.nil? && street.to_s.length > 200
|
|
322
|
+
fail ArgumentError, 'invalid value for "street", the character length must be smaller than or equal to 200.'
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
@street = street
|
|
326
|
+
end
|
|
327
|
+
|
|
328
|
+
# Checks equality by comparing each attribute.
|
|
329
|
+
# @param [Object] Object to be compared
|
|
330
|
+
def ==(o)
|
|
331
|
+
return true if self.equal?(o)
|
|
332
|
+
self.class == o.class &&
|
|
333
|
+
address_sid == o.address_sid &&
|
|
334
|
+
city == o.city &&
|
|
335
|
+
conversation_pbx_address_uuid == o.conversation_pbx_address_uuid &&
|
|
336
|
+
country_code == o.country_code &&
|
|
337
|
+
customer_name == o.customer_name &&
|
|
338
|
+
friendly_name == o.friendly_name &&
|
|
339
|
+
merchant_id == o.merchant_id &&
|
|
340
|
+
postal_code == o.postal_code &&
|
|
341
|
+
region == o.region &&
|
|
342
|
+
street == o.street &&
|
|
343
|
+
validated == o.validated &&
|
|
344
|
+
verified == o.verified
|
|
345
|
+
end
|
|
346
|
+
|
|
347
|
+
# @see the `==` method
|
|
348
|
+
# @param [Object] Object to be compared
|
|
349
|
+
def eql?(o)
|
|
350
|
+
self == o
|
|
351
|
+
end
|
|
352
|
+
|
|
353
|
+
# Calculates hash code according to all attributes.
|
|
354
|
+
# @return [Integer] Hash code
|
|
355
|
+
def hash
|
|
356
|
+
[address_sid, city, conversation_pbx_address_uuid, country_code, customer_name, friendly_name, merchant_id, postal_code, region, street, validated, verified].hash
|
|
357
|
+
end
|
|
358
|
+
|
|
359
|
+
# Builds the object from hash
|
|
360
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
361
|
+
# @return [Object] Returns the model itself
|
|
362
|
+
def self.build_from_hash(attributes)
|
|
363
|
+
new.build_from_hash(attributes)
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
# Builds the object from hash
|
|
367
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
368
|
+
# @return [Object] Returns the model itself
|
|
369
|
+
def build_from_hash(attributes)
|
|
370
|
+
return nil unless attributes.is_a?(Hash)
|
|
371
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
372
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
373
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
374
|
+
self.send("#{key}=", nil)
|
|
375
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
376
|
+
# check to ensure the input is an array given that the attribute
|
|
377
|
+
# is documented as an array but the input is not
|
|
378
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
379
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
380
|
+
end
|
|
381
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
382
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
383
|
+
end
|
|
384
|
+
end
|
|
385
|
+
|
|
386
|
+
self
|
|
387
|
+
end
|
|
388
|
+
|
|
389
|
+
# Deserializes the data based on type
|
|
390
|
+
# @param string type Data type
|
|
391
|
+
# @param string value Value to be deserialized
|
|
392
|
+
# @return [Object] Deserialized data
|
|
393
|
+
def _deserialize(type, value)
|
|
394
|
+
case type.to_sym
|
|
395
|
+
when :Time
|
|
396
|
+
Time.parse(value)
|
|
397
|
+
when :Date
|
|
398
|
+
Date.parse(value)
|
|
399
|
+
when :String
|
|
400
|
+
value.to_s
|
|
401
|
+
when :Integer
|
|
402
|
+
value.to_i
|
|
403
|
+
when :Float
|
|
404
|
+
value.to_f
|
|
405
|
+
when :Boolean
|
|
406
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
407
|
+
true
|
|
408
|
+
else
|
|
409
|
+
false
|
|
410
|
+
end
|
|
411
|
+
when :Object
|
|
412
|
+
# generic object (usually a Hash), return directly
|
|
413
|
+
value
|
|
414
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
415
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
416
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
417
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
418
|
+
k_type = Regexp.last_match[:k_type]
|
|
419
|
+
v_type = Regexp.last_match[:v_type]
|
|
420
|
+
{}.tap do |hash|
|
|
421
|
+
value.each do |k, v|
|
|
422
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
423
|
+
end
|
|
424
|
+
end
|
|
425
|
+
else # model
|
|
426
|
+
# models (e.g. Pet) or oneOf
|
|
427
|
+
klass = UltracartClient.const_get(type)
|
|
428
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
429
|
+
end
|
|
430
|
+
end
|
|
431
|
+
|
|
432
|
+
# Returns the string representation of the object
|
|
433
|
+
# @return [String] String presentation of the object
|
|
434
|
+
def to_s
|
|
435
|
+
to_hash.to_s
|
|
436
|
+
end
|
|
437
|
+
|
|
438
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
439
|
+
# @return [Hash] Returns the object in the form of hash
|
|
440
|
+
def to_body
|
|
441
|
+
to_hash
|
|
442
|
+
end
|
|
443
|
+
|
|
444
|
+
# Returns the object in the form of hash
|
|
445
|
+
# @return [Hash] Returns the object in the form of hash
|
|
446
|
+
def to_hash
|
|
447
|
+
hash = {}
|
|
448
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
449
|
+
value = self.send(attr)
|
|
450
|
+
if value.nil?
|
|
451
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
452
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
453
|
+
end
|
|
454
|
+
|
|
455
|
+
hash[param] = _to_hash(value)
|
|
456
|
+
end
|
|
457
|
+
hash
|
|
458
|
+
end
|
|
459
|
+
|
|
460
|
+
# Outputs non-array value in the form of hash
|
|
461
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
462
|
+
# @param [Object] value Any valid value
|
|
463
|
+
# @return [Hash] Returns the value in the form of hash
|
|
464
|
+
def _to_hash(value)
|
|
465
|
+
if value.is_a?(Array)
|
|
466
|
+
value.compact.map { |v| _to_hash(v) }
|
|
467
|
+
elsif value.is_a?(Hash)
|
|
468
|
+
{}.tap do |hash|
|
|
469
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
470
|
+
end
|
|
471
|
+
elsif value.respond_to? :to_hash
|
|
472
|
+
value.to_hash
|
|
473
|
+
else
|
|
474
|
+
value
|
|
475
|
+
end
|
|
476
|
+
end
|
|
477
|
+
|
|
478
|
+
end
|
|
479
|
+
|
|
480
|
+
end
|