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,340 @@
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 ConversationWebsocketMessage
18
+ # Conversation UUID if the websocket message is tied to a specific conversation
19
+ attr_accessor :conversation_uuid
20
+
21
+ attr_accessor :event_conversation_closed
22
+
23
+ attr_accessor :event_new_conversation
24
+
25
+ attr_accessor :event_new_message
26
+
27
+ attr_accessor :event_queue_position
28
+
29
+ # Type of event
30
+ attr_accessor :event_type
31
+
32
+ attr_accessor :event_updated_message
33
+
34
+ attr_accessor :message
35
+
36
+ # Type of message
37
+ attr_accessor :type
38
+
39
+ class EnumAttributeValidator
40
+ attr_reader :datatype
41
+ attr_reader :allowable_values
42
+
43
+ def initialize(datatype, allowable_values)
44
+ @allowable_values = allowable_values.map do |value|
45
+ case datatype.to_s
46
+ when /Integer/i
47
+ value.to_i
48
+ when /Float/i
49
+ value.to_f
50
+ else
51
+ value
52
+ end
53
+ end
54
+ end
55
+
56
+ def valid?(value)
57
+ !value || allowable_values.include?(value)
58
+ end
59
+ end
60
+
61
+ # Attribute mapping from ruby-style variable name to JSON key.
62
+ def self.attribute_map
63
+ {
64
+ :'conversation_uuid' => :'conversation_uuid',
65
+ :'event_conversation_closed' => :'event_conversation_closed',
66
+ :'event_new_conversation' => :'event_new_conversation',
67
+ :'event_new_message' => :'event_new_message',
68
+ :'event_queue_position' => :'event_queue_position',
69
+ :'event_type' => :'event_type',
70
+ :'event_updated_message' => :'event_updated_message',
71
+ :'message' => :'message',
72
+ :'type' => :'type'
73
+ }
74
+ end
75
+
76
+ # Returns all the JSON keys this model knows about
77
+ def self.acceptable_attributes
78
+ attribute_map.values
79
+ end
80
+
81
+ # Attribute type mapping.
82
+ def self.openapi_types
83
+ {
84
+ :'conversation_uuid' => :'String',
85
+ :'event_conversation_closed' => :'Conversation',
86
+ :'event_new_conversation' => :'Conversation',
87
+ :'event_new_message' => :'ConversationMessage',
88
+ :'event_queue_position' => :'Object',
89
+ :'event_type' => :'String',
90
+ :'event_updated_message' => :'ConversationMessage',
91
+ :'message' => :'ConversationMessage',
92
+ :'type' => :'String'
93
+ }
94
+ end
95
+
96
+ # List of attributes with nullable: true
97
+ def self.openapi_nullable
98
+ Set.new([
99
+ ])
100
+ end
101
+
102
+ # Initializes the object
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ def initialize(attributes = {})
105
+ if (!attributes.is_a?(Hash))
106
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationWebsocketMessage` initialize method"
107
+ end
108
+
109
+ # check to see if the attribute exists and convert string to symbol for hash key
110
+ attributes = attributes.each_with_object({}) { |(k, v), h|
111
+ if (!self.class.attribute_map.key?(k.to_sym))
112
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationWebsocketMessage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
113
+ end
114
+ h[k.to_sym] = v
115
+ }
116
+
117
+ if attributes.key?(:'conversation_uuid')
118
+ self.conversation_uuid = attributes[:'conversation_uuid']
119
+ end
120
+
121
+ if attributes.key?(:'event_conversation_closed')
122
+ self.event_conversation_closed = attributes[:'event_conversation_closed']
123
+ end
124
+
125
+ if attributes.key?(:'event_new_conversation')
126
+ self.event_new_conversation = attributes[:'event_new_conversation']
127
+ end
128
+
129
+ if attributes.key?(:'event_new_message')
130
+ self.event_new_message = attributes[:'event_new_message']
131
+ end
132
+
133
+ if attributes.key?(:'event_queue_position')
134
+ self.event_queue_position = attributes[:'event_queue_position']
135
+ end
136
+
137
+ if attributes.key?(:'event_type')
138
+ self.event_type = attributes[:'event_type']
139
+ end
140
+
141
+ if attributes.key?(:'event_updated_message')
142
+ self.event_updated_message = attributes[:'event_updated_message']
143
+ end
144
+
145
+ if attributes.key?(:'message')
146
+ self.message = attributes[:'message']
147
+ end
148
+
149
+ if attributes.key?(:'type')
150
+ self.type = attributes[:'type']
151
+ end
152
+ end
153
+
154
+ # Show invalid properties with the reasons. Usually used together with valid?
155
+ # @return Array for valid properties with the reasons
156
+ def list_invalid_properties
157
+ invalid_properties = Array.new
158
+ invalid_properties
159
+ end
160
+
161
+ # Check to see if the all the properties in the model are valid
162
+ # @return true if the model is valid
163
+ def valid?
164
+ event_type_validator = EnumAttributeValidator.new('String', ["queue position", "webchat start conversation", "conversation closed", "new conversation", "new message", "updated message"])
165
+ return false unless event_type_validator.valid?(@event_type)
166
+ type_validator = EnumAttributeValidator.new('String', ["message", "event", "ping"])
167
+ return false unless type_validator.valid?(@type)
168
+ true
169
+ end
170
+
171
+ # Custom attribute writer method checking allowed values (enum).
172
+ # @param [Object] event_type Object to be assigned
173
+ def event_type=(event_type)
174
+ validator = EnumAttributeValidator.new('String', ["queue position", "webchat start conversation", "conversation closed", "new conversation", "new message", "updated message"])
175
+ unless validator.valid?(event_type)
176
+ fail ArgumentError, "invalid value for \"event_type\", must be one of #{validator.allowable_values}."
177
+ end
178
+ @event_type = event_type
179
+ end
180
+
181
+ # Custom attribute writer method checking allowed values (enum).
182
+ # @param [Object] type Object to be assigned
183
+ def type=(type)
184
+ validator = EnumAttributeValidator.new('String', ["message", "event", "ping"])
185
+ unless validator.valid?(type)
186
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
187
+ end
188
+ @type = type
189
+ end
190
+
191
+ # Checks equality by comparing each attribute.
192
+ # @param [Object] Object to be compared
193
+ def ==(o)
194
+ return true if self.equal?(o)
195
+ self.class == o.class &&
196
+ conversation_uuid == o.conversation_uuid &&
197
+ event_conversation_closed == o.event_conversation_closed &&
198
+ event_new_conversation == o.event_new_conversation &&
199
+ event_new_message == o.event_new_message &&
200
+ event_queue_position == o.event_queue_position &&
201
+ event_type == o.event_type &&
202
+ event_updated_message == o.event_updated_message &&
203
+ message == o.message &&
204
+ type == o.type
205
+ end
206
+
207
+ # @see the `==` method
208
+ # @param [Object] Object to be compared
209
+ def eql?(o)
210
+ self == o
211
+ end
212
+
213
+ # Calculates hash code according to all attributes.
214
+ # @return [Integer] Hash code
215
+ def hash
216
+ [conversation_uuid, event_conversation_closed, event_new_conversation, event_new_message, event_queue_position, event_type, event_updated_message, message, type].hash
217
+ end
218
+
219
+ # Builds the object from hash
220
+ # @param [Hash] attributes Model attributes in the form of hash
221
+ # @return [Object] Returns the model itself
222
+ def self.build_from_hash(attributes)
223
+ new.build_from_hash(attributes)
224
+ end
225
+
226
+ # Builds the object from hash
227
+ # @param [Hash] attributes Model attributes in the form of hash
228
+ # @return [Object] Returns the model itself
229
+ def build_from_hash(attributes)
230
+ return nil unless attributes.is_a?(Hash)
231
+ attributes = attributes.transform_keys(&:to_sym)
232
+ self.class.openapi_types.each_pair do |key, type|
233
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
234
+ self.send("#{key}=", nil)
235
+ elsif type =~ /\AArray<(.*)>/i
236
+ # check to ensure the input is an array given that the attribute
237
+ # is documented as an array but the input is not
238
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
239
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
240
+ end
241
+ elsif !attributes[self.class.attribute_map[key]].nil?
242
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
243
+ end
244
+ end
245
+
246
+ self
247
+ end
248
+
249
+ # Deserializes the data based on type
250
+ # @param string type Data type
251
+ # @param string value Value to be deserialized
252
+ # @return [Object] Deserialized data
253
+ def _deserialize(type, value)
254
+ case type.to_sym
255
+ when :Time
256
+ Time.parse(value)
257
+ when :Date
258
+ Date.parse(value)
259
+ when :String
260
+ value.to_s
261
+ when :Integer
262
+ value.to_i
263
+ when :Float
264
+ value.to_f
265
+ when :Boolean
266
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
267
+ true
268
+ else
269
+ false
270
+ end
271
+ when :Object
272
+ # generic object (usually a Hash), return directly
273
+ value
274
+ when /\AArray<(?<inner_type>.+)>\z/
275
+ inner_type = Regexp.last_match[:inner_type]
276
+ value.map { |v| _deserialize(inner_type, v) }
277
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
278
+ k_type = Regexp.last_match[:k_type]
279
+ v_type = Regexp.last_match[:v_type]
280
+ {}.tap do |hash|
281
+ value.each do |k, v|
282
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
283
+ end
284
+ end
285
+ else # model
286
+ # models (e.g. Pet) or oneOf
287
+ klass = UltracartClient.const_get(type)
288
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
289
+ end
290
+ end
291
+
292
+ # Returns the string representation of the object
293
+ # @return [String] String presentation of the object
294
+ def to_s
295
+ to_hash.to_s
296
+ end
297
+
298
+ # to_body is an alias to to_hash (backward compatibility)
299
+ # @return [Hash] Returns the object in the form of hash
300
+ def to_body
301
+ to_hash
302
+ end
303
+
304
+ # Returns the object in the form of hash
305
+ # @return [Hash] Returns the object in the form of hash
306
+ def to_hash
307
+ hash = {}
308
+ self.class.attribute_map.each_pair do |attr, param|
309
+ value = self.send(attr)
310
+ if value.nil?
311
+ is_nullable = self.class.openapi_nullable.include?(attr)
312
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
313
+ end
314
+
315
+ hash[param] = _to_hash(value)
316
+ end
317
+ hash
318
+ end
319
+
320
+ # Outputs non-array value in the form of hash
321
+ # For object, use to_hash. Otherwise, just return the value
322
+ # @param [Object] value Any valid value
323
+ # @return [Hash] Returns the value in the form of hash
324
+ def _to_hash(value)
325
+ if value.is_a?(Array)
326
+ value.compact.map { |v| _to_hash(v) }
327
+ elsif value.is_a?(Hash)
328
+ {}.tap do |hash|
329
+ value.each { |k, v| hash[k] = _to_hash(v) }
330
+ end
331
+ elsif value.respond_to? :to_hash
332
+ value.to_hash
333
+ else
334
+ value
335
+ end
336
+ end
337
+
338
+ end
339
+
340
+ end
@@ -11,5 +11,5 @@ OpenAPI Generator version: 6.0.1-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module UltracartClient
14
- VERSION = '4.0.37.rc'
14
+ VERSION = '4.0.40.rc'
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,18 @@ 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'
138
140
  require 'ultracart_api/models/conversation_message'
139
141
  require 'ultracart_api/models/conversation_message_transport_status'
142
+ require 'ultracart_api/models/conversation_multimedia_upload_url'
143
+ require 'ultracart_api/models/conversation_multimedia_upload_url_response'
140
144
  require 'ultracart_api/models/conversation_participant'
145
+ require 'ultracart_api/models/conversation_response'
141
146
  require 'ultracart_api/models/conversation_start_request'
142
147
  require 'ultracart_api/models/conversation_start_response'
143
148
  require 'ultracart_api/models/conversation_summary'
149
+ require 'ultracart_api/models/conversation_websocket_message'
144
150
  require 'ultracart_api/models/conversations_response'
145
151
  require 'ultracart_api/models/countries_response'
146
152
  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: 4.0.37.rc
4
+ version: 4.0.40.rc
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
@@ -90,6 +90,7 @@ files:
90
90
  - docs/AutoOrderItemOption.md
91
91
  - docs/AutoOrderItemSimpleSchedule.md
92
92
  - docs/AutoOrderLog.md
93
+ - docs/AutoOrderManagement.md
93
94
  - docs/AutoOrderQuery.md
94
95
  - docs/AutoOrderQueryBatch.md
95
96
  - docs/AutoOrderResponse.md
@@ -183,14 +184,19 @@ files:
183
184
  - docs/CheckoutStateProvinceResponse.md
184
185
  - docs/CityStateZip.md
185
186
  - docs/Conversation.md
187
+ - docs/ConversationAgentAuth.md
186
188
  - docs/ConversationAgentAuthResponse.md
187
189
  - docs/ConversationApi.md
188
190
  - docs/ConversationMessage.md
189
191
  - docs/ConversationMessageTransportStatus.md
192
+ - docs/ConversationMultimediaUploadUrl.md
193
+ - docs/ConversationMultimediaUploadUrlResponse.md
190
194
  - docs/ConversationParticipant.md
195
+ - docs/ConversationResponse.md
191
196
  - docs/ConversationStartRequest.md
192
197
  - docs/ConversationStartResponse.md
193
198
  - docs/ConversationSummary.md
199
+ - docs/ConversationWebsocketMessage.md
194
200
  - docs/ConversationsResponse.md
195
201
  - docs/CountriesResponse.md
196
202
  - docs/Country.md
@@ -773,6 +779,7 @@ files:
773
779
  - lib/ultracart_api/models/auto_order_item_option.rb
774
780
  - lib/ultracart_api/models/auto_order_item_simple_schedule.rb
775
781
  - lib/ultracart_api/models/auto_order_log.rb
782
+ - lib/ultracart_api/models/auto_order_management.rb
776
783
  - lib/ultracart_api/models/auto_order_query.rb
777
784
  - lib/ultracart_api/models/auto_order_query_batch.rb
778
785
  - lib/ultracart_api/models/auto_order_response.rb
@@ -863,13 +870,18 @@ files:
863
870
  - lib/ultracart_api/models/checkout_state_province_response.rb
864
871
  - lib/ultracart_api/models/city_state_zip.rb
865
872
  - lib/ultracart_api/models/conversation.rb
873
+ - lib/ultracart_api/models/conversation_agent_auth.rb
866
874
  - lib/ultracart_api/models/conversation_agent_auth_response.rb
867
875
  - lib/ultracart_api/models/conversation_message.rb
868
876
  - lib/ultracart_api/models/conversation_message_transport_status.rb
877
+ - lib/ultracart_api/models/conversation_multimedia_upload_url.rb
878
+ - lib/ultracart_api/models/conversation_multimedia_upload_url_response.rb
869
879
  - lib/ultracart_api/models/conversation_participant.rb
880
+ - lib/ultracart_api/models/conversation_response.rb
870
881
  - lib/ultracart_api/models/conversation_start_request.rb
871
882
  - lib/ultracart_api/models/conversation_start_response.rb
872
883
  - lib/ultracart_api/models/conversation_summary.rb
884
+ - lib/ultracart_api/models/conversation_websocket_message.rb
873
885
  - lib/ultracart_api/models/conversations_response.rb
874
886
  - lib/ultracart_api/models/countries_response.rb
875
887
  - lib/ultracart_api/models/country.rb