ultracart_api 4.0.137 → 4.0.139
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.
- checksums.yaml +4 -4
- data/README.md +10 -4
- data/docs/Conversation.md +2 -0
- data/docs/ConversationSentiment.md +28 -0
- data/docs/ConversationSummary.md +2 -0
- data/docs/OrderApi.md +72 -0
- data/docs/OrderEdiDocument.md +44 -0
- data/docs/OrderEdiDocumentsResponse.md +26 -0
- data/lib/ultracart_api/api/order_api.rb +64 -0
- data/lib/ultracart_api/models/conversation.rb +10 -1
- data/lib/ultracart_api/models/conversation_sentiment.rb +304 -0
- data/lib/ultracart_api/models/conversation_summary.rb +10 -1
- data/lib/ultracart_api/models/order_edi_document.rb +372 -0
- data/lib/ultracart_api/models/order_edi_documents_response.rb +259 -0
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +3 -0
- metadata +8 -2
@@ -0,0 +1,372 @@
|
|
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 OrderEdiDocument
|
18
|
+
# Direction the document flowed
|
19
|
+
attr_accessor :direction
|
20
|
+
|
21
|
+
# Date/time the document was created/received
|
22
|
+
attr_accessor :doc_dts
|
23
|
+
|
24
|
+
attr_accessor :document
|
25
|
+
|
26
|
+
attr_accessor :document_type_description
|
27
|
+
|
28
|
+
attr_accessor :document_type_number
|
29
|
+
|
30
|
+
attr_accessor :external_id
|
31
|
+
|
32
|
+
attr_accessor :functional_acknowledgement
|
33
|
+
|
34
|
+
attr_accessor :functional_acknowledgement_dts
|
35
|
+
|
36
|
+
attr_accessor :functional_acknowledgement_pending
|
37
|
+
|
38
|
+
attr_accessor :group_control_number
|
39
|
+
|
40
|
+
attr_accessor :internal_id
|
41
|
+
|
42
|
+
attr_accessor :merchant_id
|
43
|
+
|
44
|
+
attr_accessor :order_id
|
45
|
+
|
46
|
+
attr_accessor :test_mode
|
47
|
+
|
48
|
+
class EnumAttributeValidator
|
49
|
+
attr_reader :datatype
|
50
|
+
attr_reader :allowable_values
|
51
|
+
|
52
|
+
def initialize(datatype, allowable_values)
|
53
|
+
@allowable_values = allowable_values.map do |value|
|
54
|
+
case datatype.to_s
|
55
|
+
when /Integer/i
|
56
|
+
value.to_i
|
57
|
+
when /Float/i
|
58
|
+
value.to_f
|
59
|
+
else
|
60
|
+
value
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def valid?(value)
|
66
|
+
!value || allowable_values.include?(value)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
71
|
+
def self.attribute_map
|
72
|
+
{
|
73
|
+
:'direction' => :'direction',
|
74
|
+
:'doc_dts' => :'doc_dts',
|
75
|
+
:'document' => :'document',
|
76
|
+
:'document_type_description' => :'document_type_description',
|
77
|
+
:'document_type_number' => :'document_type_number',
|
78
|
+
:'external_id' => :'external_id',
|
79
|
+
:'functional_acknowledgement' => :'functional_acknowledgement',
|
80
|
+
:'functional_acknowledgement_dts' => :'functional_acknowledgement_dts',
|
81
|
+
:'functional_acknowledgement_pending' => :'functional_acknowledgement_pending',
|
82
|
+
:'group_control_number' => :'group_control_number',
|
83
|
+
:'internal_id' => :'internal_id',
|
84
|
+
:'merchant_id' => :'merchant_id',
|
85
|
+
:'order_id' => :'order_id',
|
86
|
+
:'test_mode' => :'test_mode'
|
87
|
+
}
|
88
|
+
end
|
89
|
+
|
90
|
+
# Returns all the JSON keys this model knows about
|
91
|
+
def self.acceptable_attributes
|
92
|
+
attribute_map.values
|
93
|
+
end
|
94
|
+
|
95
|
+
# Attribute type mapping.
|
96
|
+
def self.openapi_types
|
97
|
+
{
|
98
|
+
:'direction' => :'String',
|
99
|
+
:'doc_dts' => :'String',
|
100
|
+
:'document' => :'String',
|
101
|
+
:'document_type_description' => :'String',
|
102
|
+
:'document_type_number' => :'Integer',
|
103
|
+
:'external_id' => :'String',
|
104
|
+
:'functional_acknowledgement' => :'String',
|
105
|
+
:'functional_acknowledgement_dts' => :'String',
|
106
|
+
:'functional_acknowledgement_pending' => :'Boolean',
|
107
|
+
:'group_control_number' => :'Integer',
|
108
|
+
:'internal_id' => :'String',
|
109
|
+
:'merchant_id' => :'String',
|
110
|
+
:'order_id' => :'String',
|
111
|
+
:'test_mode' => :'Boolean'
|
112
|
+
}
|
113
|
+
end
|
114
|
+
|
115
|
+
# List of attributes with nullable: true
|
116
|
+
def self.openapi_nullable
|
117
|
+
Set.new([
|
118
|
+
])
|
119
|
+
end
|
120
|
+
|
121
|
+
# Initializes the object
|
122
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
123
|
+
def initialize(attributes = {})
|
124
|
+
if (!attributes.is_a?(Hash))
|
125
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::OrderEdiDocument` initialize method"
|
126
|
+
end
|
127
|
+
|
128
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
129
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
130
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
131
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::OrderEdiDocument`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
132
|
+
end
|
133
|
+
h[k.to_sym] = v
|
134
|
+
}
|
135
|
+
|
136
|
+
if attributes.key?(:'direction')
|
137
|
+
self.direction = attributes[:'direction']
|
138
|
+
end
|
139
|
+
|
140
|
+
if attributes.key?(:'doc_dts')
|
141
|
+
self.doc_dts = attributes[:'doc_dts']
|
142
|
+
end
|
143
|
+
|
144
|
+
if attributes.key?(:'document')
|
145
|
+
self.document = attributes[:'document']
|
146
|
+
end
|
147
|
+
|
148
|
+
if attributes.key?(:'document_type_description')
|
149
|
+
self.document_type_description = attributes[:'document_type_description']
|
150
|
+
end
|
151
|
+
|
152
|
+
if attributes.key?(:'document_type_number')
|
153
|
+
self.document_type_number = attributes[:'document_type_number']
|
154
|
+
end
|
155
|
+
|
156
|
+
if attributes.key?(:'external_id')
|
157
|
+
self.external_id = attributes[:'external_id']
|
158
|
+
end
|
159
|
+
|
160
|
+
if attributes.key?(:'functional_acknowledgement')
|
161
|
+
self.functional_acknowledgement = attributes[:'functional_acknowledgement']
|
162
|
+
end
|
163
|
+
|
164
|
+
if attributes.key?(:'functional_acknowledgement_dts')
|
165
|
+
self.functional_acknowledgement_dts = attributes[:'functional_acknowledgement_dts']
|
166
|
+
end
|
167
|
+
|
168
|
+
if attributes.key?(:'functional_acknowledgement_pending')
|
169
|
+
self.functional_acknowledgement_pending = attributes[:'functional_acknowledgement_pending']
|
170
|
+
end
|
171
|
+
|
172
|
+
if attributes.key?(:'group_control_number')
|
173
|
+
self.group_control_number = attributes[:'group_control_number']
|
174
|
+
end
|
175
|
+
|
176
|
+
if attributes.key?(:'internal_id')
|
177
|
+
self.internal_id = attributes[:'internal_id']
|
178
|
+
end
|
179
|
+
|
180
|
+
if attributes.key?(:'merchant_id')
|
181
|
+
self.merchant_id = attributes[:'merchant_id']
|
182
|
+
end
|
183
|
+
|
184
|
+
if attributes.key?(:'order_id')
|
185
|
+
self.order_id = attributes[:'order_id']
|
186
|
+
end
|
187
|
+
|
188
|
+
if attributes.key?(:'test_mode')
|
189
|
+
self.test_mode = attributes[:'test_mode']
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
194
|
+
# @return Array for valid properties with the reasons
|
195
|
+
def list_invalid_properties
|
196
|
+
invalid_properties = Array.new
|
197
|
+
invalid_properties
|
198
|
+
end
|
199
|
+
|
200
|
+
# Check to see if the all the properties in the model are valid
|
201
|
+
# @return true if the model is valid
|
202
|
+
def valid?
|
203
|
+
direction_validator = EnumAttributeValidator.new('String', ["inbound", "outbound"])
|
204
|
+
return false unless direction_validator.valid?(@direction)
|
205
|
+
true
|
206
|
+
end
|
207
|
+
|
208
|
+
# Custom attribute writer method checking allowed values (enum).
|
209
|
+
# @param [Object] direction Object to be assigned
|
210
|
+
def direction=(direction)
|
211
|
+
validator = EnumAttributeValidator.new('String', ["inbound", "outbound"])
|
212
|
+
unless validator.valid?(direction)
|
213
|
+
fail ArgumentError, "invalid value for \"direction\", must be one of #{validator.allowable_values}."
|
214
|
+
end
|
215
|
+
@direction = direction
|
216
|
+
end
|
217
|
+
|
218
|
+
# Checks equality by comparing each attribute.
|
219
|
+
# @param [Object] Object to be compared
|
220
|
+
def ==(o)
|
221
|
+
return true if self.equal?(o)
|
222
|
+
self.class == o.class &&
|
223
|
+
direction == o.direction &&
|
224
|
+
doc_dts == o.doc_dts &&
|
225
|
+
document == o.document &&
|
226
|
+
document_type_description == o.document_type_description &&
|
227
|
+
document_type_number == o.document_type_number &&
|
228
|
+
external_id == o.external_id &&
|
229
|
+
functional_acknowledgement == o.functional_acknowledgement &&
|
230
|
+
functional_acknowledgement_dts == o.functional_acknowledgement_dts &&
|
231
|
+
functional_acknowledgement_pending == o.functional_acknowledgement_pending &&
|
232
|
+
group_control_number == o.group_control_number &&
|
233
|
+
internal_id == o.internal_id &&
|
234
|
+
merchant_id == o.merchant_id &&
|
235
|
+
order_id == o.order_id &&
|
236
|
+
test_mode == o.test_mode
|
237
|
+
end
|
238
|
+
|
239
|
+
# @see the `==` method
|
240
|
+
# @param [Object] Object to be compared
|
241
|
+
def eql?(o)
|
242
|
+
self == o
|
243
|
+
end
|
244
|
+
|
245
|
+
# Calculates hash code according to all attributes.
|
246
|
+
# @return [Integer] Hash code
|
247
|
+
def hash
|
248
|
+
[direction, doc_dts, document, document_type_description, document_type_number, external_id, functional_acknowledgement, functional_acknowledgement_dts, functional_acknowledgement_pending, group_control_number, internal_id, merchant_id, order_id, test_mode].hash
|
249
|
+
end
|
250
|
+
|
251
|
+
# Builds the object from hash
|
252
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
253
|
+
# @return [Object] Returns the model itself
|
254
|
+
def self.build_from_hash(attributes)
|
255
|
+
new.build_from_hash(attributes)
|
256
|
+
end
|
257
|
+
|
258
|
+
# Builds the object from hash
|
259
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
260
|
+
# @return [Object] Returns the model itself
|
261
|
+
def build_from_hash(attributes)
|
262
|
+
return nil unless attributes.is_a?(Hash)
|
263
|
+
attributes = attributes.transform_keys(&:to_sym)
|
264
|
+
self.class.openapi_types.each_pair do |key, type|
|
265
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
266
|
+
self.send("#{key}=", nil)
|
267
|
+
elsif type =~ /\AArray<(.*)>/i
|
268
|
+
# check to ensure the input is an array given that the attribute
|
269
|
+
# is documented as an array but the input is not
|
270
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
271
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
272
|
+
end
|
273
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
274
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
275
|
+
end
|
276
|
+
end
|
277
|
+
|
278
|
+
self
|
279
|
+
end
|
280
|
+
|
281
|
+
# Deserializes the data based on type
|
282
|
+
# @param string type Data type
|
283
|
+
# @param string value Value to be deserialized
|
284
|
+
# @return [Object] Deserialized data
|
285
|
+
def _deserialize(type, value)
|
286
|
+
case type.to_sym
|
287
|
+
when :Time
|
288
|
+
Time.parse(value)
|
289
|
+
when :Date
|
290
|
+
Date.parse(value)
|
291
|
+
when :String
|
292
|
+
value.to_s
|
293
|
+
when :Integer
|
294
|
+
value.to_i
|
295
|
+
when :Float
|
296
|
+
value.to_f
|
297
|
+
when :Boolean
|
298
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
299
|
+
true
|
300
|
+
else
|
301
|
+
false
|
302
|
+
end
|
303
|
+
when :Object
|
304
|
+
# generic object (usually a Hash), return directly
|
305
|
+
value
|
306
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
307
|
+
inner_type = Regexp.last_match[:inner_type]
|
308
|
+
value.map { |v| _deserialize(inner_type, v) }
|
309
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
310
|
+
k_type = Regexp.last_match[:k_type]
|
311
|
+
v_type = Regexp.last_match[:v_type]
|
312
|
+
{}.tap do |hash|
|
313
|
+
value.each do |k, v|
|
314
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
315
|
+
end
|
316
|
+
end
|
317
|
+
else # model
|
318
|
+
# models (e.g. Pet) or oneOf
|
319
|
+
klass = UltracartClient.const_get(type)
|
320
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
321
|
+
end
|
322
|
+
end
|
323
|
+
|
324
|
+
# Returns the string representation of the object
|
325
|
+
# @return [String] String presentation of the object
|
326
|
+
def to_s
|
327
|
+
to_hash.to_s
|
328
|
+
end
|
329
|
+
|
330
|
+
# to_body is an alias to to_hash (backward compatibility)
|
331
|
+
# @return [Hash] Returns the object in the form of hash
|
332
|
+
def to_body
|
333
|
+
to_hash
|
334
|
+
end
|
335
|
+
|
336
|
+
# Returns the object in the form of hash
|
337
|
+
# @return [Hash] Returns the object in the form of hash
|
338
|
+
def to_hash
|
339
|
+
hash = {}
|
340
|
+
self.class.attribute_map.each_pair do |attr, param|
|
341
|
+
value = self.send(attr)
|
342
|
+
if value.nil?
|
343
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
344
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
345
|
+
end
|
346
|
+
|
347
|
+
hash[param] = _to_hash(value)
|
348
|
+
end
|
349
|
+
hash
|
350
|
+
end
|
351
|
+
|
352
|
+
# Outputs non-array value in the form of hash
|
353
|
+
# For object, use to_hash. Otherwise, just return the value
|
354
|
+
# @param [Object] value Any valid value
|
355
|
+
# @return [Hash] Returns the value in the form of hash
|
356
|
+
def _to_hash(value)
|
357
|
+
if value.is_a?(Array)
|
358
|
+
value.compact.map { |v| _to_hash(v) }
|
359
|
+
elsif value.is_a?(Hash)
|
360
|
+
{}.tap do |hash|
|
361
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
362
|
+
end
|
363
|
+
elsif value.respond_to? :to_hash
|
364
|
+
value.to_hash
|
365
|
+
else
|
366
|
+
value
|
367
|
+
end
|
368
|
+
end
|
369
|
+
|
370
|
+
end
|
371
|
+
|
372
|
+
end
|
@@ -0,0 +1,259 @@
|
|
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 OrderEdiDocumentsResponse
|
18
|
+
# edi_documents
|
19
|
+
attr_accessor :edi_documents
|
20
|
+
|
21
|
+
attr_accessor :error
|
22
|
+
|
23
|
+
attr_accessor :metadata
|
24
|
+
|
25
|
+
# Indicates if API call was successful
|
26
|
+
attr_accessor :success
|
27
|
+
|
28
|
+
attr_accessor :warning
|
29
|
+
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
31
|
+
def self.attribute_map
|
32
|
+
{
|
33
|
+
:'edi_documents' => :'ediDocuments',
|
34
|
+
:'error' => :'error',
|
35
|
+
:'metadata' => :'metadata',
|
36
|
+
:'success' => :'success',
|
37
|
+
:'warning' => :'warning'
|
38
|
+
}
|
39
|
+
end
|
40
|
+
|
41
|
+
# Returns all the JSON keys this model knows about
|
42
|
+
def self.acceptable_attributes
|
43
|
+
attribute_map.values
|
44
|
+
end
|
45
|
+
|
46
|
+
# Attribute type mapping.
|
47
|
+
def self.openapi_types
|
48
|
+
{
|
49
|
+
:'edi_documents' => :'Array<OrderEdiDocument>',
|
50
|
+
:'error' => :'Error',
|
51
|
+
:'metadata' => :'ResponseMetadata',
|
52
|
+
:'success' => :'Boolean',
|
53
|
+
:'warning' => :'Warning'
|
54
|
+
}
|
55
|
+
end
|
56
|
+
|
57
|
+
# List of attributes with nullable: true
|
58
|
+
def self.openapi_nullable
|
59
|
+
Set.new([
|
60
|
+
])
|
61
|
+
end
|
62
|
+
|
63
|
+
# Initializes the object
|
64
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
65
|
+
def initialize(attributes = {})
|
66
|
+
if (!attributes.is_a?(Hash))
|
67
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::OrderEdiDocumentsResponse` initialize method"
|
68
|
+
end
|
69
|
+
|
70
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
71
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
72
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::OrderEdiDocumentsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
74
|
+
end
|
75
|
+
h[k.to_sym] = v
|
76
|
+
}
|
77
|
+
|
78
|
+
if attributes.key?(:'edi_documents')
|
79
|
+
if (value = attributes[:'edi_documents']).is_a?(Array)
|
80
|
+
self.edi_documents = value
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
if attributes.key?(:'error')
|
85
|
+
self.error = attributes[:'error']
|
86
|
+
end
|
87
|
+
|
88
|
+
if attributes.key?(:'metadata')
|
89
|
+
self.metadata = attributes[:'metadata']
|
90
|
+
end
|
91
|
+
|
92
|
+
if attributes.key?(:'success')
|
93
|
+
self.success = attributes[:'success']
|
94
|
+
end
|
95
|
+
|
96
|
+
if attributes.key?(:'warning')
|
97
|
+
self.warning = attributes[:'warning']
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
102
|
+
# @return Array for valid properties with the reasons
|
103
|
+
def list_invalid_properties
|
104
|
+
invalid_properties = Array.new
|
105
|
+
invalid_properties
|
106
|
+
end
|
107
|
+
|
108
|
+
# Check to see if the all the properties in the model are valid
|
109
|
+
# @return true if the model is valid
|
110
|
+
def valid?
|
111
|
+
true
|
112
|
+
end
|
113
|
+
|
114
|
+
# Checks equality by comparing each attribute.
|
115
|
+
# @param [Object] Object to be compared
|
116
|
+
def ==(o)
|
117
|
+
return true if self.equal?(o)
|
118
|
+
self.class == o.class &&
|
119
|
+
edi_documents == o.edi_documents &&
|
120
|
+
error == o.error &&
|
121
|
+
metadata == o.metadata &&
|
122
|
+
success == o.success &&
|
123
|
+
warning == o.warning
|
124
|
+
end
|
125
|
+
|
126
|
+
# @see the `==` method
|
127
|
+
# @param [Object] Object to be compared
|
128
|
+
def eql?(o)
|
129
|
+
self == o
|
130
|
+
end
|
131
|
+
|
132
|
+
# Calculates hash code according to all attributes.
|
133
|
+
# @return [Integer] Hash code
|
134
|
+
def hash
|
135
|
+
[edi_documents, error, metadata, success, warning].hash
|
136
|
+
end
|
137
|
+
|
138
|
+
# Builds the object from hash
|
139
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
140
|
+
# @return [Object] Returns the model itself
|
141
|
+
def self.build_from_hash(attributes)
|
142
|
+
new.build_from_hash(attributes)
|
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 build_from_hash(attributes)
|
149
|
+
return nil unless attributes.is_a?(Hash)
|
150
|
+
attributes = attributes.transform_keys(&:to_sym)
|
151
|
+
self.class.openapi_types.each_pair do |key, type|
|
152
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
153
|
+
self.send("#{key}=", nil)
|
154
|
+
elsif type =~ /\AArray<(.*)>/i
|
155
|
+
# check to ensure the input is an array given that the attribute
|
156
|
+
# is documented as an array but the input is not
|
157
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
158
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
159
|
+
end
|
160
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
161
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
self
|
166
|
+
end
|
167
|
+
|
168
|
+
# Deserializes the data based on type
|
169
|
+
# @param string type Data type
|
170
|
+
# @param string value Value to be deserialized
|
171
|
+
# @return [Object] Deserialized data
|
172
|
+
def _deserialize(type, value)
|
173
|
+
case type.to_sym
|
174
|
+
when :Time
|
175
|
+
Time.parse(value)
|
176
|
+
when :Date
|
177
|
+
Date.parse(value)
|
178
|
+
when :String
|
179
|
+
value.to_s
|
180
|
+
when :Integer
|
181
|
+
value.to_i
|
182
|
+
when :Float
|
183
|
+
value.to_f
|
184
|
+
when :Boolean
|
185
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
186
|
+
true
|
187
|
+
else
|
188
|
+
false
|
189
|
+
end
|
190
|
+
when :Object
|
191
|
+
# generic object (usually a Hash), return directly
|
192
|
+
value
|
193
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
194
|
+
inner_type = Regexp.last_match[:inner_type]
|
195
|
+
value.map { |v| _deserialize(inner_type, v) }
|
196
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
197
|
+
k_type = Regexp.last_match[:k_type]
|
198
|
+
v_type = Regexp.last_match[:v_type]
|
199
|
+
{}.tap do |hash|
|
200
|
+
value.each do |k, v|
|
201
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
202
|
+
end
|
203
|
+
end
|
204
|
+
else # model
|
205
|
+
# models (e.g. Pet) or oneOf
|
206
|
+
klass = UltracartClient.const_get(type)
|
207
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
# Returns the string representation of the object
|
212
|
+
# @return [String] String presentation of the object
|
213
|
+
def to_s
|
214
|
+
to_hash.to_s
|
215
|
+
end
|
216
|
+
|
217
|
+
# to_body is an alias to to_hash (backward compatibility)
|
218
|
+
# @return [Hash] Returns the object in the form of hash
|
219
|
+
def to_body
|
220
|
+
to_hash
|
221
|
+
end
|
222
|
+
|
223
|
+
# Returns the object in the form of hash
|
224
|
+
# @return [Hash] Returns the object in the form of hash
|
225
|
+
def to_hash
|
226
|
+
hash = {}
|
227
|
+
self.class.attribute_map.each_pair do |attr, param|
|
228
|
+
value = self.send(attr)
|
229
|
+
if value.nil?
|
230
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
231
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
232
|
+
end
|
233
|
+
|
234
|
+
hash[param] = _to_hash(value)
|
235
|
+
end
|
236
|
+
hash
|
237
|
+
end
|
238
|
+
|
239
|
+
# Outputs non-array value in the form of hash
|
240
|
+
# For object, use to_hash. Otherwise, just return the value
|
241
|
+
# @param [Object] value Any valid value
|
242
|
+
# @return [Hash] Returns the value in the form of hash
|
243
|
+
def _to_hash(value)
|
244
|
+
if value.is_a?(Array)
|
245
|
+
value.compact.map { |v| _to_hash(v) }
|
246
|
+
elsif value.is_a?(Hash)
|
247
|
+
{}.tap do |hash|
|
248
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
249
|
+
end
|
250
|
+
elsif value.respond_to? :to_hash
|
251
|
+
value.to_hash
|
252
|
+
else
|
253
|
+
value
|
254
|
+
end
|
255
|
+
end
|
256
|
+
|
257
|
+
end
|
258
|
+
|
259
|
+
end
|
data/lib/ultracart_api.rb
CHANGED
@@ -186,6 +186,7 @@ require 'ultracart_api/models/conversation_permissions_response'
|
|
186
186
|
require 'ultracart_api/models/conversation_response'
|
187
187
|
require 'ultracart_api/models/conversation_search_request'
|
188
188
|
require 'ultracart_api/models/conversation_search_response'
|
189
|
+
require 'ultracart_api/models/conversation_sentiment'
|
189
190
|
require 'ultracart_api/models/conversation_start_request'
|
190
191
|
require 'ultracart_api/models/conversation_start_response'
|
191
192
|
require 'ultracart_api/models/conversation_summary'
|
@@ -576,6 +577,8 @@ require 'ultracart_api/models/order_coupon'
|
|
576
577
|
require 'ultracart_api/models/order_digital_item'
|
577
578
|
require 'ultracart_api/models/order_digital_order'
|
578
579
|
require 'ultracart_api/models/order_edi'
|
580
|
+
require 'ultracart_api/models/order_edi_document'
|
581
|
+
require 'ultracart_api/models/order_edi_documents_response'
|
579
582
|
require 'ultracart_api/models/order_format'
|
580
583
|
require 'ultracart_api/models/order_format_response'
|
581
584
|
require 'ultracart_api/models/order_fraud_score'
|
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.
|
4
|
+
version: 4.0.139
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- UltraCart
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -236,6 +236,7 @@ files:
|
|
236
236
|
- docs/ConversationResponse.md
|
237
237
|
- docs/ConversationSearchRequest.md
|
238
238
|
- docs/ConversationSearchResponse.md
|
239
|
+
- docs/ConversationSentiment.md
|
239
240
|
- docs/ConversationStartRequest.md
|
240
241
|
- docs/ConversationStartResponse.md
|
241
242
|
- docs/ConversationSummary.md
|
@@ -634,6 +635,8 @@ files:
|
|
634
635
|
- docs/OrderDigitalItem.md
|
635
636
|
- docs/OrderDigitalOrder.md
|
636
637
|
- docs/OrderEdi.md
|
638
|
+
- docs/OrderEdiDocument.md
|
639
|
+
- docs/OrderEdiDocumentsResponse.md
|
637
640
|
- docs/OrderFormat.md
|
638
641
|
- docs/OrderFormatResponse.md
|
639
642
|
- docs/OrderFraudScore.md
|
@@ -1012,6 +1015,7 @@ files:
|
|
1012
1015
|
- lib/ultracart_api/models/conversation_response.rb
|
1013
1016
|
- lib/ultracart_api/models/conversation_search_request.rb
|
1014
1017
|
- lib/ultracart_api/models/conversation_search_response.rb
|
1018
|
+
- lib/ultracart_api/models/conversation_sentiment.rb
|
1015
1019
|
- lib/ultracart_api/models/conversation_start_request.rb
|
1016
1020
|
- lib/ultracart_api/models/conversation_start_response.rb
|
1017
1021
|
- lib/ultracart_api/models/conversation_summary.rb
|
@@ -1402,6 +1406,8 @@ files:
|
|
1402
1406
|
- lib/ultracart_api/models/order_digital_item.rb
|
1403
1407
|
- lib/ultracart_api/models/order_digital_order.rb
|
1404
1408
|
- lib/ultracart_api/models/order_edi.rb
|
1409
|
+
- lib/ultracart_api/models/order_edi_document.rb
|
1410
|
+
- lib/ultracart_api/models/order_edi_documents_response.rb
|
1405
1411
|
- lib/ultracart_api/models/order_format.rb
|
1406
1412
|
- lib/ultracart_api/models/order_format_response.rb
|
1407
1413
|
- lib/ultracart_api/models/order_fraud_score.rb
|