<?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 UpdateBackupPlan.
 *
 * Generated from protobuf message <code>google.cloud.gkebackup.v1.UpdateBackupPlanRequest</code>
 */
class UpdateBackupPlanRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. A new version of the BackupPlan 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.BackupPlan backup_plan = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $backup_plan = null;
    /**
     * This is used to specify the fields to be overwritten in the
     * BackupPlan targeted for update. The values for each of these
     * updated fields will be taken from the `backup_plan` provided
     * with this request. Field names are relative to the root of the resource
     * (e.g., `description`, `backup_config.include_volume_data`, etc.)
     * If no `update_mask` is provided, all fields in `backup_plan` will be
     * written to the target BackupPlan resource.
     * Note that OUTPUT_ONLY and IMMUTABLE fields in `backup_plan` are ignored
     * and are not used to update the target BackupPlan.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2;</code>
     */
    private $update_mask = null;

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

    /**
     * Required. A new version of the BackupPlan 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.BackupPlan backup_plan = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\GkeBackup\V1\BackupPlan|null
     */
    public function getBackupPlan()
    {
        return $this->backup_plan;
    }

    public function hasBackupPlan()
    {
        return isset($this->backup_plan);
    }

    public function clearBackupPlan()
    {
        unset($this->backup_plan);
    }

    /**
     * Required. A new version of the BackupPlan 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.BackupPlan backup_plan = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\GkeBackup\V1\BackupPlan $var
     * @return $this
     */
    public function setBackupPlan($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\GkeBackup\V1\BackupPlan::class);
        $this->backup_plan = $var;

        return $this;
    }

    /**
     * This is used to specify the fields to be overwritten in the
     * BackupPlan targeted for update. The values for each of these
     * updated fields will be taken from the `backup_plan` provided
     * with this request. Field names are relative to the root of the resource
     * (e.g., `description`, `backup_config.include_volume_data`, etc.)
     * If no `update_mask` is provided, all fields in `backup_plan` will be
     * written to the target BackupPlan resource.
     * Note that OUTPUT_ONLY and IMMUTABLE fields in `backup_plan` are ignored
     * and are not used to update the target BackupPlan.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2;</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);
    }

    /**
     * This is used to specify the fields to be overwritten in the
     * BackupPlan targeted for update. The values for each of these
     * updated fields will be taken from the `backup_plan` provided
     * with this request. Field names are relative to the root of the resource
     * (e.g., `description`, `backup_config.include_volume_data`, etc.)
     * If no `update_mask` is provided, all fields in `backup_plan` will be
     * written to the target BackupPlan resource.
     * Note that OUTPUT_ONLY and IMMUTABLE fields in `backup_plan` are ignored
     * and are not used to update the target BackupPlan.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2;</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;
    }

}

