ultracart_api 4.0.42.rc → 4.0.45.rc

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,350 @@
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 ConversationWebchatQueueStatus
18
+ attr_accessor :agent_available_count
19
+
20
+ attr_accessor :agent_busy_count
21
+
22
+ attr_accessor :agent_count
23
+
24
+ attr_accessor :agent_unavailable_count
25
+
26
+ attr_accessor :agents
27
+
28
+ attr_accessor :customer_abandon_count
29
+
30
+ attr_accessor :customer_active_count
31
+
32
+ attr_accessor :customer_average_abandon_time_seconds
33
+
34
+ attr_accessor :customer_average_chat_time_seconds
35
+
36
+ attr_accessor :customer_average_hold_time_seconds
37
+
38
+ attr_accessor :customer_chat_count
39
+
40
+ attr_accessor :customer_waiting_count
41
+
42
+ # Date/time that the oldest person joined the queue
43
+ attr_accessor :customer_waiting_join_dts
44
+
45
+ attr_accessor :queue_entries
46
+
47
+ attr_accessor :queue_name
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ :'agent_available_count' => :'agent_available_count',
53
+ :'agent_busy_count' => :'agent_busy_count',
54
+ :'agent_count' => :'agent_count',
55
+ :'agent_unavailable_count' => :'agent_unavailable_count',
56
+ :'agents' => :'agents',
57
+ :'customer_abandon_count' => :'customer_abandon_count',
58
+ :'customer_active_count' => :'customer_active_count',
59
+ :'customer_average_abandon_time_seconds' => :'customer_average_abandon_time_seconds',
60
+ :'customer_average_chat_time_seconds' => :'customer_average_chat_time_seconds',
61
+ :'customer_average_hold_time_seconds' => :'customer_average_hold_time_seconds',
62
+ :'customer_chat_count' => :'customer_chat_count',
63
+ :'customer_waiting_count' => :'customer_waiting_count',
64
+ :'customer_waiting_join_dts' => :'customer_waiting_join_dts',
65
+ :'queue_entries' => :'queue_entries',
66
+ :'queue_name' => :'queue_name'
67
+ }
68
+ end
69
+
70
+ # Returns all the JSON keys this model knows about
71
+ def self.acceptable_attributes
72
+ attribute_map.values
73
+ end
74
+
75
+ # Attribute type mapping.
76
+ def self.openapi_types
77
+ {
78
+ :'agent_available_count' => :'Integer',
79
+ :'agent_busy_count' => :'Integer',
80
+ :'agent_count' => :'Integer',
81
+ :'agent_unavailable_count' => :'Integer',
82
+ :'agents' => :'Array<ConversationWebchatQueueStatusAgent>',
83
+ :'customer_abandon_count' => :'Integer',
84
+ :'customer_active_count' => :'Integer',
85
+ :'customer_average_abandon_time_seconds' => :'Integer',
86
+ :'customer_average_chat_time_seconds' => :'Integer',
87
+ :'customer_average_hold_time_seconds' => :'Integer',
88
+ :'customer_chat_count' => :'Integer',
89
+ :'customer_waiting_count' => :'Integer',
90
+ :'customer_waiting_join_dts' => :'String',
91
+ :'queue_entries' => :'Array<ConversationWebchatQueueStatusQueueEntry>',
92
+ :'queue_name' => :'String'
93
+ }
94
+ end
95
+
96
+ # List of attributes with nullable: true
97
+ def self.openapi_nullable
98
+ Set.new([
99
+ ])
100
+ end
101
+
102
+ # Initializes the object
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ def initialize(attributes = {})
105
+ if (!attributes.is_a?(Hash))
106
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationWebchatQueueStatus` initialize method"
107
+ end
108
+
109
+ # check to see if the attribute exists and convert string to symbol for hash key
110
+ attributes = attributes.each_with_object({}) { |(k, v), h|
111
+ if (!self.class.attribute_map.key?(k.to_sym))
112
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationWebchatQueueStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
113
+ end
114
+ h[k.to_sym] = v
115
+ }
116
+
117
+ if attributes.key?(:'agent_available_count')
118
+ self.agent_available_count = attributes[:'agent_available_count']
119
+ end
120
+
121
+ if attributes.key?(:'agent_busy_count')
122
+ self.agent_busy_count = attributes[:'agent_busy_count']
123
+ end
124
+
125
+ if attributes.key?(:'agent_count')
126
+ self.agent_count = attributes[:'agent_count']
127
+ end
128
+
129
+ if attributes.key?(:'agent_unavailable_count')
130
+ self.agent_unavailable_count = attributes[:'agent_unavailable_count']
131
+ end
132
+
133
+ if attributes.key?(:'agents')
134
+ if (value = attributes[:'agents']).is_a?(Array)
135
+ self.agents = value
136
+ end
137
+ end
138
+
139
+ if attributes.key?(:'customer_abandon_count')
140
+ self.customer_abandon_count = attributes[:'customer_abandon_count']
141
+ end
142
+
143
+ if attributes.key?(:'customer_active_count')
144
+ self.customer_active_count = attributes[:'customer_active_count']
145
+ end
146
+
147
+ if attributes.key?(:'customer_average_abandon_time_seconds')
148
+ self.customer_average_abandon_time_seconds = attributes[:'customer_average_abandon_time_seconds']
149
+ end
150
+
151
+ if attributes.key?(:'customer_average_chat_time_seconds')
152
+ self.customer_average_chat_time_seconds = attributes[:'customer_average_chat_time_seconds']
153
+ end
154
+
155
+ if attributes.key?(:'customer_average_hold_time_seconds')
156
+ self.customer_average_hold_time_seconds = attributes[:'customer_average_hold_time_seconds']
157
+ end
158
+
159
+ if attributes.key?(:'customer_chat_count')
160
+ self.customer_chat_count = attributes[:'customer_chat_count']
161
+ end
162
+
163
+ if attributes.key?(:'customer_waiting_count')
164
+ self.customer_waiting_count = attributes[:'customer_waiting_count']
165
+ end
166
+
167
+ if attributes.key?(:'customer_waiting_join_dts')
168
+ self.customer_waiting_join_dts = attributes[:'customer_waiting_join_dts']
169
+ end
170
+
171
+ if attributes.key?(:'queue_entries')
172
+ if (value = attributes[:'queue_entries']).is_a?(Array)
173
+ self.queue_entries = value
174
+ end
175
+ end
176
+
177
+ if attributes.key?(:'queue_name')
178
+ self.queue_name = attributes[:'queue_name']
179
+ end
180
+ end
181
+
182
+ # Show invalid properties with the reasons. Usually used together with valid?
183
+ # @return Array for valid properties with the reasons
184
+ def list_invalid_properties
185
+ invalid_properties = Array.new
186
+ invalid_properties
187
+ end
188
+
189
+ # Check to see if the all the properties in the model are valid
190
+ # @return true if the model is valid
191
+ def valid?
192
+ true
193
+ end
194
+
195
+ # Checks equality by comparing each attribute.
196
+ # @param [Object] Object to be compared
197
+ def ==(o)
198
+ return true if self.equal?(o)
199
+ self.class == o.class &&
200
+ agent_available_count == o.agent_available_count &&
201
+ agent_busy_count == o.agent_busy_count &&
202
+ agent_count == o.agent_count &&
203
+ agent_unavailable_count == o.agent_unavailable_count &&
204
+ agents == o.agents &&
205
+ customer_abandon_count == o.customer_abandon_count &&
206
+ customer_active_count == o.customer_active_count &&
207
+ customer_average_abandon_time_seconds == o.customer_average_abandon_time_seconds &&
208
+ customer_average_chat_time_seconds == o.customer_average_chat_time_seconds &&
209
+ customer_average_hold_time_seconds == o.customer_average_hold_time_seconds &&
210
+ customer_chat_count == o.customer_chat_count &&
211
+ customer_waiting_count == o.customer_waiting_count &&
212
+ customer_waiting_join_dts == o.customer_waiting_join_dts &&
213
+ queue_entries == o.queue_entries &&
214
+ queue_name == o.queue_name
215
+ end
216
+
217
+ # @see the `==` method
218
+ # @param [Object] Object to be compared
219
+ def eql?(o)
220
+ self == o
221
+ end
222
+
223
+ # Calculates hash code according to all attributes.
224
+ # @return [Integer] Hash code
225
+ def hash
226
+ [agent_available_count, agent_busy_count, agent_count, agent_unavailable_count, agents, customer_abandon_count, customer_active_count, customer_average_abandon_time_seconds, customer_average_chat_time_seconds, customer_average_hold_time_seconds, customer_chat_count, customer_waiting_count, customer_waiting_join_dts, queue_entries, queue_name].hash
227
+ end
228
+
229
+ # Builds the object from hash
230
+ # @param [Hash] attributes Model attributes in the form of hash
231
+ # @return [Object] Returns the model itself
232
+ def self.build_from_hash(attributes)
233
+ new.build_from_hash(attributes)
234
+ end
235
+
236
+ # Builds the object from hash
237
+ # @param [Hash] attributes Model attributes in the form of hash
238
+ # @return [Object] Returns the model itself
239
+ def build_from_hash(attributes)
240
+ return nil unless attributes.is_a?(Hash)
241
+ attributes = attributes.transform_keys(&:to_sym)
242
+ self.class.openapi_types.each_pair do |key, type|
243
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
244
+ self.send("#{key}=", nil)
245
+ elsif type =~ /\AArray<(.*)>/i
246
+ # check to ensure the input is an array given that the attribute
247
+ # is documented as an array but the input is not
248
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
249
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
250
+ end
251
+ elsif !attributes[self.class.attribute_map[key]].nil?
252
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
253
+ end
254
+ end
255
+
256
+ self
257
+ end
258
+
259
+ # Deserializes the data based on type
260
+ # @param string type Data type
261
+ # @param string value Value to be deserialized
262
+ # @return [Object] Deserialized data
263
+ def _deserialize(type, value)
264
+ case type.to_sym
265
+ when :Time
266
+ Time.parse(value)
267
+ when :Date
268
+ Date.parse(value)
269
+ when :String
270
+ value.to_s
271
+ when :Integer
272
+ value.to_i
273
+ when :Float
274
+ value.to_f
275
+ when :Boolean
276
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
277
+ true
278
+ else
279
+ false
280
+ end
281
+ when :Object
282
+ # generic object (usually a Hash), return directly
283
+ value
284
+ when /\AArray<(?<inner_type>.+)>\z/
285
+ inner_type = Regexp.last_match[:inner_type]
286
+ value.map { |v| _deserialize(inner_type, v) }
287
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
288
+ k_type = Regexp.last_match[:k_type]
289
+ v_type = Regexp.last_match[:v_type]
290
+ {}.tap do |hash|
291
+ value.each do |k, v|
292
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
293
+ end
294
+ end
295
+ else # model
296
+ # models (e.g. Pet) or oneOf
297
+ klass = UltracartClient.const_get(type)
298
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
299
+ end
300
+ end
301
+
302
+ # Returns the string representation of the object
303
+ # @return [String] String presentation of the object
304
+ def to_s
305
+ to_hash.to_s
306
+ end
307
+
308
+ # to_body is an alias to to_hash (backward compatibility)
309
+ # @return [Hash] Returns the object in the form of hash
310
+ def to_body
311
+ to_hash
312
+ end
313
+
314
+ # Returns the object in the form of hash
315
+ # @return [Hash] Returns the object in the form of hash
316
+ def to_hash
317
+ hash = {}
318
+ self.class.attribute_map.each_pair do |attr, param|
319
+ value = self.send(attr)
320
+ if value.nil?
321
+ is_nullable = self.class.openapi_nullable.include?(attr)
322
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
323
+ end
324
+
325
+ hash[param] = _to_hash(value)
326
+ end
327
+ hash
328
+ end
329
+
330
+ # Outputs non-array value in the form of hash
331
+ # For object, use to_hash. Otherwise, just return the value
332
+ # @param [Object] value Any valid value
333
+ # @return [Hash] Returns the value in the form of hash
334
+ def _to_hash(value)
335
+ if value.is_a?(Array)
336
+ value.compact.map { |v| _to_hash(v) }
337
+ elsif value.is_a?(Hash)
338
+ {}.tap do |hash|
339
+ value.each { |k, v| hash[k] = _to_hash(v) }
340
+ end
341
+ elsif value.respond_to? :to_hash
342
+ value.to_hash
343
+ else
344
+ value
345
+ end
346
+ end
347
+
348
+ end
349
+
350
+ end
@@ -0,0 +1,256 @@
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 ConversationWebchatQueueStatusAgent
18
+ attr_accessor :agent_status
19
+
20
+ attr_accessor :conversation_participant_arn
21
+
22
+ attr_accessor :conversation_participant_name
23
+
24
+ # Date/time that this agent took their last chat
25
+ attr_accessor :last_chat_dts
26
+
27
+ attr_accessor :next_round_robin
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'agent_status' => :'agent_status',
33
+ :'conversation_participant_arn' => :'conversation_participant_arn',
34
+ :'conversation_participant_name' => :'conversation_participant_name',
35
+ :'last_chat_dts' => :'last_chat_dts',
36
+ :'next_round_robin' => :'next_round_robin'
37
+ }
38
+ end
39
+
40
+ # Returns all the JSON keys this model knows about
41
+ def self.acceptable_attributes
42
+ attribute_map.values
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'agent_status' => :'String',
49
+ :'conversation_participant_arn' => :'String',
50
+ :'conversation_participant_name' => :'String',
51
+ :'last_chat_dts' => :'String',
52
+ :'next_round_robin' => :'Boolean'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationWebchatQueueStatusAgent` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!self.class.attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationWebchatQueueStatusAgent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'agent_status')
78
+ self.agent_status = attributes[:'agent_status']
79
+ end
80
+
81
+ if attributes.key?(:'conversation_participant_arn')
82
+ self.conversation_participant_arn = attributes[:'conversation_participant_arn']
83
+ end
84
+
85
+ if attributes.key?(:'conversation_participant_name')
86
+ self.conversation_participant_name = attributes[:'conversation_participant_name']
87
+ end
88
+
89
+ if attributes.key?(:'last_chat_dts')
90
+ self.last_chat_dts = attributes[:'last_chat_dts']
91
+ end
92
+
93
+ if attributes.key?(:'next_round_robin')
94
+ self.next_round_robin = attributes[:'next_round_robin']
95
+ end
96
+ end
97
+
98
+ # Show invalid properties with the reasons. Usually used together with valid?
99
+ # @return Array for valid properties with the reasons
100
+ def list_invalid_properties
101
+ invalid_properties = Array.new
102
+ invalid_properties
103
+ end
104
+
105
+ # Check to see if the all the properties in the model are valid
106
+ # @return true if the model is valid
107
+ def valid?
108
+ true
109
+ end
110
+
111
+ # Checks equality by comparing each attribute.
112
+ # @param [Object] Object to be compared
113
+ def ==(o)
114
+ return true if self.equal?(o)
115
+ self.class == o.class &&
116
+ agent_status == o.agent_status &&
117
+ conversation_participant_arn == o.conversation_participant_arn &&
118
+ conversation_participant_name == o.conversation_participant_name &&
119
+ last_chat_dts == o.last_chat_dts &&
120
+ next_round_robin == o.next_round_robin
121
+ end
122
+
123
+ # @see the `==` method
124
+ # @param [Object] Object to be compared
125
+ def eql?(o)
126
+ self == o
127
+ end
128
+
129
+ # Calculates hash code according to all attributes.
130
+ # @return [Integer] Hash code
131
+ def hash
132
+ [agent_status, conversation_participant_arn, conversation_participant_name, last_chat_dts, next_round_robin].hash
133
+ end
134
+
135
+ # Builds the object from hash
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ # @return [Object] Returns the model itself
138
+ def self.build_from_hash(attributes)
139
+ new.build_from_hash(attributes)
140
+ end
141
+
142
+ # Builds the object from hash
143
+ # @param [Hash] attributes Model attributes in the form of hash
144
+ # @return [Object] Returns the model itself
145
+ def build_from_hash(attributes)
146
+ return nil unless attributes.is_a?(Hash)
147
+ attributes = attributes.transform_keys(&:to_sym)
148
+ self.class.openapi_types.each_pair do |key, type|
149
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
150
+ self.send("#{key}=", nil)
151
+ elsif type =~ /\AArray<(.*)>/i
152
+ # check to ensure the input is an array given that the attribute
153
+ # is documented as an array but the input is not
154
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
155
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
156
+ end
157
+ elsif !attributes[self.class.attribute_map[key]].nil?
158
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
159
+ end
160
+ end
161
+
162
+ self
163
+ end
164
+
165
+ # Deserializes the data based on type
166
+ # @param string type Data type
167
+ # @param string value Value to be deserialized
168
+ # @return [Object] Deserialized data
169
+ def _deserialize(type, value)
170
+ case type.to_sym
171
+ when :Time
172
+ Time.parse(value)
173
+ when :Date
174
+ Date.parse(value)
175
+ when :String
176
+ value.to_s
177
+ when :Integer
178
+ value.to_i
179
+ when :Float
180
+ value.to_f
181
+ when :Boolean
182
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
183
+ true
184
+ else
185
+ false
186
+ end
187
+ when :Object
188
+ # generic object (usually a Hash), return directly
189
+ value
190
+ when /\AArray<(?<inner_type>.+)>\z/
191
+ inner_type = Regexp.last_match[:inner_type]
192
+ value.map { |v| _deserialize(inner_type, v) }
193
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
194
+ k_type = Regexp.last_match[:k_type]
195
+ v_type = Regexp.last_match[:v_type]
196
+ {}.tap do |hash|
197
+ value.each do |k, v|
198
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
199
+ end
200
+ end
201
+ else # model
202
+ # models (e.g. Pet) or oneOf
203
+ klass = UltracartClient.const_get(type)
204
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
205
+ end
206
+ end
207
+
208
+ # Returns the string representation of the object
209
+ # @return [String] String presentation of the object
210
+ def to_s
211
+ to_hash.to_s
212
+ end
213
+
214
+ # to_body is an alias to to_hash (backward compatibility)
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_body
217
+ to_hash
218
+ end
219
+
220
+ # Returns the object in the form of hash
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_hash
223
+ hash = {}
224
+ self.class.attribute_map.each_pair do |attr, param|
225
+ value = self.send(attr)
226
+ if value.nil?
227
+ is_nullable = self.class.openapi_nullable.include?(attr)
228
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
229
+ end
230
+
231
+ hash[param] = _to_hash(value)
232
+ end
233
+ hash
234
+ end
235
+
236
+ # Outputs non-array value in the form of hash
237
+ # For object, use to_hash. Otherwise, just return the value
238
+ # @param [Object] value Any valid value
239
+ # @return [Hash] Returns the value in the form of hash
240
+ def _to_hash(value)
241
+ if value.is_a?(Array)
242
+ value.compact.map { |v| _to_hash(v) }
243
+ elsif value.is_a?(Hash)
244
+ {}.tap do |hash|
245
+ value.each { |k, v| hash[k] = _to_hash(v) }
246
+ end
247
+ elsif value.respond_to? :to_hash
248
+ value.to_hash
249
+ else
250
+ value
251
+ end
252
+ end
253
+
254
+ end
255
+
256
+ end