class PulpRpmClient::RpmPackageResponse

A Serializer for Package. Add serializers for the new fields defined in Package and add those fields to the Meta class keeping fields from the parent class as well. Provide help_text.

Attributes

arch[RW]

The target architecture for a package.For example, 'x86_64', 'i686', or 'noarch'

artifact[RW]

Artifact file representing the physical content

changelogs[RW]

Changelogs that package contains

checksum_type[RW]

Type of checksum, e.g. 'sha256', 'md5'

conflicts[RW]

Capabilities the package conflicts

description[RW]

In-depth description of the packaged software

enhances[RW]

Capabilities the package enhances

epoch[RW]

The package's epoch

files[RW]

Files that package contains

is_modular[RW]

Flag to identify if the package is modular

location_base[RW]

Base location of this package

location_href[RW]

Relative location of package to the repodata

md5[RW]

The MD5 checksum if available.

name[RW]

Name of the package

obsoletes[RW]

Capabilities the package obsoletes

pkg_id[RW]

Checksum of the package file

provides[RW]

Capabilities the package provides

pulp_created[RW]

Timestamp of creation.

pulp_href[RW]
recommends[RW]

Capabilities the package recommends

release[RW]

The release of a particular version of the package. e.g. '1.el7' or '3.f24'

requires[RW]

Capabilities the package requires

rpm_buildhost[RW]

Hostname of the system that built the package

rpm_group[RW]
rpm_header_end[RW]

Last byte of the header

rpm_header_start[RW]

First byte of the header

rpm_license[RW]

License term applicable to the package software (GPLv2, etc.)

rpm_packager[RW]

Person or persons responsible for creating the package

rpm_sourcerpm[RW]

Name of the source package (srpm) the package was built from

rpm_vendor[RW]

Name of the organization that produced the package

sha1[RW]

The SHA-1 checksum if available.

sha224[RW]

The SHA-224 checksum if available.

sha256[RW]

The SHA-256 checksum if available.

sha384[RW]

The SHA-384 checksum if available.

sha512[RW]

The SHA-512 checksum if available.

size_archive[RW]

Size, in bytes, of the archive portion of the original package file

size_installed[RW]

Total size, in bytes, of every file installed by this package

size_package[RW]

Size, in bytes, of the package

suggests[RW]

Capabilities the package suggests

summary[RW]

Short description of the packaged software

supplements[RW]

Capabilities the package supplements

time_build[RW]

Time the package was built in seconds since the epoch

time_file[RW]

The 'file' time attribute in the primary XML - file mtime in seconds since the epoch.

url[RW]

URL with more information about the packaged software

version[RW]

The version of the package. For example, '2.8.0'

Public Class Methods

attribute_map() click to toggle source

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

# File lib/pulp_rpm_client/models/rpm_package_response.rb, line 153
def self.attribute_map
  {
    :'pulp_href' => :'pulp_href',
    :'pulp_created' => :'pulp_created',
    :'md5' => :'md5',
    :'sha1' => :'sha1',
    :'sha224' => :'sha224',
    :'sha256' => :'sha256',
    :'sha384' => :'sha384',
    :'sha512' => :'sha512',
    :'artifact' => :'artifact',
    :'name' => :'name',
    :'epoch' => :'epoch',
    :'version' => :'version',
    :'release' => :'release',
    :'arch' => :'arch',
    :'pkg_id' => :'pkgId',
    :'checksum_type' => :'checksum_type',
    :'summary' => :'summary',
    :'description' => :'description',
    :'url' => :'url',
    :'changelogs' => :'changelogs',
    :'files' => :'files',
    :'requires' => :'requires',
    :'provides' => :'provides',
    :'conflicts' => :'conflicts',
    :'obsoletes' => :'obsoletes',
    :'suggests' => :'suggests',
    :'enhances' => :'enhances',
    :'recommends' => :'recommends',
    :'supplements' => :'supplements',
    :'location_base' => :'location_base',
    :'location_href' => :'location_href',
    :'rpm_buildhost' => :'rpm_buildhost',
    :'rpm_group' => :'rpm_group',
    :'rpm_license' => :'rpm_license',
    :'rpm_packager' => :'rpm_packager',
    :'rpm_sourcerpm' => :'rpm_sourcerpm',
    :'rpm_vendor' => :'rpm_vendor',
    :'rpm_header_start' => :'rpm_header_start',
    :'rpm_header_end' => :'rpm_header_end',
    :'is_modular' => :'is_modular',
    :'size_archive' => :'size_archive',
    :'size_installed' => :'size_installed',
    :'size_package' => :'size_package',
    :'time_build' => :'time_build',
    :'time_file' => :'time_file'
  }
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/pulp_rpm_client/models/rpm_package_response.rb, line 536
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/pulp_rpm_client/models/rpm_package_response.rb, line 262
def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `PulpRpmClient::RpmPackageResponse` 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 `PulpRpmClient::RpmPackageResponse`. 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?(:'pulp_href')
    self.pulp_href = attributes[:'pulp_href']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

List of attributes with nullable: true

# File lib/pulp_rpm_client/models/rpm_package_response.rb, line 255
def self.openapi_nullable
  Set.new([
  ])
end
openapi_types() click to toggle source

Attribute type mapping.

# File lib/pulp_rpm_client/models/rpm_package_response.rb, line 204
def self.openapi_types
  {
    :'pulp_href' => :'String',
    :'pulp_created' => :'DateTime',
    :'md5' => :'String',
    :'sha1' => :'String',
    :'sha224' => :'String',
    :'sha256' => :'String',
    :'sha384' => :'String',
    :'sha512' => :'String',
    :'artifact' => :'String',
    :'name' => :'String',
    :'epoch' => :'String',
    :'version' => :'String',
    :'release' => :'String',
    :'arch' => :'String',
    :'pkg_id' => :'String',
    :'checksum_type' => :'String',
    :'summary' => :'String',
    :'description' => :'String',
    :'url' => :'String',
    :'changelogs' => :'Object',
    :'files' => :'Object',
    :'requires' => :'Object',
    :'provides' => :'Object',
    :'conflicts' => :'Object',
    :'obsoletes' => :'Object',
    :'suggests' => :'Object',
    :'enhances' => :'Object',
    :'recommends' => :'Object',
    :'supplements' => :'Object',
    :'location_base' => :'String',
    :'location_href' => :'String',
    :'rpm_buildhost' => :'String',
    :'rpm_group' => :'String',
    :'rpm_license' => :'String',
    :'rpm_packager' => :'String',
    :'rpm_sourcerpm' => :'String',
    :'rpm_vendor' => :'String',
    :'rpm_header_start' => :'Integer',
    :'rpm_header_end' => :'Integer',
    :'is_modular' => :'Boolean',
    :'size_archive' => :'Integer',
    :'size_installed' => :'Integer',
    :'size_package' => :'Integer',
    :'time_build' => :'Integer',
    :'time_file' => :'Integer'
  }
end

Public Instance Methods

==(o) click to toggle source

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

# File lib/pulp_rpm_client/models/rpm_package_response.rb, line 471
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      pulp_href == o.pulp_href &&
      pulp_created == o.pulp_created &&
      md5 == o.md5 &&
      sha1 == o.sha1 &&
      sha224 == o.sha224 &&
      sha256 == o.sha256 &&
      sha384 == o.sha384 &&
      sha512 == o.sha512 &&
      artifact == o.artifact &&
      name == o.name &&
      epoch == o.epoch &&
      version == o.version &&
      release == o.release &&
      arch == o.arch &&
      pkg_id == o.pkg_id &&
      checksum_type == o.checksum_type &&
      summary == o.summary &&
      description == o.description &&
      url == o.url &&
      changelogs == o.changelogs &&
      files == o.files &&
      requires == o.requires &&
      provides == o.provides &&
      conflicts == o.conflicts &&
      obsoletes == o.obsoletes &&
      suggests == o.suggests &&
      enhances == o.enhances &&
      recommends == o.recommends &&
      supplements == o.supplements &&
      location_base == o.location_base &&
      location_href == o.location_href &&
      rpm_buildhost == o.rpm_buildhost &&
      rpm_group == o.rpm_group &&
      rpm_license == o.rpm_license &&
      rpm_packager == o.rpm_packager &&
      rpm_sourcerpm == o.rpm_sourcerpm &&
      rpm_vendor == o.rpm_vendor &&
      rpm_header_start == o.rpm_header_start &&
      rpm_header_end == o.rpm_header_end &&
      is_modular == o.is_modular &&
      size_archive == o.size_archive &&
      size_installed == o.size_installed &&
      size_package == o.size_package &&
      time_build == o.time_build &&
      time_file == o.time_file
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/pulp_rpm_client/models/rpm_package_response.rb, line 564
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
    PulpRpmClient.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/pulp_rpm_client/models/rpm_package_response.rb, line 633
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/pulp_rpm_client/models/rpm_package_response.rb, line 543
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/pulp_rpm_client/models/rpm_package_response.rb, line 523
def eql?(o)
  self == o
end
hash() click to toggle source

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

# File lib/pulp_rpm_client/models/rpm_package_response.rb, line 529
def hash
  [pulp_href, pulp_created, md5, sha1, sha224, sha256, sha384, sha512, artifact, name, epoch, version, release, arch, pkg_id, checksum_type, summary, description, url, changelogs, files, requires, provides, conflicts, obsoletes, suggests, enhances, recommends, supplements, location_base, location_href, rpm_buildhost, rpm_group, rpm_license, rpm_packager, rpm_sourcerpm, rpm_vendor, rpm_header_start, rpm_header_end, is_modular, size_archive, size_installed, size_package, time_build, time_file].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/pulp_rpm_client/models/rpm_package_response.rb, line 458
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/pulp_rpm_client/models/rpm_package_response.rb, line 609
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/pulp_rpm_client/models/rpm_package_response.rb, line 615
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/pulp_rpm_client/models/rpm_package_response.rb, line 603
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/pulp_rpm_client/models/rpm_package_response.rb, line 465
def valid?
  true
end