ultracart_api 3.10.25 → 3.10.26

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,223 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class ConversationWebchatQueueStatusesResponse
17
+ attr_accessor :error
18
+
19
+ attr_accessor :metadata
20
+
21
+ attr_accessor :queue_statuses
22
+
23
+ # Indicates if API call was successful
24
+ attr_accessor :success
25
+
26
+ attr_accessor :warning
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'error' => :'error',
32
+ :'metadata' => :'metadata',
33
+ :'queue_statuses' => :'queue_statuses',
34
+ :'success' => :'success',
35
+ :'warning' => :'warning'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.swagger_types
41
+ {
42
+ :'error' => :'Error',
43
+ :'metadata' => :'ResponseMetadata',
44
+ :'queue_statuses' => :'Array<ConversationWebchatQueueStatus>',
45
+ :'success' => :'BOOLEAN',
46
+ :'warning' => :'Warning'
47
+ }
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
57
+
58
+ if attributes.has_key?(:'error')
59
+ self.error = attributes[:'error']
60
+ end
61
+
62
+ if attributes.has_key?(:'metadata')
63
+ self.metadata = attributes[:'metadata']
64
+ end
65
+
66
+ if attributes.has_key?(:'queue_statuses')
67
+ if (value = attributes[:'queue_statuses']).is_a?(Array)
68
+ self.queue_statuses = value
69
+ end
70
+ end
71
+
72
+ if attributes.has_key?(:'success')
73
+ self.success = attributes[:'success']
74
+ end
75
+
76
+ if attributes.has_key?(:'warning')
77
+ self.warning = attributes[:'warning']
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ invalid_properties = Array.new
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ error == o.error &&
100
+ metadata == o.metadata &&
101
+ queue_statuses == o.queue_statuses &&
102
+ success == o.success &&
103
+ warning == o.warning
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Fixnum] Hash code
114
+ def hash
115
+ [error, metadata, queue_statuses, success, warning].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ self.class.swagger_types.each_pair do |key, type|
124
+ if type =~ /\AArray<(.*)>/i
125
+ # check to ensure the input is an array given that the attribute
126
+ # is documented as an array but the input is not
127
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
128
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
129
+ end
130
+ elsif !attributes[self.class.attribute_map[key]].nil?
131
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
132
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
133
+ end
134
+
135
+ self
136
+ end
137
+
138
+ # Deserializes the data based on type
139
+ # @param string type Data type
140
+ # @param string value Value to be deserialized
141
+ # @return [Object] Deserialized data
142
+ def _deserialize(type, value)
143
+ case type.to_sym
144
+ when :DateTime
145
+ DateTime.parse(value)
146
+ when :Date
147
+ Date.parse(value)
148
+ when :String
149
+ value.to_s
150
+ when :Integer
151
+ value.to_i
152
+ when :Float
153
+ value.to_f
154
+ when :BOOLEAN
155
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
156
+ true
157
+ else
158
+ false
159
+ end
160
+ when :Object
161
+ # generic object (usually a Hash), return directly
162
+ value
163
+ when /\AArray<(?<inner_type>.+)>\z/
164
+ inner_type = Regexp.last_match[:inner_type]
165
+ value.map { |v| _deserialize(inner_type, v) }
166
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
167
+ k_type = Regexp.last_match[:k_type]
168
+ v_type = Regexp.last_match[:v_type]
169
+ {}.tap do |hash|
170
+ value.each do |k, v|
171
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
172
+ end
173
+ end
174
+ else # model
175
+ temp_model = UltracartClient.const_get(type).new
176
+ temp_model.build_from_hash(value)
177
+ end
178
+ end
179
+
180
+ # Returns the string representation of the object
181
+ # @return [String] String presentation of the object
182
+ def to_s
183
+ to_hash.to_s
184
+ end
185
+
186
+ # to_body is an alias to to_hash (backward compatibility)
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_body
189
+ to_hash
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ next if value.nil?
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ # Outputs non-array value in the form of hash
205
+ # For object, use to_hash. Otherwise, just return the value
206
+ # @param [Object] value Any valid value
207
+ # @return [Hash] Returns the value in the form of hash
208
+ def _to_hash(value)
209
+ if value.is_a?(Array)
210
+ value.compact.map { |v| _to_hash(v) }
211
+ elsif value.is_a?(Hash)
212
+ {}.tap do |hash|
213
+ value.each { |k, v| hash[k] = _to_hash(v) }
214
+ end
215
+ elsif value.respond_to? :to_hash
216
+ value.to_hash
217
+ else
218
+ value
219
+ end
220
+ end
221
+
222
+ end
223
+ end
@@ -25,6 +25,8 @@ module UltracartClient
25
25
 
26
26
  attr_accessor :event_queue_position
27
27
 
28
+ attr_accessor :event_queue_status_update
29
+
28
30
  # Type of event
29
31
  attr_accessor :event_type
30
32
 
@@ -65,6 +67,7 @@ module UltracartClient
65
67
  :'event_new_conversation' => :'event_new_conversation',
66
68
  :'event_new_message' => :'event_new_message',
67
69
  :'event_queue_position' => :'event_queue_position',
70
+ :'event_queue_status_update' => :'event_queue_status_update',
68
71
  :'event_type' => :'event_type',
69
72
  :'event_updated_message' => :'event_updated_message',
70
73
  :'message' => :'message',
@@ -80,6 +83,7 @@ module UltracartClient
80
83
  :'event_new_conversation' => :'ConversationSummary',
81
84
  :'event_new_message' => :'ConversationSummary',
82
85
  :'event_queue_position' => :'ConversationEventQueuePosition',
86
+ :'event_queue_status_update' => :'ConversationWebchatQueueStatus',
83
87
  :'event_type' => :'String',
84
88
  :'event_updated_message' => :'ConversationMessage',
85
89
  :'message' => :'ConversationMessage',
@@ -115,6 +119,10 @@ module UltracartClient
115
119
  self.event_queue_position = attributes[:'event_queue_position']
116
120
  end
117
121
 
122
+ if attributes.has_key?(:'event_queue_status_update')
123
+ self.event_queue_status_update = attributes[:'event_queue_status_update']
124
+ end
125
+
118
126
  if attributes.has_key?(:'event_type')
119
127
  self.event_type = attributes[:'event_type']
120
128
  end
@@ -142,7 +150,7 @@ module UltracartClient
142
150
  # Check to see if the all the properties in the model are valid
143
151
  # @return true if the model is valid
144
152
  def valid?
145
- event_type_validator = EnumAttributeValidator.new('String', ['queue position', 'webchat start conversation', 'conversation closed', 'new conversation', 'new message', 'updated message'])
153
+ event_type_validator = EnumAttributeValidator.new('String', ['queue position', 'webchat start conversation', 'conversation closed', 'new conversation', 'new message', 'updated message', 'queue status update'])
146
154
  return false unless event_type_validator.valid?(@event_type)
147
155
  type_validator = EnumAttributeValidator.new('String', ['message', 'event', 'ping'])
148
156
  return false unless type_validator.valid?(@type)
@@ -152,7 +160,7 @@ module UltracartClient
152
160
  # Custom attribute writer method checking allowed values (enum).
153
161
  # @param [Object] event_type Object to be assigned
154
162
  def event_type=(event_type)
155
- validator = EnumAttributeValidator.new('String', ['queue position', 'webchat start conversation', 'conversation closed', 'new conversation', 'new message', 'updated message'])
163
+ validator = EnumAttributeValidator.new('String', ['queue position', 'webchat start conversation', 'conversation closed', 'new conversation', 'new message', 'updated message', 'queue status update'])
156
164
  unless validator.valid?(event_type)
157
165
  fail ArgumentError, 'invalid value for "event_type", must be one of #{validator.allowable_values}.'
158
166
  end
@@ -179,6 +187,7 @@ module UltracartClient
179
187
  event_new_conversation == o.event_new_conversation &&
180
188
  event_new_message == o.event_new_message &&
181
189
  event_queue_position == o.event_queue_position &&
190
+ event_queue_status_update == o.event_queue_status_update &&
182
191
  event_type == o.event_type &&
183
192
  event_updated_message == o.event_updated_message &&
184
193
  message == o.message &&
@@ -194,7 +203,7 @@ module UltracartClient
194
203
  # Calculates hash code according to all attributes.
195
204
  # @return [Fixnum] Hash code
196
205
  def hash
197
- [conversation_uuid, event_conversation_closed, event_new_conversation, event_new_message, event_queue_position, event_type, event_updated_message, message, type].hash
206
+ [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
198
207
  end
199
208
 
200
209
  # Builds the object from hash
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.4.15-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module UltracartClient
14
- VERSION = '3.10.25'
14
+ VERSION = '3.10.26'
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: 3.10.25
4
+ version: 3.10.26
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
@@ -357,6 +357,11 @@ files:
357
357
  - docs/ConversationStartRequest.md
358
358
  - docs/ConversationStartResponse.md
359
359
  - docs/ConversationSummary.md
360
+ - docs/ConversationWebchatQueueStatus.md
361
+ - docs/ConversationWebchatQueueStatusAgent.md
362
+ - docs/ConversationWebchatQueueStatusQueueEntry.md
363
+ - docs/ConversationWebchatQueueStatusUpdateRequest.md
364
+ - docs/ConversationWebchatQueueStatusesResponse.md
360
365
  - docs/ConversationWebsocketMessage.md
361
366
  - docs/ConversationsResponse.md
362
367
  - docs/CountriesResponse.md
@@ -1044,6 +1049,11 @@ files:
1044
1049
  - lib/ultracart_api/models/conversation_start_request.rb
1045
1050
  - lib/ultracart_api/models/conversation_start_response.rb
1046
1051
  - lib/ultracart_api/models/conversation_summary.rb
1052
+ - lib/ultracart_api/models/conversation_webchat_queue_status.rb
1053
+ - lib/ultracart_api/models/conversation_webchat_queue_status_agent.rb
1054
+ - lib/ultracart_api/models/conversation_webchat_queue_status_queue_entry.rb
1055
+ - lib/ultracart_api/models/conversation_webchat_queue_status_update_request.rb
1056
+ - lib/ultracart_api/models/conversation_webchat_queue_statuses_response.rb
1047
1057
  - lib/ultracart_api/models/conversation_websocket_message.rb
1048
1058
  - lib/ultracart_api/models/conversations_response.rb
1049
1059
  - lib/ultracart_api/models/countries_response.rb