ultracart_api 4.0.42.rc → 4.0.43.rc

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,258 @@
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 ConversationWebchatQueueStatusesResponse
18
+ attr_accessor :error
19
+
20
+ attr_accessor :metadata
21
+
22
+ attr_accessor :queue_statuses
23
+
24
+ # Indicates if API call was successful
25
+ attr_accessor :success
26
+
27
+ attr_accessor :warning
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'error' => :'error',
33
+ :'metadata' => :'metadata',
34
+ :'queue_statuses' => :'queue_statuses',
35
+ :'success' => :'success',
36
+ :'warning' => :'warning'
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
+ :'error' => :'Error',
49
+ :'metadata' => :'ResponseMetadata',
50
+ :'queue_statuses' => :'Array<ConversationWebchatQueueStatus>',
51
+ :'success' => :'Boolean',
52
+ :'warning' => :'Warning'
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::ConversationWebchatQueueStatusesResponse` 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::ConversationWebchatQueueStatusesResponse`. 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?(:'error')
78
+ self.error = attributes[:'error']
79
+ end
80
+
81
+ if attributes.key?(:'metadata')
82
+ self.metadata = attributes[:'metadata']
83
+ end
84
+
85
+ if attributes.key?(:'queue_statuses')
86
+ if (value = attributes[:'queue_statuses']).is_a?(Array)
87
+ self.queue_statuses = value
88
+ end
89
+ end
90
+
91
+ if attributes.key?(:'success')
92
+ self.success = attributes[:'success']
93
+ end
94
+
95
+ if attributes.key?(:'warning')
96
+ self.warning = attributes[:'warning']
97
+ end
98
+ end
99
+
100
+ # Show invalid properties with the reasons. Usually used together with valid?
101
+ # @return Array for valid properties with the reasons
102
+ def list_invalid_properties
103
+ invalid_properties = Array.new
104
+ invalid_properties
105
+ end
106
+
107
+ # Check to see if the all the properties in the model are valid
108
+ # @return true if the model is valid
109
+ def valid?
110
+ true
111
+ end
112
+
113
+ # Checks equality by comparing each attribute.
114
+ # @param [Object] Object to be compared
115
+ def ==(o)
116
+ return true if self.equal?(o)
117
+ self.class == o.class &&
118
+ error == o.error &&
119
+ metadata == o.metadata &&
120
+ queue_statuses == o.queue_statuses &&
121
+ success == o.success &&
122
+ warning == o.warning
123
+ end
124
+
125
+ # @see the `==` method
126
+ # @param [Object] Object to be compared
127
+ def eql?(o)
128
+ self == o
129
+ end
130
+
131
+ # Calculates hash code according to all attributes.
132
+ # @return [Integer] Hash code
133
+ def hash
134
+ [error, metadata, queue_statuses, success, warning].hash
135
+ end
136
+
137
+ # Builds the object from hash
138
+ # @param [Hash] attributes Model attributes in the form of hash
139
+ # @return [Object] Returns the model itself
140
+ def self.build_from_hash(attributes)
141
+ new.build_from_hash(attributes)
142
+ end
143
+
144
+ # Builds the object from hash
145
+ # @param [Hash] attributes Model attributes in the form of hash
146
+ # @return [Object] Returns the model itself
147
+ def build_from_hash(attributes)
148
+ return nil unless attributes.is_a?(Hash)
149
+ attributes = attributes.transform_keys(&:to_sym)
150
+ self.class.openapi_types.each_pair do |key, type|
151
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
152
+ self.send("#{key}=", nil)
153
+ elsif type =~ /\AArray<(.*)>/i
154
+ # check to ensure the input is an array given that the attribute
155
+ # is documented as an array but the input is not
156
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
157
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
158
+ end
159
+ elsif !attributes[self.class.attribute_map[key]].nil?
160
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
161
+ end
162
+ end
163
+
164
+ self
165
+ end
166
+
167
+ # Deserializes the data based on type
168
+ # @param string type Data type
169
+ # @param string value Value to be deserialized
170
+ # @return [Object] Deserialized data
171
+ def _deserialize(type, value)
172
+ case type.to_sym
173
+ when :Time
174
+ Time.parse(value)
175
+ when :Date
176
+ Date.parse(value)
177
+ when :String
178
+ value.to_s
179
+ when :Integer
180
+ value.to_i
181
+ when :Float
182
+ value.to_f
183
+ when :Boolean
184
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
185
+ true
186
+ else
187
+ false
188
+ end
189
+ when :Object
190
+ # generic object (usually a Hash), return directly
191
+ value
192
+ when /\AArray<(?<inner_type>.+)>\z/
193
+ inner_type = Regexp.last_match[:inner_type]
194
+ value.map { |v| _deserialize(inner_type, v) }
195
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
196
+ k_type = Regexp.last_match[:k_type]
197
+ v_type = Regexp.last_match[:v_type]
198
+ {}.tap do |hash|
199
+ value.each do |k, v|
200
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
201
+ end
202
+ end
203
+ else # model
204
+ # models (e.g. Pet) or oneOf
205
+ klass = UltracartClient.const_get(type)
206
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
207
+ end
208
+ end
209
+
210
+ # Returns the string representation of the object
211
+ # @return [String] String presentation of the object
212
+ def to_s
213
+ to_hash.to_s
214
+ end
215
+
216
+ # to_body is an alias to to_hash (backward compatibility)
217
+ # @return [Hash] Returns the object in the form of hash
218
+ def to_body
219
+ to_hash
220
+ end
221
+
222
+ # Returns the object in the form of hash
223
+ # @return [Hash] Returns the object in the form of hash
224
+ def to_hash
225
+ hash = {}
226
+ self.class.attribute_map.each_pair do |attr, param|
227
+ value = self.send(attr)
228
+ if value.nil?
229
+ is_nullable = self.class.openapi_nullable.include?(attr)
230
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
231
+ end
232
+
233
+ hash[param] = _to_hash(value)
234
+ end
235
+ hash
236
+ end
237
+
238
+ # Outputs non-array value in the form of hash
239
+ # For object, use to_hash. Otherwise, just return the value
240
+ # @param [Object] value Any valid value
241
+ # @return [Hash] Returns the value in the form of hash
242
+ def _to_hash(value)
243
+ if value.is_a?(Array)
244
+ value.compact.map { |v| _to_hash(v) }
245
+ elsif value.is_a?(Hash)
246
+ {}.tap do |hash|
247
+ value.each { |k, v| hash[k] = _to_hash(v) }
248
+ end
249
+ elsif value.respond_to? :to_hash
250
+ value.to_hash
251
+ else
252
+ value
253
+ end
254
+ end
255
+
256
+ end
257
+
258
+ end
@@ -26,6 +26,8 @@ module UltracartClient
26
26
 
27
27
  attr_accessor :event_queue_position
28
28
 
29
+ attr_accessor :event_queue_status_update
30
+
29
31
  # Type of event
30
32
  attr_accessor :event_type
31
33
 
@@ -66,6 +68,7 @@ module UltracartClient
66
68
  :'event_new_conversation' => :'event_new_conversation',
67
69
  :'event_new_message' => :'event_new_message',
68
70
  :'event_queue_position' => :'event_queue_position',
71
+ :'event_queue_status_update' => :'event_queue_status_update',
69
72
  :'event_type' => :'event_type',
70
73
  :'event_updated_message' => :'event_updated_message',
71
74
  :'message' => :'message',
@@ -86,6 +89,7 @@ module UltracartClient
86
89
  :'event_new_conversation' => :'ConversationSummary',
87
90
  :'event_new_message' => :'ConversationSummary',
88
91
  :'event_queue_position' => :'ConversationEventQueuePosition',
92
+ :'event_queue_status_update' => :'ConversationWebchatQueueStatus',
89
93
  :'event_type' => :'String',
90
94
  :'event_updated_message' => :'ConversationMessage',
91
95
  :'message' => :'ConversationMessage',
@@ -134,6 +138,10 @@ module UltracartClient
134
138
  self.event_queue_position = attributes[:'event_queue_position']
135
139
  end
136
140
 
141
+ if attributes.key?(:'event_queue_status_update')
142
+ self.event_queue_status_update = attributes[:'event_queue_status_update']
143
+ end
144
+
137
145
  if attributes.key?(:'event_type')
138
146
  self.event_type = attributes[:'event_type']
139
147
  end
@@ -161,7 +169,7 @@ module UltracartClient
161
169
  # Check to see if the all the properties in the model are valid
162
170
  # @return true if the model is valid
163
171
  def valid?
164
- event_type_validator = EnumAttributeValidator.new('String', ["queue position", "webchat start conversation", "conversation closed", "new conversation", "new message", "updated message"])
172
+ event_type_validator = EnumAttributeValidator.new('String', ["queue position", "webchat start conversation", "conversation closed", "new conversation", "new message", "updated message", "queue status update"])
165
173
  return false unless event_type_validator.valid?(@event_type)
166
174
  type_validator = EnumAttributeValidator.new('String', ["message", "event", "ping"])
167
175
  return false unless type_validator.valid?(@type)
@@ -171,7 +179,7 @@ module UltracartClient
171
179
  # Custom attribute writer method checking allowed values (enum).
172
180
  # @param [Object] event_type Object to be assigned
173
181
  def event_type=(event_type)
174
- validator = EnumAttributeValidator.new('String', ["queue position", "webchat start conversation", "conversation closed", "new conversation", "new message", "updated message"])
182
+ validator = EnumAttributeValidator.new('String', ["queue position", "webchat start conversation", "conversation closed", "new conversation", "new message", "updated message", "queue status update"])
175
183
  unless validator.valid?(event_type)
176
184
  fail ArgumentError, "invalid value for \"event_type\", must be one of #{validator.allowable_values}."
177
185
  end
@@ -198,6 +206,7 @@ module UltracartClient
198
206
  event_new_conversation == o.event_new_conversation &&
199
207
  event_new_message == o.event_new_message &&
200
208
  event_queue_position == o.event_queue_position &&
209
+ event_queue_status_update == o.event_queue_status_update &&
201
210
  event_type == o.event_type &&
202
211
  event_updated_message == o.event_updated_message &&
203
212
  message == o.message &&
@@ -213,7 +222,7 @@ module UltracartClient
213
222
  # Calculates hash code according to all attributes.
214
223
  # @return [Integer] Hash code
215
224
  def hash
216
- [conversation_uuid, event_conversation_closed, event_new_conversation, event_new_message, event_queue_position, event_type, event_updated_message, message, type].hash
225
+ [conversation_uuid, event_conversation_closed, event_new_conversation, event_new_message, event_queue_position, event_queue_status_update, event_type, event_updated_message, message, type].hash
217
226
  end
218
227
 
219
228
  # Builds the object from hash
@@ -11,5 +11,5 @@ OpenAPI Generator version: 6.0.1-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module UltracartClient
14
- VERSION = '4.0.42.rc'
14
+ VERSION = '4.0.43.rc'
15
15
  end
data/lib/ultracart_api.rb CHANGED
@@ -147,6 +147,11 @@ require 'ultracart_api/models/conversation_response'
147
147
  require 'ultracart_api/models/conversation_start_request'
148
148
  require 'ultracart_api/models/conversation_start_response'
149
149
  require 'ultracart_api/models/conversation_summary'
150
+ require 'ultracart_api/models/conversation_webchat_queue_status'
151
+ require 'ultracart_api/models/conversation_webchat_queue_status_agent'
152
+ require 'ultracart_api/models/conversation_webchat_queue_status_queue_entry'
153
+ require 'ultracart_api/models/conversation_webchat_queue_status_update_request'
154
+ require 'ultracart_api/models/conversation_webchat_queue_statuses_response'
150
155
  require 'ultracart_api/models/conversation_websocket_message'
151
156
  require 'ultracart_api/models/conversations_response'
152
157
  require 'ultracart_api/models/countries_response'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ultracart_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.42.rc
4
+ version: 4.0.43.rc
5
5
  platform: ruby
6
6
  authors:
7
7
  - UltraCart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-25 00:00:00.000000000 Z
11
+ date: 2022-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -197,6 +197,11 @@ files:
197
197
  - docs/ConversationStartRequest.md
198
198
  - docs/ConversationStartResponse.md
199
199
  - docs/ConversationSummary.md
200
+ - docs/ConversationWebchatQueueStatus.md
201
+ - docs/ConversationWebchatQueueStatusAgent.md
202
+ - docs/ConversationWebchatQueueStatusQueueEntry.md
203
+ - docs/ConversationWebchatQueueStatusUpdateRequest.md
204
+ - docs/ConversationWebchatQueueStatusesResponse.md
200
205
  - docs/ConversationWebsocketMessage.md
201
206
  - docs/ConversationsResponse.md
202
207
  - docs/CountriesResponse.md
@@ -883,6 +888,11 @@ files:
883
888
  - lib/ultracart_api/models/conversation_start_request.rb
884
889
  - lib/ultracart_api/models/conversation_start_response.rb
885
890
  - lib/ultracart_api/models/conversation_summary.rb
891
+ - lib/ultracart_api/models/conversation_webchat_queue_status.rb
892
+ - lib/ultracart_api/models/conversation_webchat_queue_status_agent.rb
893
+ - lib/ultracart_api/models/conversation_webchat_queue_status_queue_entry.rb
894
+ - lib/ultracart_api/models/conversation_webchat_queue_status_update_request.rb
895
+ - lib/ultracart_api/models/conversation_webchat_queue_statuses_response.rb
886
896
  - lib/ultracart_api/models/conversation_websocket_message.rb
887
897
  - lib/ultracart_api/models/conversations_response.rb
888
898
  - lib/ultracart_api/models/countries_response.rb