<?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\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Request message for UpdateBackupChannel.
 *
 * Generated from protobuf message <code>google.cloud.gkebackup.v1.UpdateBackupChannelRequest</code>
 */
class UpdateBackupChannelRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. A new version of the BackupChannel resource that contains updated
     * fields. This may be sparsely populated if an `update_mask` is provided.
     *
     * Generated from protobuf field <code>.google.cloud.gkebackup.v1.BackupChannel backup_channel = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $backup_channel = null;
    /**
     * Optional. This is used to specify the fields to be overwritten in the
     * BackupChannel targeted for update. The values for each of these
     * updated fields will be taken from the `backup_channel` provided
     * with this request. Field names are relative to the root of the resource
     * (e.g., `description`, `labels`, etc.)
     * If no `update_mask` is provided, all fields in `backup_channel` will
     * be written to the target BackupChannel resource. Note that
     * OUTPUT_ONLY and IMMUTABLE fields in `backup_channel` are ignored and
     * are not used to update the target BackupChannel.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $update_mask = null;

    /**
     * @param \Google\Cloud\GkeBackup\V1\BackupChannel $backupChannel Required. A new version of the BackupChannel resource that contains updated
     *                                                                fields. This may be sparsely populated if an `update_mask` is provided.
     * @param \Google\Protobuf\FieldMask               $updateMask    Optional. This is used to specify the fields to be overwritten in the
     *                                                                BackupChannel targeted for update. The values for each of these
     *                                                                updated fields will be taken from the `backup_channel` provided
     *                                                                with this request. Field names are relative to the root of the resource
     *                                                                (e.g., `description`, `labels`, etc.)
     *                                                                If no `update_mask` is provided, all fields in `backup_channel` will
     *                                                                be written to the target BackupChannel resource. Note that
     *                                                                OUTPUT_ONLY and IMMUTABLE fields in `backup_channel` are ignored and
     *                                                                are not used to update the target BackupChannel.
     *
     * @return \Google\Cloud\GkeBackup\V1\UpdateBackupChannelRequest
     *
     * @experimental
     */
    public static function build(\Google\Cloud\GkeBackup\V1\BackupChannel $backupChannel, \Google\Protobuf\FieldMask $updateMask): self
    {
        return (new self())
            ->setBackupChannel($backupChannel)
            ->setUpdateMask($updateMask);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\GkeBackup\V1\BackupChannel $backup_channel
     *           Required. A new version of the BackupChannel resource that contains updated
     *           fields. This may be sparsely populated if an `update_mask` is provided.
     *     @type \Google\Protobuf\FieldMask $update_mask
     *           Optional. This is used to specify the fields to be overwritten in the
     *           BackupChannel targeted for update. The values for each of these
     *           updated fields will be taken from the `backup_channel` provided
     *           with this request. Field names are relative to the root of the resource
     *           (e.g., `description`, `labels`, etc.)
     *           If no `update_mask` is provided, all fields in `backup_channel` will
     *           be written to the target BackupChannel resource. Note that
     *           OUTPUT_ONLY and IMMUTABLE fields in `backup_channel` are ignored and
     *           are not used to update the target BackupChannel.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Gkebackup\V1\Gkebackup::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. A new version of the BackupChannel resource that contains updated
     * fields. This may be sparsely populated if an `update_mask` is provided.
     *
     * Generated from protobuf field <code>.google.cloud.gkebackup.v1.BackupChannel backup_channel = 1 [(.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. A new version of the BackupChannel resource that contains updated
     * fields. This may be sparsely populated if an `update_mask` is provided.
     *
     * Generated from protobuf field <code>.google.cloud.gkebackup.v1.BackupChannel backup_channel = 1 [(.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. This is used to specify the fields to be overwritten in the
     * BackupChannel targeted for update. The values for each of these
     * updated fields will be taken from the `backup_channel` provided
     * with this request. Field names are relative to the root of the resource
     * (e.g., `description`, `labels`, etc.)
     * If no `update_mask` is provided, all fields in `backup_channel` will
     * be written to the target BackupChannel resource. Note that
     * OUTPUT_ONLY and IMMUTABLE fields in `backup_channel` are ignored and
     * are not used to update the target BackupChannel.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\FieldMask|null
     */
    public function getUpdateMask()
    {
        return $this->update_mask;
    }

    public function hasUpdateMask()
    {
        return isset($this->update_mask);
    }

    public function clearUpdateMask()
    {
        unset($this->update_mask);
    }

    /**
     * Optional. This is used to specify the fields to be overwritten in the
     * BackupChannel targeted for update. The values for each of these
     * updated fields will be taken from the `backup_channel` provided
     * with this request. Field names are relative to the root of the resource
     * (e.g., `description`, `labels`, etc.)
     * If no `update_mask` is provided, all fields in `backup_channel` will
     * be written to the target BackupChannel resource. Note that
     * OUTPUT_ONLY and IMMUTABLE fields in `backup_channel` are ignored and
     * are not used to update the target BackupChannel.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Protobuf\FieldMask $var
     * @return $this
     */
    public function setUpdateMask($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class);
        $this->update_mask = $var;

        return $this;
    }

}

