ultracart_api 4.0.35.rc → 4.0.38.rc

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