ultracart_api 4.1.80 → 4.1.82
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 +34 -2
- data/docs/AgentSummary.md +30 -0
- data/docs/ConversationAgentCallEvent.md +30 -0
- data/docs/ConversationAgentChatEvent.md +26 -0
- data/docs/ConversationAgentStatusConfig.md +42 -0
- data/docs/ConversationAgentStatusConfigResponse.md +26 -0
- data/docs/ConversationAgentStatusConfigsResponse.md +26 -0
- data/docs/ConversationAgentStatusEvent.md +48 -0
- data/docs/ConversationAgentStatusHeatmapRequest.md +24 -0
- data/docs/ConversationAgentStatusHeatmapResponse.md +30 -0
- data/docs/ConversationAgentStatusHistorySearchRequest.md +28 -0
- data/docs/ConversationAgentStatusHistorySearchResponse.md +28 -0
- data/docs/ConversationAgentStatusRollup.md +38 -0
- data/docs/ConversationAgentStatusRollupSearchRequest.md +24 -0
- data/docs/ConversationAgentStatusRollupSearchResponse.md +26 -0
- data/docs/ConversationAgentStatusSummaryResponse.md +32 -0
- data/docs/ConversationAgentStatusTimelineResponse.md +32 -0
- data/docs/ConversationApi.md +600 -0
- data/docs/ConversationPbxDefaultTimezoneResponse.md +26 -0
- data/docs/ConversationPbxDefaultTimezoneUpdateRequest.md +18 -0
- data/docs/ConversationWebchatQueueStatusAgent.md +6 -0
- data/docs/ConversationWebchatQueueStatusUpdateRequest.md +5 -1
- data/docs/TimelineSummary.md +26 -0
- data/lib/ultracart_api/api/conversation_api.rb +766 -2
- data/lib/ultracart_api/models/agent_summary.rb +279 -0
- data/lib/ultracart_api/models/conversation_agent_call_event.rb +314 -0
- data/lib/ultracart_api/models/conversation_agent_chat_event.rb +260 -0
- data/lib/ultracart_api/models/conversation_agent_status_config.rb +461 -0
- data/lib/ultracart_api/models/conversation_agent_status_config_response.rb +256 -0
- data/lib/ultracart_api/models/conversation_agent_status_configs_response.rb +259 -0
- data/lib/ultracart_api/models/conversation_agent_status_event.rb +512 -0
- data/lib/ultracart_api/models/conversation_agent_status_heatmap_request.rb +296 -0
- data/lib/ultracart_api/models/conversation_agent_status_heatmap_response.rb +283 -0
- data/lib/ultracart_api/models/conversation_agent_status_history_search_request.rb +316 -0
- data/lib/ultracart_api/models/conversation_agent_status_history_search_response.rb +269 -0
- data/lib/ultracart_api/models/conversation_agent_status_rollup.rb +353 -0
- data/lib/ultracart_api/models/conversation_agent_status_rollup_search_request.rb +284 -0
- data/lib/ultracart_api/models/conversation_agent_status_rollup_search_response.rb +259 -0
- data/lib/ultracart_api/models/conversation_agent_status_summary_response.rb +288 -0
- data/lib/ultracart_api/models/conversation_agent_status_timeline_response.rb +292 -0
- data/lib/ultracart_api/models/conversation_pbx_default_timezone_response.rb +272 -0
- data/lib/ultracart_api/models/conversation_pbx_default_timezone_update_request.rb +235 -0
- data/lib/ultracart_api/models/conversation_webchat_queue_status_agent.rb +31 -1
- data/lib/ultracart_api/models/conversation_webchat_queue_status_update_request.rb +24 -4
- data/lib/ultracart_api/models/timeline_summary.rb +260 -0
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +19 -0
- metadata +40 -2
|
@@ -0,0 +1,512 @@
|
|
|
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 ConversationAgentStatusEvent
|
|
18
|
+
# Agent display name at the time of the event
|
|
19
|
+
attr_accessor :agent_name
|
|
20
|
+
|
|
21
|
+
# Agent type
|
|
22
|
+
attr_accessor :agent_type
|
|
23
|
+
|
|
24
|
+
# Agent user id (links across channels)
|
|
25
|
+
attr_accessor :agent_user_id
|
|
26
|
+
|
|
27
|
+
# Channel
|
|
28
|
+
attr_accessor :channel
|
|
29
|
+
|
|
30
|
+
# Custom status name (when applicable)
|
|
31
|
+
attr_accessor :custom_status_name
|
|
32
|
+
|
|
33
|
+
# Custom status uuid (when applicable)
|
|
34
|
+
attr_accessor :custom_status_uuid
|
|
35
|
+
|
|
36
|
+
# Time spent in the previous status, in seconds
|
|
37
|
+
attr_accessor :duration_in_previous_seconds
|
|
38
|
+
|
|
39
|
+
# Event timestamp (ISO 8601)
|
|
40
|
+
attr_accessor :event_dts
|
|
41
|
+
|
|
42
|
+
# Event UUID (natural key for ES + BQ)
|
|
43
|
+
attr_accessor :event_uuid
|
|
44
|
+
|
|
45
|
+
# Merchant Id
|
|
46
|
+
attr_accessor :merchant_id
|
|
47
|
+
|
|
48
|
+
# Canonical new routing semantic
|
|
49
|
+
attr_accessor :new_routing_effect
|
|
50
|
+
|
|
51
|
+
# Channel-native new status name
|
|
52
|
+
attr_accessor :new_status
|
|
53
|
+
|
|
54
|
+
# Parent merchant id (denormalized for ES routing parity)
|
|
55
|
+
attr_accessor :parent_merchant_id
|
|
56
|
+
|
|
57
|
+
# Canonical previous routing semantic
|
|
58
|
+
attr_accessor :previous_routing_effect
|
|
59
|
+
|
|
60
|
+
# Channel-native previous status name
|
|
61
|
+
attr_accessor :previous_status
|
|
62
|
+
|
|
63
|
+
# What triggered the transition
|
|
64
|
+
attr_accessor :trigger
|
|
65
|
+
|
|
66
|
+
class EnumAttributeValidator
|
|
67
|
+
attr_reader :datatype
|
|
68
|
+
attr_reader :allowable_values
|
|
69
|
+
|
|
70
|
+
def initialize(datatype, allowable_values)
|
|
71
|
+
@allowable_values = allowable_values.map do |value|
|
|
72
|
+
case datatype.to_s
|
|
73
|
+
when /Integer/i
|
|
74
|
+
value.to_i
|
|
75
|
+
when /Float/i
|
|
76
|
+
value.to_f
|
|
77
|
+
else
|
|
78
|
+
value
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def valid?(value)
|
|
84
|
+
!value || allowable_values.include?(value)
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
89
|
+
def self.attribute_map
|
|
90
|
+
{
|
|
91
|
+
:'agent_name' => :'agent_name',
|
|
92
|
+
:'agent_type' => :'agent_type',
|
|
93
|
+
:'agent_user_id' => :'agent_user_id',
|
|
94
|
+
:'channel' => :'channel',
|
|
95
|
+
:'custom_status_name' => :'custom_status_name',
|
|
96
|
+
:'custom_status_uuid' => :'custom_status_uuid',
|
|
97
|
+
:'duration_in_previous_seconds' => :'duration_in_previous_seconds',
|
|
98
|
+
:'event_dts' => :'event_dts',
|
|
99
|
+
:'event_uuid' => :'event_uuid',
|
|
100
|
+
:'merchant_id' => :'merchant_id',
|
|
101
|
+
:'new_routing_effect' => :'new_routing_effect',
|
|
102
|
+
:'new_status' => :'new_status',
|
|
103
|
+
:'parent_merchant_id' => :'parent_merchant_id',
|
|
104
|
+
:'previous_routing_effect' => :'previous_routing_effect',
|
|
105
|
+
:'previous_status' => :'previous_status',
|
|
106
|
+
:'trigger' => :'trigger'
|
|
107
|
+
}
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Returns all the JSON keys this model knows about
|
|
111
|
+
def self.acceptable_attributes
|
|
112
|
+
attribute_map.values
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Attribute type mapping.
|
|
116
|
+
def self.openapi_types
|
|
117
|
+
{
|
|
118
|
+
:'agent_name' => :'String',
|
|
119
|
+
:'agent_type' => :'String',
|
|
120
|
+
:'agent_user_id' => :'String',
|
|
121
|
+
:'channel' => :'String',
|
|
122
|
+
:'custom_status_name' => :'String',
|
|
123
|
+
:'custom_status_uuid' => :'String',
|
|
124
|
+
:'duration_in_previous_seconds' => :'Integer',
|
|
125
|
+
:'event_dts' => :'String',
|
|
126
|
+
:'event_uuid' => :'String',
|
|
127
|
+
:'merchant_id' => :'String',
|
|
128
|
+
:'new_routing_effect' => :'String',
|
|
129
|
+
:'new_status' => :'String',
|
|
130
|
+
:'parent_merchant_id' => :'String',
|
|
131
|
+
:'previous_routing_effect' => :'String',
|
|
132
|
+
:'previous_status' => :'String',
|
|
133
|
+
:'trigger' => :'String'
|
|
134
|
+
}
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# List of attributes with nullable: true
|
|
138
|
+
def self.openapi_nullable
|
|
139
|
+
Set.new([
|
|
140
|
+
])
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Initializes the object
|
|
144
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
145
|
+
def initialize(attributes = {})
|
|
146
|
+
if (!attributes.is_a?(Hash))
|
|
147
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationAgentStatusEvent` initialize method"
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
151
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
152
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
153
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationAgentStatusEvent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
154
|
+
end
|
|
155
|
+
h[k.to_sym] = v
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if attributes.key?(:'agent_name')
|
|
159
|
+
self.agent_name = attributes[:'agent_name']
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
if attributes.key?(:'agent_type')
|
|
163
|
+
self.agent_type = attributes[:'agent_type']
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
if attributes.key?(:'agent_user_id')
|
|
167
|
+
self.agent_user_id = attributes[:'agent_user_id']
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
if attributes.key?(:'channel')
|
|
171
|
+
self.channel = attributes[:'channel']
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
if attributes.key?(:'custom_status_name')
|
|
175
|
+
self.custom_status_name = attributes[:'custom_status_name']
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
if attributes.key?(:'custom_status_uuid')
|
|
179
|
+
self.custom_status_uuid = attributes[:'custom_status_uuid']
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
if attributes.key?(:'duration_in_previous_seconds')
|
|
183
|
+
self.duration_in_previous_seconds = attributes[:'duration_in_previous_seconds']
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
if attributes.key?(:'event_dts')
|
|
187
|
+
self.event_dts = attributes[:'event_dts']
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
if attributes.key?(:'event_uuid')
|
|
191
|
+
self.event_uuid = attributes[:'event_uuid']
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
if attributes.key?(:'merchant_id')
|
|
195
|
+
self.merchant_id = attributes[:'merchant_id']
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
if attributes.key?(:'new_routing_effect')
|
|
199
|
+
self.new_routing_effect = attributes[:'new_routing_effect']
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
if attributes.key?(:'new_status')
|
|
203
|
+
self.new_status = attributes[:'new_status']
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
if attributes.key?(:'parent_merchant_id')
|
|
207
|
+
self.parent_merchant_id = attributes[:'parent_merchant_id']
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
if attributes.key?(:'previous_routing_effect')
|
|
211
|
+
self.previous_routing_effect = attributes[:'previous_routing_effect']
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
if attributes.key?(:'previous_status')
|
|
215
|
+
self.previous_status = attributes[:'previous_status']
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
if attributes.key?(:'trigger')
|
|
219
|
+
self.trigger = attributes[:'trigger']
|
|
220
|
+
end
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
224
|
+
# @return Array for valid properties with the reasons
|
|
225
|
+
def list_invalid_properties
|
|
226
|
+
invalid_properties = Array.new
|
|
227
|
+
if !@custom_status_uuid.nil? && @custom_status_uuid.to_s.length > 50
|
|
228
|
+
invalid_properties.push('invalid value for "custom_status_uuid", the character length must be smaller than or equal to 50.')
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
if !@event_uuid.nil? && @event_uuid.to_s.length > 36
|
|
232
|
+
invalid_properties.push('invalid value for "event_uuid", the character length must be smaller than or equal to 36.')
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
if !@merchant_id.nil? && @merchant_id.to_s.length > 5
|
|
236
|
+
invalid_properties.push('invalid value for "merchant_id", the character length must be smaller than or equal to 5.')
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
if !@parent_merchant_id.nil? && @parent_merchant_id.to_s.length > 5
|
|
240
|
+
invalid_properties.push('invalid value for "parent_merchant_id", the character length must be smaller than or equal to 5.')
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
invalid_properties
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
# Check to see if the all the properties in the model are valid
|
|
247
|
+
# @return true if the model is valid
|
|
248
|
+
def valid?
|
|
249
|
+
agent_type_validator = EnumAttributeValidator.new('String', ["human", "ai"])
|
|
250
|
+
return false unless agent_type_validator.valid?(@agent_type)
|
|
251
|
+
channel_validator = EnumAttributeValidator.new('String', ["pbx", "chat"])
|
|
252
|
+
return false unless channel_validator.valid?(@channel)
|
|
253
|
+
return false if !@custom_status_uuid.nil? && @custom_status_uuid.to_s.length > 50
|
|
254
|
+
return false if !@event_uuid.nil? && @event_uuid.to_s.length > 36
|
|
255
|
+
return false if !@merchant_id.nil? && @merchant_id.to_s.length > 5
|
|
256
|
+
new_routing_effect_validator = EnumAttributeValidator.new('String', ["available", "busy", "unavailable"])
|
|
257
|
+
return false unless new_routing_effect_validator.valid?(@new_routing_effect)
|
|
258
|
+
return false if !@parent_merchant_id.nil? && @parent_merchant_id.to_s.length > 5
|
|
259
|
+
previous_routing_effect_validator = EnumAttributeValidator.new('String', ["available", "busy", "unavailable"])
|
|
260
|
+
return false unless previous_routing_effect_validator.valid?(@previous_routing_effect)
|
|
261
|
+
trigger_validator = EnumAttributeValidator.new('String', ["manual", "system", "auto_disconnect"])
|
|
262
|
+
return false unless trigger_validator.valid?(@trigger)
|
|
263
|
+
true
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
267
|
+
# @param [Object] agent_type Object to be assigned
|
|
268
|
+
def agent_type=(agent_type)
|
|
269
|
+
validator = EnumAttributeValidator.new('String', ["human", "ai"])
|
|
270
|
+
unless validator.valid?(agent_type)
|
|
271
|
+
fail ArgumentError, "invalid value for \"agent_type\", must be one of #{validator.allowable_values}."
|
|
272
|
+
end
|
|
273
|
+
@agent_type = agent_type
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
277
|
+
# @param [Object] channel Object to be assigned
|
|
278
|
+
def channel=(channel)
|
|
279
|
+
validator = EnumAttributeValidator.new('String', ["pbx", "chat"])
|
|
280
|
+
unless validator.valid?(channel)
|
|
281
|
+
fail ArgumentError, "invalid value for \"channel\", must be one of #{validator.allowable_values}."
|
|
282
|
+
end
|
|
283
|
+
@channel = channel
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
# Custom attribute writer method with validation
|
|
287
|
+
# @param [Object] custom_status_uuid Value to be assigned
|
|
288
|
+
def custom_status_uuid=(custom_status_uuid)
|
|
289
|
+
if !custom_status_uuid.nil? && custom_status_uuid.to_s.length > 50
|
|
290
|
+
fail ArgumentError, 'invalid value for "custom_status_uuid", the character length must be smaller than or equal to 50.'
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
@custom_status_uuid = custom_status_uuid
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
# Custom attribute writer method with validation
|
|
297
|
+
# @param [Object] event_uuid Value to be assigned
|
|
298
|
+
def event_uuid=(event_uuid)
|
|
299
|
+
if !event_uuid.nil? && event_uuid.to_s.length > 36
|
|
300
|
+
fail ArgumentError, 'invalid value for "event_uuid", the character length must be smaller than or equal to 36.'
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
@event_uuid = event_uuid
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
# Custom attribute writer method with validation
|
|
307
|
+
# @param [Object] merchant_id Value to be assigned
|
|
308
|
+
def merchant_id=(merchant_id)
|
|
309
|
+
if !merchant_id.nil? && merchant_id.to_s.length > 5
|
|
310
|
+
fail ArgumentError, 'invalid value for "merchant_id", the character length must be smaller than or equal to 5.'
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
@merchant_id = merchant_id
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
317
|
+
# @param [Object] new_routing_effect Object to be assigned
|
|
318
|
+
def new_routing_effect=(new_routing_effect)
|
|
319
|
+
validator = EnumAttributeValidator.new('String', ["available", "busy", "unavailable"])
|
|
320
|
+
unless validator.valid?(new_routing_effect)
|
|
321
|
+
fail ArgumentError, "invalid value for \"new_routing_effect\", must be one of #{validator.allowable_values}."
|
|
322
|
+
end
|
|
323
|
+
@new_routing_effect = new_routing_effect
|
|
324
|
+
end
|
|
325
|
+
|
|
326
|
+
# Custom attribute writer method with validation
|
|
327
|
+
# @param [Object] parent_merchant_id Value to be assigned
|
|
328
|
+
def parent_merchant_id=(parent_merchant_id)
|
|
329
|
+
if !parent_merchant_id.nil? && parent_merchant_id.to_s.length > 5
|
|
330
|
+
fail ArgumentError, 'invalid value for "parent_merchant_id", the character length must be smaller than or equal to 5.'
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
@parent_merchant_id = parent_merchant_id
|
|
334
|
+
end
|
|
335
|
+
|
|
336
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
337
|
+
# @param [Object] previous_routing_effect Object to be assigned
|
|
338
|
+
def previous_routing_effect=(previous_routing_effect)
|
|
339
|
+
validator = EnumAttributeValidator.new('String', ["available", "busy", "unavailable"])
|
|
340
|
+
unless validator.valid?(previous_routing_effect)
|
|
341
|
+
fail ArgumentError, "invalid value for \"previous_routing_effect\", must be one of #{validator.allowable_values}."
|
|
342
|
+
end
|
|
343
|
+
@previous_routing_effect = previous_routing_effect
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
347
|
+
# @param [Object] trigger Object to be assigned
|
|
348
|
+
def trigger=(trigger)
|
|
349
|
+
validator = EnumAttributeValidator.new('String', ["manual", "system", "auto_disconnect"])
|
|
350
|
+
unless validator.valid?(trigger)
|
|
351
|
+
fail ArgumentError, "invalid value for \"trigger\", must be one of #{validator.allowable_values}."
|
|
352
|
+
end
|
|
353
|
+
@trigger = trigger
|
|
354
|
+
end
|
|
355
|
+
|
|
356
|
+
# Checks equality by comparing each attribute.
|
|
357
|
+
# @param [Object] Object to be compared
|
|
358
|
+
def ==(o)
|
|
359
|
+
return true if self.equal?(o)
|
|
360
|
+
self.class == o.class &&
|
|
361
|
+
agent_name == o.agent_name &&
|
|
362
|
+
agent_type == o.agent_type &&
|
|
363
|
+
agent_user_id == o.agent_user_id &&
|
|
364
|
+
channel == o.channel &&
|
|
365
|
+
custom_status_name == o.custom_status_name &&
|
|
366
|
+
custom_status_uuid == o.custom_status_uuid &&
|
|
367
|
+
duration_in_previous_seconds == o.duration_in_previous_seconds &&
|
|
368
|
+
event_dts == o.event_dts &&
|
|
369
|
+
event_uuid == o.event_uuid &&
|
|
370
|
+
merchant_id == o.merchant_id &&
|
|
371
|
+
new_routing_effect == o.new_routing_effect &&
|
|
372
|
+
new_status == o.new_status &&
|
|
373
|
+
parent_merchant_id == o.parent_merchant_id &&
|
|
374
|
+
previous_routing_effect == o.previous_routing_effect &&
|
|
375
|
+
previous_status == o.previous_status &&
|
|
376
|
+
trigger == o.trigger
|
|
377
|
+
end
|
|
378
|
+
|
|
379
|
+
# @see the `==` method
|
|
380
|
+
# @param [Object] Object to be compared
|
|
381
|
+
def eql?(o)
|
|
382
|
+
self == o
|
|
383
|
+
end
|
|
384
|
+
|
|
385
|
+
# Calculates hash code according to all attributes.
|
|
386
|
+
# @return [Integer] Hash code
|
|
387
|
+
def hash
|
|
388
|
+
[agent_name, agent_type, agent_user_id, channel, custom_status_name, custom_status_uuid, duration_in_previous_seconds, event_dts, event_uuid, merchant_id, new_routing_effect, new_status, parent_merchant_id, previous_routing_effect, previous_status, trigger].hash
|
|
389
|
+
end
|
|
390
|
+
|
|
391
|
+
# Builds the object from hash
|
|
392
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
393
|
+
# @return [Object] Returns the model itself
|
|
394
|
+
def self.build_from_hash(attributes)
|
|
395
|
+
new.build_from_hash(attributes)
|
|
396
|
+
end
|
|
397
|
+
|
|
398
|
+
# Builds the object from hash
|
|
399
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
400
|
+
# @return [Object] Returns the model itself
|
|
401
|
+
def build_from_hash(attributes)
|
|
402
|
+
return nil unless attributes.is_a?(Hash)
|
|
403
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
404
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
405
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
406
|
+
self.send("#{key}=", nil)
|
|
407
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
408
|
+
# check to ensure the input is an array given that the attribute
|
|
409
|
+
# is documented as an array but the input is not
|
|
410
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
411
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
412
|
+
end
|
|
413
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
414
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
415
|
+
end
|
|
416
|
+
end
|
|
417
|
+
|
|
418
|
+
self
|
|
419
|
+
end
|
|
420
|
+
|
|
421
|
+
# Deserializes the data based on type
|
|
422
|
+
# @param string type Data type
|
|
423
|
+
# @param string value Value to be deserialized
|
|
424
|
+
# @return [Object] Deserialized data
|
|
425
|
+
def _deserialize(type, value)
|
|
426
|
+
case type.to_sym
|
|
427
|
+
when :Time
|
|
428
|
+
Time.parse(value)
|
|
429
|
+
when :Date
|
|
430
|
+
Date.parse(value)
|
|
431
|
+
when :String
|
|
432
|
+
value.to_s
|
|
433
|
+
when :Integer
|
|
434
|
+
value.to_i
|
|
435
|
+
when :Float
|
|
436
|
+
value.to_f
|
|
437
|
+
when :Boolean
|
|
438
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
439
|
+
true
|
|
440
|
+
else
|
|
441
|
+
false
|
|
442
|
+
end
|
|
443
|
+
when :Object
|
|
444
|
+
# generic object (usually a Hash), return directly
|
|
445
|
+
value
|
|
446
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
447
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
448
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
449
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
450
|
+
k_type = Regexp.last_match[:k_type]
|
|
451
|
+
v_type = Regexp.last_match[:v_type]
|
|
452
|
+
{}.tap do |hash|
|
|
453
|
+
value.each do |k, v|
|
|
454
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
455
|
+
end
|
|
456
|
+
end
|
|
457
|
+
else # model
|
|
458
|
+
# models (e.g. Pet) or oneOf
|
|
459
|
+
klass = UltracartClient.const_get(type)
|
|
460
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
461
|
+
end
|
|
462
|
+
end
|
|
463
|
+
|
|
464
|
+
# Returns the string representation of the object
|
|
465
|
+
# @return [String] String presentation of the object
|
|
466
|
+
def to_s
|
|
467
|
+
to_hash.to_s
|
|
468
|
+
end
|
|
469
|
+
|
|
470
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
471
|
+
# @return [Hash] Returns the object in the form of hash
|
|
472
|
+
def to_body
|
|
473
|
+
to_hash
|
|
474
|
+
end
|
|
475
|
+
|
|
476
|
+
# Returns the object in the form of hash
|
|
477
|
+
# @return [Hash] Returns the object in the form of hash
|
|
478
|
+
def to_hash
|
|
479
|
+
hash = {}
|
|
480
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
481
|
+
value = self.send(attr)
|
|
482
|
+
if value.nil?
|
|
483
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
484
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
485
|
+
end
|
|
486
|
+
|
|
487
|
+
hash[param] = _to_hash(value)
|
|
488
|
+
end
|
|
489
|
+
hash
|
|
490
|
+
end
|
|
491
|
+
|
|
492
|
+
# Outputs non-array value in the form of hash
|
|
493
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
494
|
+
# @param [Object] value Any valid value
|
|
495
|
+
# @return [Hash] Returns the value in the form of hash
|
|
496
|
+
def _to_hash(value)
|
|
497
|
+
if value.is_a?(Array)
|
|
498
|
+
value.compact.map { |v| _to_hash(v) }
|
|
499
|
+
elsif value.is_a?(Hash)
|
|
500
|
+
{}.tap do |hash|
|
|
501
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
502
|
+
end
|
|
503
|
+
elsif value.respond_to? :to_hash
|
|
504
|
+
value.to_hash
|
|
505
|
+
else
|
|
506
|
+
value
|
|
507
|
+
end
|
|
508
|
+
end
|
|
509
|
+
|
|
510
|
+
end
|
|
511
|
+
|
|
512
|
+
end
|