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

namespace Google\Cloud\Dialogflow\V2;

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

/**
 * The request to initialize a location-level encryption specification.
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.v2.InitializeEncryptionSpecRequest</code>
 */
class InitializeEncryptionSpecRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The encryption spec used for CMEK encryption. It is required that
     * the kms key is in the same region as the endpoint. The same key will be
     * used for all provisioned resources, if encryption is available. If the
     * kms_key_name is left empty, no encryption will be enforced.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.EncryptionSpec encryption_spec = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $encryption_spec = null;

    /**
     * @param \Google\Cloud\Dialogflow\V2\EncryptionSpec $encryptionSpec Required. The encryption spec used for CMEK encryption. It is required that
     *                                                                   the kms key is in the same region as the endpoint. The same key will be
     *                                                                   used for all provisioned resources, if encryption is available. If the
     *                                                                   kms_key_name is left empty, no encryption will be enforced.
     *
     * @return \Google\Cloud\Dialogflow\V2\InitializeEncryptionSpecRequest
     *
     * @experimental
     */
    public static function build(\Google\Cloud\Dialogflow\V2\EncryptionSpec $encryptionSpec): self
    {
        return (new self())
            ->setEncryptionSpec($encryptionSpec);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Dialogflow\V2\EncryptionSpec $encryption_spec
     *           Required. The encryption spec used for CMEK encryption. It is required that
     *           the kms key is in the same region as the endpoint. The same key will be
     *           used for all provisioned resources, if encryption is available. If the
     *           kms_key_name is left empty, no encryption will be enforced.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\V2\EncryptionSpec::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The encryption spec used for CMEK encryption. It is required that
     * the kms key is in the same region as the endpoint. The same key will be
     * used for all provisioned resources, if encryption is available. If the
     * kms_key_name is left empty, no encryption will be enforced.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.EncryptionSpec encryption_spec = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Dialogflow\V2\EncryptionSpec|null
     */
    public function getEncryptionSpec()
    {
        return $this->encryption_spec;
    }

    public function hasEncryptionSpec()
    {
        return isset($this->encryption_spec);
    }

    public function clearEncryptionSpec()
    {
        unset($this->encryption_spec);
    }

    /**
     * Required. The encryption spec used for CMEK encryption. It is required that
     * the kms key is in the same region as the endpoint. The same key will be
     * used for all provisioned resources, if encryption is available. If the
     * kms_key_name is left empty, no encryption will be enforced.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.EncryptionSpec encryption_spec = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Dialogflow\V2\EncryptionSpec $var
     * @return $this
     */
    public function setEncryptionSpec($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\V2\EncryptionSpec::class);
        $this->encryption_spec = $var;

        return $this;
    }

}

