ultracart_api 3.10.22 → 3.10.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -4
  3. data/docs/AutoOrder.md +1 -0
  4. data/docs/AutoOrderManagement.md +8 -0
  5. data/docs/ConversationAgentAuth.md +13 -0
  6. data/docs/ConversationAgentAuthResponse.md +5 -6
  7. data/docs/ConversationApi.md +6 -5
  8. data/docs/ConversationEventQueuePosition.md +7 -0
  9. data/docs/ConversationMultimediaUploadUrl.md +9 -0
  10. data/docs/ConversationMultimediaUploadUrlResponse.md +12 -0
  11. data/docs/ConversationResponse.md +12 -0
  12. data/docs/ConversationStartRequest.md +1 -0
  13. data/docs/ConversationStartResponse.md +1 -2
  14. data/docs/ConversationWebsocketMessage.md +16 -0
  15. data/lib/ultracart_api/api/conversation_api.rb +9 -8
  16. data/lib/ultracart_api/models/auto_order.rb +10 -1
  17. data/lib/ultracart_api/models/auto_order_management.rb +185 -0
  18. data/lib/ultracart_api/models/conversation_agent_auth.rb +231 -0
  19. data/lib/ultracart_api/models/conversation_agent_auth_response.rb +32 -42
  20. data/lib/ultracart_api/models/conversation_event_queue_position.rb +175 -0
  21. data/lib/ultracart_api/models/conversation_multimedia_upload_url.rb +193 -0
  22. data/lib/ultracart_api/models/conversation_multimedia_upload_url_response.rb +221 -0
  23. data/lib/ultracart_api/models/conversation_response.rb +221 -0
  24. data/lib/ultracart_api/models/conversation_start_request.rb +13 -4
  25. data/lib/ultracart_api/models/conversation_start_response.rb +7 -16
  26. data/lib/ultracart_api/models/conversation_websocket_message.rb +305 -0
  27. data/lib/ultracart_api/version.rb +1 -1
  28. data/lib/ultracart_api.rb +7 -0
  29. metadata +16 -2
@@ -0,0 +1,231 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class ConversationAgentAuth
17
+ attr_accessor :conversation_participant_arn
18
+
19
+ attr_accessor :conversation_participant_name
20
+
21
+ attr_accessor :jwt
22
+
23
+ attr_accessor :merchant_id
24
+
25
+ attr_accessor :twilio_phone_numbers
26
+
27
+ attr_accessor :websocket_url
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'conversation_participant_arn' => :'conversation_participant_arn',
33
+ :'conversation_participant_name' => :'conversation_participant_name',
34
+ :'jwt' => :'jwt',
35
+ :'merchant_id' => :'merchant_id',
36
+ :'twilio_phone_numbers' => :'twilio_phone_numbers',
37
+ :'websocket_url' => :'websocket_url'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.swagger_types
43
+ {
44
+ :'conversation_participant_arn' => :'String',
45
+ :'conversation_participant_name' => :'String',
46
+ :'jwt' => :'String',
47
+ :'merchant_id' => :'String',
48
+ :'twilio_phone_numbers' => :'Array<String>',
49
+ :'websocket_url' => :'String'
50
+ }
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ return unless attributes.is_a?(Hash)
57
+
58
+ # convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
60
+
61
+ if attributes.has_key?(:'conversation_participant_arn')
62
+ self.conversation_participant_arn = attributes[:'conversation_participant_arn']
63
+ end
64
+
65
+ if attributes.has_key?(:'conversation_participant_name')
66
+ self.conversation_participant_name = attributes[:'conversation_participant_name']
67
+ end
68
+
69
+ if attributes.has_key?(:'jwt')
70
+ self.jwt = attributes[:'jwt']
71
+ end
72
+
73
+ if attributes.has_key?(:'merchant_id')
74
+ self.merchant_id = attributes[:'merchant_id']
75
+ end
76
+
77
+ if attributes.has_key?(:'twilio_phone_numbers')
78
+ if (value = attributes[:'twilio_phone_numbers']).is_a?(Array)
79
+ self.twilio_phone_numbers = value
80
+ end
81
+ end
82
+
83
+ if attributes.has_key?(:'websocket_url')
84
+ self.websocket_url = attributes[:'websocket_url']
85
+ end
86
+ end
87
+
88
+ # Show invalid properties with the reasons. Usually used together with valid?
89
+ # @return Array for valid properties with the reasons
90
+ def list_invalid_properties
91
+ invalid_properties = Array.new
92
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ true
99
+ end
100
+
101
+ # Checks equality by comparing each attribute.
102
+ # @param [Object] Object to be compared
103
+ def ==(o)
104
+ return true if self.equal?(o)
105
+ self.class == o.class &&
106
+ conversation_participant_arn == o.conversation_participant_arn &&
107
+ conversation_participant_name == o.conversation_participant_name &&
108
+ jwt == o.jwt &&
109
+ merchant_id == o.merchant_id &&
110
+ twilio_phone_numbers == o.twilio_phone_numbers &&
111
+ websocket_url == o.websocket_url
112
+ end
113
+
114
+ # @see the `==` method
115
+ # @param [Object] Object to be compared
116
+ def eql?(o)
117
+ self == o
118
+ end
119
+
120
+ # Calculates hash code according to all attributes.
121
+ # @return [Fixnum] Hash code
122
+ def hash
123
+ [conversation_participant_arn, conversation_participant_name, jwt, merchant_id, twilio_phone_numbers, websocket_url].hash
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+ self.class.swagger_types.each_pair do |key, type|
132
+ if type =~ /\AArray<(.*)>/i
133
+ # check to ensure the input is an array given that the attribute
134
+ # is documented as an array but the input is not
135
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
136
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
137
+ end
138
+ elsif !attributes[self.class.attribute_map[key]].nil?
139
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
140
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
141
+ end
142
+
143
+ self
144
+ end
145
+
146
+ # Deserializes the data based on type
147
+ # @param string type Data type
148
+ # @param string value Value to be deserialized
149
+ # @return [Object] Deserialized data
150
+ def _deserialize(type, value)
151
+ case type.to_sym
152
+ when :DateTime
153
+ DateTime.parse(value)
154
+ when :Date
155
+ Date.parse(value)
156
+ when :String
157
+ value.to_s
158
+ when :Integer
159
+ value.to_i
160
+ when :Float
161
+ value.to_f
162
+ when :BOOLEAN
163
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
164
+ true
165
+ else
166
+ false
167
+ end
168
+ when :Object
169
+ # generic object (usually a Hash), return directly
170
+ value
171
+ when /\AArray<(?<inner_type>.+)>\z/
172
+ inner_type = Regexp.last_match[:inner_type]
173
+ value.map { |v| _deserialize(inner_type, v) }
174
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
175
+ k_type = Regexp.last_match[:k_type]
176
+ v_type = Regexp.last_match[:v_type]
177
+ {}.tap do |hash|
178
+ value.each do |k, v|
179
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
180
+ end
181
+ end
182
+ else # model
183
+ temp_model = UltracartClient.const_get(type).new
184
+ temp_model.build_from_hash(value)
185
+ end
186
+ end
187
+
188
+ # Returns the string representation of the object
189
+ # @return [String] String presentation of the object
190
+ def to_s
191
+ to_hash.to_s
192
+ end
193
+
194
+ # to_body is an alias to to_hash (backward compatibility)
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_body
197
+ to_hash
198
+ end
199
+
200
+ # Returns the object in the form of hash
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_hash
203
+ hash = {}
204
+ self.class.attribute_map.each_pair do |attr, param|
205
+ value = self.send(attr)
206
+ next if value.nil?
207
+ hash[param] = _to_hash(value)
208
+ end
209
+ hash
210
+ end
211
+
212
+ # Outputs non-array value in the form of hash
213
+ # For object, use to_hash. Otherwise, just return the value
214
+ # @param [Object] value Any valid value
215
+ # @return [Hash] Returns the value in the form of hash
216
+ def _to_hash(value)
217
+ if value.is_a?(Array)
218
+ value.compact.map { |v| _to_hash(v) }
219
+ elsif value.is_a?(Hash)
220
+ {}.tap do |hash|
221
+ value.each { |k, v| hash[k] = _to_hash(v) }
222
+ end
223
+ elsif value.respond_to? :to_hash
224
+ value.to_hash
225
+ else
226
+ value
227
+ end
228
+ end
229
+
230
+ end
231
+ end
@@ -14,39 +14,36 @@ require 'date'
14
14
 
15
15
  module UltracartClient
16
16
  class ConversationAgentAuthResponse
17
- attr_accessor :conversation_participant_arn
17
+ attr_accessor :agent_auth
18
18
 
19
- attr_accessor :conversation_participant_name
19
+ attr_accessor :error
20
20
 
21
- attr_accessor :jwt
21
+ attr_accessor :metadata
22
22
 
23
- attr_accessor :merchant_id
23
+ # Indicates if API call was successful
24
+ attr_accessor :success
24
25
 
25
- attr_accessor :twilio_phone_numbers
26
-
27
- attr_accessor :websocket_url
26
+ attr_accessor :warning
28
27
 
29
28
  # Attribute mapping from ruby-style variable name to JSON key.
30
29
  def self.attribute_map
31
30
  {
32
- :'conversation_participant_arn' => :'conversation_participant_arn',
33
- :'conversation_participant_name' => :'conversation_participant_name',
34
- :'jwt' => :'jwt',
35
- :'merchant_id' => :'merchant_id',
36
- :'twilio_phone_numbers' => :'twilio_phone_numbers',
37
- :'websocket_url' => :'websocket_url'
31
+ :'agent_auth' => :'agent_auth',
32
+ :'error' => :'error',
33
+ :'metadata' => :'metadata',
34
+ :'success' => :'success',
35
+ :'warning' => :'warning'
38
36
  }
39
37
  end
40
38
 
41
39
  # Attribute type mapping.
42
40
  def self.swagger_types
43
41
  {
44
- :'conversation_participant_arn' => :'String',
45
- :'conversation_participant_name' => :'String',
46
- :'jwt' => :'String',
47
- :'merchant_id' => :'String',
48
- :'twilio_phone_numbers' => :'Array<String>',
49
- :'websocket_url' => :'String'
42
+ :'agent_auth' => :'ConversationAgentAuth',
43
+ :'error' => :'Error',
44
+ :'metadata' => :'ResponseMetadata',
45
+ :'success' => :'BOOLEAN',
46
+ :'warning' => :'Warning'
50
47
  }
51
48
  end
52
49
 
@@ -58,30 +55,24 @@ module UltracartClient
58
55
  # convert string to symbol for hash key
59
56
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
60
57
 
61
- if attributes.has_key?(:'conversation_participant_arn')
62
- self.conversation_participant_arn = attributes[:'conversation_participant_arn']
63
- end
64
-
65
- if attributes.has_key?(:'conversation_participant_name')
66
- self.conversation_participant_name = attributes[:'conversation_participant_name']
58
+ if attributes.has_key?(:'agent_auth')
59
+ self.agent_auth = attributes[:'agent_auth']
67
60
  end
68
61
 
69
- if attributes.has_key?(:'jwt')
70
- self.jwt = attributes[:'jwt']
62
+ if attributes.has_key?(:'error')
63
+ self.error = attributes[:'error']
71
64
  end
72
65
 
73
- if attributes.has_key?(:'merchant_id')
74
- self.merchant_id = attributes[:'merchant_id']
66
+ if attributes.has_key?(:'metadata')
67
+ self.metadata = attributes[:'metadata']
75
68
  end
76
69
 
77
- if attributes.has_key?(:'twilio_phone_numbers')
78
- if (value = attributes[:'twilio_phone_numbers']).is_a?(Array)
79
- self.twilio_phone_numbers = value
80
- end
70
+ if attributes.has_key?(:'success')
71
+ self.success = attributes[:'success']
81
72
  end
82
73
 
83
- if attributes.has_key?(:'websocket_url')
84
- self.websocket_url = attributes[:'websocket_url']
74
+ if attributes.has_key?(:'warning')
75
+ self.warning = attributes[:'warning']
85
76
  end
86
77
  end
87
78
 
@@ -103,12 +94,11 @@ module UltracartClient
103
94
  def ==(o)
104
95
  return true if self.equal?(o)
105
96
  self.class == o.class &&
106
- conversation_participant_arn == o.conversation_participant_arn &&
107
- conversation_participant_name == o.conversation_participant_name &&
108
- jwt == o.jwt &&
109
- merchant_id == o.merchant_id &&
110
- twilio_phone_numbers == o.twilio_phone_numbers &&
111
- websocket_url == o.websocket_url
97
+ agent_auth == o.agent_auth &&
98
+ error == o.error &&
99
+ metadata == o.metadata &&
100
+ success == o.success &&
101
+ warning == o.warning
112
102
  end
113
103
 
114
104
  # @see the `==` method
@@ -120,7 +110,7 @@ module UltracartClient
120
110
  # Calculates hash code according to all attributes.
121
111
  # @return [Fixnum] Hash code
122
112
  def hash
123
- [conversation_participant_arn, conversation_participant_name, jwt, merchant_id, twilio_phone_numbers, websocket_url].hash
113
+ [agent_auth, error, metadata, success, warning].hash
124
114
  end
125
115
 
126
116
  # Builds the object from hash
@@ -0,0 +1,175 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class ConversationEventQueuePosition
17
+ # Attribute mapping from ruby-style variable name to JSON key.
18
+ def self.attribute_map
19
+ {
20
+ }
21
+ end
22
+
23
+ # Attribute type mapping.
24
+ def self.swagger_types
25
+ {
26
+ }
27
+ end
28
+
29
+ # Initializes the object
30
+ # @param [Hash] attributes Model attributes in the form of hash
31
+ def initialize(attributes = {})
32
+ return unless attributes.is_a?(Hash)
33
+
34
+ # convert string to symbol for hash key
35
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
36
+ end
37
+
38
+ # Show invalid properties with the reasons. Usually used together with valid?
39
+ # @return Array for valid properties with the reasons
40
+ def list_invalid_properties
41
+ invalid_properties = Array.new
42
+ invalid_properties
43
+ end
44
+
45
+ # Check to see if the all the properties in the model are valid
46
+ # @return true if the model is valid
47
+ def valid?
48
+ true
49
+ end
50
+
51
+ # Checks equality by comparing each attribute.
52
+ # @param [Object] Object to be compared
53
+ def ==(o)
54
+ return true if self.equal?(o)
55
+ self.class == o.class
56
+ end
57
+
58
+ # @see the `==` method
59
+ # @param [Object] Object to be compared
60
+ def eql?(o)
61
+ self == o
62
+ end
63
+
64
+ # Calculates hash code according to all attributes.
65
+ # @return [Fixnum] Hash code
66
+ def hash
67
+ [].hash
68
+ end
69
+
70
+ # Builds the object from hash
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ # @return [Object] Returns the model itself
73
+ def build_from_hash(attributes)
74
+ return nil unless attributes.is_a?(Hash)
75
+ self.class.swagger_types.each_pair do |key, type|
76
+ if type =~ /\AArray<(.*)>/i
77
+ # check to ensure the input is an array given that the attribute
78
+ # is documented as an array but the input is not
79
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
80
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
81
+ end
82
+ elsif !attributes[self.class.attribute_map[key]].nil?
83
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
84
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
85
+ end
86
+
87
+ self
88
+ end
89
+
90
+ # Deserializes the data based on type
91
+ # @param string type Data type
92
+ # @param string value Value to be deserialized
93
+ # @return [Object] Deserialized data
94
+ def _deserialize(type, value)
95
+ case type.to_sym
96
+ when :DateTime
97
+ DateTime.parse(value)
98
+ when :Date
99
+ Date.parse(value)
100
+ when :String
101
+ value.to_s
102
+ when :Integer
103
+ value.to_i
104
+ when :Float
105
+ value.to_f
106
+ when :BOOLEAN
107
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
108
+ true
109
+ else
110
+ false
111
+ end
112
+ when :Object
113
+ # generic object (usually a Hash), return directly
114
+ value
115
+ when /\AArray<(?<inner_type>.+)>\z/
116
+ inner_type = Regexp.last_match[:inner_type]
117
+ value.map { |v| _deserialize(inner_type, v) }
118
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
119
+ k_type = Regexp.last_match[:k_type]
120
+ v_type = Regexp.last_match[:v_type]
121
+ {}.tap do |hash|
122
+ value.each do |k, v|
123
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
124
+ end
125
+ end
126
+ else # model
127
+ temp_model = UltracartClient.const_get(type).new
128
+ temp_model.build_from_hash(value)
129
+ end
130
+ end
131
+
132
+ # Returns the string representation of the object
133
+ # @return [String] String presentation of the object
134
+ def to_s
135
+ to_hash.to_s
136
+ end
137
+
138
+ # to_body is an alias to to_hash (backward compatibility)
139
+ # @return [Hash] Returns the object in the form of hash
140
+ def to_body
141
+ to_hash
142
+ end
143
+
144
+ # Returns the object in the form of hash
145
+ # @return [Hash] Returns the object in the form of hash
146
+ def to_hash
147
+ hash = {}
148
+ self.class.attribute_map.each_pair do |attr, param|
149
+ value = self.send(attr)
150
+ next if value.nil?
151
+ hash[param] = _to_hash(value)
152
+ end
153
+ hash
154
+ end
155
+
156
+ # Outputs non-array value in the form of hash
157
+ # For object, use to_hash. Otherwise, just return the value
158
+ # @param [Object] value Any valid value
159
+ # @return [Hash] Returns the value in the form of hash
160
+ def _to_hash(value)
161
+ if value.is_a?(Array)
162
+ value.compact.map { |v| _to_hash(v) }
163
+ elsif value.is_a?(Hash)
164
+ {}.tap do |hash|
165
+ value.each { |k, v| hash[k] = _to_hash(v) }
166
+ end
167
+ elsif value.respond_to? :to_hash
168
+ value.to_hash
169
+ else
170
+ value
171
+ end
172
+ end
173
+
174
+ end
175
+ end