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

namespace Google\Cloud\DevTools\Source\V1;

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

/**
 * A CloudWorkspaceId is a unique identifier for a cloud workspace.
 * A cloud workspace is a place associated with a repo where modified files
 * can be stored before they are committed.
 *
 * Generated from protobuf message <code>google.devtools.source.v1.CloudWorkspaceId</code>
 */
class CloudWorkspaceId extends \Google\Protobuf\Internal\Message
{
    /**
     * The ID of the repo containing the workspace.
     *
     * Generated from protobuf field <code>.google.devtools.source.v1.RepoId repo_id = 1;</code>
     */
    protected $repo_id = null;
    /**
     * The unique name of the workspace within the repo.  This is the name
     * chosen by the client in the Source API's CreateWorkspace method.
     *
     * Generated from protobuf field <code>string name = 2;</code>
     */
    protected $name = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\DevTools\Source\V1\RepoId $repo_id
     *           The ID of the repo containing the workspace.
     *     @type string $name
     *           The unique name of the workspace within the repo.  This is the name
     *           chosen by the client in the Source API's CreateWorkspace method.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Devtools\Source\V1\SourceContext::initOnce();
        parent::__construct($data);
    }

    /**
     * The ID of the repo containing the workspace.
     *
     * Generated from protobuf field <code>.google.devtools.source.v1.RepoId repo_id = 1;</code>
     * @return \Google\Cloud\DevTools\Source\V1\RepoId|null
     */
    public function getRepoId()
    {
        return isset($this->repo_id) ? $this->repo_id : null;
    }

    public function hasRepoId()
    {
        return isset($this->repo_id);
    }

    public function clearRepoId()
    {
        unset($this->repo_id);
    }

    /**
     * The ID of the repo containing the workspace.
     *
     * Generated from protobuf field <code>.google.devtools.source.v1.RepoId repo_id = 1;</code>
     * @param \Google\Cloud\DevTools\Source\V1\RepoId $var
     * @return $this
     */
    public function setRepoId($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DevTools\Source\V1\RepoId::class);
        $this->repo_id = $var;

        return $this;
    }

    /**
     * The unique name of the workspace within the repo.  This is the name
     * chosen by the client in the Source API's CreateWorkspace method.
     *
     * Generated from protobuf field <code>string name = 2;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * The unique name of the workspace within the repo.  This is the name
     * chosen by the client in the Source API's CreateWorkspace method.
     *
     * Generated from protobuf field <code>string name = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

}

