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

namespace Google\Cloud\GkeBackup\V1;

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

/**
 * Request message for CreateBackupChannel.
 *
 * Generated from protobuf message <code>google.cloud.gkebackup.v1.CreateBackupChannelRequest</code>
 */
class CreateBackupChannelRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The location within which to create the BackupChannel.
     * Format: `projects/{@*}locations/*`
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $parent = '';
    /**
     * Required. The BackupChannel resource object to create.
     *
     * Generated from protobuf field <code>.google.cloud.gkebackup.v1.BackupChannel backup_channel = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $backup_channel = null;
    /**
     * Optional. The client-provided short name for the BackupChannel resource.
     * This name must:
     * - be between 1 and 63 characters long (inclusive)
     * - consist of only lower-case ASCII letters, numbers, and dashes
     * - start with a lower-case letter
     * - end with a lower-case letter or number
     * - be unique within the set of BackupChannels in this location
     * If the user does not provide a name, a uuid will be used as the name.
     *
     * Generated from protobuf field <code>string backup_channel_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $backup_channel_id = '';

    /**
     * @param string                                   $parent          Required. The location within which to create the BackupChannel.
     *                                                                  Format: `projects/&#42;/locations/*`
     *                                                                  Please see {@see BackupForGKEClient::locationName()} for help formatting this field.
     * @param \Google\Cloud\GkeBackup\V1\BackupChannel $backupChannel   Required. The BackupChannel resource object to create.
     * @param string                                   $backupChannelId Optional. The client-provided short name for the BackupChannel resource.
     *                                                                  This name must:
     *
     *                                                                  - be between 1 and 63 characters long (inclusive)
     *                                                                  - consist of only lower-case ASCII letters, numbers, and dashes
     *                                                                  - start with a lower-case letter
     *                                                                  - end with a lower-case letter or number
     *                                                                  - be unique within the set of BackupChannels in this location
     *                                                                  If the user does not provide a name, a uuid will be used as the name.
     *
     * @return \Google\Cloud\GkeBackup\V1\CreateBackupChannelRequest
     *
     * @experimental
     */
    public static function build(string $parent, \Google\Cloud\GkeBackup\V1\BackupChannel $backupChannel, string $backupChannelId): self
    {
        return (new self())
            ->setParent($parent)
            ->setBackupChannel($backupChannel)
            ->setBackupChannelId($backupChannelId);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The location within which to create the BackupChannel.
     *           Format: `projects/{@*}locations/*`
     *     @type \Google\Cloud\GkeBackup\V1\BackupChannel $backup_channel
     *           Required. The BackupChannel resource object to create.
     *     @type string $backup_channel_id
     *           Optional. The client-provided short name for the BackupChannel resource.
     *           This name must:
     *           - be between 1 and 63 characters long (inclusive)
     *           - consist of only lower-case ASCII letters, numbers, and dashes
     *           - start with a lower-case letter
     *           - end with a lower-case letter or number
     *           - be unique within the set of BackupChannels in this location
     *           If the user does not provide a name, a uuid will be used as the name.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Gkebackup\V1\Gkebackup::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The location within which to create the BackupChannel.
     * Format: `projects/{@*}locations/*`
     *
     * 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 location within which to create the BackupChannel.
     * Format: `projects/{@*}locations/*`
     *
     * 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 BackupChannel resource object to create.
     *
     * Generated from protobuf field <code>.google.cloud.gkebackup.v1.BackupChannel backup_channel = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\GkeBackup\V1\BackupChannel|null
     */
    public function getBackupChannel()
    {
        return $this->backup_channel;
    }

    public function hasBackupChannel()
    {
        return isset($this->backup_channel);
    }

    public function clearBackupChannel()
    {
        unset($this->backup_channel);
    }

    /**
     * Required. The BackupChannel resource object to create.
     *
     * Generated from protobuf field <code>.google.cloud.gkebackup.v1.BackupChannel backup_channel = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\GkeBackup\V1\BackupChannel $var
     * @return $this
     */
    public function setBackupChannel($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\GkeBackup\V1\BackupChannel::class);
        $this->backup_channel = $var;

        return $this;
    }

    /**
     * Optional. The client-provided short name for the BackupChannel resource.
     * This name must:
     * - be between 1 and 63 characters long (inclusive)
     * - consist of only lower-case ASCII letters, numbers, and dashes
     * - start with a lower-case letter
     * - end with a lower-case letter or number
     * - be unique within the set of BackupChannels in this location
     * If the user does not provide a name, a uuid will be used as the name.
     *
     * Generated from protobuf field <code>string backup_channel_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getBackupChannelId()
    {
        return $this->backup_channel_id;
    }

    /**
     * Optional. The client-provided short name for the BackupChannel resource.
     * This name must:
     * - be between 1 and 63 characters long (inclusive)
     * - consist of only lower-case ASCII letters, numbers, and dashes
     * - start with a lower-case letter
     * - end with a lower-case letter or number
     * - be unique within the set of BackupChannels in this location
     * If the user does not provide a name, a uuid will be used as the name.
     *
     * Generated from protobuf field <code>string backup_channel_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setBackupChannelId($var)
    {
        GPBUtil::checkString($var, True);
        $this->backup_channel_id = $var;

        return $this;
    }

}

