<?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".
     * If the package or version ID parts contain slashes, the slashes are
     * escaped.
     *
     * 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;
    /**
     * Output only. Repository-specific Metadata stored against this version.
     * The fields returned are defined by the underlying repository-specific
     * resource. Currently, the only resource in use is
     * [DockerImage][google.devtools.artifactregistry.v1.DockerImage]
     *
     * Generated from protobuf field <code>.google.protobuf.Struct metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $metadata = null;

    /**
     * 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".
     *           If the package or version ID parts contain slashes, the slashes are
     *           escaped.
     *     @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 array<\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.
     *     @type \Google\Protobuf\Struct $metadata
     *           Output only. Repository-specific Metadata stored against this version.
     *           The fields returned are defined by the underlying repository-specific
     *           resource. Currently, the only resource in use is
     *           [DockerImage][google.devtools.artifactregistry.v1.DockerImage]
     * }
     */
    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".
     * If the package or version ID parts contain slashes, the slashes are
     * escaped.
     *
     * 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".
     * If the package or version ID parts contain slashes, the slashes are
     * escaped.
     *
     * 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 $this->create_time;
    }

    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 $this->update_time;
    }

    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 array<\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;
    }

    /**
     * Output only. Repository-specific Metadata stored against this version.
     * The fields returned are defined by the underlying repository-specific
     * resource. Currently, the only resource in use is
     * [DockerImage][google.devtools.artifactregistry.v1.DockerImage]
     *
     * Generated from protobuf field <code>.google.protobuf.Struct metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Struct|null
     */
    public function getMetadata()
    {
        return $this->metadata;
    }

    public function hasMetadata()
    {
        return isset($this->metadata);
    }

    public function clearMetadata()
    {
        unset($this->metadata);
    }

    /**
     * Output only. Repository-specific Metadata stored against this version.
     * The fields returned are defined by the underlying repository-specific
     * resource. Currently, the only resource in use is
     * [DockerImage][google.devtools.artifactregistry.v1.DockerImage]
     *
     * Generated from protobuf field <code>.google.protobuf.Struct metadata = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Struct $var
     * @return $this
     */
    public function setMetadata($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class);
        $this->metadata = $var;

        return $this;
    }

}

