ultracart_api 4.0.208 → 4.0.210
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 -4
- data/docs/AutoOrder.md +2 -0
- data/docs/AutoOrderItem.md +4 -0
- data/docs/ConversationApi.md +575 -0
- data/docs/ConversationPbxVoicemailMessage.md +42 -0
- data/docs/ConversationPbxVoicemailMessageResponse.md +26 -0
- data/docs/ConversationPbxVoicemailMessageSummariesResponse.md +26 -0
- data/docs/ConversationPbxVoicemailMessageSummary.md +36 -0
- data/docs/ItemApi.md +73 -0
- data/docs/WorkflowTask.md +2 -2
- data/docs/WorkflowTasksRequest.md +4 -0
- data/lib/ultracart_api/api/conversation_api.rb +524 -0
- data/lib/ultracart_api/api/item_api.rb +75 -0
- data/lib/ultracart_api/models/auto_order.rb +11 -1
- data/lib/ultracart_api/models/auto_order_item.rb +21 -1
- data/lib/ultracart_api/models/conversation_pbx_phone_number_response.rb +1 -1
- data/lib/ultracart_api/models/conversation_pbx_phone_numbers_response.rb +1 -1
- data/lib/ultracart_api/models/conversation_pbx_time_based_response.rb +1 -1
- data/lib/ultracart_api/models/conversation_pbx_time_baseds_response.rb +1 -1
- data/lib/ultracart_api/models/conversation_pbx_time_range_response.rb +1 -1
- data/lib/ultracart_api/models/conversation_pbx_time_ranges_response.rb +1 -1
- data/lib/ultracart_api/models/conversation_pbx_voicemail_mailbox.rb +29 -5
- data/lib/ultracart_api/models/conversation_pbx_voicemail_mailbox_response.rb +1 -1
- data/lib/ultracart_api/models/conversation_pbx_voicemail_mailboxes_response.rb +1 -1
- data/lib/ultracart_api/models/conversation_pbx_voicemail_message.rb +374 -0
- data/lib/ultracart_api/models/conversation_pbx_voicemail_message_response.rb +256 -0
- data/lib/ultracart_api/models/conversation_pbx_voicemail_message_summaries_response.rb +258 -0
- data/lib/ultracart_api/models/conversation_pbx_voicemail_message_summary.rb +344 -0
- data/lib/ultracart_api/models/workflow_task.rb +2 -2
- data/lib/ultracart_api/models/workflow_tasks_request.rb +21 -1
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +4 -0
- metadata +10 -2
@@ -65,6 +65,9 @@ module UltracartClient
|
|
65
65
|
|
66
66
|
attr_accessor :management
|
67
67
|
|
68
|
+
# UltraCart merchant ID owning this order
|
69
|
+
attr_accessor :merchant_id
|
70
|
+
|
68
71
|
# The next time that the auto order will be attempted for processing
|
69
72
|
attr_accessor :next_attempt
|
70
73
|
|
@@ -127,6 +130,7 @@ module UltracartClient
|
|
127
130
|
:'items' => :'items',
|
128
131
|
:'logs' => :'logs',
|
129
132
|
:'management' => :'management',
|
133
|
+
:'merchant_id' => :'merchant_id',
|
130
134
|
:'next_attempt' => :'next_attempt',
|
131
135
|
:'original_order' => :'original_order',
|
132
136
|
:'original_order_id' => :'original_order_id',
|
@@ -162,6 +166,7 @@ module UltracartClient
|
|
162
166
|
:'items' => :'Array<AutoOrderItem>',
|
163
167
|
:'logs' => :'Array<AutoOrderLog>',
|
164
168
|
:'management' => :'AutoOrderManagement',
|
169
|
+
:'merchant_id' => :'String',
|
165
170
|
:'next_attempt' => :'String',
|
166
171
|
:'original_order' => :'Order',
|
167
172
|
:'original_order_id' => :'String',
|
@@ -267,6 +272,10 @@ module UltracartClient
|
|
267
272
|
self.management = attributes[:'management']
|
268
273
|
end
|
269
274
|
|
275
|
+
if attributes.key?(:'merchant_id')
|
276
|
+
self.merchant_id = attributes[:'merchant_id']
|
277
|
+
end
|
278
|
+
|
270
279
|
if attributes.key?(:'next_attempt')
|
271
280
|
self.next_attempt = attributes[:'next_attempt']
|
272
281
|
end
|
@@ -345,6 +354,7 @@ module UltracartClient
|
|
345
354
|
items == o.items &&
|
346
355
|
logs == o.logs &&
|
347
356
|
management == o.management &&
|
357
|
+
merchant_id == o.merchant_id &&
|
348
358
|
next_attempt == o.next_attempt &&
|
349
359
|
original_order == o.original_order &&
|
350
360
|
original_order_id == o.original_order_id &&
|
@@ -363,7 +373,7 @@ module UltracartClient
|
|
363
373
|
# Calculates hash code according to all attributes.
|
364
374
|
# @return [Integer] Hash code
|
365
375
|
def hash
|
366
|
-
[add_ons, auto_order_code, auto_order_oid, cancel_after_next_x_orders, cancel_downgrade, cancel_reason, cancel_upgrade, canceled_by_user, canceled_dts, completed, credit_card_attempt, disabled_dts, enabled, failure_reason, items, logs, management, next_attempt, original_order, original_order_id, override_affiliate_id, rebill_orders, rotating_transaction_gateway_code, status].hash
|
376
|
+
[add_ons, auto_order_code, auto_order_oid, cancel_after_next_x_orders, cancel_downgrade, cancel_reason, cancel_upgrade, canceled_by_user, canceled_dts, completed, credit_card_attempt, disabled_dts, enabled, failure_reason, items, logs, management, merchant_id, next_attempt, original_order, original_order_id, override_affiliate_id, rebill_orders, rotating_transaction_gateway_code, status].hash
|
367
377
|
end
|
368
378
|
|
369
379
|
# Builds the object from hash
|
@@ -36,6 +36,9 @@ module UltracartClient
|
|
36
36
|
# Primary key of AutoOrderItem
|
37
37
|
attr_accessor :auto_order_item_oid
|
38
38
|
|
39
|
+
# Calculated Date/time that this item is scheduled to rebill. Will be null if no more shipments are going to occur on this item
|
40
|
+
attr_accessor :calculated_next_shipment_dts
|
41
|
+
|
39
42
|
# Date/time of the first order of this item. Null if item added to auto order and has not been rebilled yet.
|
40
43
|
attr_accessor :first_order_dts
|
41
44
|
|
@@ -51,6 +54,9 @@ module UltracartClient
|
|
51
54
|
# The life time value of this item including the original purchase
|
52
55
|
attr_accessor :life_time_value
|
53
56
|
|
57
|
+
# Calculated next item id
|
58
|
+
attr_accessor :next_item_id
|
59
|
+
|
54
60
|
# The date/time of when the next pre-shipment notice should be sent
|
55
61
|
attr_accessor :next_preshipment_notice_dts
|
56
62
|
|
@@ -124,11 +130,13 @@ module UltracartClient
|
|
124
130
|
:'arbitrary_unit_cost' => :'arbitrary_unit_cost',
|
125
131
|
:'arbitrary_unit_cost_remaining_orders' => :'arbitrary_unit_cost_remaining_orders',
|
126
132
|
:'auto_order_item_oid' => :'auto_order_item_oid',
|
133
|
+
:'calculated_next_shipment_dts' => :'calculated_next_shipment_dts',
|
127
134
|
:'first_order_dts' => :'first_order_dts',
|
128
135
|
:'frequency' => :'frequency',
|
129
136
|
:'future_schedules' => :'future_schedules',
|
130
137
|
:'last_order_dts' => :'last_order_dts',
|
131
138
|
:'life_time_value' => :'life_time_value',
|
139
|
+
:'next_item_id' => :'next_item_id',
|
132
140
|
:'next_preshipment_notice_dts' => :'next_preshipment_notice_dts',
|
133
141
|
:'next_shipment_dts' => :'next_shipment_dts',
|
134
142
|
:'no_order_after_dts' => :'no_order_after_dts',
|
@@ -161,11 +169,13 @@ module UltracartClient
|
|
161
169
|
:'arbitrary_unit_cost' => :'Float',
|
162
170
|
:'arbitrary_unit_cost_remaining_orders' => :'Integer',
|
163
171
|
:'auto_order_item_oid' => :'Integer',
|
172
|
+
:'calculated_next_shipment_dts' => :'String',
|
164
173
|
:'first_order_dts' => :'String',
|
165
174
|
:'frequency' => :'String',
|
166
175
|
:'future_schedules' => :'Array<AutoOrderItemFutureSchedule>',
|
167
176
|
:'last_order_dts' => :'String',
|
168
177
|
:'life_time_value' => :'Float',
|
178
|
+
:'next_item_id' => :'String',
|
169
179
|
:'next_preshipment_notice_dts' => :'String',
|
170
180
|
:'next_shipment_dts' => :'String',
|
171
181
|
:'no_order_after_dts' => :'String',
|
@@ -232,6 +242,10 @@ module UltracartClient
|
|
232
242
|
self.auto_order_item_oid = attributes[:'auto_order_item_oid']
|
233
243
|
end
|
234
244
|
|
245
|
+
if attributes.key?(:'calculated_next_shipment_dts')
|
246
|
+
self.calculated_next_shipment_dts = attributes[:'calculated_next_shipment_dts']
|
247
|
+
end
|
248
|
+
|
235
249
|
if attributes.key?(:'first_order_dts')
|
236
250
|
self.first_order_dts = attributes[:'first_order_dts']
|
237
251
|
end
|
@@ -254,6 +268,10 @@ module UltracartClient
|
|
254
268
|
self.life_time_value = attributes[:'life_time_value']
|
255
269
|
end
|
256
270
|
|
271
|
+
if attributes.key?(:'next_item_id')
|
272
|
+
self.next_item_id = attributes[:'next_item_id']
|
273
|
+
end
|
274
|
+
|
257
275
|
if attributes.key?(:'next_preshipment_notice_dts')
|
258
276
|
self.next_preshipment_notice_dts = attributes[:'next_preshipment_notice_dts']
|
259
277
|
end
|
@@ -350,11 +368,13 @@ module UltracartClient
|
|
350
368
|
arbitrary_unit_cost == o.arbitrary_unit_cost &&
|
351
369
|
arbitrary_unit_cost_remaining_orders == o.arbitrary_unit_cost_remaining_orders &&
|
352
370
|
auto_order_item_oid == o.auto_order_item_oid &&
|
371
|
+
calculated_next_shipment_dts == o.calculated_next_shipment_dts &&
|
353
372
|
first_order_dts == o.first_order_dts &&
|
354
373
|
frequency == o.frequency &&
|
355
374
|
future_schedules == o.future_schedules &&
|
356
375
|
last_order_dts == o.last_order_dts &&
|
357
376
|
life_time_value == o.life_time_value &&
|
377
|
+
next_item_id == o.next_item_id &&
|
358
378
|
next_preshipment_notice_dts == o.next_preshipment_notice_dts &&
|
359
379
|
next_shipment_dts == o.next_shipment_dts &&
|
360
380
|
no_order_after_dts == o.no_order_after_dts &&
|
@@ -380,7 +400,7 @@ module UltracartClient
|
|
380
400
|
# Calculates hash code according to all attributes.
|
381
401
|
# @return [Integer] Hash code
|
382
402
|
def hash
|
383
|
-
[arbitrary_item_id, arbitrary_percentage_discount, arbitrary_quantity, arbitrary_schedule_days, arbitrary_unit_cost, arbitrary_unit_cost_remaining_orders, auto_order_item_oid, first_order_dts, frequency, future_schedules, last_order_dts, life_time_value, next_preshipment_notice_dts, next_shipment_dts, no_order_after_dts, number_of_rebills, options, original_item_id, original_quantity, paused, paypal_payer_id, paypal_recurring_payment_profile_id, preshipment_notice_sent, rebill_value, remaining_repeat_count, simple_schedule].hash
|
403
|
+
[arbitrary_item_id, arbitrary_percentage_discount, arbitrary_quantity, arbitrary_schedule_days, arbitrary_unit_cost, arbitrary_unit_cost_remaining_orders, auto_order_item_oid, calculated_next_shipment_dts, first_order_dts, frequency, future_schedules, last_order_dts, life_time_value, next_item_id, next_preshipment_notice_dts, next_shipment_dts, no_order_after_dts, number_of_rebills, options, original_item_id, original_quantity, paused, paypal_payer_id, paypal_recurring_payment_profile_id, preshipment_notice_sent, rebill_value, remaining_repeat_count, simple_schedule].hash
|
384
404
|
end
|
385
405
|
|
386
406
|
# Builds the object from hash
|
@@ -48,6 +48,28 @@ module UltracartClient
|
|
48
48
|
# Voicemail say voice
|
49
49
|
attr_accessor :voicemail_say_voice
|
50
50
|
|
51
|
+
class EnumAttributeValidator
|
52
|
+
attr_reader :datatype
|
53
|
+
attr_reader :allowable_values
|
54
|
+
|
55
|
+
def initialize(datatype, allowable_values)
|
56
|
+
@allowable_values = allowable_values.map do |value|
|
57
|
+
case datatype.to_s
|
58
|
+
when /Integer/i
|
59
|
+
value.to_i
|
60
|
+
when /Float/i
|
61
|
+
value.to_f
|
62
|
+
else
|
63
|
+
value
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def valid?(value)
|
69
|
+
!value || allowable_values.include?(value)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
51
73
|
# Attribute mapping from ruby-style variable name to JSON key.
|
52
74
|
def self.attribute_map
|
53
75
|
{
|
@@ -200,6 +222,8 @@ module UltracartClient
|
|
200
222
|
return false if !@send_notices_to_email.nil? && @send_notices_to_email.to_s.length > 250
|
201
223
|
return false if !@voicemail_follow_play_audio_uuid.nil? && @voicemail_follow_play_audio_uuid.to_s.length > 50
|
202
224
|
return false if !@voicemail_mailbox_id.nil? && @voicemail_mailbox_id.to_s.length > 50
|
225
|
+
voicemail_mailbox_type_validator = EnumAttributeValidator.new('String', ["agent", "shared"])
|
226
|
+
return false unless voicemail_mailbox_type_validator.valid?(@voicemail_mailbox_type)
|
203
227
|
return false if !@voicemail_mailbox_type.nil? && @voicemail_mailbox_type.to_s.length > 50
|
204
228
|
return false if !@voicemail_prompt_play_audio_uuid.nil? && @voicemail_prompt_play_audio_uuid.to_s.length > 50
|
205
229
|
return false if !@voicemail_say_voice.nil? && @voicemail_say_voice.to_s.length > 50
|
@@ -256,13 +280,13 @@ module UltracartClient
|
|
256
280
|
@voicemail_mailbox_id = voicemail_mailbox_id
|
257
281
|
end
|
258
282
|
|
259
|
-
# Custom attribute writer method
|
260
|
-
# @param [Object] voicemail_mailbox_type
|
283
|
+
# Custom attribute writer method checking allowed values (enum).
|
284
|
+
# @param [Object] voicemail_mailbox_type Object to be assigned
|
261
285
|
def voicemail_mailbox_type=(voicemail_mailbox_type)
|
262
|
-
|
263
|
-
|
286
|
+
validator = EnumAttributeValidator.new('String', ["agent", "shared"])
|
287
|
+
unless validator.valid?(voicemail_mailbox_type)
|
288
|
+
fail ArgumentError, "invalid value for \"voicemail_mailbox_type\", must be one of #{validator.allowable_values}."
|
264
289
|
end
|
265
|
-
|
266
290
|
@voicemail_mailbox_type = voicemail_mailbox_type
|
267
291
|
end
|
268
292
|
|
@@ -0,0 +1,374 @@
|
|
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 ConversationPbxVoicemailMessage
|
18
|
+
# Call SID
|
19
|
+
attr_accessor :call_sid
|
20
|
+
|
21
|
+
# Duration in seconds
|
22
|
+
attr_accessor :duration
|
23
|
+
|
24
|
+
# From phone number in E.164
|
25
|
+
attr_accessor :from
|
26
|
+
|
27
|
+
# From caller id (if available)
|
28
|
+
attr_accessor :from_caller_id
|
29
|
+
|
30
|
+
# True if the voicemail has been listened to in the user interface
|
31
|
+
attr_accessor :listened
|
32
|
+
|
33
|
+
# Merchant ID
|
34
|
+
attr_accessor :merchant_id
|
35
|
+
|
36
|
+
# Recording SID
|
37
|
+
attr_accessor :recording_sid
|
38
|
+
|
39
|
+
# Recording size in bytes
|
40
|
+
attr_accessor :recording_size_bytes
|
41
|
+
|
42
|
+
# Recording Status
|
43
|
+
attr_accessor :recording_status
|
44
|
+
|
45
|
+
# Recording URL (expires in 4 hours)
|
46
|
+
attr_accessor :recording_url
|
47
|
+
|
48
|
+
# JSON version of the transcript
|
49
|
+
attr_accessor :transcript_json
|
50
|
+
|
51
|
+
# Formatted text of the transcript
|
52
|
+
attr_accessor :transcript_text
|
53
|
+
|
54
|
+
# Voicemail date/time
|
55
|
+
attr_accessor :voicemail_dts
|
56
|
+
|
57
|
+
class EnumAttributeValidator
|
58
|
+
attr_reader :datatype
|
59
|
+
attr_reader :allowable_values
|
60
|
+
|
61
|
+
def initialize(datatype, allowable_values)
|
62
|
+
@allowable_values = allowable_values.map do |value|
|
63
|
+
case datatype.to_s
|
64
|
+
when /Integer/i
|
65
|
+
value.to_i
|
66
|
+
when /Float/i
|
67
|
+
value.to_f
|
68
|
+
else
|
69
|
+
value
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def valid?(value)
|
75
|
+
!value || allowable_values.include?(value)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
80
|
+
def self.attribute_map
|
81
|
+
{
|
82
|
+
:'call_sid' => :'call_sid',
|
83
|
+
:'duration' => :'duration',
|
84
|
+
:'from' => :'from',
|
85
|
+
:'from_caller_id' => :'from_caller_id',
|
86
|
+
:'listened' => :'listened',
|
87
|
+
:'merchant_id' => :'merchant_id',
|
88
|
+
:'recording_sid' => :'recording_sid',
|
89
|
+
:'recording_size_bytes' => :'recording_size_bytes',
|
90
|
+
:'recording_status' => :'recording_status',
|
91
|
+
:'recording_url' => :'recording_url',
|
92
|
+
:'transcript_json' => :'transcript_json',
|
93
|
+
:'transcript_text' => :'transcript_text',
|
94
|
+
:'voicemail_dts' => :'voicemail_dts'
|
95
|
+
}
|
96
|
+
end
|
97
|
+
|
98
|
+
# Returns all the JSON keys this model knows about
|
99
|
+
def self.acceptable_attributes
|
100
|
+
attribute_map.values
|
101
|
+
end
|
102
|
+
|
103
|
+
# Attribute type mapping.
|
104
|
+
def self.openapi_types
|
105
|
+
{
|
106
|
+
:'call_sid' => :'String',
|
107
|
+
:'duration' => :'Integer',
|
108
|
+
:'from' => :'String',
|
109
|
+
:'from_caller_id' => :'String',
|
110
|
+
:'listened' => :'Boolean',
|
111
|
+
:'merchant_id' => :'String',
|
112
|
+
:'recording_sid' => :'String',
|
113
|
+
:'recording_size_bytes' => :'Integer',
|
114
|
+
:'recording_status' => :'String',
|
115
|
+
:'recording_url' => :'String',
|
116
|
+
:'transcript_json' => :'String',
|
117
|
+
:'transcript_text' => :'String',
|
118
|
+
:'voicemail_dts' => :'String'
|
119
|
+
}
|
120
|
+
end
|
121
|
+
|
122
|
+
# List of attributes with nullable: true
|
123
|
+
def self.openapi_nullable
|
124
|
+
Set.new([
|
125
|
+
])
|
126
|
+
end
|
127
|
+
|
128
|
+
# Initializes the object
|
129
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
130
|
+
def initialize(attributes = {})
|
131
|
+
if (!attributes.is_a?(Hash))
|
132
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationPbxVoicemailMessage` initialize method"
|
133
|
+
end
|
134
|
+
|
135
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
136
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
137
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
138
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationPbxVoicemailMessage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
139
|
+
end
|
140
|
+
h[k.to_sym] = v
|
141
|
+
}
|
142
|
+
|
143
|
+
if attributes.key?(:'call_sid')
|
144
|
+
self.call_sid = attributes[:'call_sid']
|
145
|
+
end
|
146
|
+
|
147
|
+
if attributes.key?(:'duration')
|
148
|
+
self.duration = attributes[:'duration']
|
149
|
+
end
|
150
|
+
|
151
|
+
if attributes.key?(:'from')
|
152
|
+
self.from = attributes[:'from']
|
153
|
+
end
|
154
|
+
|
155
|
+
if attributes.key?(:'from_caller_id')
|
156
|
+
self.from_caller_id = attributes[:'from_caller_id']
|
157
|
+
end
|
158
|
+
|
159
|
+
if attributes.key?(:'listened')
|
160
|
+
self.listened = attributes[:'listened']
|
161
|
+
end
|
162
|
+
|
163
|
+
if attributes.key?(:'merchant_id')
|
164
|
+
self.merchant_id = attributes[:'merchant_id']
|
165
|
+
end
|
166
|
+
|
167
|
+
if attributes.key?(:'recording_sid')
|
168
|
+
self.recording_sid = attributes[:'recording_sid']
|
169
|
+
end
|
170
|
+
|
171
|
+
if attributes.key?(:'recording_size_bytes')
|
172
|
+
self.recording_size_bytes = attributes[:'recording_size_bytes']
|
173
|
+
end
|
174
|
+
|
175
|
+
if attributes.key?(:'recording_status')
|
176
|
+
self.recording_status = attributes[:'recording_status']
|
177
|
+
end
|
178
|
+
|
179
|
+
if attributes.key?(:'recording_url')
|
180
|
+
self.recording_url = attributes[:'recording_url']
|
181
|
+
end
|
182
|
+
|
183
|
+
if attributes.key?(:'transcript_json')
|
184
|
+
self.transcript_json = attributes[:'transcript_json']
|
185
|
+
end
|
186
|
+
|
187
|
+
if attributes.key?(:'transcript_text')
|
188
|
+
self.transcript_text = attributes[:'transcript_text']
|
189
|
+
end
|
190
|
+
|
191
|
+
if attributes.key?(:'voicemail_dts')
|
192
|
+
self.voicemail_dts = attributes[:'voicemail_dts']
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
197
|
+
# @return Array for valid properties with the reasons
|
198
|
+
def list_invalid_properties
|
199
|
+
invalid_properties = Array.new
|
200
|
+
invalid_properties
|
201
|
+
end
|
202
|
+
|
203
|
+
# Check to see if the all the properties in the model are valid
|
204
|
+
# @return true if the model is valid
|
205
|
+
def valid?
|
206
|
+
recording_status_validator = EnumAttributeValidator.new('String', ["completed"])
|
207
|
+
return false unless recording_status_validator.valid?(@recording_status)
|
208
|
+
true
|
209
|
+
end
|
210
|
+
|
211
|
+
# Custom attribute writer method checking allowed values (enum).
|
212
|
+
# @param [Object] recording_status Object to be assigned
|
213
|
+
def recording_status=(recording_status)
|
214
|
+
validator = EnumAttributeValidator.new('String', ["completed"])
|
215
|
+
unless validator.valid?(recording_status)
|
216
|
+
fail ArgumentError, "invalid value for \"recording_status\", must be one of #{validator.allowable_values}."
|
217
|
+
end
|
218
|
+
@recording_status = recording_status
|
219
|
+
end
|
220
|
+
|
221
|
+
# Checks equality by comparing each attribute.
|
222
|
+
# @param [Object] Object to be compared
|
223
|
+
def ==(o)
|
224
|
+
return true if self.equal?(o)
|
225
|
+
self.class == o.class &&
|
226
|
+
call_sid == o.call_sid &&
|
227
|
+
duration == o.duration &&
|
228
|
+
from == o.from &&
|
229
|
+
from_caller_id == o.from_caller_id &&
|
230
|
+
listened == o.listened &&
|
231
|
+
merchant_id == o.merchant_id &&
|
232
|
+
recording_sid == o.recording_sid &&
|
233
|
+
recording_size_bytes == o.recording_size_bytes &&
|
234
|
+
recording_status == o.recording_status &&
|
235
|
+
recording_url == o.recording_url &&
|
236
|
+
transcript_json == o.transcript_json &&
|
237
|
+
transcript_text == o.transcript_text &&
|
238
|
+
voicemail_dts == o.voicemail_dts
|
239
|
+
end
|
240
|
+
|
241
|
+
# @see the `==` method
|
242
|
+
# @param [Object] Object to be compared
|
243
|
+
def eql?(o)
|
244
|
+
self == o
|
245
|
+
end
|
246
|
+
|
247
|
+
# Calculates hash code according to all attributes.
|
248
|
+
# @return [Integer] Hash code
|
249
|
+
def hash
|
250
|
+
[call_sid, duration, from, from_caller_id, listened, merchant_id, recording_sid, recording_size_bytes, recording_status, recording_url, transcript_json, transcript_text, voicemail_dts].hash
|
251
|
+
end
|
252
|
+
|
253
|
+
# Builds the object from hash
|
254
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
255
|
+
# @return [Object] Returns the model itself
|
256
|
+
def self.build_from_hash(attributes)
|
257
|
+
new.build_from_hash(attributes)
|
258
|
+
end
|
259
|
+
|
260
|
+
# Builds the object from hash
|
261
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
262
|
+
# @return [Object] Returns the model itself
|
263
|
+
def build_from_hash(attributes)
|
264
|
+
return nil unless attributes.is_a?(Hash)
|
265
|
+
attributes = attributes.transform_keys(&:to_sym)
|
266
|
+
self.class.openapi_types.each_pair do |key, type|
|
267
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
268
|
+
self.send("#{key}=", nil)
|
269
|
+
elsif type =~ /\AArray<(.*)>/i
|
270
|
+
# check to ensure the input is an array given that the attribute
|
271
|
+
# is documented as an array but the input is not
|
272
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
273
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
274
|
+
end
|
275
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
276
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
277
|
+
end
|
278
|
+
end
|
279
|
+
|
280
|
+
self
|
281
|
+
end
|
282
|
+
|
283
|
+
# Deserializes the data based on type
|
284
|
+
# @param string type Data type
|
285
|
+
# @param string value Value to be deserialized
|
286
|
+
# @return [Object] Deserialized data
|
287
|
+
def _deserialize(type, value)
|
288
|
+
case type.to_sym
|
289
|
+
when :Time
|
290
|
+
Time.parse(value)
|
291
|
+
when :Date
|
292
|
+
Date.parse(value)
|
293
|
+
when :String
|
294
|
+
value.to_s
|
295
|
+
when :Integer
|
296
|
+
value.to_i
|
297
|
+
when :Float
|
298
|
+
value.to_f
|
299
|
+
when :Boolean
|
300
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
301
|
+
true
|
302
|
+
else
|
303
|
+
false
|
304
|
+
end
|
305
|
+
when :Object
|
306
|
+
# generic object (usually a Hash), return directly
|
307
|
+
value
|
308
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
309
|
+
inner_type = Regexp.last_match[:inner_type]
|
310
|
+
value.map { |v| _deserialize(inner_type, v) }
|
311
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
312
|
+
k_type = Regexp.last_match[:k_type]
|
313
|
+
v_type = Regexp.last_match[:v_type]
|
314
|
+
{}.tap do |hash|
|
315
|
+
value.each do |k, v|
|
316
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
317
|
+
end
|
318
|
+
end
|
319
|
+
else # model
|
320
|
+
# models (e.g. Pet) or oneOf
|
321
|
+
klass = UltracartClient.const_get(type)
|
322
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
323
|
+
end
|
324
|
+
end
|
325
|
+
|
326
|
+
# Returns the string representation of the object
|
327
|
+
# @return [String] String presentation of the object
|
328
|
+
def to_s
|
329
|
+
to_hash.to_s
|
330
|
+
end
|
331
|
+
|
332
|
+
# to_body is an alias to to_hash (backward compatibility)
|
333
|
+
# @return [Hash] Returns the object in the form of hash
|
334
|
+
def to_body
|
335
|
+
to_hash
|
336
|
+
end
|
337
|
+
|
338
|
+
# Returns the object in the form of hash
|
339
|
+
# @return [Hash] Returns the object in the form of hash
|
340
|
+
def to_hash
|
341
|
+
hash = {}
|
342
|
+
self.class.attribute_map.each_pair do |attr, param|
|
343
|
+
value = self.send(attr)
|
344
|
+
if value.nil?
|
345
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
346
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
347
|
+
end
|
348
|
+
|
349
|
+
hash[param] = _to_hash(value)
|
350
|
+
end
|
351
|
+
hash
|
352
|
+
end
|
353
|
+
|
354
|
+
# Outputs non-array value in the form of hash
|
355
|
+
# For object, use to_hash. Otherwise, just return the value
|
356
|
+
# @param [Object] value Any valid value
|
357
|
+
# @return [Hash] Returns the value in the form of hash
|
358
|
+
def _to_hash(value)
|
359
|
+
if value.is_a?(Array)
|
360
|
+
value.compact.map { |v| _to_hash(v) }
|
361
|
+
elsif value.is_a?(Hash)
|
362
|
+
{}.tap do |hash|
|
363
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
364
|
+
end
|
365
|
+
elsif value.respond_to? :to_hash
|
366
|
+
value.to_hash
|
367
|
+
else
|
368
|
+
value
|
369
|
+
end
|
370
|
+
end
|
371
|
+
|
372
|
+
end
|
373
|
+
|
374
|
+
end
|