ultracart_api 4.0.39.rc → 4.0.42.rc

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,6 +15,8 @@ require 'time'
15
15
 
16
16
  module UltracartClient
17
17
  class Conversation
18
+ attr_accessor :closed
19
+
18
20
  attr_accessor :conversation_arn
19
21
 
20
22
  attr_accessor :conversation_uuid
@@ -28,6 +30,7 @@ module UltracartClient
28
30
  # Attribute mapping from ruby-style variable name to JSON key.
29
31
  def self.attribute_map
30
32
  {
33
+ :'closed' => :'closed',
31
34
  :'conversation_arn' => :'conversation_arn',
32
35
  :'conversation_uuid' => :'conversation_uuid',
33
36
  :'merchant_id' => :'merchant_id',
@@ -44,6 +47,7 @@ module UltracartClient
44
47
  # Attribute type mapping.
45
48
  def self.openapi_types
46
49
  {
50
+ :'closed' => :'Boolean',
47
51
  :'conversation_arn' => :'String',
48
52
  :'conversation_uuid' => :'String',
49
53
  :'merchant_id' => :'String',
@@ -73,6 +77,10 @@ module UltracartClient
73
77
  h[k.to_sym] = v
74
78
  }
75
79
 
80
+ if attributes.key?(:'closed')
81
+ self.closed = attributes[:'closed']
82
+ end
83
+
76
84
  if attributes.key?(:'conversation_arn')
77
85
  self.conversation_arn = attributes[:'conversation_arn']
78
86
  end
@@ -116,6 +124,7 @@ module UltracartClient
116
124
  def ==(o)
117
125
  return true if self.equal?(o)
118
126
  self.class == o.class &&
127
+ closed == o.closed &&
119
128
  conversation_arn == o.conversation_arn &&
120
129
  conversation_uuid == o.conversation_uuid &&
121
130
  merchant_id == o.merchant_id &&
@@ -132,7 +141,7 @@ module UltracartClient
132
141
  # Calculates hash code according to all attributes.
133
142
  # @return [Integer] Hash code
134
143
  def hash
135
- [conversation_arn, conversation_uuid, merchant_id, messages, participants].hash
144
+ [closed, conversation_arn, conversation_uuid, merchant_id, messages, participants].hash
136
145
  end
137
146
 
138
147
  # Builds the object from hash
@@ -0,0 +1,230 @@
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 ConversationEventQueuePosition
18
+ # True if agents are logged into the queue
19
+ attr_accessor :available
20
+
21
+ # Position in the queue. Value will be -1 if they cant be found in the queue.
22
+ attr_accessor :position
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'available' => :'available',
28
+ :'position' => :'position'
29
+ }
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'available' => :'Boolean',
41
+ :'position' => :'Integer'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationEventQueuePosition` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationEventQueuePosition`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'available')
67
+ self.available = attributes[:'available']
68
+ end
69
+
70
+ if attributes.key?(:'position')
71
+ self.position = attributes[:'position']
72
+ end
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ invalid_properties = Array.new
79
+ invalid_properties
80
+ end
81
+
82
+ # Check to see if the all the properties in the model are valid
83
+ # @return true if the model is valid
84
+ def valid?
85
+ true
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ available == o.available &&
94
+ position == o.position
95
+ end
96
+
97
+ # @see the `==` method
98
+ # @param [Object] Object to be compared
99
+ def eql?(o)
100
+ self == o
101
+ end
102
+
103
+ # Calculates hash code according to all attributes.
104
+ # @return [Integer] Hash code
105
+ def hash
106
+ [available, position].hash
107
+ end
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def self.build_from_hash(attributes)
113
+ new.build_from_hash(attributes)
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+ attributes = attributes.transform_keys(&:to_sym)
122
+ self.class.openapi_types.each_pair do |key, type|
123
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
124
+ self.send("#{key}=", nil)
125
+ elsif type =~ /\AArray<(.*)>/i
126
+ # check to ensure the input is an array given that the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
129
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
130
+ end
131
+ elsif !attributes[self.class.attribute_map[key]].nil?
132
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
133
+ end
134
+ end
135
+
136
+ self
137
+ end
138
+
139
+ # Deserializes the data based on type
140
+ # @param string type Data type
141
+ # @param string value Value to be deserialized
142
+ # @return [Object] Deserialized data
143
+ def _deserialize(type, value)
144
+ case type.to_sym
145
+ when :Time
146
+ Time.parse(value)
147
+ when :Date
148
+ Date.parse(value)
149
+ when :String
150
+ value.to_s
151
+ when :Integer
152
+ value.to_i
153
+ when :Float
154
+ value.to_f
155
+ when :Boolean
156
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
157
+ true
158
+ else
159
+ false
160
+ end
161
+ when :Object
162
+ # generic object (usually a Hash), return directly
163
+ value
164
+ when /\AArray<(?<inner_type>.+)>\z/
165
+ inner_type = Regexp.last_match[:inner_type]
166
+ value.map { |v| _deserialize(inner_type, v) }
167
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
168
+ k_type = Regexp.last_match[:k_type]
169
+ v_type = Regexp.last_match[:v_type]
170
+ {}.tap do |hash|
171
+ value.each do |k, v|
172
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
173
+ end
174
+ end
175
+ else # model
176
+ # models (e.g. Pet) or oneOf
177
+ klass = UltracartClient.const_get(type)
178
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
179
+ end
180
+ end
181
+
182
+ # Returns the string representation of the object
183
+ # @return [String] String presentation of the object
184
+ def to_s
185
+ to_hash.to_s
186
+ end
187
+
188
+ # to_body is an alias to to_hash (backward compatibility)
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_body
191
+ to_hash
192
+ end
193
+
194
+ # Returns the object in the form of hash
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_hash
197
+ hash = {}
198
+ self.class.attribute_map.each_pair do |attr, param|
199
+ value = self.send(attr)
200
+ if value.nil?
201
+ is_nullable = self.class.openapi_nullable.include?(attr)
202
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
203
+ end
204
+
205
+ hash[param] = _to_hash(value)
206
+ end
207
+ hash
208
+ end
209
+
210
+ # Outputs non-array value in the form of hash
211
+ # For object, use to_hash. Otherwise, just return the value
212
+ # @param [Object] value Any valid value
213
+ # @return [Hash] Returns the value in the form of hash
214
+ def _to_hash(value)
215
+ if value.is_a?(Array)
216
+ value.compact.map { |v| _to_hash(v) }
217
+ elsif value.is_a?(Hash)
218
+ {}.tap do |hash|
219
+ value.each { |k, v| hash[k] = _to_hash(v) }
220
+ end
221
+ elsif value.respond_to? :to_hash
222
+ value.to_hash
223
+ else
224
+ value
225
+ end
226
+ end
227
+
228
+ end
229
+
230
+ end
@@ -19,11 +19,14 @@ module UltracartClient
19
19
 
20
20
  attr_accessor :conversation_arn
21
21
 
22
+ attr_accessor :conversation_webchat_queue_uuid
23
+
22
24
  # Attribute mapping from ruby-style variable name to JSON key.
23
25
  def self.attribute_map
24
26
  {
25
27
  :'add_conversation_participant_arns' => :'add_conversation_participant_arns',
26
- :'conversation_arn' => :'conversation_arn'
28
+ :'conversation_arn' => :'conversation_arn',
29
+ :'conversation_webchat_queue_uuid' => :'conversation_webchat_queue_uuid'
27
30
  }
28
31
  end
29
32
 
@@ -36,7 +39,8 @@ module UltracartClient
36
39
  def self.openapi_types
37
40
  {
38
41
  :'add_conversation_participant_arns' => :'Array<String>',
39
- :'conversation_arn' => :'String'
42
+ :'conversation_arn' => :'String',
43
+ :'conversation_webchat_queue_uuid' => :'String'
40
44
  }
41
45
  end
42
46
 
@@ -70,6 +74,10 @@ module UltracartClient
70
74
  if attributes.key?(:'conversation_arn')
71
75
  self.conversation_arn = attributes[:'conversation_arn']
72
76
  end
77
+
78
+ if attributes.key?(:'conversation_webchat_queue_uuid')
79
+ self.conversation_webchat_queue_uuid = attributes[:'conversation_webchat_queue_uuid']
80
+ end
73
81
  end
74
82
 
75
83
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -91,7 +99,8 @@ module UltracartClient
91
99
  return true if self.equal?(o)
92
100
  self.class == o.class &&
93
101
  add_conversation_participant_arns == o.add_conversation_participant_arns &&
94
- conversation_arn == o.conversation_arn
102
+ conversation_arn == o.conversation_arn &&
103
+ conversation_webchat_queue_uuid == o.conversation_webchat_queue_uuid
95
104
  end
96
105
 
97
106
  # @see the `==` method
@@ -103,7 +112,7 @@ module UltracartClient
103
112
  # Calculates hash code according to all attributes.
104
113
  # @return [Integer] Hash code
105
114
  def hash
106
- [add_conversation_participant_arns, conversation_arn].hash
115
+ [add_conversation_participant_arns, conversation_arn, conversation_webchat_queue_uuid].hash
107
116
  end
108
117
 
109
118
  # 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