<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: grafeas/v1/package.proto

namespace Grafeas\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Details on how a particular software package was installed on a system.
 *
 * Generated from protobuf message <code>grafeas.v1.PackageOccurrence</code>
 */
class PackageOccurrence extends \Google\Protobuf\Internal\Message
{
    /**
     * The name of the installed package.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $name = '';
    /**
     * All of the places within the filesystem versions of this package
     * have been found.
     *
     * Generated from protobuf field <code>repeated .grafeas.v1.Location location = 2;</code>
     */
    private $location;
    /**
     * The type of package; whether native or non native (e.g., ruby gems,
     * node.js packages, etc.).
     *
     * Generated from protobuf field <code>string package_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $package_type = '';
    /**
     * The cpe_uri in [CPE format](https://cpe.mitre.org/specification/)
     * denoting the package manager version distributing a package.
     * The cpe_uri will be blank for language packages.
     *
     * Generated from protobuf field <code>string cpe_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $cpe_uri = '';
    /**
     * The CPU architecture for which packages in this distribution channel were
     * built. Architecture will be blank for language packages.
     *
     * Generated from protobuf field <code>.grafeas.v1.Architecture architecture = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $architecture = 0;
    /**
     * Licenses that have been declared by the authors of the package.
     *
     * Generated from protobuf field <code>.grafeas.v1.License license = 6;</code>
     */
    private $license = null;
    /**
     * The version of the package.
     *
     * Generated from protobuf field <code>.grafeas.v1.Version version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $version = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           The name of the installed package.
     *     @type array<\Grafeas\V1\Location>|\Google\Protobuf\Internal\RepeatedField $location
     *           All of the places within the filesystem versions of this package
     *           have been found.
     *     @type string $package_type
     *           The type of package; whether native or non native (e.g., ruby gems,
     *           node.js packages, etc.).
     *     @type string $cpe_uri
     *           The cpe_uri in [CPE format](https://cpe.mitre.org/specification/)
     *           denoting the package manager version distributing a package.
     *           The cpe_uri will be blank for language packages.
     *     @type int $architecture
     *           The CPU architecture for which packages in this distribution channel were
     *           built. Architecture will be blank for language packages.
     *     @type \Grafeas\V1\License $license
     *           Licenses that have been declared by the authors of the package.
     *     @type \Grafeas\V1\Version $version
     *           The version of the package.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Grafeas\V1\Package::initOnce();
        parent::__construct($data);
    }

    /**
     * The name of the installed package.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * The name of the installed package.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * All of the places within the filesystem versions of this package
     * have been found.
     *
     * Generated from protobuf field <code>repeated .grafeas.v1.Location location = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getLocation()
    {
        return $this->location;
    }

    /**
     * All of the places within the filesystem versions of this package
     * have been found.
     *
     * Generated from protobuf field <code>repeated .grafeas.v1.Location location = 2;</code>
     * @param array<\Grafeas\V1\Location>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setLocation($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Grafeas\V1\Location::class);
        $this->location = $arr;

        return $this;
    }

    /**
     * The type of package; whether native or non native (e.g., ruby gems,
     * node.js packages, etc.).
     *
     * Generated from protobuf field <code>string package_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getPackageType()
    {
        return $this->package_type;
    }

    /**
     * The type of package; whether native or non native (e.g., ruby gems,
     * node.js packages, etc.).
     *
     * Generated from protobuf field <code>string package_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setPackageType($var)
    {
        GPBUtil::checkString($var, True);
        $this->package_type = $var;

        return $this;
    }

    /**
     * The cpe_uri in [CPE format](https://cpe.mitre.org/specification/)
     * denoting the package manager version distributing a package.
     * The cpe_uri will be blank for language packages.
     *
     * Generated from protobuf field <code>string cpe_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getCpeUri()
    {
        return $this->cpe_uri;
    }

    /**
     * The cpe_uri in [CPE format](https://cpe.mitre.org/specification/)
     * denoting the package manager version distributing a package.
     * The cpe_uri will be blank for language packages.
     *
     * Generated from protobuf field <code>string cpe_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setCpeUri($var)
    {
        GPBUtil::checkString($var, True);
        $this->cpe_uri = $var;

        return $this;
    }

    /**
     * The CPU architecture for which packages in this distribution channel were
     * built. Architecture will be blank for language packages.
     *
     * Generated from protobuf field <code>.grafeas.v1.Architecture architecture = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getArchitecture()
    {
        return $this->architecture;
    }

    /**
     * The CPU architecture for which packages in this distribution channel were
     * built. Architecture will be blank for language packages.
     *
     * Generated from protobuf field <code>.grafeas.v1.Architecture architecture = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setArchitecture($var)
    {
        GPBUtil::checkEnum($var, \Grafeas\V1\Architecture::class);
        $this->architecture = $var;

        return $this;
    }

    /**
     * Licenses that have been declared by the authors of the package.
     *
     * Generated from protobuf field <code>.grafeas.v1.License license = 6;</code>
     * @return \Grafeas\V1\License|null
     */
    public function getLicense()
    {
        return $this->license;
    }

    public function hasLicense()
    {
        return isset($this->license);
    }

    public function clearLicense()
    {
        unset($this->license);
    }

    /**
     * Licenses that have been declared by the authors of the package.
     *
     * Generated from protobuf field <code>.grafeas.v1.License license = 6;</code>
     * @param \Grafeas\V1\License $var
     * @return $this
     */
    public function setLicense($var)
    {
        GPBUtil::checkMessage($var, \Grafeas\V1\License::class);
        $this->license = $var;

        return $this;
    }

    /**
     * The version of the package.
     *
     * Generated from protobuf field <code>.grafeas.v1.Version version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Grafeas\V1\Version|null
     */
    public function getVersion()
    {
        return $this->version;
    }

    public function hasVersion()
    {
        return isset($this->version);
    }

    public function clearVersion()
    {
        unset($this->version);
    }

    /**
     * The version of the package.
     *
     * Generated from protobuf field <code>.grafeas.v1.Version version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Grafeas\V1\Version $var
     * @return $this
     */
    public function setVersion($var)
    {
        GPBUtil::checkMessage($var, \Grafeas\V1\Version::class);
        $this->version = $var;

        return $this;
    }

}

