Class: CloudsmithApi::RecycleBinPackage
- Inherits:
-
Object
- Object
- CloudsmithApi::RecycleBinPackage
- Defined in:
- lib/cloudsmith-api/models/recycle_bin_package.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#action_by ⇒ Object
The name of the user who deleted the package.
-
#downloads ⇒ Object
Returns the value of attribute downloads.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#format ⇒ Object
Returns the value of attribute format.
-
#fully_qualified_name ⇒ Object
The fully qualified name of the package.
-
#identifiers ⇒ Object
Returns the value of attribute identifiers.
-
#invoked_retention_rule ⇒ Object
Information about the retention rule that triggered deletion (if any).
-
#is_deleteable ⇒ Object
Returns the value of attribute is_deleteable.
-
#is_malware_detected ⇒ Object
Whether the package has been detected as containing malware.
-
#is_quarantined ⇒ Object
Returns the value of attribute is_quarantined.
-
#is_restorable ⇒ Object
Returns the value of attribute is_restorable.
-
#name ⇒ Object
The name of this package.
-
#policy_violated ⇒ Object
Whether or not the package has violated any policy.
-
#repository ⇒ Object
Returns the value of attribute repository.
-
#security_scan_completed_at ⇒ Object
The datetime the security scanning was completed.
-
#security_scan_status ⇒ Object
Returns the value of attribute security_scan_status.
-
#size ⇒ Object
The calculated size of the package.
-
#slug_perm ⇒ Object
Returns the value of attribute slug_perm.
-
#status ⇒ Object
The synchronisation status of the package.
-
#status_updated_at ⇒ Object
The datetime the package status was updated at.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#type_display ⇒ Object
Returns the value of attribute type_display.
-
#uploaded_at ⇒ Object
The date this package was uploaded.
-
#uploader ⇒ Object
Returns the value of attribute uploader.
-
#version ⇒ Object
The raw version for this package.
-
#vulnerability_counts ⇒ Object
Returns the value of attribute vulnerability_counts.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ RecycleBinPackage
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ RecycleBinPackage
Initializes the object
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 169 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'action_by') self.action_by = attributes[:'action_by'] end if attributes.has_key?(:'downloads') self.downloads = attributes[:'downloads'] end if attributes.has_key?(:'filename') self.filename = attributes[:'filename'] end if attributes.has_key?(:'format') self.format = attributes[:'format'] end if attributes.has_key?(:'fully_qualified_name') self.fully_qualified_name = attributes[:'fully_qualified_name'] end if attributes.has_key?(:'identifiers') if (value = attributes[:'identifiers']).is_a?(Hash) self.identifiers = value end end if attributes.has_key?(:'invoked_retention_rule') if (value = attributes[:'invoked_retention_rule']).is_a?(Hash) self.invoked_retention_rule = value end end if attributes.has_key?(:'is_deleteable') self.is_deleteable = attributes[:'is_deleteable'] end if attributes.has_key?(:'is_malware_detected') self.is_malware_detected = attributes[:'is_malware_detected'] end if attributes.has_key?(:'is_quarantined') self.is_quarantined = attributes[:'is_quarantined'] end if attributes.has_key?(:'is_restorable') self.is_restorable = attributes[:'is_restorable'] end if attributes.has_key?(:'name') self.name = attributes[:'name'] end if attributes.has_key?(:'policy_violated') self.policy_violated = attributes[:'policy_violated'] end if attributes.has_key?(:'repository') self.repository = attributes[:'repository'] end if attributes.has_key?(:'security_scan_completed_at') self.security_scan_completed_at = attributes[:'security_scan_completed_at'] end if attributes.has_key?(:'security_scan_status') self.security_scan_status = attributes[:'security_scan_status'] else self.security_scan_status = 'Awaiting Security Scan' end if attributes.has_key?(:'size') self.size = attributes[:'size'] end if attributes.has_key?(:'slug_perm') self.slug_perm = attributes[:'slug_perm'] end if attributes.has_key?(:'status') self.status = attributes[:'status'] end if attributes.has_key?(:'status_updated_at') self.status_updated_at = attributes[:'status_updated_at'] end if attributes.has_key?(:'tags') self. = attributes[:'tags'] end if attributes.has_key?(:'type_display') self.type_display = attributes[:'type_display'] end if attributes.has_key?(:'uploaded_at') self.uploaded_at = attributes[:'uploaded_at'] end if attributes.has_key?(:'uploader') self.uploader = attributes[:'uploader'] end if attributes.has_key?(:'version') self.version = attributes[:'version'] end if attributes.has_key?(:'vulnerability_counts') self.vulnerability_counts = attributes[:'vulnerability_counts'] end end |
Instance Attribute Details
#action_by ⇒ Object
The name of the user who deleted the package.
18 19 20 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 18 def action_by @action_by end |
#downloads ⇒ Object
Returns the value of attribute downloads.
20 21 22 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 20 def downloads @downloads end |
#filename ⇒ Object
Returns the value of attribute filename.
22 23 24 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 22 def filename @filename end |
#format ⇒ Object
Returns the value of attribute format.
24 25 26 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 24 def format @format end |
#fully_qualified_name ⇒ Object
The fully qualified name of the package.
27 28 29 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 27 def fully_qualified_name @fully_qualified_name end |
#identifiers ⇒ Object
Returns the value of attribute identifiers.
29 30 31 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 29 def identifiers @identifiers end |
#invoked_retention_rule ⇒ Object
Information about the retention rule that triggered deletion (if any).
32 33 34 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 32 def invoked_retention_rule @invoked_retention_rule end |
#is_deleteable ⇒ Object
Returns the value of attribute is_deleteable.
34 35 36 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 34 def is_deleteable @is_deleteable end |
#is_malware_detected ⇒ Object
Whether the package has been detected as containing malware. Requires Ultra plan.
37 38 39 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 37 def is_malware_detected @is_malware_detected end |
#is_quarantined ⇒ Object
Returns the value of attribute is_quarantined.
39 40 41 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 39 def is_quarantined @is_quarantined end |
#is_restorable ⇒ Object
Returns the value of attribute is_restorable.
41 42 43 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 41 def is_restorable @is_restorable end |
#name ⇒ Object
The name of this package.
44 45 46 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 44 def name @name end |
#policy_violated ⇒ Object
Whether or not the package has violated any policy.
47 48 49 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 47 def policy_violated @policy_violated end |
#repository ⇒ Object
Returns the value of attribute repository.
49 50 51 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 49 def repository @repository end |
#security_scan_completed_at ⇒ Object
The datetime the security scanning was completed.
52 53 54 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 52 def security_scan_completed_at @security_scan_completed_at end |
#security_scan_status ⇒ Object
Returns the value of attribute security_scan_status.
54 55 56 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 54 def security_scan_status @security_scan_status end |
#size ⇒ Object
The calculated size of the package.
57 58 59 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 57 def size @size end |
#slug_perm ⇒ Object
Returns the value of attribute slug_perm.
59 60 61 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 59 def slug_perm @slug_perm end |
#status ⇒ Object
The synchronisation status of the package.
62 63 64 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 62 def status @status end |
#status_updated_at ⇒ Object
The datetime the package status was updated at.
65 66 67 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 65 def status_updated_at @status_updated_at end |
#tags ⇒ Object
Returns the value of attribute tags.
67 68 69 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 67 def @tags end |
#type_display ⇒ Object
Returns the value of attribute type_display.
69 70 71 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 69 def type_display @type_display end |
#uploaded_at ⇒ Object
The date this package was uploaded.
72 73 74 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 72 def uploaded_at @uploaded_at end |
#uploader ⇒ Object
Returns the value of attribute uploader.
74 75 76 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 74 def uploader @uploader end |
#version ⇒ Object
The raw version for this package.
77 78 79 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 77 def version @version end |
#vulnerability_counts ⇒ Object
Returns the value of attribute vulnerability_counts.
79 80 81 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 79 def vulnerability_counts @vulnerability_counts end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 104 def self.attribute_map { :'action_by' => :'action_by', :'downloads' => :'downloads', :'filename' => :'filename', :'format' => :'format', :'fully_qualified_name' => :'fully_qualified_name', :'identifiers' => :'identifiers', :'invoked_retention_rule' => :'invoked_retention_rule', :'is_deleteable' => :'is_deleteable', :'is_malware_detected' => :'is_malware_detected', :'is_quarantined' => :'is_quarantined', :'is_restorable' => :'is_restorable', :'name' => :'name', :'policy_violated' => :'policy_violated', :'repository' => :'repository', :'security_scan_completed_at' => :'security_scan_completed_at', :'security_scan_status' => :'security_scan_status', :'size' => :'size', :'slug_perm' => :'slug_perm', :'status' => :'status', :'status_updated_at' => :'status_updated_at', :'tags' => :'tags', :'type_display' => :'type_display', :'uploaded_at' => :'uploaded_at', :'uploader' => :'uploader', :'version' => :'version', :'vulnerability_counts' => :'vulnerability_counts' } end |
.swagger_types ⇒ Object
Attribute type mapping.
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 136 def self.swagger_types { :'action_by' => :'String', :'downloads' => :'Integer', :'filename' => :'String', :'format' => :'String', :'fully_qualified_name' => :'String', :'identifiers' => :'Hash<String, String>', :'invoked_retention_rule' => :'Hash<String, String>', :'is_deleteable' => :'BOOLEAN', :'is_malware_detected' => :'BOOLEAN', :'is_quarantined' => :'BOOLEAN', :'is_restorable' => :'BOOLEAN', :'name' => :'String', :'policy_violated' => :'BOOLEAN', :'repository' => :'String', :'security_scan_completed_at' => :'DateTime', :'security_scan_status' => :'String', :'size' => :'Integer', :'slug_perm' => :'String', :'status' => :'Integer', :'status_updated_at' => :'DateTime', :'tags' => :'Tags', :'type_display' => :'String', :'uploaded_at' => :'DateTime', :'uploader' => :'String', :'version' => :'String', :'vulnerability_counts' => :'WebOSVSeverityCounts' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 313 def ==(o) return true if self.equal?(o) self.class == o.class && action_by == o.action_by && downloads == o.downloads && filename == o.filename && format == o.format && fully_qualified_name == o.fully_qualified_name && identifiers == o.identifiers && invoked_retention_rule == o.invoked_retention_rule && is_deleteable == o.is_deleteable && is_malware_detected == o.is_malware_detected && is_quarantined == o.is_quarantined && is_restorable == o.is_restorable && name == o.name && policy_violated == o.policy_violated && repository == o.repository && security_scan_completed_at == o.security_scan_completed_at && security_scan_status == o.security_scan_status && size == o.size && slug_perm == o.slug_perm && status == o.status && status_updated_at == o.status_updated_at && == o. && type_display == o.type_display && uploaded_at == o.uploaded_at && uploader == o.uploader && version == o.version && vulnerability_counts == o.vulnerability_counts end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 380 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model temp_model = CloudsmithApi.const_get(type).new temp_model.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
446 447 448 449 450 451 452 453 454 455 456 457 458 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 446 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 359 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(o) ⇒ Boolean
346 347 348 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 346 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
352 353 354 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 352 def hash [action_by, downloads, filename, format, fully_qualified_name, identifiers, invoked_retention_rule, is_deleteable, is_malware_detected, is_quarantined, is_restorable, name, policy_violated, repository, security_scan_completed_at, security_scan_status, size, slug_perm, status, status_updated_at, , type_display, uploaded_at, uploader, version, vulnerability_counts].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
288 289 290 291 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 288 def list_invalid_properties invalid_properties = Array.new invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
426 427 428 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 426 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
432 433 434 435 436 437 438 439 440 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 432 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
420 421 422 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 420 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
295 296 297 298 299 |
# File 'lib/cloudsmith-api/models/recycle_bin_package.rb', line 295 def valid? security_scan_status_validator = EnumAttributeValidator.new('String', ['Awaiting Security Scan', 'Security Scanning in Progress', 'Scan Detected Vulnerabilities', 'Scan Detected No Vulnerabilities', 'Security Scanning Disabled', 'Security Scanning Failed', 'Security Scanning Skipped', 'Security Scanning Not Supported']) return false unless security_scan_status_validator.valid?(@security_scan_status) true end |