Class: DependencyTracker::Component
- Inherits:
-
Object
- Object
- DependencyTracker::Component
- Defined in:
- lib/dependency-tracker-client/models/component.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
-
#classifier ⇒ Object
Returns the value of attribute classifier.
-
#copyright ⇒ Object
Returns the value of attribute copyright.
-
#cpe ⇒ Object
Returns the value of attribute cpe.
-
#description ⇒ Object
Returns the value of attribute description.
-
#extension ⇒ Object
Returns the value of attribute extension.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#group ⇒ Object
Returns the value of attribute group.
-
#is_internal ⇒ Object
Returns the value of attribute is_internal.
-
#last_inherited_risk_score ⇒ Object
Returns the value of attribute last_inherited_risk_score.
-
#license ⇒ Object
Returns the value of attribute license.
-
#md5 ⇒ Object
Returns the value of attribute md5.
-
#metrics ⇒ Object
Returns the value of attribute metrics.
-
#name ⇒ Object
Returns the value of attribute name.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#purl ⇒ Object
Returns the value of attribute purl.
-
#repository_meta ⇒ Object
Returns the value of attribute repository_meta.
-
#resolved_license ⇒ Object
Returns the value of attribute resolved_license.
-
#sha1 ⇒ Object
Returns the value of attribute sha1.
-
#sha256 ⇒ Object
Returns the value of attribute sha256.
-
#sha3_256 ⇒ Object
Returns the value of attribute sha3_256.
-
#sha3_512 ⇒ Object
Returns the value of attribute sha3_512.
-
#sha512 ⇒ Object
Returns the value of attribute sha512.
-
#used_by ⇒ Object
Returns the value of attribute used_by.
-
#uuid ⇒ Object
Returns the value of attribute uuid.
-
#version ⇒ Object
Returns the value of attribute version.
-
#vulnerabilities ⇒ Object
Returns the value of attribute vulnerabilities.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_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 ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ Component
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 = {}) ⇒ Component
Initializes the object
167 168 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 285 286 287 288 289 290 291 |
# File 'lib/dependency-tracker-client/models/component.rb', line 167 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `DependencyTracker::Component` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `DependencyTracker::Component`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'group') self.group = attributes[:'group'] end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'version') self.version = attributes[:'version'] end if attributes.key?(:'classifier') self.classifier = attributes[:'classifier'] end if attributes.key?(:'filename') self.filename = attributes[:'filename'] end if attributes.key?(:'extension') self.extension = attributes[:'extension'] end if attributes.key?(:'md5') self.md5 = attributes[:'md5'] end if attributes.key?(:'sha1') self.sha1 = attributes[:'sha1'] end if attributes.key?(:'sha256') self.sha256 = attributes[:'sha256'] end if attributes.key?(:'sha512') self.sha512 = attributes[:'sha512'] end if attributes.key?(:'sha3_256') self.sha3_256 = attributes[:'sha3_256'] end if attributes.key?(:'sha3_512') self.sha3_512 = attributes[:'sha3_512'] end if attributes.key?(:'cpe') self.cpe = attributes[:'cpe'] end if attributes.key?(:'purl') self.purl = attributes[:'purl'] end if attributes.key?(:'description') self.description = attributes[:'description'] end if attributes.key?(:'copyright') self.copyright = attributes[:'copyright'] end if attributes.key?(:'license') self.license = attributes[:'license'] end if attributes.key?(:'resolved_license') self.resolved_license = attributes[:'resolved_license'] end if attributes.key?(:'parent') self.parent = attributes[:'parent'] end if attributes.key?(:'children') if (value = attributes[:'children']).is_a?(Array) self.children = value end end if attributes.key?(:'vulnerabilities') if (value = attributes[:'vulnerabilities']).is_a?(Array) self.vulnerabilities = value end end if attributes.key?(:'last_inherited_risk_score') self.last_inherited_risk_score = attributes[:'last_inherited_risk_score'] end if attributes.key?(:'uuid') self.uuid = attributes[:'uuid'] end if attributes.key?(:'metrics') self.metrics = attributes[:'metrics'] end if attributes.key?(:'repository_meta') self. = attributes[:'repository_meta'] end if attributes.key?(:'used_by') self.used_by = attributes[:'used_by'] end if attributes.key?(:'is_internal') self.is_internal = attributes[:'is_internal'] end end |
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
55 56 57 |
# File 'lib/dependency-tracker-client/models/component.rb', line 55 def children @children end |
#classifier ⇒ Object
Returns the value of attribute classifier.
23 24 25 |
# File 'lib/dependency-tracker-client/models/component.rb', line 23 def classifier @classifier end |
#copyright ⇒ Object
Returns the value of attribute copyright.
47 48 49 |
# File 'lib/dependency-tracker-client/models/component.rb', line 47 def copyright @copyright end |
#cpe ⇒ Object
Returns the value of attribute cpe.
41 42 43 |
# File 'lib/dependency-tracker-client/models/component.rb', line 41 def cpe @cpe end |
#description ⇒ Object
Returns the value of attribute description.
45 46 47 |
# File 'lib/dependency-tracker-client/models/component.rb', line 45 def description @description end |
#extension ⇒ Object
Returns the value of attribute extension.
27 28 29 |
# File 'lib/dependency-tracker-client/models/component.rb', line 27 def extension @extension end |
#filename ⇒ Object
Returns the value of attribute filename.
25 26 27 |
# File 'lib/dependency-tracker-client/models/component.rb', line 25 def filename @filename end |
#group ⇒ Object
Returns the value of attribute group.
17 18 19 |
# File 'lib/dependency-tracker-client/models/component.rb', line 17 def group @group end |
#is_internal ⇒ Object
Returns the value of attribute is_internal.
69 70 71 |
# File 'lib/dependency-tracker-client/models/component.rb', line 69 def is_internal @is_internal end |
#last_inherited_risk_score ⇒ Object
Returns the value of attribute last_inherited_risk_score.
59 60 61 |
# File 'lib/dependency-tracker-client/models/component.rb', line 59 def last_inherited_risk_score @last_inherited_risk_score end |
#license ⇒ Object
Returns the value of attribute license.
49 50 51 |
# File 'lib/dependency-tracker-client/models/component.rb', line 49 def license @license end |
#md5 ⇒ Object
Returns the value of attribute md5.
29 30 31 |
# File 'lib/dependency-tracker-client/models/component.rb', line 29 def md5 @md5 end |
#metrics ⇒ Object
Returns the value of attribute metrics.
63 64 65 |
# File 'lib/dependency-tracker-client/models/component.rb', line 63 def metrics @metrics end |
#name ⇒ Object
Returns the value of attribute name.
19 20 21 |
# File 'lib/dependency-tracker-client/models/component.rb', line 19 def name @name end |
#parent ⇒ Object
Returns the value of attribute parent.
53 54 55 |
# File 'lib/dependency-tracker-client/models/component.rb', line 53 def parent @parent end |
#purl ⇒ Object
Returns the value of attribute purl.
43 44 45 |
# File 'lib/dependency-tracker-client/models/component.rb', line 43 def purl @purl end |
#repository_meta ⇒ Object
Returns the value of attribute repository_meta.
65 66 67 |
# File 'lib/dependency-tracker-client/models/component.rb', line 65 def end |
#resolved_license ⇒ Object
Returns the value of attribute resolved_license.
51 52 53 |
# File 'lib/dependency-tracker-client/models/component.rb', line 51 def resolved_license @resolved_license end |
#sha1 ⇒ Object
Returns the value of attribute sha1.
31 32 33 |
# File 'lib/dependency-tracker-client/models/component.rb', line 31 def sha1 @sha1 end |
#sha256 ⇒ Object
Returns the value of attribute sha256.
33 34 35 |
# File 'lib/dependency-tracker-client/models/component.rb', line 33 def sha256 @sha256 end |
#sha3_256 ⇒ Object
Returns the value of attribute sha3_256.
37 38 39 |
# File 'lib/dependency-tracker-client/models/component.rb', line 37 def sha3_256 @sha3_256 end |
#sha3_512 ⇒ Object
Returns the value of attribute sha3_512.
39 40 41 |
# File 'lib/dependency-tracker-client/models/component.rb', line 39 def sha3_512 @sha3_512 end |
#sha512 ⇒ Object
Returns the value of attribute sha512.
35 36 37 |
# File 'lib/dependency-tracker-client/models/component.rb', line 35 def sha512 @sha512 end |
#used_by ⇒ Object
Returns the value of attribute used_by.
67 68 69 |
# File 'lib/dependency-tracker-client/models/component.rb', line 67 def used_by @used_by end |
#uuid ⇒ Object
Returns the value of attribute uuid.
61 62 63 |
# File 'lib/dependency-tracker-client/models/component.rb', line 61 def uuid @uuid end |
#version ⇒ Object
Returns the value of attribute version.
21 22 23 |
# File 'lib/dependency-tracker-client/models/component.rb', line 21 def version @version end |
#vulnerabilities ⇒ Object
Returns the value of attribute vulnerabilities.
57 58 59 |
# File 'lib/dependency-tracker-client/models/component.rb', line 57 def vulnerabilities @vulnerabilities end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/dependency-tracker-client/models/component.rb', line 94 def self.attribute_map { :'group' => :'group', :'name' => :'name', :'version' => :'version', :'classifier' => :'classifier', :'filename' => :'filename', :'extension' => :'extension', :'md5' => :'md5', :'sha1' => :'sha1', :'sha256' => :'sha256', :'sha512' => :'sha512', :'sha3_256' => :'sha3_256', :'sha3_512' => :'sha3_512', :'cpe' => :'cpe', :'purl' => :'purl', :'description' => :'description', :'copyright' => :'copyright', :'license' => :'license', :'resolved_license' => :'resolvedLicense', :'parent' => :'parent', :'children' => :'children', :'vulnerabilities' => :'vulnerabilities', :'last_inherited_risk_score' => :'lastInheritedRiskScore', :'uuid' => :'uuid', :'metrics' => :'metrics', :'repository_meta' => :'repositoryMeta', :'used_by' => :'usedBy', :'is_internal' => :'isInternal' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
789 790 791 |
# File 'lib/dependency-tracker-client/models/component.rb', line 789 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
160 161 162 163 |
# File 'lib/dependency-tracker-client/models/component.rb', line 160 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/dependency-tracker-client/models/component.rb', line 127 def self.openapi_types { :'group' => :'String', :'name' => :'String', :'version' => :'String', :'classifier' => :'String', :'filename' => :'String', :'extension' => :'String', :'md5' => :'String', :'sha1' => :'String', :'sha256' => :'String', :'sha512' => :'String', :'sha3_256' => :'String', :'sha3_512' => :'String', :'cpe' => :'String', :'purl' => :'PackageURL', :'description' => :'String', :'copyright' => :'String', :'license' => :'String', :'resolved_license' => :'License', :'parent' => :'Component', :'children' => :'Array<Component>', :'vulnerabilities' => :'Array<Vulnerability>', :'last_inherited_risk_score' => :'Float', :'uuid' => :'String', :'metrics' => :'ComponentMetrics', :'repository_meta' => :'RepositoryMetaComponent', :'used_by' => :'Integer', :'is_internal' => :'Boolean' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 |
# File 'lib/dependency-tracker-client/models/component.rb', line 742 def ==(o) return true if self.equal?(o) self.class == o.class && group == o.group && name == o.name && version == o.version && classifier == o.classifier && filename == o.filename && extension == o.extension && md5 == o.md5 && sha1 == o.sha1 && sha256 == o.sha256 && sha512 == o.sha512 && sha3_256 == o.sha3_256 && sha3_512 == o.sha3_512 && cpe == o.cpe && purl == o.purl && description == o.description && copyright == o.copyright && license == o.license && resolved_license == o.resolved_license && parent == o.parent && children == o.children && vulnerabilities == o.vulnerabilities && last_inherited_risk_score == o.last_inherited_risk_score && uuid == o.uuid && metrics == o.metrics && == o. && used_by == o.used_by && is_internal == o.is_internal end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 |
# File 'lib/dependency-tracker-client/models/component.rb', line 817 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 DependencyTracker.const_get(type).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
886 887 888 889 890 891 892 893 894 895 896 897 898 |
# File 'lib/dependency-tracker-client/models/component.rb', line 886 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
796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 |
# File 'lib/dependency-tracker-client/models/component.rb', line 796 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_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
776 777 778 |
# File 'lib/dependency-tracker-client/models/component.rb', line 776 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
782 783 784 |
# File 'lib/dependency-tracker-client/models/component.rb', line 782 def hash [group, name, version, classifier, filename, extension, md5, sha1, sha256, sha512, sha3_256, sha3_512, cpe, purl, description, copyright, license, resolved_license, parent, children, vulnerabilities, last_inherited_risk_score, uuid, metrics, , used_by, is_internal].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 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 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 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 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 |
# File 'lib/dependency-tracker-client/models/component.rb', line 295 def list_invalid_properties invalid_properties = Array.new if !@group.nil? && @group.to_s.length > 255 invalid_properties.push('invalid value for "group", the character length must be smaller than or equal to 255.') end if !@group.nil? && @group.to_s.length < 0 invalid_properties.push('invalid value for "group", the character length must be great than or equal to 0.') end pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/) if !@group.nil? && @group !~ pattern invalid_properties.push("invalid value for \"group\", must conform to the pattern #{pattern}.") end if !@name.nil? && @name.to_s.length > 255 invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.') end if !@name.nil? && @name.to_s.length < 1 invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.') end pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/) if !@name.nil? && @name !~ pattern invalid_properties.push("invalid value for \"name\", must conform to the pattern #{pattern}.") end if !@version.nil? && @version.to_s.length > 255 invalid_properties.push('invalid value for "version", the character length must be smaller than or equal to 255.') end if !@version.nil? && @version.to_s.length < 0 invalid_properties.push('invalid value for "version", the character length must be great than or equal to 0.') end pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/) if !@version.nil? && @version !~ pattern invalid_properties.push("invalid value for \"version\", must conform to the pattern #{pattern}.") end if !@filename.nil? && @filename.to_s.length > 255 invalid_properties.push('invalid value for "filename", the character length must be smaller than or equal to 255.') end if !@filename.nil? && @filename.to_s.length < 0 invalid_properties.push('invalid value for "filename", the character length must be great than or equal to 0.') end pattern = Regexp.new(/^[\p{Alnum}:\/\\!@#$%^&{}\[\]()_+\-=,.~'` ]{1,255}$/) if !@filename.nil? && @filename !~ pattern invalid_properties.push("invalid value for \"filename\", must conform to the pattern #{pattern}.") end if !@extension.nil? && @extension.to_s.length > 255 invalid_properties.push('invalid value for "extension", the character length must be smaller than or equal to 255.') end if !@extension.nil? && @extension.to_s.length < 0 invalid_properties.push('invalid value for "extension", the character length must be great than or equal to 0.') end pattern = Regexp.new(/^[\p{Alnum}!@#$%^&{}\[\]()_+\-=,.~'` ]{1,255}$/) if !@extension.nil? && @extension !~ pattern invalid_properties.push("invalid value for \"extension\", must conform to the pattern #{pattern}.") end pattern = Regexp.new(/^[0-9a-f]{32}$/) if !@md5.nil? && @md5 !~ pattern invalid_properties.push("invalid value for \"md5\", must conform to the pattern #{pattern}.") end pattern = Regexp.new(/^[0-9a-f]{40}$/) if !@sha1.nil? && @sha1 !~ pattern invalid_properties.push("invalid value for \"sha1\", must conform to the pattern #{pattern}.") end pattern = Regexp.new(/^[0-9a-f]{64}$/) if !@sha256.nil? && @sha256 !~ pattern invalid_properties.push("invalid value for \"sha256\", must conform to the pattern #{pattern}.") end pattern = Regexp.new(/^[0-9a-f]{128}$/) if !@sha512.nil? && @sha512 !~ pattern invalid_properties.push("invalid value for \"sha512\", must conform to the pattern #{pattern}.") end pattern = Regexp.new(/^[0-9a-f]{64}$/) if !@sha3_256.nil? && @sha3_256 !~ pattern invalid_properties.push("invalid value for \"sha3_256\", must conform to the pattern #{pattern}.") end pattern = Regexp.new(/^[0-9a-f]{128}$/) if !@sha3_512.nil? && @sha3_512 !~ pattern invalid_properties.push("invalid value for \"sha3_512\", must conform to the pattern #{pattern}.") end if !@cpe.nil? && @cpe.to_s.length > 255 invalid_properties.push('invalid value for "cpe", the character length must be smaller than or equal to 255.') end if !@cpe.nil? && @cpe.to_s.length < 0 invalid_properties.push('invalid value for "cpe", the character length must be great than or equal to 0.') end pattern = Regexp.new(/(cpe:2\.3:[aho\*\-](:(((\?*|\*?)([a-zA-Z0-9\-\._]|(\\[\\\*\?!"#$$%&'\(\)\+,\/:;<=>@\[\]\^`\{\|}~]))+(\?*|\*?))|[\*\-])){5}(:(([a-zA-Z]{2,3}(-([a-zA-Z]{2}|[0-9]{3}))?)|[\*\-]))(:(((\?*|\*?)([a-zA-Z0-9\-\._]|(\\[\\\*\?!"#$$%&'\(\)\+,\/:;<=>@\[\]\^`\{\|}~]))+(\?*|\*?))|[\*\-])){4})|([c][pP][eE]:\/[AHOaho]?(:[A-Za-z0-9\._\-~%]*){0,6})/) if !@cpe.nil? && @cpe !~ pattern invalid_properties.push("invalid value for \"cpe\", must conform to the pattern #{pattern}.") end if !@description.nil? && @description.to_s.length > 1024 invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 1024.') end if !@description.nil? && @description.to_s.length < 0 invalid_properties.push('invalid value for "description", the character length must be great than or equal to 0.') end pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/) if !@description.nil? && @description !~ pattern invalid_properties.push("invalid value for \"description\", must conform to the pattern #{pattern}.") end if !@copyright.nil? && @copyright.to_s.length > 1024 invalid_properties.push('invalid value for "copyright", the character length must be smaller than or equal to 1024.') end if !@copyright.nil? && @copyright.to_s.length < 0 invalid_properties.push('invalid value for "copyright", the character length must be great than or equal to 0.') end pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/) if !@copyright.nil? && @copyright !~ pattern invalid_properties.push("invalid value for \"copyright\", must conform to the pattern #{pattern}.") end if !@license.nil? && @license.to_s.length > 255 invalid_properties.push('invalid value for "license", the character length must be smaller than or equal to 255.') end if !@license.nil? && @license.to_s.length < 0 invalid_properties.push('invalid value for "license", the character length must be great than or equal to 0.') end pattern = Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/) if !@license.nil? && @license !~ pattern invalid_properties.push("invalid value for \"license\", must conform to the pattern #{pattern}.") end if @uuid.nil? invalid_properties.push('invalid value for "uuid", uuid cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
862 863 864 |
# File 'lib/dependency-tracker-client/models/component.rb', line 862 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
868 869 870 871 872 873 874 875 876 877 878 879 880 |
# File 'lib/dependency-tracker-client/models/component.rb', line 868 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
856 857 858 |
# File 'lib/dependency-tracker-client/models/component.rb', line 856 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 |
# File 'lib/dependency-tracker-client/models/component.rb', line 453 def valid? return false if !@group.nil? && @group.to_s.length > 255 return false if !@group.nil? && @group.to_s.length < 0 return false if !@group.nil? && @group !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/) return false if !@name.nil? && @name.to_s.length > 255 return false if !@name.nil? && @name.to_s.length < 1 return false if !@name.nil? && @name !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/) return false if !@version.nil? && @version.to_s.length > 255 return false if !@version.nil? && @version.to_s.length < 0 return false if !@version.nil? && @version !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/) classifier_validator = EnumAttributeValidator.new('String', ["APPLICATION", "FRAMEWORK", "LIBRARY", "OPERATING_SYSTEM", "DEVICE", "FILE"]) return false unless classifier_validator.valid?(@classifier) return false if !@filename.nil? && @filename.to_s.length > 255 return false if !@filename.nil? && @filename.to_s.length < 0 return false if !@filename.nil? && @filename !~ Regexp.new(/^[\p{Alnum}:\/\\!@#$%^&{}\[\]()_+\-=,.~'` ]{1,255}$/) return false if !@extension.nil? && @extension.to_s.length > 255 return false if !@extension.nil? && @extension.to_s.length < 0 return false if !@extension.nil? && @extension !~ Regexp.new(/^[\p{Alnum}!@#$%^&{}\[\]()_+\-=,.~'` ]{1,255}$/) return false if !@md5.nil? && @md5 !~ Regexp.new(/^[0-9a-f]{32}$/) return false if !@sha1.nil? && @sha1 !~ Regexp.new(/^[0-9a-f]{40}$/) return false if !@sha256.nil? && @sha256 !~ Regexp.new(/^[0-9a-f]{64}$/) return false if !@sha512.nil? && @sha512 !~ Regexp.new(/^[0-9a-f]{128}$/) return false if !@sha3_256.nil? && @sha3_256 !~ Regexp.new(/^[0-9a-f]{64}$/) return false if !@sha3_512.nil? && @sha3_512 !~ Regexp.new(/^[0-9a-f]{128}$/) return false if !@cpe.nil? && @cpe.to_s.length > 255 return false if !@cpe.nil? && @cpe.to_s.length < 0 return false if !@cpe.nil? && @cpe !~ Regexp.new(/(cpe:2\.3:[aho\*\-](:(((\?*|\*?)([a-zA-Z0-9\-\._]|(\\[\\\*\?!"#$$%&'\(\)\+,\/:;<=>@\[\]\^`\{\|}~]))+(\?*|\*?))|[\*\-])){5}(:(([a-zA-Z]{2,3}(-([a-zA-Z]{2}|[0-9]{3}))?)|[\*\-]))(:(((\?*|\*?)([a-zA-Z0-9\-\._]|(\\[\\\*\?!"#$$%&'\(\)\+,\/:;<=>@\[\]\^`\{\|}~]))+(\?*|\*?))|[\*\-])){4})|([c][pP][eE]:\/[AHOaho]?(:[A-Za-z0-9\._\-~%]*){0,6})/) return false if !@description.nil? && @description.to_s.length > 1024 return false if !@description.nil? && @description.to_s.length < 0 return false if !@description.nil? && @description !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/) return false if !@copyright.nil? && @copyright.to_s.length > 1024 return false if !@copyright.nil? && @copyright.to_s.length < 0 return false if !@copyright.nil? && @copyright !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/) return false if !@license.nil? && @license.to_s.length > 255 return false if !@license.nil? && @license.to_s.length < 0 return false if !@license.nil? && @license !~ Regexp.new(/^[\p{White_Space}\p{L}\p{M}\p{S}\p{N}\p{P}]*$/) return false if @uuid.nil? true end |