ultracart_api 3.10.49 → 3.10.51

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,346 @@
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 FileManagerFile
17
+ attr_accessor :favorite
18
+
19
+ attr_accessor :hostname
20
+
21
+ attr_accessor :i18n_violation
22
+
23
+ attr_accessor :icon
24
+
25
+ attr_accessor :internal_version
26
+
27
+ attr_accessor :last_modified
28
+
29
+ attr_accessor :merge_conflict
30
+
31
+ attr_accessor :name
32
+
33
+ attr_accessor :parent_storefront_fs_directory_oid
34
+
35
+ attr_accessor :part_of_active_theme
36
+
37
+ attr_accessor :path
38
+
39
+ attr_accessor :raw_size
40
+
41
+ attr_accessor :selected
42
+
43
+ attr_accessor :size
44
+
45
+ attr_accessor :storefront_fs_directory_oid
46
+
47
+ attr_accessor :storefront_fs_file_oid
48
+
49
+ attr_accessor :storefront_oid
50
+
51
+ attr_accessor :type
52
+
53
+ attr_accessor :valid_velocity
54
+
55
+ # Attribute mapping from ruby-style variable name to JSON key.
56
+ def self.attribute_map
57
+ {
58
+ :'favorite' => :'favorite',
59
+ :'hostname' => :'hostname',
60
+ :'i18n_violation' => :'i18n_violation',
61
+ :'icon' => :'icon',
62
+ :'internal_version' => :'internal_version',
63
+ :'last_modified' => :'last_modified',
64
+ :'merge_conflict' => :'merge_conflict',
65
+ :'name' => :'name',
66
+ :'parent_storefront_fs_directory_oid' => :'parent_storefront_fs_directory_oid',
67
+ :'part_of_active_theme' => :'part_of_active_theme',
68
+ :'path' => :'path',
69
+ :'raw_size' => :'raw_size',
70
+ :'selected' => :'selected',
71
+ :'size' => :'size',
72
+ :'storefront_fs_directory_oid' => :'storefront_fs_directory_oid',
73
+ :'storefront_fs_file_oid' => :'storefront_fs_file_oid',
74
+ :'storefront_oid' => :'storefront_oid',
75
+ :'type' => :'type',
76
+ :'valid_velocity' => :'valid_velocity'
77
+ }
78
+ end
79
+
80
+ # Attribute type mapping.
81
+ def self.swagger_types
82
+ {
83
+ :'favorite' => :'BOOLEAN',
84
+ :'hostname' => :'String',
85
+ :'i18n_violation' => :'BOOLEAN',
86
+ :'icon' => :'String',
87
+ :'internal_version' => :'Integer',
88
+ :'last_modified' => :'String',
89
+ :'merge_conflict' => :'BOOLEAN',
90
+ :'name' => :'String',
91
+ :'parent_storefront_fs_directory_oid' => :'Integer',
92
+ :'part_of_active_theme' => :'BOOLEAN',
93
+ :'path' => :'String',
94
+ :'raw_size' => :'Integer',
95
+ :'selected' => :'BOOLEAN',
96
+ :'size' => :'String',
97
+ :'storefront_fs_directory_oid' => :'Integer',
98
+ :'storefront_fs_file_oid' => :'Integer',
99
+ :'storefront_oid' => :'Integer',
100
+ :'type' => :'String',
101
+ :'valid_velocity' => :'String'
102
+ }
103
+ end
104
+
105
+ # Initializes the object
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ def initialize(attributes = {})
108
+ return unless attributes.is_a?(Hash)
109
+
110
+ # convert string to symbol for hash key
111
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
112
+
113
+ if attributes.has_key?(:'favorite')
114
+ self.favorite = attributes[:'favorite']
115
+ end
116
+
117
+ if attributes.has_key?(:'hostname')
118
+ self.hostname = attributes[:'hostname']
119
+ end
120
+
121
+ if attributes.has_key?(:'i18n_violation')
122
+ self.i18n_violation = attributes[:'i18n_violation']
123
+ end
124
+
125
+ if attributes.has_key?(:'icon')
126
+ self.icon = attributes[:'icon']
127
+ end
128
+
129
+ if attributes.has_key?(:'internal_version')
130
+ self.internal_version = attributes[:'internal_version']
131
+ end
132
+
133
+ if attributes.has_key?(:'last_modified')
134
+ self.last_modified = attributes[:'last_modified']
135
+ end
136
+
137
+ if attributes.has_key?(:'merge_conflict')
138
+ self.merge_conflict = attributes[:'merge_conflict']
139
+ end
140
+
141
+ if attributes.has_key?(:'name')
142
+ self.name = attributes[:'name']
143
+ end
144
+
145
+ if attributes.has_key?(:'parent_storefront_fs_directory_oid')
146
+ self.parent_storefront_fs_directory_oid = attributes[:'parent_storefront_fs_directory_oid']
147
+ end
148
+
149
+ if attributes.has_key?(:'part_of_active_theme')
150
+ self.part_of_active_theme = attributes[:'part_of_active_theme']
151
+ end
152
+
153
+ if attributes.has_key?(:'path')
154
+ self.path = attributes[:'path']
155
+ end
156
+
157
+ if attributes.has_key?(:'raw_size')
158
+ self.raw_size = attributes[:'raw_size']
159
+ end
160
+
161
+ if attributes.has_key?(:'selected')
162
+ self.selected = attributes[:'selected']
163
+ end
164
+
165
+ if attributes.has_key?(:'size')
166
+ self.size = attributes[:'size']
167
+ end
168
+
169
+ if attributes.has_key?(:'storefront_fs_directory_oid')
170
+ self.storefront_fs_directory_oid = attributes[:'storefront_fs_directory_oid']
171
+ end
172
+
173
+ if attributes.has_key?(:'storefront_fs_file_oid')
174
+ self.storefront_fs_file_oid = attributes[:'storefront_fs_file_oid']
175
+ end
176
+
177
+ if attributes.has_key?(:'storefront_oid')
178
+ self.storefront_oid = attributes[:'storefront_oid']
179
+ end
180
+
181
+ if attributes.has_key?(:'type')
182
+ self.type = attributes[:'type']
183
+ end
184
+
185
+ if attributes.has_key?(:'valid_velocity')
186
+ self.valid_velocity = attributes[:'valid_velocity']
187
+ end
188
+ end
189
+
190
+ # Show invalid properties with the reasons. Usually used together with valid?
191
+ # @return Array for valid properties with the reasons
192
+ def list_invalid_properties
193
+ invalid_properties = Array.new
194
+ invalid_properties
195
+ end
196
+
197
+ # Check to see if the all the properties in the model are valid
198
+ # @return true if the model is valid
199
+ def valid?
200
+ true
201
+ end
202
+
203
+ # Checks equality by comparing each attribute.
204
+ # @param [Object] Object to be compared
205
+ def ==(o)
206
+ return true if self.equal?(o)
207
+ self.class == o.class &&
208
+ favorite == o.favorite &&
209
+ hostname == o.hostname &&
210
+ i18n_violation == o.i18n_violation &&
211
+ icon == o.icon &&
212
+ internal_version == o.internal_version &&
213
+ last_modified == o.last_modified &&
214
+ merge_conflict == o.merge_conflict &&
215
+ name == o.name &&
216
+ parent_storefront_fs_directory_oid == o.parent_storefront_fs_directory_oid &&
217
+ part_of_active_theme == o.part_of_active_theme &&
218
+ path == o.path &&
219
+ raw_size == o.raw_size &&
220
+ selected == o.selected &&
221
+ size == o.size &&
222
+ storefront_fs_directory_oid == o.storefront_fs_directory_oid &&
223
+ storefront_fs_file_oid == o.storefront_fs_file_oid &&
224
+ storefront_oid == o.storefront_oid &&
225
+ type == o.type &&
226
+ valid_velocity == o.valid_velocity
227
+ end
228
+
229
+ # @see the `==` method
230
+ # @param [Object] Object to be compared
231
+ def eql?(o)
232
+ self == o
233
+ end
234
+
235
+ # Calculates hash code according to all attributes.
236
+ # @return [Fixnum] Hash code
237
+ def hash
238
+ [favorite, hostname, i18n_violation, icon, internal_version, last_modified, merge_conflict, name, parent_storefront_fs_directory_oid, part_of_active_theme, path, raw_size, selected, size, storefront_fs_directory_oid, storefront_fs_file_oid, storefront_oid, type, valid_velocity].hash
239
+ end
240
+
241
+ # Builds the object from hash
242
+ # @param [Hash] attributes Model attributes in the form of hash
243
+ # @return [Object] Returns the model itself
244
+ def build_from_hash(attributes)
245
+ return nil unless attributes.is_a?(Hash)
246
+ self.class.swagger_types.each_pair do |key, type|
247
+ if type =~ /\AArray<(.*)>/i
248
+ # check to ensure the input is an array given that the attribute
249
+ # is documented as an array but the input is not
250
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
251
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
252
+ end
253
+ elsif !attributes[self.class.attribute_map[key]].nil?
254
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
255
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
256
+ end
257
+
258
+ self
259
+ end
260
+
261
+ # Deserializes the data based on type
262
+ # @param string type Data type
263
+ # @param string value Value to be deserialized
264
+ # @return [Object] Deserialized data
265
+ def _deserialize(type, value)
266
+ case type.to_sym
267
+ when :DateTime
268
+ DateTime.parse(value)
269
+ when :Date
270
+ Date.parse(value)
271
+ when :String
272
+ value.to_s
273
+ when :Integer
274
+ value.to_i
275
+ when :Float
276
+ value.to_f
277
+ when :BOOLEAN
278
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
279
+ true
280
+ else
281
+ false
282
+ end
283
+ when :Object
284
+ # generic object (usually a Hash), return directly
285
+ value
286
+ when /\AArray<(?<inner_type>.+)>\z/
287
+ inner_type = Regexp.last_match[:inner_type]
288
+ value.map { |v| _deserialize(inner_type, v) }
289
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
290
+ k_type = Regexp.last_match[:k_type]
291
+ v_type = Regexp.last_match[:v_type]
292
+ {}.tap do |hash|
293
+ value.each do |k, v|
294
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
295
+ end
296
+ end
297
+ else # model
298
+ temp_model = UltracartClient.const_get(type).new
299
+ temp_model.build_from_hash(value)
300
+ end
301
+ end
302
+
303
+ # Returns the string representation of the object
304
+ # @return [String] String presentation of the object
305
+ def to_s
306
+ to_hash.to_s
307
+ end
308
+
309
+ # to_body is an alias to to_hash (backward compatibility)
310
+ # @return [Hash] Returns the object in the form of hash
311
+ def to_body
312
+ to_hash
313
+ end
314
+
315
+ # Returns the object in the form of hash
316
+ # @return [Hash] Returns the object in the form of hash
317
+ def to_hash
318
+ hash = {}
319
+ self.class.attribute_map.each_pair do |attr, param|
320
+ value = self.send(attr)
321
+ next if value.nil?
322
+ hash[param] = _to_hash(value)
323
+ end
324
+ hash
325
+ end
326
+
327
+ # Outputs non-array value in the form of hash
328
+ # For object, use to_hash. Otherwise, just return the value
329
+ # @param [Object] value Any valid value
330
+ # @return [Hash] Returns the value in the form of hash
331
+ def _to_hash(value)
332
+ if value.is_a?(Array)
333
+ value.compact.map { |v| _to_hash(v) }
334
+ elsif value.is_a?(Hash)
335
+ {}.tap do |hash|
336
+ value.each { |k, v| hash[k] = _to_hash(v) }
337
+ end
338
+ elsif value.respond_to? :to_hash
339
+ value.to_hash
340
+ else
341
+ value
342
+ end
343
+ end
344
+
345
+ end
346
+ end
@@ -0,0 +1,253 @@
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 FileManagerPage
17
+ attr_accessor :current_storefront_fs_directory_oid
18
+
19
+ attr_accessor :directories
20
+
21
+ attr_accessor :files
22
+
23
+ attr_accessor :hostname
24
+
25
+ attr_accessor :parent_storefront_fs_directory_oid
26
+
27
+ attr_accessor :path
28
+
29
+ attr_accessor :path_list
30
+
31
+ attr_accessor :storefront_oid
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'current_storefront_fs_directory_oid' => :'current_storefront_fs_directory_oid',
37
+ :'directories' => :'directories',
38
+ :'files' => :'files',
39
+ :'hostname' => :'hostname',
40
+ :'parent_storefront_fs_directory_oid' => :'parent_storefront_fs_directory_oid',
41
+ :'path' => :'path',
42
+ :'path_list' => :'path_list',
43
+ :'storefront_oid' => :'storefront_oid'
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.swagger_types
49
+ {
50
+ :'current_storefront_fs_directory_oid' => :'Integer',
51
+ :'directories' => :'Array<FileManagerDirectory>',
52
+ :'files' => :'Array<FileManagerFile>',
53
+ :'hostname' => :'String',
54
+ :'parent_storefront_fs_directory_oid' => :'Integer',
55
+ :'path' => :'String',
56
+ :'path_list' => :'Array<FileManagerDirectory>',
57
+ :'storefront_oid' => :'Integer'
58
+ }
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ return unless attributes.is_a?(Hash)
65
+
66
+ # convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
68
+
69
+ if attributes.has_key?(:'current_storefront_fs_directory_oid')
70
+ self.current_storefront_fs_directory_oid = attributes[:'current_storefront_fs_directory_oid']
71
+ end
72
+
73
+ if attributes.has_key?(:'directories')
74
+ if (value = attributes[:'directories']).is_a?(Array)
75
+ self.directories = value
76
+ end
77
+ end
78
+
79
+ if attributes.has_key?(:'files')
80
+ if (value = attributes[:'files']).is_a?(Array)
81
+ self.files = value
82
+ end
83
+ end
84
+
85
+ if attributes.has_key?(:'hostname')
86
+ self.hostname = attributes[:'hostname']
87
+ end
88
+
89
+ if attributes.has_key?(:'parent_storefront_fs_directory_oid')
90
+ self.parent_storefront_fs_directory_oid = attributes[:'parent_storefront_fs_directory_oid']
91
+ end
92
+
93
+ if attributes.has_key?(:'path')
94
+ self.path = attributes[:'path']
95
+ end
96
+
97
+ if attributes.has_key?(:'path_list')
98
+ if (value = attributes[:'path_list']).is_a?(Array)
99
+ self.path_list = value
100
+ end
101
+ end
102
+
103
+ if attributes.has_key?(:'storefront_oid')
104
+ self.storefront_oid = attributes[:'storefront_oid']
105
+ end
106
+ end
107
+
108
+ # Show invalid properties with the reasons. Usually used together with valid?
109
+ # @return Array for valid properties with the reasons
110
+ def list_invalid_properties
111
+ invalid_properties = Array.new
112
+ invalid_properties
113
+ end
114
+
115
+ # Check to see if the all the properties in the model are valid
116
+ # @return true if the model is valid
117
+ def valid?
118
+ true
119
+ end
120
+
121
+ # Checks equality by comparing each attribute.
122
+ # @param [Object] Object to be compared
123
+ def ==(o)
124
+ return true if self.equal?(o)
125
+ self.class == o.class &&
126
+ current_storefront_fs_directory_oid == o.current_storefront_fs_directory_oid &&
127
+ directories == o.directories &&
128
+ files == o.files &&
129
+ hostname == o.hostname &&
130
+ parent_storefront_fs_directory_oid == o.parent_storefront_fs_directory_oid &&
131
+ path == o.path &&
132
+ path_list == o.path_list &&
133
+ storefront_oid == o.storefront_oid
134
+ end
135
+
136
+ # @see the `==` method
137
+ # @param [Object] Object to be compared
138
+ def eql?(o)
139
+ self == o
140
+ end
141
+
142
+ # Calculates hash code according to all attributes.
143
+ # @return [Fixnum] Hash code
144
+ def hash
145
+ [current_storefront_fs_directory_oid, directories, files, hostname, parent_storefront_fs_directory_oid, path, path_list, storefront_oid].hash
146
+ end
147
+
148
+ # Builds the object from hash
149
+ # @param [Hash] attributes Model attributes in the form of hash
150
+ # @return [Object] Returns the model itself
151
+ def build_from_hash(attributes)
152
+ return nil unless attributes.is_a?(Hash)
153
+ self.class.swagger_types.each_pair do |key, type|
154
+ if 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 # or else data not found in attributes(hash), not an issue as the data can be optional
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 :DateTime
175
+ DateTime.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
+ temp_model = UltracartClient.const_get(type).new
206
+ temp_model.build_from_hash(value)
207
+ end
208
+ end
209
+
210
+ # Returns the string representation of the object
211
+ # @return [String] String presentation of the object
212
+ def to_s
213
+ to_hash.to_s
214
+ end
215
+
216
+ # to_body is an alias to to_hash (backward compatibility)
217
+ # @return [Hash] Returns the object in the form of hash
218
+ def to_body
219
+ to_hash
220
+ end
221
+
222
+ # Returns the object in the form of hash
223
+ # @return [Hash] Returns the object in the form of hash
224
+ def to_hash
225
+ hash = {}
226
+ self.class.attribute_map.each_pair do |attr, param|
227
+ value = self.send(attr)
228
+ next if value.nil?
229
+ hash[param] = _to_hash(value)
230
+ end
231
+ hash
232
+ end
233
+
234
+ # Outputs non-array value in the form of hash
235
+ # For object, use to_hash. Otherwise, just return the value
236
+ # @param [Object] value Any valid value
237
+ # @return [Hash] Returns the value in the form of hash
238
+ def _to_hash(value)
239
+ if value.is_a?(Array)
240
+ value.compact.map { |v| _to_hash(v) }
241
+ elsif value.is_a?(Hash)
242
+ {}.tap do |hash|
243
+ value.each { |k, v| hash[k] = _to_hash(v) }
244
+ end
245
+ elsif value.respond_to? :to_hash
246
+ value.to_hash
247
+ else
248
+ value
249
+ end
250
+ end
251
+
252
+ end
253
+ end