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