ultracart_api 4.0.34.rc → 4.0.37.rc

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