ultracart_api 4.0.67.rc → 4.0.69.rc

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.
@@ -0,0 +1,256 @@
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 FileManagerUploadUrlResponse
18
+ attr_accessor :error
19
+
20
+ attr_accessor :key
21
+
22
+ attr_accessor :metadata
23
+
24
+ # Indicates if API call was successful
25
+ attr_accessor :success
26
+
27
+ attr_accessor :warning
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'error' => :'error',
33
+ :'key' => :'key',
34
+ :'metadata' => :'metadata',
35
+ :'success' => :'success',
36
+ :'warning' => :'warning'
37
+ }
38
+ end
39
+
40
+ # Returns all the JSON keys this model knows about
41
+ def self.acceptable_attributes
42
+ attribute_map.values
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'error' => :'Error',
49
+ :'key' => :'String',
50
+ :'metadata' => :'ResponseMetadata',
51
+ :'success' => :'Boolean',
52
+ :'warning' => :'Warning'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::FileManagerUploadUrlResponse` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!self.class.attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::FileManagerUploadUrlResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'error')
78
+ self.error = attributes[:'error']
79
+ end
80
+
81
+ if attributes.key?(:'key')
82
+ self.key = attributes[:'key']
83
+ end
84
+
85
+ if attributes.key?(:'metadata')
86
+ self.metadata = attributes[:'metadata']
87
+ end
88
+
89
+ if attributes.key?(:'success')
90
+ self.success = attributes[:'success']
91
+ end
92
+
93
+ if attributes.key?(:'warning')
94
+ self.warning = attributes[:'warning']
95
+ end
96
+ end
97
+
98
+ # Show invalid properties with the reasons. Usually used together with valid?
99
+ # @return Array for valid properties with the reasons
100
+ def list_invalid_properties
101
+ invalid_properties = Array.new
102
+ invalid_properties
103
+ end
104
+
105
+ # Check to see if the all the properties in the model are valid
106
+ # @return true if the model is valid
107
+ def valid?
108
+ true
109
+ end
110
+
111
+ # Checks equality by comparing each attribute.
112
+ # @param [Object] Object to be compared
113
+ def ==(o)
114
+ return true if self.equal?(o)
115
+ self.class == o.class &&
116
+ error == o.error &&
117
+ key == o.key &&
118
+ metadata == o.metadata &&
119
+ success == o.success &&
120
+ warning == o.warning
121
+ end
122
+
123
+ # @see the `==` method
124
+ # @param [Object] Object to be compared
125
+ def eql?(o)
126
+ self == o
127
+ end
128
+
129
+ # Calculates hash code according to all attributes.
130
+ # @return [Integer] Hash code
131
+ def hash
132
+ [error, key, metadata, success, warning].hash
133
+ end
134
+
135
+ # Builds the object from hash
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ # @return [Object] Returns the model itself
138
+ def self.build_from_hash(attributes)
139
+ new.build_from_hash(attributes)
140
+ end
141
+
142
+ # Builds the object from hash
143
+ # @param [Hash] attributes Model attributes in the form of hash
144
+ # @return [Object] Returns the model itself
145
+ def build_from_hash(attributes)
146
+ return nil unless attributes.is_a?(Hash)
147
+ attributes = attributes.transform_keys(&:to_sym)
148
+ self.class.openapi_types.each_pair do |key, type|
149
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
150
+ self.send("#{key}=", nil)
151
+ elsif type =~ /\AArray<(.*)>/i
152
+ # check to ensure the input is an array given that the attribute
153
+ # is documented as an array but the input is not
154
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
155
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
156
+ end
157
+ elsif !attributes[self.class.attribute_map[key]].nil?
158
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
159
+ end
160
+ end
161
+
162
+ self
163
+ end
164
+
165
+ # Deserializes the data based on type
166
+ # @param string type Data type
167
+ # @param string value Value to be deserialized
168
+ # @return [Object] Deserialized data
169
+ def _deserialize(type, value)
170
+ case type.to_sym
171
+ when :Time
172
+ Time.parse(value)
173
+ when :Date
174
+ Date.parse(value)
175
+ when :String
176
+ value.to_s
177
+ when :Integer
178
+ value.to_i
179
+ when :Float
180
+ value.to_f
181
+ when :Boolean
182
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
183
+ true
184
+ else
185
+ false
186
+ end
187
+ when :Object
188
+ # generic object (usually a Hash), return directly
189
+ value
190
+ when /\AArray<(?<inner_type>.+)>\z/
191
+ inner_type = Regexp.last_match[:inner_type]
192
+ value.map { |v| _deserialize(inner_type, v) }
193
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
194
+ k_type = Regexp.last_match[:k_type]
195
+ v_type = Regexp.last_match[:v_type]
196
+ {}.tap do |hash|
197
+ value.each do |k, v|
198
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
199
+ end
200
+ end
201
+ else # model
202
+ # models (e.g. Pet) or oneOf
203
+ klass = UltracartClient.const_get(type)
204
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
205
+ end
206
+ end
207
+
208
+ # Returns the string representation of the object
209
+ # @return [String] String presentation of the object
210
+ def to_s
211
+ to_hash.to_s
212
+ end
213
+
214
+ # to_body is an alias to to_hash (backward compatibility)
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_body
217
+ to_hash
218
+ end
219
+
220
+ # Returns the object in the form of hash
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_hash
223
+ hash = {}
224
+ self.class.attribute_map.each_pair do |attr, param|
225
+ value = self.send(attr)
226
+ if value.nil?
227
+ is_nullable = self.class.openapi_nullable.include?(attr)
228
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
229
+ end
230
+
231
+ hash[param] = _to_hash(value)
232
+ end
233
+ hash
234
+ end
235
+
236
+ # Outputs non-array value in the form of hash
237
+ # For object, use to_hash. Otherwise, just return the value
238
+ # @param [Object] value Any valid value
239
+ # @return [Hash] Returns the value in the form of hash
240
+ def _to_hash(value)
241
+ if value.is_a?(Array)
242
+ value.compact.map { |v| _to_hash(v) }
243
+ elsif value.is_a?(Hash)
244
+ {}.tap do |hash|
245
+ value.each { |k, v| hash[k] = _to_hash(v) }
246
+ end
247
+ elsif value.respond_to? :to_hash
248
+ value.to_hash
249
+ else
250
+ value
251
+ end
252
+ end
253
+
254
+ end
255
+
256
+ end
@@ -27,6 +27,9 @@ module UltracartClient
27
27
  # The Digital item oid is a primary key used internally by UltraCart. You should not set or change this value. Doing so will have no effect.
28
28
  attr_accessor :digital_item_oid
29
29
 
30
+ # External Id useful for syncing with a remote filesystem, this may be an MD5 hash or whatever suits your needs.
31
+ attr_accessor :external_id
32
+
30
33
  # File size
31
34
  attr_accessor :file_size
32
35
 
@@ -48,6 +51,7 @@ module UltracartClient
48
51
  :'creation_dts' => :'creation_dts',
49
52
  :'description' => :'description',
50
53
  :'digital_item_oid' => :'digital_item_oid',
54
+ :'external_id' => :'external_id',
51
55
  :'file_size' => :'file_size',
52
56
  :'import_from_url' => :'import_from_url',
53
57
  :'mime_type' => :'mime_type',
@@ -68,6 +72,7 @@ module UltracartClient
68
72
  :'creation_dts' => :'String',
69
73
  :'description' => :'String',
70
74
  :'digital_item_oid' => :'Integer',
75
+ :'external_id' => :'String',
71
76
  :'file_size' => :'Integer',
72
77
  :'import_from_url' => :'String',
73
78
  :'mime_type' => :'String',
@@ -113,6 +118,10 @@ module UltracartClient
113
118
  self.digital_item_oid = attributes[:'digital_item_oid']
114
119
  end
115
120
 
121
+ if attributes.key?(:'external_id')
122
+ self.external_id = attributes[:'external_id']
123
+ end
124
+
116
125
  if attributes.key?(:'file_size')
117
126
  self.file_size = attributes[:'file_size']
118
127
  end
@@ -142,6 +151,10 @@ module UltracartClient
142
151
  invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 200.')
143
152
  end
144
153
 
154
+ if !@external_id.nil? && @external_id.to_s.length > 100
155
+ invalid_properties.push('invalid value for "external_id", the character length must be smaller than or equal to 100.')
156
+ end
157
+
145
158
  if !@mime_type.nil? && @mime_type.to_s.length > 100
146
159
  invalid_properties.push('invalid value for "mime_type", the character length must be smaller than or equal to 100.')
147
160
  end
@@ -157,6 +170,7 @@ module UltracartClient
157
170
  # @return true if the model is valid
158
171
  def valid?
159
172
  return false if !@description.nil? && @description.to_s.length > 200
173
+ return false if !@external_id.nil? && @external_id.to_s.length > 100
160
174
  return false if !@mime_type.nil? && @mime_type.to_s.length > 100
161
175
  return false if !@original_filename.nil? && @original_filename.to_s.length > 250
162
176
  true
@@ -172,6 +186,16 @@ module UltracartClient
172
186
  @description = description
173
187
  end
174
188
 
189
+ # Custom attribute writer method with validation
190
+ # @param [Object] external_id Value to be assigned
191
+ def external_id=(external_id)
192
+ if !external_id.nil? && external_id.to_s.length > 100
193
+ fail ArgumentError, 'invalid value for "external_id", the character length must be smaller than or equal to 100.'
194
+ end
195
+
196
+ @external_id = external_id
197
+ end
198
+
175
199
  # Custom attribute writer method with validation
176
200
  # @param [Object] mime_type Value to be assigned
177
201
  def mime_type=(mime_type)
@@ -201,6 +225,7 @@ module UltracartClient
201
225
  creation_dts == o.creation_dts &&
202
226
  description == o.description &&
203
227
  digital_item_oid == o.digital_item_oid &&
228
+ external_id == o.external_id &&
204
229
  file_size == o.file_size &&
205
230
  import_from_url == o.import_from_url &&
206
231
  mime_type == o.mime_type &&
@@ -217,7 +242,7 @@ module UltracartClient
217
242
  # Calculates hash code according to all attributes.
218
243
  # @return [Integer] Hash code
219
244
  def hash
220
- [click_wrap_agreement, creation_dts, description, digital_item_oid, file_size, import_from_url, mime_type, original_filename, pdf_meta].hash
245
+ [click_wrap_agreement, creation_dts, description, digital_item_oid, external_id, file_size, import_from_url, mime_type, original_filename, pdf_meta].hash
221
246
  end
222
247
 
223
248
  # Builds the object from hash
@@ -11,5 +11,5 @@ OpenAPI Generator version: 6.0.1-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module UltracartClient
14
- VERSION = '4.0.67.rc'
14
+ VERSION = '4.0.69.rc'
15
15
  end
data/lib/ultracart_api.rb CHANGED
@@ -379,7 +379,12 @@ require 'ultracart_api/models/experiment_response'
379
379
  require 'ultracart_api/models/experiment_variation'
380
380
  require 'ultracart_api/models/experiment_variation_stat'
381
381
  require 'ultracart_api/models/experiments_response'
382
+ require 'ultracart_api/models/file_manager_directory'
383
+ require 'ultracart_api/models/file_manager_file'
382
384
  require 'ultracart_api/models/file_manager_page'
385
+ require 'ultracart_api/models/file_manager_page_response'
386
+ require 'ultracart_api/models/file_manager_upload_request'
387
+ require 'ultracart_api/models/file_manager_upload_url_response'
383
388
  require 'ultracart_api/models/fulfillment_inventory'
384
389
  require 'ultracart_api/models/fulfillment_shipment'
385
390
  require 'ultracart_api/models/geo_point'
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.67.rc
4
+ version: 4.0.69.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-09-27 00:00:00.000000000 Z
11
+ date: 2022-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -431,7 +431,12 @@ files:
431
431
  - docs/ExperimentVariation.md
432
432
  - docs/ExperimentVariationStat.md
433
433
  - docs/ExperimentsResponse.md
434
+ - docs/FileManagerDirectory.md
435
+ - docs/FileManagerFile.md
434
436
  - docs/FileManagerPage.md
437
+ - docs/FileManagerPageResponse.md
438
+ - docs/FileManagerUploadRequest.md
439
+ - docs/FileManagerUploadUrlResponse.md
435
440
  - docs/FulfillmentApi.md
436
441
  - docs/FulfillmentInventory.md
437
442
  - docs/FulfillmentShipment.md
@@ -1140,7 +1145,12 @@ files:
1140
1145
  - lib/ultracart_api/models/experiment_variation.rb
1141
1146
  - lib/ultracart_api/models/experiment_variation_stat.rb
1142
1147
  - lib/ultracart_api/models/experiments_response.rb
1148
+ - lib/ultracart_api/models/file_manager_directory.rb
1149
+ - lib/ultracart_api/models/file_manager_file.rb
1143
1150
  - lib/ultracart_api/models/file_manager_page.rb
1151
+ - lib/ultracart_api/models/file_manager_page_response.rb
1152
+ - lib/ultracart_api/models/file_manager_upload_request.rb
1153
+ - lib/ultracart_api/models/file_manager_upload_url_response.rb
1144
1154
  - lib/ultracart_api/models/fulfillment_inventory.rb
1145
1155
  - lib/ultracart_api/models/fulfillment_shipment.rb
1146
1156
  - lib/ultracart_api/models/geo_point.rb