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

namespace Google\Cloud\NetApp\V1;

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

/**
 * UpdateActiveDirectoryRequest for updating an active directory.
 *
 * Generated from protobuf message <code>google.cloud.netapp.v1.UpdateActiveDirectoryRequest</code>
 */
class UpdateActiveDirectoryRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Field mask is used to specify the fields to be overwritten in the
     * Active Directory resource by the update.
     * The fields specified in the update_mask are relative to the resource, not
     * the full request. A field will be overwritten if it is in the mask. If the
     * user does not provide a mask then all fields will be overwritten.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $update_mask = null;
    /**
     * Required. The volume being updated
     *
     * Generated from protobuf field <code>.google.cloud.netapp.v1.ActiveDirectory active_directory = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $active_directory = null;

    /**
     * @param \Google\Cloud\NetApp\V1\ActiveDirectory $activeDirectory Required. The volume being updated
     * @param \Google\Protobuf\FieldMask              $updateMask      Required. Field mask is used to specify the fields to be overwritten in the
     *                                                                 Active Directory resource by the update.
     *                                                                 The fields specified in the update_mask are relative to the resource, not
     *                                                                 the full request. A field will be overwritten if it is in the mask. If the
     *                                                                 user does not provide a mask then all fields will be overwritten.
     *
     * @return \Google\Cloud\NetApp\V1\UpdateActiveDirectoryRequest
     *
     * @experimental
     */
    public static function build(\Google\Cloud\NetApp\V1\ActiveDirectory $activeDirectory, \Google\Protobuf\FieldMask $updateMask): self
    {
        return (new self())
            ->setActiveDirectory($activeDirectory)
            ->setUpdateMask($updateMask);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\FieldMask $update_mask
     *           Required. Field mask is used to specify the fields to be overwritten in the
     *           Active Directory resource by the update.
     *           The fields specified in the update_mask are relative to the resource, not
     *           the full request. A field will be overwritten if it is in the mask. If the
     *           user does not provide a mask then all fields will be overwritten.
     *     @type \Google\Cloud\NetApp\V1\ActiveDirectory $active_directory
     *           Required. The volume being updated
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Netapp\V1\ActiveDirectory::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Field mask is used to specify the fields to be overwritten in the
     * Active Directory resource by the update.
     * The fields specified in the update_mask are relative to the resource, not
     * the full request. A field will be overwritten if it is in the mask. If the
     * user does not provide a mask then all fields will be overwritten.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED];</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);
    }

    /**
     * Required. Field mask is used to specify the fields to be overwritten in the
     * Active Directory resource by the update.
     * The fields specified in the update_mask are relative to the resource, not
     * the full request. A field will be overwritten if it is in the mask. If the
     * user does not provide a mask then all fields will be overwritten.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED];</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;
    }

    /**
     * Required. The volume being updated
     *
     * Generated from protobuf field <code>.google.cloud.netapp.v1.ActiveDirectory active_directory = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\NetApp\V1\ActiveDirectory|null
     */
    public function getActiveDirectory()
    {
        return $this->active_directory;
    }

    public function hasActiveDirectory()
    {
        return isset($this->active_directory);
    }

    public function clearActiveDirectory()
    {
        unset($this->active_directory);
    }

    /**
     * Required. The volume being updated
     *
     * Generated from protobuf field <code>.google.cloud.netapp.v1.ActiveDirectory active_directory = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\NetApp\V1\ActiveDirectory $var
     * @return $this
     */
    public function setActiveDirectory($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\NetApp\V1\ActiveDirectory::class);
        $this->active_directory = $var;

        return $this;
    }

}

