ultracart_api 4.0.37.rc → 4.0.40.rc

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