<?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;

/**
 * Windows Update represents the metadata about the update for the Windows
 * operating system. The fields in this message come from the Windows Update API
 * documented at
 * https://docs.microsoft.com/en-us/windows/win32/api/wuapi/nn-wuapi-iupdate.
 *
 * Generated from protobuf message <code>grafeas.v1.WindowsUpdate</code>
 */
class WindowsUpdate extends \Google\Protobuf\Internal\Message
{
    /**
     * Required - The unique identifier for the update.
     *
     * Generated from protobuf field <code>.grafeas.v1.WindowsUpdate.Identity identity = 1;</code>
     */
    private $identity = null;
    /**
     * The localized title of the update.
     *
     * Generated from protobuf field <code>string title = 2;</code>
     */
    private $title = '';
    /**
     * The localized description of the update.
     *
     * Generated from protobuf field <code>string description = 3;</code>
     */
    private $description = '';
    /**
     * The list of categories to which the update belongs.
     *
     * Generated from protobuf field <code>repeated .grafeas.v1.WindowsUpdate.Category categories = 4;</code>
     */
    private $categories;
    /**
     * The Microsoft Knowledge Base article IDs that are associated with the
     * update.
     *
     * Generated from protobuf field <code>repeated string kb_article_ids = 5;</code>
     */
    private $kb_article_ids;
    /**
     * The hyperlink to the support information for the update.
     *
     * Generated from protobuf field <code>string support_url = 6;</code>
     */
    private $support_url = '';
    /**
     * The last published timestamp of the update.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_published_timestamp = 7;</code>
     */
    private $last_published_timestamp = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Grafeas\V1\WindowsUpdate\Identity $identity
     *           Required - The unique identifier for the update.
     *     @type string $title
     *           The localized title of the update.
     *     @type string $description
     *           The localized description of the update.
     *     @type array<\Grafeas\V1\WindowsUpdate\Category>|\Google\Protobuf\Internal\RepeatedField $categories
     *           The list of categories to which the update belongs.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $kb_article_ids
     *           The Microsoft Knowledge Base article IDs that are associated with the
     *           update.
     *     @type string $support_url
     *           The hyperlink to the support information for the update.
     *     @type \Google\Protobuf\Timestamp $last_published_timestamp
     *           The last published timestamp of the update.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Grafeas\V1\Upgrade::initOnce();
        parent::__construct($data);
    }

    /**
     * Required - The unique identifier for the update.
     *
     * Generated from protobuf field <code>.grafeas.v1.WindowsUpdate.Identity identity = 1;</code>
     * @return \Grafeas\V1\WindowsUpdate\Identity|null
     */
    public function getIdentity()
    {
        return $this->identity;
    }

    public function hasIdentity()
    {
        return isset($this->identity);
    }

    public function clearIdentity()
    {
        unset($this->identity);
    }

    /**
     * Required - The unique identifier for the update.
     *
     * Generated from protobuf field <code>.grafeas.v1.WindowsUpdate.Identity identity = 1;</code>
     * @param \Grafeas\V1\WindowsUpdate\Identity $var
     * @return $this
     */
    public function setIdentity($var)
    {
        GPBUtil::checkMessage($var, \Grafeas\V1\WindowsUpdate\Identity::class);
        $this->identity = $var;

        return $this;
    }

    /**
     * The localized title of the update.
     *
     * Generated from protobuf field <code>string title = 2;</code>
     * @return string
     */
    public function getTitle()
    {
        return $this->title;
    }

    /**
     * The localized title of the update.
     *
     * Generated from protobuf field <code>string title = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setTitle($var)
    {
        GPBUtil::checkString($var, True);
        $this->title = $var;

        return $this;
    }

    /**
     * The localized description of the update.
     *
     * Generated from protobuf field <code>string description = 3;</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * The localized description of the update.
     *
     * Generated from protobuf field <code>string description = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * The list of categories to which the update belongs.
     *
     * Generated from protobuf field <code>repeated .grafeas.v1.WindowsUpdate.Category categories = 4;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getCategories()
    {
        return $this->categories;
    }

    /**
     * The list of categories to which the update belongs.
     *
     * Generated from protobuf field <code>repeated .grafeas.v1.WindowsUpdate.Category categories = 4;</code>
     * @param array<\Grafeas\V1\WindowsUpdate\Category>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setCategories($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Grafeas\V1\WindowsUpdate\Category::class);
        $this->categories = $arr;

        return $this;
    }

    /**
     * The Microsoft Knowledge Base article IDs that are associated with the
     * update.
     *
     * Generated from protobuf field <code>repeated string kb_article_ids = 5;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getKbArticleIds()
    {
        return $this->kb_article_ids;
    }

    /**
     * The Microsoft Knowledge Base article IDs that are associated with the
     * update.
     *
     * Generated from protobuf field <code>repeated string kb_article_ids = 5;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setKbArticleIds($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->kb_article_ids = $arr;

        return $this;
    }

    /**
     * The hyperlink to the support information for the update.
     *
     * Generated from protobuf field <code>string support_url = 6;</code>
     * @return string
     */
    public function getSupportUrl()
    {
        return $this->support_url;
    }

    /**
     * The hyperlink to the support information for the update.
     *
     * Generated from protobuf field <code>string support_url = 6;</code>
     * @param string $var
     * @return $this
     */
    public function setSupportUrl($var)
    {
        GPBUtil::checkString($var, True);
        $this->support_url = $var;

        return $this;
    }

    /**
     * The last published timestamp of the update.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_published_timestamp = 7;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getLastPublishedTimestamp()
    {
        return $this->last_published_timestamp;
    }

    public function hasLastPublishedTimestamp()
    {
        return isset($this->last_published_timestamp);
    }

    public function clearLastPublishedTimestamp()
    {
        unset($this->last_published_timestamp);
    }

    /**
     * The last published timestamp of the update.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_published_timestamp = 7;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setLastPublishedTimestamp($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->last_published_timestamp = $var;

        return $this;
    }

}

