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.
@@ -16,21 +16,30 @@ module UltracartClient
16
16
  class FileManagerPage
17
17
  attr_accessor :current_storefront_fs_directory_oid
18
18
 
19
+ attr_accessor :directories
20
+
21
+ attr_accessor :files
22
+
19
23
  attr_accessor :hostname
20
24
 
21
25
  attr_accessor :parent_storefront_fs_directory_oid
22
26
 
23
27
  attr_accessor :path
24
28
 
29
+ attr_accessor :path_list
30
+
25
31
  attr_accessor :storefront_oid
26
32
 
27
33
  # Attribute mapping from ruby-style variable name to JSON key.
28
34
  def self.attribute_map
29
35
  {
30
36
  :'current_storefront_fs_directory_oid' => :'current_storefront_fs_directory_oid',
37
+ :'directories' => :'directories',
38
+ :'files' => :'files',
31
39
  :'hostname' => :'hostname',
32
40
  :'parent_storefront_fs_directory_oid' => :'parent_storefront_fs_directory_oid',
33
41
  :'path' => :'path',
42
+ :'path_list' => :'path_list',
34
43
  :'storefront_oid' => :'storefront_oid'
35
44
  }
36
45
  end
@@ -39,9 +48,12 @@ module UltracartClient
39
48
  def self.swagger_types
40
49
  {
41
50
  :'current_storefront_fs_directory_oid' => :'Integer',
51
+ :'directories' => :'Array<FileManagerDirectory>',
52
+ :'files' => :'Array<FileManagerFile>',
42
53
  :'hostname' => :'String',
43
54
  :'parent_storefront_fs_directory_oid' => :'Integer',
44
55
  :'path' => :'String',
56
+ :'path_list' => :'Array<FileManagerDirectory>',
45
57
  :'storefront_oid' => :'Integer'
46
58
  }
47
59
  end
@@ -58,6 +70,18 @@ module UltracartClient
58
70
  self.current_storefront_fs_directory_oid = attributes[:'current_storefront_fs_directory_oid']
59
71
  end
60
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
+
61
85
  if attributes.has_key?(:'hostname')
62
86
  self.hostname = attributes[:'hostname']
63
87
  end
@@ -70,6 +94,12 @@ module UltracartClient
70
94
  self.path = attributes[:'path']
71
95
  end
72
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
+
73
103
  if attributes.has_key?(:'storefront_oid')
74
104
  self.storefront_oid = attributes[:'storefront_oid']
75
105
  end
@@ -94,9 +124,12 @@ module UltracartClient
94
124
  return true if self.equal?(o)
95
125
  self.class == o.class &&
96
126
  current_storefront_fs_directory_oid == o.current_storefront_fs_directory_oid &&
127
+ directories == o.directories &&
128
+ files == o.files &&
97
129
  hostname == o.hostname &&
98
130
  parent_storefront_fs_directory_oid == o.parent_storefront_fs_directory_oid &&
99
131
  path == o.path &&
132
+ path_list == o.path_list &&
100
133
  storefront_oid == o.storefront_oid
101
134
  end
102
135
 
@@ -109,7 +142,7 @@ module UltracartClient
109
142
  # Calculates hash code according to all attributes.
110
143
  # @return [Fixnum] Hash code
111
144
  def hash
112
- [current_storefront_fs_directory_oid, hostname, parent_storefront_fs_directory_oid, path, storefront_oid].hash
145
+ [current_storefront_fs_directory_oid, directories, files, hostname, parent_storefront_fs_directory_oid, path, path_list, storefront_oid].hash
113
146
  end
114
147
 
115
148
  # Builds the object from hash
@@ -0,0 +1,221 @@
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 FileManagerPageResponse
17
+ attr_accessor :error
18
+
19
+ attr_accessor :file_manager_page
20
+
21
+ attr_accessor :metadata
22
+
23
+ # Indicates if API call was successful
24
+ attr_accessor :success
25
+
26
+ attr_accessor :warning
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'error' => :'error',
32
+ :'file_manager_page' => :'file_manager_page',
33
+ :'metadata' => :'metadata',
34
+ :'success' => :'success',
35
+ :'warning' => :'warning'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.swagger_types
41
+ {
42
+ :'error' => :'Error',
43
+ :'file_manager_page' => :'FileManagerPage',
44
+ :'metadata' => :'ResponseMetadata',
45
+ :'success' => :'BOOLEAN',
46
+ :'warning' => :'Warning'
47
+ }
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
57
+
58
+ if attributes.has_key?(:'error')
59
+ self.error = attributes[:'error']
60
+ end
61
+
62
+ if attributes.has_key?(:'file_manager_page')
63
+ self.file_manager_page = attributes[:'file_manager_page']
64
+ end
65
+
66
+ if attributes.has_key?(:'metadata')
67
+ self.metadata = attributes[:'metadata']
68
+ end
69
+
70
+ if attributes.has_key?(:'success')
71
+ self.success = attributes[:'success']
72
+ end
73
+
74
+ if attributes.has_key?(:'warning')
75
+ self.warning = attributes[:'warning']
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ invalid_properties = Array.new
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ true
90
+ end
91
+
92
+ # Checks equality by comparing each attribute.
93
+ # @param [Object] Object to be compared
94
+ def ==(o)
95
+ return true if self.equal?(o)
96
+ self.class == o.class &&
97
+ error == o.error &&
98
+ file_manager_page == o.file_manager_page &&
99
+ metadata == o.metadata &&
100
+ success == o.success &&
101
+ warning == o.warning
102
+ end
103
+
104
+ # @see the `==` method
105
+ # @param [Object] Object to be compared
106
+ def eql?(o)
107
+ self == o
108
+ end
109
+
110
+ # Calculates hash code according to all attributes.
111
+ # @return [Fixnum] Hash code
112
+ def hash
113
+ [error, file_manager_page, metadata, success, warning].hash
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+ self.class.swagger_types.each_pair do |key, type|
122
+ if type =~ /\AArray<(.*)>/i
123
+ # check to ensure the input is an array given that the attribute
124
+ # is documented as an array but the input is not
125
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
126
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
127
+ end
128
+ elsif !attributes[self.class.attribute_map[key]].nil?
129
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
130
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
131
+ end
132
+
133
+ self
134
+ end
135
+
136
+ # Deserializes the data based on type
137
+ # @param string type Data type
138
+ # @param string value Value to be deserialized
139
+ # @return [Object] Deserialized data
140
+ def _deserialize(type, value)
141
+ case type.to_sym
142
+ when :DateTime
143
+ DateTime.parse(value)
144
+ when :Date
145
+ Date.parse(value)
146
+ when :String
147
+ value.to_s
148
+ when :Integer
149
+ value.to_i
150
+ when :Float
151
+ value.to_f
152
+ when :BOOLEAN
153
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
154
+ true
155
+ else
156
+ false
157
+ end
158
+ when :Object
159
+ # generic object (usually a Hash), return directly
160
+ value
161
+ when /\AArray<(?<inner_type>.+)>\z/
162
+ inner_type = Regexp.last_match[:inner_type]
163
+ value.map { |v| _deserialize(inner_type, v) }
164
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
165
+ k_type = Regexp.last_match[:k_type]
166
+ v_type = Regexp.last_match[:v_type]
167
+ {}.tap do |hash|
168
+ value.each do |k, v|
169
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
170
+ end
171
+ end
172
+ else # model
173
+ temp_model = UltracartClient.const_get(type).new
174
+ temp_model.build_from_hash(value)
175
+ end
176
+ end
177
+
178
+ # Returns the string representation of the object
179
+ # @return [String] String presentation of the object
180
+ def to_s
181
+ to_hash.to_s
182
+ end
183
+
184
+ # to_body is an alias to to_hash (backward compatibility)
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_body
187
+ to_hash
188
+ end
189
+
190
+ # Returns the object in the form of hash
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_hash
193
+ hash = {}
194
+ self.class.attribute_map.each_pair do |attr, param|
195
+ value = self.send(attr)
196
+ next if value.nil?
197
+ hash[param] = _to_hash(value)
198
+ end
199
+ hash
200
+ end
201
+
202
+ # Outputs non-array value in the form of hash
203
+ # For object, use to_hash. Otherwise, just return the value
204
+ # @param [Object] value Any valid value
205
+ # @return [Hash] Returns the value in the form of hash
206
+ def _to_hash(value)
207
+ if value.is_a?(Array)
208
+ value.compact.map { |v| _to_hash(v) }
209
+ elsif value.is_a?(Hash)
210
+ {}.tap do |hash|
211
+ value.each { |k, v| hash[k] = _to_hash(v) }
212
+ end
213
+ elsif value.respond_to? :to_hash
214
+ value.to_hash
215
+ else
216
+ value
217
+ end
218
+ end
219
+
220
+ end
221
+ end
@@ -0,0 +1,202 @@
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 FileManagerUploadRequest
17
+ attr_accessor :filename
18
+
19
+ attr_accessor :key
20
+
21
+ attr_accessor :parent_storefront_fs_directory_oid
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'filename' => :'filename',
27
+ :'key' => :'key',
28
+ :'parent_storefront_fs_directory_oid' => :'parent_storefront_fs_directory_oid'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.swagger_types
34
+ {
35
+ :'filename' => :'String',
36
+ :'key' => :'String',
37
+ :'parent_storefront_fs_directory_oid' => :'Integer'
38
+ }
39
+ end
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ def initialize(attributes = {})
44
+ return unless attributes.is_a?(Hash)
45
+
46
+ # convert string to symbol for hash key
47
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
48
+
49
+ if attributes.has_key?(:'filename')
50
+ self.filename = attributes[:'filename']
51
+ end
52
+
53
+ if attributes.has_key?(:'key')
54
+ self.key = attributes[:'key']
55
+ end
56
+
57
+ if attributes.has_key?(:'parent_storefront_fs_directory_oid')
58
+ self.parent_storefront_fs_directory_oid = attributes[:'parent_storefront_fs_directory_oid']
59
+ end
60
+ end
61
+
62
+ # Show invalid properties with the reasons. Usually used together with valid?
63
+ # @return Array for valid properties with the reasons
64
+ def list_invalid_properties
65
+ invalid_properties = Array.new
66
+ invalid_properties
67
+ end
68
+
69
+ # Check to see if the all the properties in the model are valid
70
+ # @return true if the model is valid
71
+ def valid?
72
+ true
73
+ end
74
+
75
+ # Checks equality by comparing each attribute.
76
+ # @param [Object] Object to be compared
77
+ def ==(o)
78
+ return true if self.equal?(o)
79
+ self.class == o.class &&
80
+ filename == o.filename &&
81
+ key == o.key &&
82
+ parent_storefront_fs_directory_oid == o.parent_storefront_fs_directory_oid
83
+ end
84
+
85
+ # @see the `==` method
86
+ # @param [Object] Object to be compared
87
+ def eql?(o)
88
+ self == o
89
+ end
90
+
91
+ # Calculates hash code according to all attributes.
92
+ # @return [Fixnum] Hash code
93
+ def hash
94
+ [filename, key, parent_storefront_fs_directory_oid].hash
95
+ end
96
+
97
+ # Builds the object from hash
98
+ # @param [Hash] attributes Model attributes in the form of hash
99
+ # @return [Object] Returns the model itself
100
+ def build_from_hash(attributes)
101
+ return nil unless attributes.is_a?(Hash)
102
+ self.class.swagger_types.each_pair do |key, type|
103
+ if type =~ /\AArray<(.*)>/i
104
+ # check to ensure the input is an array given that the attribute
105
+ # is documented as an array but the input is not
106
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
107
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
108
+ end
109
+ elsif !attributes[self.class.attribute_map[key]].nil?
110
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
111
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
112
+ end
113
+
114
+ self
115
+ end
116
+
117
+ # Deserializes the data based on type
118
+ # @param string type Data type
119
+ # @param string value Value to be deserialized
120
+ # @return [Object] Deserialized data
121
+ def _deserialize(type, value)
122
+ case type.to_sym
123
+ when :DateTime
124
+ DateTime.parse(value)
125
+ when :Date
126
+ Date.parse(value)
127
+ when :String
128
+ value.to_s
129
+ when :Integer
130
+ value.to_i
131
+ when :Float
132
+ value.to_f
133
+ when :BOOLEAN
134
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
135
+ true
136
+ else
137
+ false
138
+ end
139
+ when :Object
140
+ # generic object (usually a Hash), return directly
141
+ value
142
+ when /\AArray<(?<inner_type>.+)>\z/
143
+ inner_type = Regexp.last_match[:inner_type]
144
+ value.map { |v| _deserialize(inner_type, v) }
145
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
146
+ k_type = Regexp.last_match[:k_type]
147
+ v_type = Regexp.last_match[:v_type]
148
+ {}.tap do |hash|
149
+ value.each do |k, v|
150
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
151
+ end
152
+ end
153
+ else # model
154
+ temp_model = UltracartClient.const_get(type).new
155
+ temp_model.build_from_hash(value)
156
+ end
157
+ end
158
+
159
+ # Returns the string representation of the object
160
+ # @return [String] String presentation of the object
161
+ def to_s
162
+ to_hash.to_s
163
+ end
164
+
165
+ # to_body is an alias to to_hash (backward compatibility)
166
+ # @return [Hash] Returns the object in the form of hash
167
+ def to_body
168
+ to_hash
169
+ end
170
+
171
+ # Returns the object in the form of hash
172
+ # @return [Hash] Returns the object in the form of hash
173
+ def to_hash
174
+ hash = {}
175
+ self.class.attribute_map.each_pair do |attr, param|
176
+ value = self.send(attr)
177
+ next if value.nil?
178
+ hash[param] = _to_hash(value)
179
+ end
180
+ hash
181
+ end
182
+
183
+ # Outputs non-array value in the form of hash
184
+ # For object, use to_hash. Otherwise, just return the value
185
+ # @param [Object] value Any valid value
186
+ # @return [Hash] Returns the value in the form of hash
187
+ def _to_hash(value)
188
+ if value.is_a?(Array)
189
+ value.compact.map { |v| _to_hash(v) }
190
+ elsif value.is_a?(Hash)
191
+ {}.tap do |hash|
192
+ value.each { |k, v| hash[k] = _to_hash(v) }
193
+ end
194
+ elsif value.respond_to? :to_hash
195
+ value.to_hash
196
+ else
197
+ value
198
+ end
199
+ end
200
+
201
+ end
202
+ end