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

namespace Grafeas\V1;

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

/**
 * An Upgrade Occurrence represents that a specific resource_url could install a
 * specific upgrade. This presence is supplied via local sources (i.e. it is
 * present in the mirror and the running system has noticed its availability).
 * For Windows, both distribution and windows_update contain information for the
 * Windows update.
 *
 * Generated from protobuf message <code>grafeas.v1.UpgradeOccurrence</code>
 */
class UpgradeOccurrence extends \Google\Protobuf\Internal\Message
{
    /**
     * Required for non-Windows OS. The package this Upgrade is for.
     *
     * Generated from protobuf field <code>string package = 1;</code>
     */
    private $package = '';
    /**
     * Required for non-Windows OS. The version of the package in a machine +
     * human readable form.
     *
     * Generated from protobuf field <code>.grafeas.v1.Version parsed_version = 3;</code>
     */
    private $parsed_version = null;
    /**
     * Metadata about the upgrade for available for the specific operating system
     * for the resource_url. This allows efficient filtering, as well as
     * making it easier to use the occurrence.
     *
     * Generated from protobuf field <code>.grafeas.v1.UpgradeDistribution distribution = 4;</code>
     */
    private $distribution = null;
    /**
     * Required for Windows OS. Represents the metadata about the Windows update.
     *
     * Generated from protobuf field <code>.grafeas.v1.WindowsUpdate windows_update = 5;</code>
     */
    private $windows_update = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $package
     *           Required for non-Windows OS. The package this Upgrade is for.
     *     @type \Grafeas\V1\Version $parsed_version
     *           Required for non-Windows OS. The version of the package in a machine +
     *           human readable form.
     *     @type \Grafeas\V1\UpgradeDistribution $distribution
     *           Metadata about the upgrade for available for the specific operating system
     *           for the resource_url. This allows efficient filtering, as well as
     *           making it easier to use the occurrence.
     *     @type \Grafeas\V1\WindowsUpdate $windows_update
     *           Required for Windows OS. Represents the metadata about the Windows update.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Grafeas\V1\Upgrade::initOnce();
        parent::__construct($data);
    }

    /**
     * Required for non-Windows OS. The package this Upgrade is for.
     *
     * Generated from protobuf field <code>string package = 1;</code>
     * @return string
     */
    public function getPackage()
    {
        return $this->package;
    }

    /**
     * Required for non-Windows OS. The package this Upgrade is for.
     *
     * Generated from protobuf field <code>string package = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setPackage($var)
    {
        GPBUtil::checkString($var, True);
        $this->package = $var;

        return $this;
    }

    /**
     * Required for non-Windows OS. The version of the package in a machine +
     * human readable form.
     *
     * Generated from protobuf field <code>.grafeas.v1.Version parsed_version = 3;</code>
     * @return \Grafeas\V1\Version|null
     */
    public function getParsedVersion()
    {
        return $this->parsed_version;
    }

    public function hasParsedVersion()
    {
        return isset($this->parsed_version);
    }

    public function clearParsedVersion()
    {
        unset($this->parsed_version);
    }

    /**
     * Required for non-Windows OS. The version of the package in a machine +
     * human readable form.
     *
     * Generated from protobuf field <code>.grafeas.v1.Version parsed_version = 3;</code>
     * @param \Grafeas\V1\Version $var
     * @return $this
     */
    public function setParsedVersion($var)
    {
        GPBUtil::checkMessage($var, \Grafeas\V1\Version::class);
        $this->parsed_version = $var;

        return $this;
    }

    /**
     * Metadata about the upgrade for available for the specific operating system
     * for the resource_url. This allows efficient filtering, as well as
     * making it easier to use the occurrence.
     *
     * Generated from protobuf field <code>.grafeas.v1.UpgradeDistribution distribution = 4;</code>
     * @return \Grafeas\V1\UpgradeDistribution|null
     */
    public function getDistribution()
    {
        return $this->distribution;
    }

    public function hasDistribution()
    {
        return isset($this->distribution);
    }

    public function clearDistribution()
    {
        unset($this->distribution);
    }

    /**
     * Metadata about the upgrade for available for the specific operating system
     * for the resource_url. This allows efficient filtering, as well as
     * making it easier to use the occurrence.
     *
     * Generated from protobuf field <code>.grafeas.v1.UpgradeDistribution distribution = 4;</code>
     * @param \Grafeas\V1\UpgradeDistribution $var
     * @return $this
     */
    public function setDistribution($var)
    {
        GPBUtil::checkMessage($var, \Grafeas\V1\UpgradeDistribution::class);
        $this->distribution = $var;

        return $this;
    }

    /**
     * Required for Windows OS. Represents the metadata about the Windows update.
     *
     * Generated from protobuf field <code>.grafeas.v1.WindowsUpdate windows_update = 5;</code>
     * @return \Grafeas\V1\WindowsUpdate|null
     */
    public function getWindowsUpdate()
    {
        return $this->windows_update;
    }

    public function hasWindowsUpdate()
    {
        return isset($this->windows_update);
    }

    public function clearWindowsUpdate()
    {
        unset($this->windows_update);
    }

    /**
     * Required for Windows OS. Represents the metadata about the Windows update.
     *
     * Generated from protobuf field <code>.grafeas.v1.WindowsUpdate windows_update = 5;</code>
     * @param \Grafeas\V1\WindowsUpdate $var
     * @return $this
     */
    public function setWindowsUpdate($var)
    {
        GPBUtil::checkMessage($var, \Grafeas\V1\WindowsUpdate::class);
        $this->windows_update = $var;

        return $this;
    }

}

