crx_packmgr_api_client 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile +7 -0
- data/Gemfile.lock +105 -0
- data/README.md +6 -7
- data/Rakefile +8 -0
- data/coverage/.last_run.json +5 -0
- data/coverage/.resultset.json +4814 -0
- data/coverage/.resultset.json.lock +0 -0
- data/coverage/assets/0.10.2/application.css +799 -0
- data/coverage/assets/0.10.2/application.js +1707 -0
- data/coverage/assets/0.10.2/colorbox/border.png +0 -0
- data/coverage/assets/0.10.2/colorbox/controls.png +0 -0
- data/coverage/assets/0.10.2/colorbox/loading.gif +0 -0
- data/coverage/assets/0.10.2/colorbox/loading_background.png +0 -0
- data/coverage/assets/0.10.2/favicon_green.png +0 -0
- data/coverage/assets/0.10.2/favicon_red.png +0 -0
- data/coverage/assets/0.10.2/favicon_yellow.png +0 -0
- data/coverage/assets/0.10.2/loading.gif +0 -0
- data/coverage/assets/0.10.2/magnify.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/coverage/index.html +29254 -0
- data/crx_packmgr_api_client.gemspec +18 -15
- data/docs/DefaultApi.md +15 -15
- data/git_push.sh +31 -16
- data/lib/crx_packmgr_api_client.rb +2 -2
- data/lib/crx_packmgr_api_client/api/default_api.rb +68 -126
- data/lib/crx_packmgr_api_client/api_client.rb +61 -40
- data/lib/crx_packmgr_api_client/api_error.rb +9 -7
- data/lib/crx_packmgr_api_client/configuration.rb +9 -3
- data/lib/crx_packmgr_api_client/models/filter.rb +11 -16
- data/lib/crx_packmgr_api_client/models/filter_rule.rb +14 -18
- data/lib/crx_packmgr_api_client/models/group.rb +11 -16
- data/lib/crx_packmgr_api_client/models/group_list.rb +11 -16
- data/lib/crx_packmgr_api_client/models/init_data.rb +11 -16
- data/lib/crx_packmgr_api_client/models/install_status.rb +11 -16
- data/lib/crx_packmgr_api_client/models/install_status_status.rb +11 -16
- data/lib/crx_packmgr_api_client/models/package.rb +11 -16
- data/lib/crx_packmgr_api_client/models/package_list.rb +11 -16
- data/lib/crx_packmgr_api_client/models/service_exec_response.rb +11 -16
- data/lib/crx_packmgr_api_client/models/service_response.rb +11 -16
- data/lib/crx_packmgr_api_client/models/service_response_request.rb +11 -16
- data/lib/crx_packmgr_api_client/models/service_response_request_param.rb +11 -16
- data/lib/crx_packmgr_api_client/models/service_response_response.rb +11 -16
- data/lib/crx_packmgr_api_client/models/update_status.rb +11 -16
- data/lib/crx_packmgr_api_client/version.rb +3 -3
- data/spec/api/download_api_spec.rb +1 -1
- data/spec/api/screenshot_api_spec.rb +1 -1
- data/spec/api/thumbnail_api_spec.rb +1 -1
- metadata +104 -98
- data/crx_packmgr_api_client-0.2.0.gem +0 -0
- data/crx_packmgr_api_client-1.0.0.gem +0 -0
- data/crx_packmgr_api_client-1.1.0.gem +0 -0
- data/crx_packmgr_api_client-1.1.1.gem +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
=begin
|
2
|
-
|
2
|
+
CRX Package Manager API
|
3
3
|
|
4
|
-
|
4
|
+
API for interacting with the CRX Package Manager in AEM.
|
5
5
|
|
6
6
|
OpenAPI spec version: 6.2.0
|
7
7
|
Contact: bryan.stopp@gmail.com
|
@@ -44,7 +44,7 @@ module CrxPackageManager
|
|
44
44
|
@config = config
|
45
45
|
@user_agent = "Swagger-Codegen/#{VERSION}/ruby"
|
46
46
|
@default_headers = {
|
47
|
-
'Content-Type' =>
|
47
|
+
'Content-Type' => 'application/json',
|
48
48
|
'User-Agent' => @user_agent
|
49
49
|
}
|
50
50
|
end
|
@@ -66,10 +66,18 @@ module CrxPackageManager
|
|
66
66
|
end
|
67
67
|
|
68
68
|
unless response.success?
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
69
|
+
if response.timed_out?
|
70
|
+
fail ApiError.new('Connection timed out')
|
71
|
+
elsif response.code == 0
|
72
|
+
# Errors from libcurl will be made visible here
|
73
|
+
fail ApiError.new(:code => 0,
|
74
|
+
:message => response.return_message)
|
75
|
+
else
|
76
|
+
fail ApiError.new(:code => response.code,
|
77
|
+
:response_headers => response.headers,
|
78
|
+
:response_body => response.body),
|
79
|
+
response.status_message
|
80
|
+
end
|
73
81
|
end
|
74
82
|
|
75
83
|
if opts[:return_type]
|
@@ -126,7 +134,9 @@ module CrxPackageManager
|
|
126
134
|
end
|
127
135
|
end
|
128
136
|
|
129
|
-
Typhoeus::Request.new(url, req_opts)
|
137
|
+
request = Typhoeus::Request.new(url, req_opts)
|
138
|
+
download_file(request) if opts[:return_type] == 'File'
|
139
|
+
request
|
130
140
|
end
|
131
141
|
|
132
142
|
# Check if the given MIME is a JSON MIME.
|
@@ -134,10 +144,11 @@ module CrxPackageManager
|
|
134
144
|
# application/json
|
135
145
|
# application/json; charset=UTF8
|
136
146
|
# APPLICATION/JSON
|
147
|
+
# */*
|
137
148
|
# @param [String] mime MIME
|
138
|
-
# @return [Boolean] True if the MIME is
|
149
|
+
# @return [Boolean] True if the MIME is application/json
|
139
150
|
def json_mime?(mime)
|
140
|
-
|
151
|
+
(mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
|
141
152
|
end
|
142
153
|
|
143
154
|
# Deserialize the response to the given return type.
|
@@ -146,14 +157,16 @@ module CrxPackageManager
|
|
146
157
|
# @param [String] return_type some examples: "User", "Array[User]", "Hash[String,Integer]"
|
147
158
|
def deserialize(response, return_type)
|
148
159
|
body = response.body
|
160
|
+
|
161
|
+
# handle file downloading - return the File instance processed in request callbacks
|
162
|
+
# note that response body is empty when the file is written in chunks in request on_body callback
|
163
|
+
return @tempfile if return_type == 'File'
|
164
|
+
|
149
165
|
return nil if body.nil? || body.empty?
|
150
166
|
|
151
167
|
# return response body directly for String return type
|
152
168
|
return body if return_type == 'String'
|
153
169
|
|
154
|
-
# handle file downloading - save response body into a tmp file and return the File instance
|
155
|
-
return download_file(response) if return_type == 'File'
|
156
|
-
|
157
170
|
# ensuring a default content type
|
158
171
|
content_type = response.headers['Content-Type'] || 'application/json'
|
159
172
|
|
@@ -199,12 +212,12 @@ module CrxPackageManager
|
|
199
212
|
when /\AArray<(.+)>\z/
|
200
213
|
# e.g. Array<Pet>
|
201
214
|
sub_type = $1
|
202
|
-
data.map {|item| convert_to_type(item, sub_type) }
|
215
|
+
data.map { |item| convert_to_type(item, sub_type) }
|
203
216
|
when /\AHash\<String, (.+)\>\z/
|
204
217
|
# e.g. Hash<String, Integer>
|
205
218
|
sub_type = $1
|
206
219
|
{}.tap do |hash|
|
207
|
-
data.each {|k, v| hash[k] = convert_to_type(v, sub_type) }
|
220
|
+
data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
|
208
221
|
end
|
209
222
|
else
|
210
223
|
# models, e.g. Pet
|
@@ -216,30 +229,38 @@ module CrxPackageManager
|
|
216
229
|
|
217
230
|
# Save response body into a file in (the defined) temporary folder, using the filename
|
218
231
|
# from the "Content-Disposition" header if provided, otherwise a random filename.
|
232
|
+
# The response body is written to the file in chunks in order to handle files which
|
233
|
+
# size is larger than maximum Ruby String or even larger than the maximum memory a Ruby
|
234
|
+
# process can use.
|
219
235
|
#
|
220
236
|
# @see Configuration#temp_folder_path
|
221
|
-
|
222
|
-
def download_file(response)
|
223
|
-
content_disposition = response.headers['Content-Disposition']
|
224
|
-
if content_disposition and content_disposition =~ /filename=/i
|
225
|
-
filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
|
226
|
-
prefix = sanitize_filename(filename)
|
227
|
-
else
|
228
|
-
prefix = 'download-'
|
229
|
-
end
|
230
|
-
prefix = prefix + '-' unless prefix.end_with?('-')
|
231
|
-
|
237
|
+
def download_file(request)
|
232
238
|
tempfile = nil
|
233
|
-
encoding =
|
234
|
-
|
235
|
-
|
236
|
-
|
239
|
+
encoding = nil
|
240
|
+
request.on_headers do |response|
|
241
|
+
content_disposition = response.headers['Content-Disposition']
|
242
|
+
if content_disposition && content_disposition =~ /filename=/i
|
243
|
+
filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
|
244
|
+
prefix = sanitize_filename(filename)
|
245
|
+
else
|
246
|
+
prefix = 'download-'
|
247
|
+
end
|
248
|
+
prefix = prefix + '-' unless prefix.end_with?('-')
|
249
|
+
encoding = response.body.encoding
|
250
|
+
tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
|
251
|
+
@tempfile = tempfile
|
252
|
+
end
|
253
|
+
request.on_body do |chunk|
|
254
|
+
chunk.force_encoding(encoding)
|
255
|
+
tempfile.write(chunk)
|
256
|
+
end
|
257
|
+
request.on_complete do |response|
|
258
|
+
tempfile.close
|
259
|
+
@config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
|
260
|
+
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
|
261
|
+
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
|
262
|
+
"explicitly with `tempfile.delete`"
|
237
263
|
end
|
238
|
-
@config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
|
239
|
-
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
|
240
|
-
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
|
241
|
-
"explicitly with `tempfile.delete`"
|
242
|
-
tempfile
|
243
264
|
end
|
244
265
|
|
245
266
|
# Sanitize filename by removing path.
|
@@ -270,7 +291,7 @@ module CrxPackageManager
|
|
270
291
|
data = {}
|
271
292
|
form_params.each do |key, value|
|
272
293
|
case value
|
273
|
-
when File, Array, nil
|
294
|
+
when ::File, ::Array, nil
|
274
295
|
# let typhoeus handle File, Array and nil parameters
|
275
296
|
data[key] = value
|
276
297
|
else
|
@@ -288,7 +309,7 @@ module CrxPackageManager
|
|
288
309
|
# Update hearder and query params based on authentication settings.
|
289
310
|
#
|
290
311
|
# @param [Hash] header_params Header parameters
|
291
|
-
# @param [Hash]
|
312
|
+
# @param [Hash] query_params Query parameters
|
292
313
|
# @param [String] auth_names Authentication scheme name
|
293
314
|
def update_params_for_auth!(header_params, query_params, auth_names)
|
294
315
|
Array(auth_names).each do |auth_name|
|
@@ -317,7 +338,7 @@ module CrxPackageManager
|
|
317
338
|
return nil if accepts.nil? || accepts.empty?
|
318
339
|
# use JSON when present, otherwise use all of the provided
|
319
340
|
json_accept = accepts.find { |s| json_mime?(s) }
|
320
|
-
|
341
|
+
json_accept || accepts.join(',')
|
321
342
|
end
|
322
343
|
|
323
344
|
# Return Content-Type header based on an array of content types provided.
|
@@ -328,7 +349,7 @@ module CrxPackageManager
|
|
328
349
|
return 'application/json' if content_types.nil? || content_types.empty?
|
329
350
|
# use JSON when present, otherwise use the first one
|
330
351
|
json_content_type = content_types.find { |s| json_mime?(s) }
|
331
|
-
|
352
|
+
json_content_type || content_types.first
|
332
353
|
end
|
333
354
|
|
334
355
|
# Convert object (array, hash, object, etc) to JSON string.
|
@@ -338,7 +359,7 @@ module CrxPackageManager
|
|
338
359
|
return model if model.nil? || model.is_a?(String)
|
339
360
|
local_body = nil
|
340
361
|
if model.is_a?(Array)
|
341
|
-
local_body = model.map{|m| object_to_hash(m) }
|
362
|
+
local_body = model.map { |m| object_to_hash(m) }
|
342
363
|
else
|
343
364
|
local_body = object_to_hash(model)
|
344
365
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
=begin
|
2
|
-
|
2
|
+
CRX Package Manager API
|
3
3
|
|
4
|
-
|
4
|
+
API for interacting with the CRX Package Manager in AEM.
|
5
5
|
|
6
6
|
OpenAPI spec version: 6.2.0
|
7
7
|
Contact: bryan.stopp@gmail.com
|
@@ -32,12 +32,14 @@ module CrxPackageManager
|
|
32
32
|
# ApiError.new(:code => 404, :message => "Not Found")
|
33
33
|
def initialize(arg = nil)
|
34
34
|
if arg.is_a? Hash
|
35
|
+
if arg.key?(:message) || arg.key?('message')
|
36
|
+
super(arg[:message] || arg['message'])
|
37
|
+
else
|
38
|
+
super arg
|
39
|
+
end
|
40
|
+
|
35
41
|
arg.each do |k, v|
|
36
|
-
|
37
|
-
super v
|
38
|
-
else
|
39
|
-
instance_variable_set "@#{k}", v
|
40
|
-
end
|
42
|
+
instance_variable_set "@#{k}", v
|
41
43
|
end
|
42
44
|
else
|
43
45
|
super arg
|
@@ -1,7 +1,7 @@
|
|
1
1
|
=begin
|
2
|
-
|
2
|
+
CRX Package Manager API
|
3
3
|
|
4
|
-
|
4
|
+
API for interacting with the CRX Package Manager in AEM.
|
5
5
|
|
6
6
|
OpenAPI spec version: 6.2.0
|
7
7
|
Contact: bryan.stopp@gmail.com
|
@@ -87,6 +87,11 @@ module CrxPackageManager
|
|
87
87
|
# Default to 0 (never times out).
|
88
88
|
attr_accessor :timeout
|
89
89
|
|
90
|
+
# Set this to false to skip client side validation in the operation.
|
91
|
+
# Default to true.
|
92
|
+
# @return [true, false]
|
93
|
+
attr_accessor :client_side_validation
|
94
|
+
|
90
95
|
### TLS/SSL setting
|
91
96
|
# Set this to false to skip verifying SSL certificate when calling API from https server.
|
92
97
|
# Default to true.
|
@@ -140,6 +145,7 @@ module CrxPackageManager
|
|
140
145
|
@api_key = {}
|
141
146
|
@api_key_prefix = {}
|
142
147
|
@timeout = 0
|
148
|
+
@client_side_validation = true
|
143
149
|
@verify_ssl = true
|
144
150
|
@verify_ssl_host = true
|
145
151
|
@params_encoding = nil
|
@@ -175,7 +181,7 @@ module CrxPackageManager
|
|
175
181
|
def base_path=(base_path)
|
176
182
|
# Add leading and trailing slashes to base_path
|
177
183
|
@base_path = "/#{base_path}".gsub(/\/+/, '/')
|
178
|
-
@base_path =
|
184
|
+
@base_path = '' if @base_path == '/'
|
179
185
|
end
|
180
186
|
|
181
187
|
def base_url
|
@@ -1,7 +1,7 @@
|
|
1
1
|
=begin
|
2
|
-
|
2
|
+
CRX Package Manager API
|
3
3
|
|
4
|
-
|
4
|
+
API for interacting with the CRX Package Manager in AEM.
|
5
5
|
|
6
6
|
OpenAPI spec version: 6.2.0
|
7
7
|
Contact: bryan.stopp@gmail.com
|
@@ -24,13 +24,11 @@ limitations under the License.
|
|
24
24
|
require 'date'
|
25
25
|
|
26
26
|
module CrxPackageManager
|
27
|
-
|
28
27
|
class Filter
|
29
28
|
attr_accessor :root
|
30
29
|
|
31
30
|
attr_accessor :rules
|
32
31
|
|
33
|
-
|
34
32
|
# Attribute mapping from ruby-style variable name to JSON key.
|
35
33
|
def self.attribute_map
|
36
34
|
{
|
@@ -53,7 +51,7 @@ module CrxPackageManager
|
|
53
51
|
return unless attributes.is_a?(Hash)
|
54
52
|
|
55
53
|
# convert string to symbol for hash key
|
56
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
54
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
57
55
|
|
58
56
|
if attributes.has_key?(:'root')
|
59
57
|
self.root = attributes[:'root']
|
@@ -64,20 +62,19 @@ module CrxPackageManager
|
|
64
62
|
self.rules = value
|
65
63
|
end
|
66
64
|
end
|
67
|
-
|
68
65
|
end
|
69
66
|
|
70
67
|
# Show invalid properties with the reasons. Usually used together with valid?
|
71
|
-
# @return Array for valid
|
68
|
+
# @return Array for valid properties with the reasons
|
72
69
|
def list_invalid_properties
|
73
70
|
invalid_properties = Array.new
|
74
|
-
|
71
|
+
invalid_properties
|
75
72
|
end
|
76
73
|
|
77
74
|
# Check to see if the all the properties in the model are valid
|
78
75
|
# @return true if the model is valid
|
79
76
|
def valid?
|
80
|
-
|
77
|
+
true
|
81
78
|
end
|
82
79
|
|
83
80
|
# Checks equality by comparing each attribute.
|
@@ -107,11 +104,11 @@ module CrxPackageManager
|
|
107
104
|
def build_from_hash(attributes)
|
108
105
|
return nil unless attributes.is_a?(Hash)
|
109
106
|
self.class.swagger_types.each_pair do |key, type|
|
110
|
-
if type =~
|
107
|
+
if type =~ /\AArray<(.*)>/i
|
111
108
|
# check to ensure the input is an array given that the the attribute
|
112
109
|
# is documented as an array but the input is not
|
113
110
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
114
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
111
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
115
112
|
end
|
116
113
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
117
114
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -138,7 +135,7 @@ module CrxPackageManager
|
|
138
135
|
when :Float
|
139
136
|
value.to_f
|
140
137
|
when :BOOLEAN
|
141
|
-
if value.to_s =~
|
138
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
142
139
|
true
|
143
140
|
else
|
144
141
|
false
|
@@ -149,7 +146,7 @@ module CrxPackageManager
|
|
149
146
|
when /\AArray<(?<inner_type>.+)>\z/
|
150
147
|
inner_type = Regexp.last_match[:inner_type]
|
151
148
|
value.map { |v| _deserialize(inner_type, v) }
|
152
|
-
when /\AHash<(?<k_type
|
149
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
153
150
|
k_type = Regexp.last_match[:k_type]
|
154
151
|
v_type = Regexp.last_match[:v_type]
|
155
152
|
{}.tap do |hash|
|
@@ -193,7 +190,7 @@ module CrxPackageManager
|
|
193
190
|
# @return [Hash] Returns the value in the form of hash
|
194
191
|
def _to_hash(value)
|
195
192
|
if value.is_a?(Array)
|
196
|
-
value.compact.map{ |v| _to_hash(v) }
|
193
|
+
value.compact.map { |v| _to_hash(v) }
|
197
194
|
elsif value.is_a?(Hash)
|
198
195
|
{}.tap do |hash|
|
199
196
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -204,7 +201,5 @@ module CrxPackageManager
|
|
204
201
|
value
|
205
202
|
end
|
206
203
|
end
|
207
|
-
|
208
204
|
end
|
209
|
-
|
210
205
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
=begin
|
2
|
-
|
2
|
+
CRX Package Manager API
|
3
3
|
|
4
|
-
|
4
|
+
API for interacting with the CRX Package Manager in AEM.
|
5
5
|
|
6
6
|
OpenAPI spec version: 6.2.0
|
7
7
|
Contact: bryan.stopp@gmail.com
|
@@ -24,7 +24,6 @@ limitations under the License.
|
|
24
24
|
require 'date'
|
25
25
|
|
26
26
|
module CrxPackageManager
|
27
|
-
|
28
27
|
class FilterRule
|
29
28
|
attr_accessor :modifier
|
30
29
|
|
@@ -74,7 +73,7 @@ module CrxPackageManager
|
|
74
73
|
return unless attributes.is_a?(Hash)
|
75
74
|
|
76
75
|
# convert string to symbol for hash key
|
77
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
76
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
78
77
|
|
79
78
|
if attributes.has_key?(:'modifier')
|
80
79
|
self.modifier = attributes[:'modifier']
|
@@ -83,30 +82,29 @@ module CrxPackageManager
|
|
83
82
|
if attributes.has_key?(:'pattern')
|
84
83
|
self.pattern = attributes[:'pattern']
|
85
84
|
end
|
86
|
-
|
87
85
|
end
|
88
86
|
|
89
87
|
# Show invalid properties with the reasons. Usually used together with valid?
|
90
|
-
# @return Array for valid
|
88
|
+
# @return Array for valid properties with the reasons
|
91
89
|
def list_invalid_properties
|
92
90
|
invalid_properties = Array.new
|
93
|
-
|
91
|
+
invalid_properties
|
94
92
|
end
|
95
93
|
|
96
94
|
# Check to see if the all the properties in the model are valid
|
97
95
|
# @return true if the model is valid
|
98
96
|
def valid?
|
99
|
-
modifier_validator = EnumAttributeValidator.new('String', [
|
97
|
+
modifier_validator = EnumAttributeValidator.new('String', ['exclude', 'include'])
|
100
98
|
return false unless modifier_validator.valid?(@modifier)
|
101
|
-
|
99
|
+
true
|
102
100
|
end
|
103
101
|
|
104
102
|
# Custom attribute writer method checking allowed values (enum).
|
105
103
|
# @param [Object] modifier Object to be assigned
|
106
104
|
def modifier=(modifier)
|
107
|
-
validator = EnumAttributeValidator.new('String', [
|
105
|
+
validator = EnumAttributeValidator.new('String', ['exclude', 'include'])
|
108
106
|
unless validator.valid?(modifier)
|
109
|
-
fail ArgumentError,
|
107
|
+
fail ArgumentError, 'invalid value for "modifier", must be one of #{validator.allowable_values}.'
|
110
108
|
end
|
111
109
|
@modifier = modifier
|
112
110
|
end
|
@@ -138,11 +136,11 @@ module CrxPackageManager
|
|
138
136
|
def build_from_hash(attributes)
|
139
137
|
return nil unless attributes.is_a?(Hash)
|
140
138
|
self.class.swagger_types.each_pair do |key, type|
|
141
|
-
if type =~
|
139
|
+
if type =~ /\AArray<(.*)>/i
|
142
140
|
# check to ensure the input is an array given that the the attribute
|
143
141
|
# is documented as an array but the input is not
|
144
142
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
145
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) }
|
143
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
146
144
|
end
|
147
145
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
148
146
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
@@ -169,7 +167,7 @@ module CrxPackageManager
|
|
169
167
|
when :Float
|
170
168
|
value.to_f
|
171
169
|
when :BOOLEAN
|
172
|
-
if value.to_s =~
|
170
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
173
171
|
true
|
174
172
|
else
|
175
173
|
false
|
@@ -180,7 +178,7 @@ module CrxPackageManager
|
|
180
178
|
when /\AArray<(?<inner_type>.+)>\z/
|
181
179
|
inner_type = Regexp.last_match[:inner_type]
|
182
180
|
value.map { |v| _deserialize(inner_type, v) }
|
183
|
-
when /\AHash<(?<k_type
|
181
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
184
182
|
k_type = Regexp.last_match[:k_type]
|
185
183
|
v_type = Regexp.last_match[:v_type]
|
186
184
|
{}.tap do |hash|
|
@@ -224,7 +222,7 @@ module CrxPackageManager
|
|
224
222
|
# @return [Hash] Returns the value in the form of hash
|
225
223
|
def _to_hash(value)
|
226
224
|
if value.is_a?(Array)
|
227
|
-
value.compact.map{ |v| _to_hash(v) }
|
225
|
+
value.compact.map { |v| _to_hash(v) }
|
228
226
|
elsif value.is_a?(Hash)
|
229
227
|
{}.tap do |hash|
|
230
228
|
value.each { |k, v| hash[k] = _to_hash(v) }
|
@@ -235,7 +233,5 @@ module CrxPackageManager
|
|
235
233
|
value
|
236
234
|
end
|
237
235
|
end
|
238
|
-
|
239
236
|
end
|
240
|
-
|
241
237
|
end
|