ultracart_api 4.0.53.rc → 4.0.56.rc

Sign up to get free protection for your applications and to get access to all the features.
@@ -30,6 +30,8 @@ module UltracartClient
30
30
  # Left conversation date/time
31
31
  attr_accessor :left_dts
32
32
 
33
+ attr_accessor :profile_image_url
34
+
33
35
  attr_accessor :status
34
36
 
35
37
  attr_accessor :unread_messages
@@ -43,6 +45,7 @@ module UltracartClient
43
45
  :'joined_dts' => :'joined_dts',
44
46
  :'last_message_dts' => :'last_message_dts',
45
47
  :'left_dts' => :'left_dts',
48
+ :'profile_image_url' => :'profile_image_url',
46
49
  :'status' => :'status',
47
50
  :'unread_messages' => :'unread_messages'
48
51
  }
@@ -62,6 +65,7 @@ module UltracartClient
62
65
  :'joined_dts' => :'String',
63
66
  :'last_message_dts' => :'String',
64
67
  :'left_dts' => :'String',
68
+ :'profile_image_url' => :'String',
65
69
  :'status' => :'String',
66
70
  :'unread_messages' => :'Integer'
67
71
  }
@@ -112,6 +116,10 @@ module UltracartClient
112
116
  self.left_dts = attributes[:'left_dts']
113
117
  end
114
118
 
119
+ if attributes.key?(:'profile_image_url')
120
+ self.profile_image_url = attributes[:'profile_image_url']
121
+ end
122
+
115
123
  if attributes.key?(:'status')
116
124
  self.status = attributes[:'status']
117
125
  end
@@ -145,6 +153,7 @@ module UltracartClient
145
153
  joined_dts == o.joined_dts &&
146
154
  last_message_dts == o.last_message_dts &&
147
155
  left_dts == o.left_dts &&
156
+ profile_image_url == o.profile_image_url &&
148
157
  status == o.status &&
149
158
  unread_messages == o.unread_messages
150
159
  end
@@ -158,7 +167,7 @@ module UltracartClient
158
167
  # Calculates hash code according to all attributes.
159
168
  # @return [Integer] Hash code
160
169
  def hash
161
- [conversation_participant_arn, conversation_participant_name, conversation_participant_uuid, joined_dts, last_message_dts, left_dts, status, unread_messages].hash
170
+ [conversation_participant_arn, conversation_participant_name, conversation_participant_uuid, joined_dts, last_message_dts, left_dts, profile_image_url, status, unread_messages].hash
162
171
  end
163
172
 
164
173
  # Builds the object from hash
@@ -15,6 +15,7 @@ require 'time'
15
15
 
16
16
  module UltracartClient
17
17
  class ConversationWebchatQueueStatusAgent
18
+ # Status of the agent
18
19
  attr_accessor :agent_status
19
20
 
20
21
  attr_accessor :conversation_participant_arn
@@ -26,6 +27,31 @@ module UltracartClient
26
27
 
27
28
  attr_accessor :next_round_robin
28
29
 
30
+ # Profile image URL
31
+ attr_accessor :profile_image_url
32
+
33
+ class EnumAttributeValidator
34
+ attr_reader :datatype
35
+ attr_reader :allowable_values
36
+
37
+ def initialize(datatype, allowable_values)
38
+ @allowable_values = allowable_values.map do |value|
39
+ case datatype.to_s
40
+ when /Integer/i
41
+ value.to_i
42
+ when /Float/i
43
+ value.to_f
44
+ else
45
+ value
46
+ end
47
+ end
48
+ end
49
+
50
+ def valid?(value)
51
+ !value || allowable_values.include?(value)
52
+ end
53
+ end
54
+
29
55
  # Attribute mapping from ruby-style variable name to JSON key.
30
56
  def self.attribute_map
31
57
  {
@@ -33,7 +59,8 @@ module UltracartClient
33
59
  :'conversation_participant_arn' => :'conversation_participant_arn',
34
60
  :'conversation_participant_name' => :'conversation_participant_name',
35
61
  :'last_chat_dts' => :'last_chat_dts',
36
- :'next_round_robin' => :'next_round_robin'
62
+ :'next_round_robin' => :'next_round_robin',
63
+ :'profile_image_url' => :'profile_image_url'
37
64
  }
38
65
  end
39
66
 
@@ -49,7 +76,8 @@ module UltracartClient
49
76
  :'conversation_participant_arn' => :'String',
50
77
  :'conversation_participant_name' => :'String',
51
78
  :'last_chat_dts' => :'String',
52
- :'next_round_robin' => :'Boolean'
79
+ :'next_round_robin' => :'Boolean',
80
+ :'profile_image_url' => :'String'
53
81
  }
54
82
  end
55
83
 
@@ -93,6 +121,10 @@ module UltracartClient
93
121
  if attributes.key?(:'next_round_robin')
94
122
  self.next_round_robin = attributes[:'next_round_robin']
95
123
  end
124
+
125
+ if attributes.key?(:'profile_image_url')
126
+ self.profile_image_url = attributes[:'profile_image_url']
127
+ end
96
128
  end
97
129
 
98
130
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -105,9 +137,21 @@ module UltracartClient
105
137
  # Check to see if the all the properties in the model are valid
106
138
  # @return true if the model is valid
107
139
  def valid?
140
+ agent_status_validator = EnumAttributeValidator.new('String', ["available", "busy", "unavailable"])
141
+ return false unless agent_status_validator.valid?(@agent_status)
108
142
  true
109
143
  end
110
144
 
145
+ # Custom attribute writer method checking allowed values (enum).
146
+ # @param [Object] agent_status Object to be assigned
147
+ def agent_status=(agent_status)
148
+ validator = EnumAttributeValidator.new('String', ["available", "busy", "unavailable"])
149
+ unless validator.valid?(agent_status)
150
+ fail ArgumentError, "invalid value for \"agent_status\", must be one of #{validator.allowable_values}."
151
+ end
152
+ @agent_status = agent_status
153
+ end
154
+
111
155
  # Checks equality by comparing each attribute.
112
156
  # @param [Object] Object to be compared
113
157
  def ==(o)
@@ -117,7 +161,8 @@ module UltracartClient
117
161
  conversation_participant_arn == o.conversation_participant_arn &&
118
162
  conversation_participant_name == o.conversation_participant_name &&
119
163
  last_chat_dts == o.last_chat_dts &&
120
- next_round_robin == o.next_round_robin
164
+ next_round_robin == o.next_round_robin &&
165
+ profile_image_url == o.profile_image_url
121
166
  end
122
167
 
123
168
  # @see the `==` method
@@ -129,7 +174,7 @@ module UltracartClient
129
174
  # Calculates hash code according to all attributes.
130
175
  # @return [Integer] Hash code
131
176
  def hash
132
- [agent_status, conversation_participant_arn, conversation_participant_name, last_chat_dts, next_round_robin].hash
177
+ [agent_status, conversation_participant_arn, conversation_participant_name, last_chat_dts, next_round_robin, profile_image_url].hash
133
178
  end
134
179
 
135
180
  # Builds the object from hash
@@ -0,0 +1,257 @@
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 CustomerMagicLinkResponse
18
+ attr_accessor :error
19
+
20
+ attr_accessor :metadata
21
+
22
+ # Indicates if API call was successful
23
+ attr_accessor :success
24
+
25
+ # URL
26
+ attr_accessor :url
27
+
28
+ attr_accessor :warning
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'error' => :'error',
34
+ :'metadata' => :'metadata',
35
+ :'success' => :'success',
36
+ :'url' => :'url',
37
+ :'warning' => :'warning'
38
+ }
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'error' => :'Error',
50
+ :'metadata' => :'ResponseMetadata',
51
+ :'success' => :'Boolean',
52
+ :'url' => :'String',
53
+ :'warning' => :'Warning'
54
+ }
55
+ end
56
+
57
+ # List of attributes with nullable: true
58
+ def self.openapi_nullable
59
+ Set.new([
60
+ ])
61
+ end
62
+
63
+ # Initializes the object
64
+ # @param [Hash] attributes Model attributes in the form of hash
65
+ def initialize(attributes = {})
66
+ if (!attributes.is_a?(Hash))
67
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::CustomerMagicLinkResponse` initialize method"
68
+ end
69
+
70
+ # check to see if the attribute exists and convert string to symbol for hash key
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!self.class.attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::CustomerMagicLinkResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'error')
79
+ self.error = attributes[:'error']
80
+ end
81
+
82
+ if attributes.key?(:'metadata')
83
+ self.metadata = attributes[:'metadata']
84
+ end
85
+
86
+ if attributes.key?(:'success')
87
+ self.success = attributes[:'success']
88
+ end
89
+
90
+ if attributes.key?(:'url')
91
+ self.url = attributes[:'url']
92
+ end
93
+
94
+ if attributes.key?(:'warning')
95
+ self.warning = attributes[:'warning']
96
+ end
97
+ end
98
+
99
+ # Show invalid properties with the reasons. Usually used together with valid?
100
+ # @return Array for valid properties with the reasons
101
+ def list_invalid_properties
102
+ invalid_properties = Array.new
103
+ invalid_properties
104
+ end
105
+
106
+ # Check to see if the all the properties in the model are valid
107
+ # @return true if the model is valid
108
+ def valid?
109
+ true
110
+ end
111
+
112
+ # Checks equality by comparing each attribute.
113
+ # @param [Object] Object to be compared
114
+ def ==(o)
115
+ return true if self.equal?(o)
116
+ self.class == o.class &&
117
+ error == o.error &&
118
+ metadata == o.metadata &&
119
+ success == o.success &&
120
+ url == o.url &&
121
+ warning == o.warning
122
+ end
123
+
124
+ # @see the `==` method
125
+ # @param [Object] Object to be compared
126
+ def eql?(o)
127
+ self == o
128
+ end
129
+
130
+ # Calculates hash code according to all attributes.
131
+ # @return [Integer] Hash code
132
+ def hash
133
+ [error, metadata, success, url, warning].hash
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def self.build_from_hash(attributes)
140
+ new.build_from_hash(attributes)
141
+ end
142
+
143
+ # Builds the object from hash
144
+ # @param [Hash] attributes Model attributes in the form of hash
145
+ # @return [Object] Returns the model itself
146
+ def build_from_hash(attributes)
147
+ return nil unless attributes.is_a?(Hash)
148
+ attributes = attributes.transform_keys(&:to_sym)
149
+ self.class.openapi_types.each_pair do |key, type|
150
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
151
+ self.send("#{key}=", nil)
152
+ elsif type =~ /\AArray<(.*)>/i
153
+ # check to ensure the input is an array given that the attribute
154
+ # is documented as an array but the input is not
155
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
156
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
157
+ end
158
+ elsif !attributes[self.class.attribute_map[key]].nil?
159
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
160
+ end
161
+ end
162
+
163
+ self
164
+ end
165
+
166
+ # Deserializes the data based on type
167
+ # @param string type Data type
168
+ # @param string value Value to be deserialized
169
+ # @return [Object] Deserialized data
170
+ def _deserialize(type, value)
171
+ case type.to_sym
172
+ when :Time
173
+ Time.parse(value)
174
+ when :Date
175
+ Date.parse(value)
176
+ when :String
177
+ value.to_s
178
+ when :Integer
179
+ value.to_i
180
+ when :Float
181
+ value.to_f
182
+ when :Boolean
183
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
184
+ true
185
+ else
186
+ false
187
+ end
188
+ when :Object
189
+ # generic object (usually a Hash), return directly
190
+ value
191
+ when /\AArray<(?<inner_type>.+)>\z/
192
+ inner_type = Regexp.last_match[:inner_type]
193
+ value.map { |v| _deserialize(inner_type, v) }
194
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
195
+ k_type = Regexp.last_match[:k_type]
196
+ v_type = Regexp.last_match[:v_type]
197
+ {}.tap do |hash|
198
+ value.each do |k, v|
199
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
200
+ end
201
+ end
202
+ else # model
203
+ # models (e.g. Pet) or oneOf
204
+ klass = UltracartClient.const_get(type)
205
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
206
+ end
207
+ end
208
+
209
+ # Returns the string representation of the object
210
+ # @return [String] String presentation of the object
211
+ def to_s
212
+ to_hash.to_s
213
+ end
214
+
215
+ # to_body is an alias to to_hash (backward compatibility)
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_body
218
+ to_hash
219
+ end
220
+
221
+ # Returns the object in the form of hash
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_hash
224
+ hash = {}
225
+ self.class.attribute_map.each_pair do |attr, param|
226
+ value = self.send(attr)
227
+ if value.nil?
228
+ is_nullable = self.class.openapi_nullable.include?(attr)
229
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
230
+ end
231
+
232
+ hash[param] = _to_hash(value)
233
+ end
234
+ hash
235
+ end
236
+
237
+ # Outputs non-array value in the form of hash
238
+ # For object, use to_hash. Otherwise, just return the value
239
+ # @param [Object] value Any valid value
240
+ # @return [Hash] Returns the value in the form of hash
241
+ def _to_hash(value)
242
+ if value.is_a?(Array)
243
+ value.compact.map { |v| _to_hash(v) }
244
+ elsif value.is_a?(Hash)
245
+ {}.tap do |hash|
246
+ value.each { |k, v| hash[k] = _to_hash(v) }
247
+ end
248
+ elsif value.respond_to? :to_hash
249
+ value.to_hash
250
+ else
251
+ value
252
+ end
253
+ end
254
+
255
+ end
256
+
257
+ end
@@ -24,6 +24,12 @@ module UltracartClient
24
24
  # CC emails. Multiple allowed, but total length of all emails can not exceed 100 characters.
25
25
  attr_accessor :cc_emails
26
26
 
27
+ # Cell phone
28
+ attr_accessor :cell_phone
29
+
30
+ # Cell phone (E164 format)
31
+ attr_accessor :cell_phone_e164
32
+
27
33
  # City
28
34
  attr_accessor :city
29
35
 
@@ -69,6 +75,8 @@ module UltracartClient
69
75
  :'address1' => :'address1',
70
76
  :'address2' => :'address2',
71
77
  :'cc_emails' => :'cc_emails',
78
+ :'cell_phone' => :'cell_phone',
79
+ :'cell_phone_e164' => :'cell_phone_e164',
72
80
  :'city' => :'city',
73
81
  :'company' => :'company',
74
82
  :'country_code' => :'country_code',
@@ -96,6 +104,8 @@ module UltracartClient
96
104
  :'address1' => :'String',
97
105
  :'address2' => :'String',
98
106
  :'cc_emails' => :'Array<String>',
107
+ :'cell_phone' => :'String',
108
+ :'cell_phone_e164' => :'String',
99
109
  :'city' => :'String',
100
110
  :'company' => :'String',
101
111
  :'country_code' => :'String',
@@ -147,6 +157,14 @@ module UltracartClient
147
157
  end
148
158
  end
149
159
 
160
+ if attributes.key?(:'cell_phone')
161
+ self.cell_phone = attributes[:'cell_phone']
162
+ end
163
+
164
+ if attributes.key?(:'cell_phone_e164')
165
+ self.cell_phone_e164 = attributes[:'cell_phone_e164']
166
+ end
167
+
150
168
  if attributes.key?(:'city')
151
169
  self.city = attributes[:'city']
152
170
  end
@@ -212,6 +230,14 @@ module UltracartClient
212
230
  invalid_properties.push('invalid value for "address2", the character length must be smaller than or equal to 50.')
213
231
  end
214
232
 
233
+ if !@cell_phone.nil? && @cell_phone.to_s.length > 25
234
+ invalid_properties.push('invalid value for "cell_phone", the character length must be smaller than or equal to 25.')
235
+ end
236
+
237
+ if !@cell_phone_e164.nil? && @cell_phone_e164.to_s.length > 25
238
+ invalid_properties.push('invalid value for "cell_phone_e164", the character length must be smaller than or equal to 25.')
239
+ end
240
+
215
241
  if !@city.nil? && @city.to_s.length > 32
216
242
  invalid_properties.push('invalid value for "city", the character length must be smaller than or equal to 32.')
217
243
  end
@@ -272,6 +298,8 @@ module UltracartClient
272
298
  def valid?
273
299
  return false if !@address1.nil? && @address1.to_s.length > 50
274
300
  return false if !@address2.nil? && @address2.to_s.length > 50
301
+ return false if !@cell_phone.nil? && @cell_phone.to_s.length > 25
302
+ return false if !@cell_phone_e164.nil? && @cell_phone_e164.to_s.length > 25
275
303
  return false if !@city.nil? && @city.to_s.length > 32
276
304
  return false if !@company.nil? && @company.to_s.length > 50
277
305
  return false if !@country_code.nil? && @country_code.to_s.length > 2
@@ -308,6 +336,26 @@ module UltracartClient
308
336
  @address2 = address2
309
337
  end
310
338
 
339
+ # Custom attribute writer method with validation
340
+ # @param [Object] cell_phone Value to be assigned
341
+ def cell_phone=(cell_phone)
342
+ if !cell_phone.nil? && cell_phone.to_s.length > 25
343
+ fail ArgumentError, 'invalid value for "cell_phone", the character length must be smaller than or equal to 25.'
344
+ end
345
+
346
+ @cell_phone = cell_phone
347
+ end
348
+
349
+ # Custom attribute writer method with validation
350
+ # @param [Object] cell_phone_e164 Value to be assigned
351
+ def cell_phone_e164=(cell_phone_e164)
352
+ if !cell_phone_e164.nil? && cell_phone_e164.to_s.length > 25
353
+ fail ArgumentError, 'invalid value for "cell_phone_e164", the character length must be smaller than or equal to 25.'
354
+ end
355
+
356
+ @cell_phone_e164 = cell_phone_e164
357
+ end
358
+
311
359
  # Custom attribute writer method with validation
312
360
  # @param [Object] city Value to be assigned
313
361
  def city=(city)
@@ -446,6 +494,8 @@ module UltracartClient
446
494
  address1 == o.address1 &&
447
495
  address2 == o.address2 &&
448
496
  cc_emails == o.cc_emails &&
497
+ cell_phone == o.cell_phone &&
498
+ cell_phone_e164 == o.cell_phone_e164 &&
449
499
  city == o.city &&
450
500
  company == o.company &&
451
501
  country_code == o.country_code &&
@@ -470,7 +520,7 @@ module UltracartClient
470
520
  # Calculates hash code according to all attributes.
471
521
  # @return [Integer] Hash code
472
522
  def hash
473
- [address1, address2, cc_emails, city, company, country_code, day_phone, day_phone_e164, email, evening_phone, evening_phone_e164, first_name, last_name, postal_code, state_region, title].hash
523
+ [address1, address2, cc_emails, cell_phone, cell_phone_e164, city, company, country_code, day_phone, day_phone_e164, email, evening_phone, evening_phone_e164, first_name, last_name, postal_code, state_region, title].hash
474
524
  end
475
525
 
476
526
  # Builds the object from hash
@@ -18,6 +18,9 @@ module UltracartClient
18
18
  # Advertising source
19
19
  attr_accessor :advertising_source
20
20
 
21
+ # True if the customer has opted into SMS marketing
22
+ attr_accessor :cell_phone_opt_in
23
+
21
24
  # True if the customer has opted into mailing list subscription
22
25
  attr_accessor :mailing_list
23
26
 
@@ -28,6 +31,7 @@ module UltracartClient
28
31
  def self.attribute_map
29
32
  {
30
33
  :'advertising_source' => :'advertising_source',
34
+ :'cell_phone_opt_in' => :'cell_phone_opt_in',
31
35
  :'mailing_list' => :'mailing_list',
32
36
  :'referral_code' => :'referral_code'
33
37
  }
@@ -42,6 +46,7 @@ module UltracartClient
42
46
  def self.openapi_types
43
47
  {
44
48
  :'advertising_source' => :'String',
49
+ :'cell_phone_opt_in' => :'Boolean',
45
50
  :'mailing_list' => :'Boolean',
46
51
  :'referral_code' => :'String'
47
52
  }
@@ -72,6 +77,10 @@ module UltracartClient
72
77
  self.advertising_source = attributes[:'advertising_source']
73
78
  end
74
79
 
80
+ if attributes.key?(:'cell_phone_opt_in')
81
+ self.cell_phone_opt_in = attributes[:'cell_phone_opt_in']
82
+ end
83
+
75
84
  if attributes.key?(:'mailing_list')
76
85
  self.mailing_list = attributes[:'mailing_list']
77
86
  end
@@ -130,6 +139,7 @@ module UltracartClient
130
139
  return true if self.equal?(o)
131
140
  self.class == o.class &&
132
141
  advertising_source == o.advertising_source &&
142
+ cell_phone_opt_in == o.cell_phone_opt_in &&
133
143
  mailing_list == o.mailing_list &&
134
144
  referral_code == o.referral_code
135
145
  end
@@ -143,7 +153,7 @@ module UltracartClient
143
153
  # Calculates hash code according to all attributes.
144
154
  # @return [Integer] Hash code
145
155
  def hash
146
- [advertising_source, mailing_list, referral_code].hash
156
+ [advertising_source, cell_phone_opt_in, mailing_list, referral_code].hash
147
157
  end
148
158
 
149
159
  # Builds the object from hash