<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/devtools/artifactregistry/v1beta2/version.proto

namespace Google\Cloud\ArtifactRegistry\V1beta2;

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

/**
 * The body of a version resource. A version resource represents a
 * collection of components, such as files and other data. This may correspond
 * to a version in many package management schemes.
 *
 * Generated from protobuf message <code>google.devtools.artifactregistry.v1beta2.Version</code>
 */
class Version extends \Google\Protobuf\Internal\Message
{
    /**
     * The name of the version, for example:
     * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/art1".
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    private $name = '';
    /**
     * Optional. Description of the version, as specified in its metadata.
     *
     * Generated from protobuf field <code>string description = 3;</code>
     */
    private $description = '';
    /**
     * The time when the version was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 5;</code>
     */
    private $create_time = null;
    /**
     * The time when the version was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 6;</code>
     */
    private $update_time = null;
    /**
     * Output only. A list of related tags. Will contain up to 100 tags that
     * reference this version.
     *
     * Generated from protobuf field <code>repeated .google.devtools.artifactregistry.v1beta2.Tag related_tags = 7;</code>
     */
    private $related_tags;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           The name of the version, for example:
     *           "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/art1".
     *     @type string $description
     *           Optional. Description of the version, as specified in its metadata.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           The time when the version was created.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           The time when the version was last updated.
     *     @type \Google\Cloud\ArtifactRegistry\V1beta2\Tag[]|\Google\Protobuf\Internal\RepeatedField $related_tags
     *           Output only. A list of related tags. Will contain up to 100 tags that
     *           reference this version.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Devtools\Artifactregistry\V1Beta2\Version::initOnce();
        parent::__construct($data);
    }

    /**
     * The name of the version, for example:
     * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/art1".
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * The name of the version, for example:
     * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/art1".
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Optional. Description of the version, as specified in its metadata.
     *
     * Generated from protobuf field <code>string description = 3;</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Optional. Description of the version, as specified in its metadata.
     *
     * 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 time when the version was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 5;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreateTime()
    {
        return isset($this->create_time) ? $this->create_time : null;
    }

    public function hasCreateTime()
    {
        return isset($this->create_time);
    }

    public function clearCreateTime()
    {
        unset($this->create_time);
    }

    /**
     * The time when the version was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 5;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->create_time = $var;

        return $this;
    }

    /**
     * The time when the version was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 6;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getUpdateTime()
    {
        return isset($this->update_time) ? $this->update_time : null;
    }

    public function hasUpdateTime()
    {
        return isset($this->update_time);
    }

    public function clearUpdateTime()
    {
        unset($this->update_time);
    }

    /**
     * The time when the version was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 6;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->update_time = $var;

        return $this;
    }

    /**
     * Output only. A list of related tags. Will contain up to 100 tags that
     * reference this version.
     *
     * Generated from protobuf field <code>repeated .google.devtools.artifactregistry.v1beta2.Tag related_tags = 7;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getRelatedTags()
    {
        return $this->related_tags;
    }

    /**
     * Output only. A list of related tags. Will contain up to 100 tags that
     * reference this version.
     *
     * Generated from protobuf field <code>repeated .google.devtools.artifactregistry.v1beta2.Tag related_tags = 7;</code>
     * @param \Google\Cloud\ArtifactRegistry\V1beta2\Tag[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setRelatedTags($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ArtifactRegistry\V1beta2\Tag::class);
        $this->related_tags = $arr;

        return $this;
    }

}

