class DependencyTracker::VulnerableSoftware

Attributes

cpe22[RW]
cpe23[RW]
edition[RW]
is_vulnerable[RW]
language[RW]
other[RW]
part[RW]
product[RW]
purl[RW]
purl_name[RW]
purl_namespace[RW]
purl_qualifiers[RW]
purl_subpath[RW]
purl_type[RW]
purl_version[RW]
sw_edition[RW]
target_hw[RW]
target_sw[RW]
update[RW]
uuid[RW]
vendor[RW]
version[RW]
version_end_excluding[RW]
version_end_including[RW]
version_start_excluding[RW]
version_start_including[RW]
vulnerabilities[RW]

Public Class Methods

attribute_map() click to toggle source

Attribute mapping from ruby-style variable name to JSON key.

# File lib/dependency-tracker-client/models/vulnerable_software.rb, line 72
def self.attribute_map
  {
    :'purl' => :'purl',
    :'purl_type' => :'purlType',
    :'purl_namespace' => :'purlNamespace',
    :'purl_name' => :'purlName',
    :'purl_version' => :'purlVersion',
    :'purl_qualifiers' => :'purlQualifiers',
    :'purl_subpath' => :'purlSubpath',
    :'cpe22' => :'cpe22',
    :'cpe23' => :'cpe23',
    :'part' => :'part',
    :'vendor' => :'vendor',
    :'product' => :'product',
    :'version' => :'version',
    :'update' => :'update',
    :'edition' => :'edition',
    :'language' => :'language',
    :'sw_edition' => :'swEdition',
    :'target_sw' => :'targetSw',
    :'target_hw' => :'targetHw',
    :'other' => :'other',
    :'version_end_excluding' => :'versionEndExcluding',
    :'version_end_including' => :'versionEndIncluding',
    :'version_start_excluding' => :'versionStartExcluding',
    :'version_start_including' => :'versionStartIncluding',
    :'vulnerabilities' => :'vulnerabilities',
    :'uuid' => :'uuid',
    :'is_vulnerable' => :'isVulnerable'
  }
end
build_from_hash(attributes) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/dependency-tracker-client/models/vulnerable_software.rb, line 331
def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash

# File lib/dependency-tracker-client/models/vulnerable_software.rb, line 145
def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `DependencyTracker::VulnerableSoftware` 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::VulnerableSoftware`. 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?(:'purl')
    self.purl = attributes[:'purl']
  end

  if attributes.key?(:'purl_type')
    self.purl_type = attributes[:'purl_type']
  end

  if attributes.key?(:'purl_namespace')
    self.purl_namespace = attributes[:'purl_namespace']
  end

  if attributes.key?(:'purl_name')
    self.purl_name = attributes[:'purl_name']
  end

  if attributes.key?(:'purl_version')
    self.purl_version = attributes[:'purl_version']
  end

  if attributes.key?(:'purl_qualifiers')
    self.purl_qualifiers = attributes[:'purl_qualifiers']
  end

  if attributes.key?(:'purl_subpath')
    self.purl_subpath = attributes[:'purl_subpath']
  end

  if attributes.key?(:'cpe22')
    self.cpe22 = attributes[:'cpe22']
  end

  if attributes.key?(:'cpe23')
    self.cpe23 = attributes[:'cpe23']
  end

  if attributes.key?(:'part')
    self.part = attributes[:'part']
  end

  if attributes.key?(:'vendor')
    self.vendor = attributes[:'vendor']
  end

  if attributes.key?(:'product')
    self.product = attributes[:'product']
  end

  if attributes.key?(:'version')
    self.version = attributes[:'version']
  end

  if attributes.key?(:'update')
    self.update = attributes[:'update']
  end

  if attributes.key?(:'edition')
    self.edition = attributes[:'edition']
  end

  if attributes.key?(:'language')
    self.language = attributes[:'language']
  end

  if attributes.key?(:'sw_edition')
    self.sw_edition = attributes[:'sw_edition']
  end

  if attributes.key?(:'target_sw')
    self.target_sw = attributes[:'target_sw']
  end

  if attributes.key?(:'target_hw')
    self.target_hw = attributes[:'target_hw']
  end

  if attributes.key?(:'other')
    self.other = attributes[:'other']
  end

  if attributes.key?(:'version_end_excluding')
    self.version_end_excluding = attributes[:'version_end_excluding']
  end

  if attributes.key?(:'version_end_including')
    self.version_end_including = attributes[:'version_end_including']
  end

  if attributes.key?(:'version_start_excluding')
    self.version_start_excluding = attributes[:'version_start_excluding']
  end

  if attributes.key?(:'version_start_including')
    self.version_start_including = attributes[:'version_start_including']
  end

  if attributes.key?(:'vulnerabilities')
    if (value = attributes[:'vulnerabilities']).is_a?(Array)
      self.vulnerabilities = value
    end
  end

  if attributes.key?(:'uuid')
    self.uuid = attributes[:'uuid']
  end

  if attributes.key?(:'is_vulnerable')
    self.is_vulnerable = attributes[:'is_vulnerable']
  end
end
openapi_nullable() click to toggle source

List of attributes with nullable: true

# File lib/dependency-tracker-client/models/vulnerable_software.rb, line 138
def self.openapi_nullable
  Set.new([
  ])
end
openapi_types() click to toggle source

Attribute type mapping.

# File lib/dependency-tracker-client/models/vulnerable_software.rb, line 105
def self.openapi_types
  {
    :'purl' => :'String',
    :'purl_type' => :'String',
    :'purl_namespace' => :'String',
    :'purl_name' => :'String',
    :'purl_version' => :'String',
    :'purl_qualifiers' => :'String',
    :'purl_subpath' => :'String',
    :'cpe22' => :'String',
    :'cpe23' => :'String',
    :'part' => :'String',
    :'vendor' => :'String',
    :'product' => :'String',
    :'version' => :'String',
    :'update' => :'String',
    :'edition' => :'String',
    :'language' => :'String',
    :'sw_edition' => :'String',
    :'target_sw' => :'String',
    :'target_hw' => :'String',
    :'other' => :'String',
    :'version_end_excluding' => :'String',
    :'version_end_including' => :'String',
    :'version_start_excluding' => :'String',
    :'version_start_including' => :'String',
    :'vulnerabilities' => :'Array<Vulnerability>',
    :'uuid' => :'String',
    :'is_vulnerable' => :'Boolean'
  }
end

Public Instance Methods

==(o) click to toggle source

Checks equality by comparing each attribute. @param [Object] Object to be compared

# File lib/dependency-tracker-client/models/vulnerable_software.rb, line 284
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      purl == o.purl &&
      purl_type == o.purl_type &&
      purl_namespace == o.purl_namespace &&
      purl_name == o.purl_name &&
      purl_version == o.purl_version &&
      purl_qualifiers == o.purl_qualifiers &&
      purl_subpath == o.purl_subpath &&
      cpe22 == o.cpe22 &&
      cpe23 == o.cpe23 &&
      part == o.part &&
      vendor == o.vendor &&
      product == o.product &&
      version == o.version &&
      update == o.update &&
      edition == o.edition &&
      language == o.language &&
      sw_edition == o.sw_edition &&
      target_sw == o.target_sw &&
      target_hw == o.target_hw &&
      other == o.other &&
      version_end_excluding == o.version_end_excluding &&
      version_end_including == o.version_end_including &&
      version_start_excluding == o.version_start_excluding &&
      version_start_including == o.version_start_including &&
      vulnerabilities == o.vulnerabilities &&
      uuid == o.uuid &&
      is_vulnerable == o.is_vulnerable
end
_deserialize(type, value) click to toggle source

Deserializes the data based on type @param string type Data type @param string value Value to be deserialized @return [Object] Deserialized data

# File lib/dependency-tracker-client/models/vulnerable_software.rb, line 359
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) click to toggle source

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash

# File lib/dependency-tracker-client/models/vulnerable_software.rb, line 428
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) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/dependency-tracker-client/models/vulnerable_software.rb, line 338
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) click to toggle source

@see the `==` method @param [Object] Object to be compared

# File lib/dependency-tracker-client/models/vulnerable_software.rb, line 318
def eql?(o)
  self == o
end
hash() click to toggle source

Calculates hash code according to all attributes. @return [Integer] Hash code

# File lib/dependency-tracker-client/models/vulnerable_software.rb, line 324
def hash
  [purl, purl_type, purl_namespace, purl_name, purl_version, purl_qualifiers, purl_subpath, cpe22, cpe23, part, vendor, product, version, update, edition, language, sw_edition, target_sw, target_hw, other, version_end_excluding, version_end_including, version_start_excluding, version_start_including, vulnerabilities, uuid, is_vulnerable].hash
end
list_invalid_properties() click to toggle source

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons

# File lib/dependency-tracker-client/models/vulnerable_software.rb, line 271
def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end
to_body() click to toggle source

to_body is an alias to to_hash (backward compatibility) @return [Hash] Returns the object in the form of hash

# File lib/dependency-tracker-client/models/vulnerable_software.rb, line 404
def to_body
  to_hash
end
to_hash() click to toggle source

Returns the object in the form of hash @return [Hash] Returns the object in the form of hash

# File lib/dependency-tracker-client/models/vulnerable_software.rb, line 410
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() click to toggle source

Returns the string representation of the object @return [String] String presentation of the object

# File lib/dependency-tracker-client/models/vulnerable_software.rb, line 398
def to_s
  to_hash.to_s
end
valid?() click to toggle source

Check to see if the all the properties in the model are valid @return true if the model is valid

# File lib/dependency-tracker-client/models/vulnerable_software.rb, line 278
def valid?
  true
end