ultracart_api 3.10.22 → 3.10.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +14 -4
  3. data/docs/AutoOrder.md +1 -0
  4. data/docs/AutoOrderManagement.md +8 -0
  5. data/docs/Conversation.md +1 -0
  6. data/docs/ConversationAgentAuth.md +13 -0
  7. data/docs/ConversationAgentAuthResponse.md +5 -6
  8. data/docs/ConversationApi.md +6 -5
  9. data/docs/ConversationEventQueuePosition.md +9 -0
  10. data/docs/ConversationMultimediaUploadUrl.md +9 -0
  11. data/docs/ConversationMultimediaUploadUrlResponse.md +12 -0
  12. data/docs/ConversationResponse.md +12 -0
  13. data/docs/ConversationStartRequest.md +1 -0
  14. data/docs/ConversationStartResponse.md +1 -2
  15. data/docs/ConversationSummary.md +1 -0
  16. data/docs/ConversationWebsocketMessage.md +16 -0
  17. data/lib/ultracart_api/api/conversation_api.rb +9 -8
  18. data/lib/ultracart_api/models/auto_order.rb +10 -1
  19. data/lib/ultracart_api/models/auto_order_management.rb +185 -0
  20. data/lib/ultracart_api/models/conversation.rb +10 -1
  21. data/lib/ultracart_api/models/conversation_agent_auth.rb +231 -0
  22. data/lib/ultracart_api/models/conversation_agent_auth_response.rb +32 -42
  23. data/lib/ultracart_api/models/conversation_event_queue_position.rb +195 -0
  24. data/lib/ultracart_api/models/conversation_multimedia_upload_url.rb +193 -0
  25. data/lib/ultracart_api/models/conversation_multimedia_upload_url_response.rb +221 -0
  26. data/lib/ultracart_api/models/conversation_response.rb +221 -0
  27. data/lib/ultracart_api/models/conversation_start_request.rb +13 -4
  28. data/lib/ultracart_api/models/conversation_start_response.rb +7 -16
  29. data/lib/ultracart_api/models/conversation_summary.rb +10 -1
  30. data/lib/ultracart_api/models/conversation_websocket_message.rb +305 -0
  31. data/lib/ultracart_api/version.rb +1 -1
  32. data/lib/ultracart_api.rb +7 -0
  33. 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,195 @@
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
+ # True if agents are logged into the queue
18
+ attr_accessor :available
19
+
20
+ # Position in the queue. Value will be -1 if they cant be found in the queue.
21
+ attr_accessor :position
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'available' => :'available',
27
+ :'position' => :'position'
28
+ }
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.swagger_types
33
+ {
34
+ :'available' => :'BOOLEAN',
35
+ :'position' => :'Integer'
36
+ }
37
+ end
38
+
39
+ # Initializes the object
40
+ # @param [Hash] attributes Model attributes in the form of hash
41
+ def initialize(attributes = {})
42
+ return unless attributes.is_a?(Hash)
43
+
44
+ # convert string to symbol for hash key
45
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
46
+
47
+ if attributes.has_key?(:'available')
48
+ self.available = attributes[:'available']
49
+ end
50
+
51
+ if attributes.has_key?(:'position')
52
+ self.position = attributes[:'position']
53
+ end
54
+ end
55
+
56
+ # Show invalid properties with the reasons. Usually used together with valid?
57
+ # @return Array for valid properties with the reasons
58
+ def list_invalid_properties
59
+ invalid_properties = Array.new
60
+ invalid_properties
61
+ end
62
+
63
+ # Check to see if the all the properties in the model are valid
64
+ # @return true if the model is valid
65
+ def valid?
66
+ true
67
+ end
68
+
69
+ # Checks equality by comparing each attribute.
70
+ # @param [Object] Object to be compared
71
+ def ==(o)
72
+ return true if self.equal?(o)
73
+ self.class == o.class &&
74
+ available == o.available &&
75
+ position == o.position
76
+ end
77
+
78
+ # @see the `==` method
79
+ # @param [Object] Object to be compared
80
+ def eql?(o)
81
+ self == o
82
+ end
83
+
84
+ # Calculates hash code according to all attributes.
85
+ # @return [Fixnum] Hash code
86
+ def hash
87
+ [available, position].hash
88
+ end
89
+
90
+ # Builds the object from hash
91
+ # @param [Hash] attributes Model attributes in the form of hash
92
+ # @return [Object] Returns the model itself
93
+ def build_from_hash(attributes)
94
+ return nil unless attributes.is_a?(Hash)
95
+ self.class.swagger_types.each_pair do |key, type|
96
+ if type =~ /\AArray<(.*)>/i
97
+ # check to ensure the input is an array given that the attribute
98
+ # is documented as an array but the input is not
99
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
100
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
101
+ end
102
+ elsif !attributes[self.class.attribute_map[key]].nil?
103
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
104
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
105
+ end
106
+
107
+ self
108
+ end
109
+
110
+ # Deserializes the data based on type
111
+ # @param string type Data type
112
+ # @param string value Value to be deserialized
113
+ # @return [Object] Deserialized data
114
+ def _deserialize(type, value)
115
+ case type.to_sym
116
+ when :DateTime
117
+ DateTime.parse(value)
118
+ when :Date
119
+ Date.parse(value)
120
+ when :String
121
+ value.to_s
122
+ when :Integer
123
+ value.to_i
124
+ when :Float
125
+ value.to_f
126
+ when :BOOLEAN
127
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
128
+ true
129
+ else
130
+ false
131
+ end
132
+ when :Object
133
+ # generic object (usually a Hash), return directly
134
+ value
135
+ when /\AArray<(?<inner_type>.+)>\z/
136
+ inner_type = Regexp.last_match[:inner_type]
137
+ value.map { |v| _deserialize(inner_type, v) }
138
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
139
+ k_type = Regexp.last_match[:k_type]
140
+ v_type = Regexp.last_match[:v_type]
141
+ {}.tap do |hash|
142
+ value.each do |k, v|
143
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
144
+ end
145
+ end
146
+ else # model
147
+ temp_model = UltracartClient.const_get(type).new
148
+ temp_model.build_from_hash(value)
149
+ end
150
+ end
151
+
152
+ # Returns the string representation of the object
153
+ # @return [String] String presentation of the object
154
+ def to_s
155
+ to_hash.to_s
156
+ end
157
+
158
+ # to_body is an alias to to_hash (backward compatibility)
159
+ # @return [Hash] Returns the object in the form of hash
160
+ def to_body
161
+ to_hash
162
+ end
163
+
164
+ # Returns the object in the form of hash
165
+ # @return [Hash] Returns the object in the form of hash
166
+ def to_hash
167
+ hash = {}
168
+ self.class.attribute_map.each_pair do |attr, param|
169
+ value = self.send(attr)
170
+ next if value.nil?
171
+ hash[param] = _to_hash(value)
172
+ end
173
+ hash
174
+ end
175
+
176
+ # Outputs non-array value in the form of hash
177
+ # For object, use to_hash. Otherwise, just return the value
178
+ # @param [Object] value Any valid value
179
+ # @return [Hash] Returns the value in the form of hash
180
+ def _to_hash(value)
181
+ if value.is_a?(Array)
182
+ value.compact.map { |v| _to_hash(v) }
183
+ elsif value.is_a?(Hash)
184
+ {}.tap do |hash|
185
+ value.each { |k, v| hash[k] = _to_hash(v) }
186
+ end
187
+ elsif value.respond_to? :to_hash
188
+ value.to_hash
189
+ else
190
+ value
191
+ end
192
+ end
193
+
194
+ end
195
+ end