ultracart_api 4.0.41.rc → 4.0.44.rc

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