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

namespace Google\Cloud\SecureSourceManager\V1;

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

/**
 * CreateRepositoryRequest is the request for creating a repository.
 *
 * Generated from protobuf message <code>google.cloud.securesourcemanager.v1.CreateRepositoryRequest</code>
 */
class CreateRepositoryRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The project in which to create the repository. Values are of the
     * form `projects/{project_number}/locations/{location_id}`
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $parent = '';
    /**
     * Required. The resource being created.
     *
     * Generated from protobuf field <code>.google.cloud.securesourcemanager.v1.Repository repository = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $repository = null;
    /**
     * Required. The ID to use for the repository, which will become the final
     * component of the repository's resource name. This value should be 4-63
     * characters, and valid characters are /[a-z][0-9]-/.
     *
     * Generated from protobuf field <code>string repository_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $repository_id = '';

    /**
     * @param string                                          $parent       Required. The project in which to create the repository. Values are of the
     *                                                                      form `projects/{project_number}/locations/{location_id}`
     *                                                                      Please see {@see SecureSourceManagerClient::locationName()} for help formatting this field.
     * @param \Google\Cloud\SecureSourceManager\V1\Repository $repository   Required. The resource being created.
     * @param string                                          $repositoryId Required. The ID to use for the repository, which will become the final
     *                                                                      component of the repository's resource name. This value should be 4-63
     *                                                                      characters, and valid characters are /[a-z][0-9]-/.
     *
     * @return \Google\Cloud\SecureSourceManager\V1\CreateRepositoryRequest
     *
     * @experimental
     */
    public static function build(string $parent, \Google\Cloud\SecureSourceManager\V1\Repository $repository, string $repositoryId): self
    {
        return (new self())
            ->setParent($parent)
            ->setRepository($repository)
            ->setRepositoryId($repositoryId);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The project in which to create the repository. Values are of the
     *           form `projects/{project_number}/locations/{location_id}`
     *     @type \Google\Cloud\SecureSourceManager\V1\Repository $repository
     *           Required. The resource being created.
     *     @type string $repository_id
     *           Required. The ID to use for the repository, which will become the final
     *           component of the repository's resource name. This value should be 4-63
     *           characters, and valid characters are /[a-z][0-9]-/.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Securesourcemanager\V1\SecureSourceManager::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The project in which to create the repository. Values are of the
     * form `projects/{project_number}/locations/{location_id}`
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Required. The project in which to create the repository. Values are of the
     * form `projects/{project_number}/locations/{location_id}`
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setParent($var)
    {
        GPBUtil::checkString($var, True);
        $this->parent = $var;

        return $this;
    }

    /**
     * Required. The resource being created.
     *
     * Generated from protobuf field <code>.google.cloud.securesourcemanager.v1.Repository repository = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\SecureSourceManager\V1\Repository|null
     */
    public function getRepository()
    {
        return $this->repository;
    }

    public function hasRepository()
    {
        return isset($this->repository);
    }

    public function clearRepository()
    {
        unset($this->repository);
    }

    /**
     * Required. The resource being created.
     *
     * Generated from protobuf field <code>.google.cloud.securesourcemanager.v1.Repository repository = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\SecureSourceManager\V1\Repository $var
     * @return $this
     */
    public function setRepository($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\SecureSourceManager\V1\Repository::class);
        $this->repository = $var;

        return $this;
    }

    /**
     * Required. The ID to use for the repository, which will become the final
     * component of the repository's resource name. This value should be 4-63
     * characters, and valid characters are /[a-z][0-9]-/.
     *
     * Generated from protobuf field <code>string repository_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getRepositoryId()
    {
        return $this->repository_id;
    }

    /**
     * Required. The ID to use for the repository, which will become the final
     * component of the repository's resource name. This value should be 4-63
     * characters, and valid characters are /[a-z][0-9]-/.
     *
     * Generated from protobuf field <code>string repository_id = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setRepositoryId($var)
    {
        GPBUtil::checkString($var, True);
        $this->repository_id = $var;

        return $this;
    }

}

