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
@@ -14,23 +14,19 @@ require 'date'
14
14
 
15
15
  module UltracartClient
16
16
  class ConversationStartResponse
17
- attr_accessor :conversation_arn
18
-
19
- attr_accessor :conversation_uuid
17
+ attr_accessor :conversation
20
18
 
21
19
  # Attribute mapping from ruby-style variable name to JSON key.
22
20
  def self.attribute_map
23
21
  {
24
- :'conversation_arn' => :'conversation_arn',
25
- :'conversation_uuid' => :'conversation_uuid'
22
+ :'conversation' => :'conversation'
26
23
  }
27
24
  end
28
25
 
29
26
  # Attribute type mapping.
30
27
  def self.swagger_types
31
28
  {
32
- :'conversation_arn' => :'String',
33
- :'conversation_uuid' => :'String'
29
+ :'conversation' => :'Conversation'
34
30
  }
35
31
  end
36
32
 
@@ -42,12 +38,8 @@ module UltracartClient
42
38
  # convert string to symbol for hash key
43
39
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
44
40
 
45
- if attributes.has_key?(:'conversation_arn')
46
- self.conversation_arn = attributes[:'conversation_arn']
47
- end
48
-
49
- if attributes.has_key?(:'conversation_uuid')
50
- self.conversation_uuid = attributes[:'conversation_uuid']
41
+ if attributes.has_key?(:'conversation')
42
+ self.conversation = attributes[:'conversation']
51
43
  end
52
44
  end
53
45
 
@@ -69,8 +61,7 @@ module UltracartClient
69
61
  def ==(o)
70
62
  return true if self.equal?(o)
71
63
  self.class == o.class &&
72
- conversation_arn == o.conversation_arn &&
73
- conversation_uuid == o.conversation_uuid
64
+ conversation == o.conversation
74
65
  end
75
66
 
76
67
  # @see the `==` method
@@ -82,7 +73,7 @@ module UltracartClient
82
73
  # Calculates hash code according to all attributes.
83
74
  # @return [Fixnum] Hash code
84
75
  def hash
85
- [conversation_arn, conversation_uuid].hash
76
+ [conversation].hash
86
77
  end
87
78
 
88
79
  # Builds the object from hash
@@ -0,0 +1,305 @@
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 ConversationWebsocketMessage
17
+ # Conversation UUID if the websocket message is tied to a specific conversation
18
+ attr_accessor :conversation_uuid
19
+
20
+ attr_accessor :event_conversation_closed
21
+
22
+ attr_accessor :event_new_conversation
23
+
24
+ attr_accessor :event_new_message
25
+
26
+ attr_accessor :event_queue_position
27
+
28
+ # Type of event
29
+ attr_accessor :event_type
30
+
31
+ attr_accessor :event_updated_message
32
+
33
+ attr_accessor :message
34
+
35
+ # Type of message
36
+ attr_accessor :type
37
+
38
+ class EnumAttributeValidator
39
+ attr_reader :datatype
40
+ attr_reader :allowable_values
41
+
42
+ def initialize(datatype, allowable_values)
43
+ @allowable_values = allowable_values.map do |value|
44
+ case datatype.to_s
45
+ when /Integer/i
46
+ value.to_i
47
+ when /Float/i
48
+ value.to_f
49
+ else
50
+ value
51
+ end
52
+ end
53
+ end
54
+
55
+ def valid?(value)
56
+ !value || allowable_values.include?(value)
57
+ end
58
+ end
59
+
60
+ # Attribute mapping from ruby-style variable name to JSON key.
61
+ def self.attribute_map
62
+ {
63
+ :'conversation_uuid' => :'conversation_uuid',
64
+ :'event_conversation_closed' => :'event_conversation_closed',
65
+ :'event_new_conversation' => :'event_new_conversation',
66
+ :'event_new_message' => :'event_new_message',
67
+ :'event_queue_position' => :'event_queue_position',
68
+ :'event_type' => :'event_type',
69
+ :'event_updated_message' => :'event_updated_message',
70
+ :'message' => :'message',
71
+ :'type' => :'type'
72
+ }
73
+ end
74
+
75
+ # Attribute type mapping.
76
+ def self.swagger_types
77
+ {
78
+ :'conversation_uuid' => :'String',
79
+ :'event_conversation_closed' => :'Conversation',
80
+ :'event_new_conversation' => :'Conversation',
81
+ :'event_new_message' => :'ConversationMessage',
82
+ :'event_queue_position' => :'ConversationEventQueuePosition',
83
+ :'event_type' => :'String',
84
+ :'event_updated_message' => :'ConversationMessage',
85
+ :'message' => :'ConversationMessage',
86
+ :'type' => :'String'
87
+ }
88
+ end
89
+
90
+ # Initializes the object
91
+ # @param [Hash] attributes Model attributes in the form of hash
92
+ def initialize(attributes = {})
93
+ return unless attributes.is_a?(Hash)
94
+
95
+ # convert string to symbol for hash key
96
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
97
+
98
+ if attributes.has_key?(:'conversation_uuid')
99
+ self.conversation_uuid = attributes[:'conversation_uuid']
100
+ end
101
+
102
+ if attributes.has_key?(:'event_conversation_closed')
103
+ self.event_conversation_closed = attributes[:'event_conversation_closed']
104
+ end
105
+
106
+ if attributes.has_key?(:'event_new_conversation')
107
+ self.event_new_conversation = attributes[:'event_new_conversation']
108
+ end
109
+
110
+ if attributes.has_key?(:'event_new_message')
111
+ self.event_new_message = attributes[:'event_new_message']
112
+ end
113
+
114
+ if attributes.has_key?(:'event_queue_position')
115
+ self.event_queue_position = attributes[:'event_queue_position']
116
+ end
117
+
118
+ if attributes.has_key?(:'event_type')
119
+ self.event_type = attributes[:'event_type']
120
+ end
121
+
122
+ if attributes.has_key?(:'event_updated_message')
123
+ self.event_updated_message = attributes[:'event_updated_message']
124
+ end
125
+
126
+ if attributes.has_key?(:'message')
127
+ self.message = attributes[:'message']
128
+ end
129
+
130
+ if attributes.has_key?(:'type')
131
+ self.type = attributes[:'type']
132
+ end
133
+ end
134
+
135
+ # Show invalid properties with the reasons. Usually used together with valid?
136
+ # @return Array for valid properties with the reasons
137
+ def list_invalid_properties
138
+ invalid_properties = Array.new
139
+ invalid_properties
140
+ end
141
+
142
+ # Check to see if the all the properties in the model are valid
143
+ # @return true if the model is valid
144
+ def valid?
145
+ event_type_validator = EnumAttributeValidator.new('String', ['queue position', 'webchat start conversation', 'conversation closed', 'new conversation', 'new message', 'updated message'])
146
+ return false unless event_type_validator.valid?(@event_type)
147
+ type_validator = EnumAttributeValidator.new('String', ['message', 'event', 'ping'])
148
+ return false unless type_validator.valid?(@type)
149
+ true
150
+ end
151
+
152
+ # Custom attribute writer method checking allowed values (enum).
153
+ # @param [Object] event_type Object to be assigned
154
+ def event_type=(event_type)
155
+ validator = EnumAttributeValidator.new('String', ['queue position', 'webchat start conversation', 'conversation closed', 'new conversation', 'new message', 'updated message'])
156
+ unless validator.valid?(event_type)
157
+ fail ArgumentError, 'invalid value for "event_type", must be one of #{validator.allowable_values}.'
158
+ end
159
+ @event_type = event_type
160
+ end
161
+
162
+ # Custom attribute writer method checking allowed values (enum).
163
+ # @param [Object] type Object to be assigned
164
+ def type=(type)
165
+ validator = EnumAttributeValidator.new('String', ['message', 'event', 'ping'])
166
+ unless validator.valid?(type)
167
+ fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.'
168
+ end
169
+ @type = type
170
+ end
171
+
172
+ # Checks equality by comparing each attribute.
173
+ # @param [Object] Object to be compared
174
+ def ==(o)
175
+ return true if self.equal?(o)
176
+ self.class == o.class &&
177
+ conversation_uuid == o.conversation_uuid &&
178
+ event_conversation_closed == o.event_conversation_closed &&
179
+ event_new_conversation == o.event_new_conversation &&
180
+ event_new_message == o.event_new_message &&
181
+ event_queue_position == o.event_queue_position &&
182
+ event_type == o.event_type &&
183
+ event_updated_message == o.event_updated_message &&
184
+ message == o.message &&
185
+ type == o.type
186
+ end
187
+
188
+ # @see the `==` method
189
+ # @param [Object] Object to be compared
190
+ def eql?(o)
191
+ self == o
192
+ end
193
+
194
+ # Calculates hash code according to all attributes.
195
+ # @return [Fixnum] Hash code
196
+ def hash
197
+ [conversation_uuid, event_conversation_closed, event_new_conversation, event_new_message, event_queue_position, event_type, event_updated_message, message, type].hash
198
+ end
199
+
200
+ # Builds the object from hash
201
+ # @param [Hash] attributes Model attributes in the form of hash
202
+ # @return [Object] Returns the model itself
203
+ def build_from_hash(attributes)
204
+ return nil unless attributes.is_a?(Hash)
205
+ self.class.swagger_types.each_pair do |key, type|
206
+ if type =~ /\AArray<(.*)>/i
207
+ # check to ensure the input is an array given that the attribute
208
+ # is documented as an array but the input is not
209
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
210
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
211
+ end
212
+ elsif !attributes[self.class.attribute_map[key]].nil?
213
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
214
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
215
+ end
216
+
217
+ self
218
+ end
219
+
220
+ # Deserializes the data based on type
221
+ # @param string type Data type
222
+ # @param string value Value to be deserialized
223
+ # @return [Object] Deserialized data
224
+ def _deserialize(type, value)
225
+ case type.to_sym
226
+ when :DateTime
227
+ DateTime.parse(value)
228
+ when :Date
229
+ Date.parse(value)
230
+ when :String
231
+ value.to_s
232
+ when :Integer
233
+ value.to_i
234
+ when :Float
235
+ value.to_f
236
+ when :BOOLEAN
237
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
238
+ true
239
+ else
240
+ false
241
+ end
242
+ when :Object
243
+ # generic object (usually a Hash), return directly
244
+ value
245
+ when /\AArray<(?<inner_type>.+)>\z/
246
+ inner_type = Regexp.last_match[:inner_type]
247
+ value.map { |v| _deserialize(inner_type, v) }
248
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
249
+ k_type = Regexp.last_match[:k_type]
250
+ v_type = Regexp.last_match[:v_type]
251
+ {}.tap do |hash|
252
+ value.each do |k, v|
253
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
254
+ end
255
+ end
256
+ else # model
257
+ temp_model = UltracartClient.const_get(type).new
258
+ temp_model.build_from_hash(value)
259
+ end
260
+ end
261
+
262
+ # Returns the string representation of the object
263
+ # @return [String] String presentation of the object
264
+ def to_s
265
+ to_hash.to_s
266
+ end
267
+
268
+ # to_body is an alias to to_hash (backward compatibility)
269
+ # @return [Hash] Returns the object in the form of hash
270
+ def to_body
271
+ to_hash
272
+ end
273
+
274
+ # Returns the object in the form of hash
275
+ # @return [Hash] Returns the object in the form of hash
276
+ def to_hash
277
+ hash = {}
278
+ self.class.attribute_map.each_pair do |attr, param|
279
+ value = self.send(attr)
280
+ next if value.nil?
281
+ hash[param] = _to_hash(value)
282
+ end
283
+ hash
284
+ end
285
+
286
+ # Outputs non-array value in the form of hash
287
+ # For object, use to_hash. Otherwise, just return the value
288
+ # @param [Object] value Any valid value
289
+ # @return [Hash] Returns the value in the form of hash
290
+ def _to_hash(value)
291
+ if value.is_a?(Array)
292
+ value.compact.map { |v| _to_hash(v) }
293
+ elsif value.is_a?(Hash)
294
+ {}.tap do |hash|
295
+ value.each { |k, v| hash[k] = _to_hash(v) }
296
+ end
297
+ elsif value.respond_to? :to_hash
298
+ value.to_hash
299
+ else
300
+ value
301
+ end
302
+ end
303
+
304
+ end
305
+ end
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.4.15-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module UltracartClient
14
- VERSION = '3.10.22'
14
+ VERSION = '3.10.23'
15
15
  end
data/lib/ultracart_api.rb CHANGED
@@ -44,6 +44,7 @@ require 'ultracart_api/models/auto_order_item_future_schedule'
44
44
  require 'ultracart_api/models/auto_order_item_option'
45
45
  require 'ultracart_api/models/auto_order_item_simple_schedule'
46
46
  require 'ultracart_api/models/auto_order_log'
47
+ require 'ultracart_api/models/auto_order_management'
47
48
  require 'ultracart_api/models/auto_order_query'
48
49
  require 'ultracart_api/models/auto_order_query_batch'
49
50
  require 'ultracart_api/models/auto_order_response'
@@ -134,13 +135,19 @@ require 'ultracart_api/models/checkout_setup_browser_key_response'
134
135
  require 'ultracart_api/models/checkout_state_province_response'
135
136
  require 'ultracart_api/models/city_state_zip'
136
137
  require 'ultracart_api/models/conversation'
138
+ require 'ultracart_api/models/conversation_agent_auth'
137
139
  require 'ultracart_api/models/conversation_agent_auth_response'
140
+ require 'ultracart_api/models/conversation_event_queue_position'
138
141
  require 'ultracart_api/models/conversation_message'
139
142
  require 'ultracart_api/models/conversation_message_transport_status'
143
+ require 'ultracart_api/models/conversation_multimedia_upload_url'
144
+ require 'ultracart_api/models/conversation_multimedia_upload_url_response'
140
145
  require 'ultracart_api/models/conversation_participant'
146
+ require 'ultracart_api/models/conversation_response'
141
147
  require 'ultracart_api/models/conversation_start_request'
142
148
  require 'ultracart_api/models/conversation_start_response'
143
149
  require 'ultracart_api/models/conversation_summary'
150
+ require 'ultracart_api/models/conversation_websocket_message'
144
151
  require 'ultracart_api/models/conversations_response'
145
152
  require 'ultracart_api/models/countries_response'
146
153
  require 'ultracart_api/models/country'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ultracart_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.10.22
4
+ version: 3.10.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - UltraCart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-20 00:00:00.000000000 Z
11
+ date: 2022-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -250,6 +250,7 @@ files:
250
250
  - docs/AutoOrderItemOption.md
251
251
  - docs/AutoOrderItemSimpleSchedule.md
252
252
  - docs/AutoOrderLog.md
253
+ - docs/AutoOrderManagement.md
253
254
  - docs/AutoOrderQuery.md
254
255
  - docs/AutoOrderQueryBatch.md
255
256
  - docs/AutoOrderResponse.md
@@ -343,14 +344,20 @@ files:
343
344
  - docs/CheckoutStateProvinceResponse.md
344
345
  - docs/CityStateZip.md
345
346
  - docs/Conversation.md
347
+ - docs/ConversationAgentAuth.md
346
348
  - docs/ConversationAgentAuthResponse.md
347
349
  - docs/ConversationApi.md
350
+ - docs/ConversationEventQueuePosition.md
348
351
  - docs/ConversationMessage.md
349
352
  - docs/ConversationMessageTransportStatus.md
353
+ - docs/ConversationMultimediaUploadUrl.md
354
+ - docs/ConversationMultimediaUploadUrlResponse.md
350
355
  - docs/ConversationParticipant.md
356
+ - docs/ConversationResponse.md
351
357
  - docs/ConversationStartRequest.md
352
358
  - docs/ConversationStartResponse.md
353
359
  - docs/ConversationSummary.md
360
+ - docs/ConversationWebsocketMessage.md
354
361
  - docs/ConversationsResponse.md
355
362
  - docs/CountriesResponse.md
356
363
  - docs/Country.md
@@ -934,6 +941,7 @@ files:
934
941
  - lib/ultracart_api/models/auto_order_item_option.rb
935
942
  - lib/ultracart_api/models/auto_order_item_simple_schedule.rb
936
943
  - lib/ultracart_api/models/auto_order_log.rb
944
+ - lib/ultracart_api/models/auto_order_management.rb
937
945
  - lib/ultracart_api/models/auto_order_query.rb
938
946
  - lib/ultracart_api/models/auto_order_query_batch.rb
939
947
  - lib/ultracart_api/models/auto_order_response.rb
@@ -1024,13 +1032,19 @@ files:
1024
1032
  - lib/ultracart_api/models/checkout_state_province_response.rb
1025
1033
  - lib/ultracart_api/models/city_state_zip.rb
1026
1034
  - lib/ultracart_api/models/conversation.rb
1035
+ - lib/ultracart_api/models/conversation_agent_auth.rb
1027
1036
  - lib/ultracart_api/models/conversation_agent_auth_response.rb
1037
+ - lib/ultracart_api/models/conversation_event_queue_position.rb
1028
1038
  - lib/ultracart_api/models/conversation_message.rb
1029
1039
  - lib/ultracart_api/models/conversation_message_transport_status.rb
1040
+ - lib/ultracart_api/models/conversation_multimedia_upload_url.rb
1041
+ - lib/ultracart_api/models/conversation_multimedia_upload_url_response.rb
1030
1042
  - lib/ultracart_api/models/conversation_participant.rb
1043
+ - lib/ultracart_api/models/conversation_response.rb
1031
1044
  - lib/ultracart_api/models/conversation_start_request.rb
1032
1045
  - lib/ultracart_api/models/conversation_start_response.rb
1033
1046
  - lib/ultracart_api/models/conversation_summary.rb
1047
+ - lib/ultracart_api/models/conversation_websocket_message.rb
1034
1048
  - lib/ultracart_api/models/conversations_response.rb
1035
1049
  - lib/ultracart_api/models/countries_response.rb
1036
1050
  - lib/ultracart_api/models/country.rb