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

/**
 * A customer-managed encryption key specification that can be applied to all
 * created resources (e.g. Conversation).
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.v2.EncryptionSpec</code>
 */
class EncryptionSpec extends \Google\Protobuf\Internal\Message
{
    /**
     * Immutable. The resource name of the encryption key specification resource.
     * Format:
     * projects/{project}/locations/{location}/encryptionSpec
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
     */
    protected $name = '';
    /**
     * Required. The name of customer-managed encryption key that is used to
     * secure a resource and its sub-resources. If empty, the resource is secured
     * by the default Google encryption key. Only the key in the same location as
     * this resource is allowed to be used for encryption. Format:
     * `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}`
     *
     * Generated from protobuf field <code>string kms_key = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $kms_key = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Immutable. The resource name of the encryption key specification resource.
     *           Format:
     *           projects/{project}/locations/{location}/encryptionSpec
     *     @type string $kms_key
     *           Required. The name of customer-managed encryption key that is used to
     *           secure a resource and its sub-resources. If empty, the resource is secured
     *           by the default Google encryption key. Only the key in the same location as
     *           this resource is allowed to be used for encryption. Format:
     *           `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}`
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\V2\EncryptionSpec::initOnce();
        parent::__construct($data);
    }

    /**
     * Immutable. The resource name of the encryption key specification resource.
     * Format:
     * projects/{project}/locations/{location}/encryptionSpec
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Immutable. The resource name of the encryption key specification resource.
     * Format:
     * projects/{project}/locations/{location}/encryptionSpec
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Required. The name of customer-managed encryption key that is used to
     * secure a resource and its sub-resources. If empty, the resource is secured
     * by the default Google encryption key. Only the key in the same location as
     * this resource is allowed to be used for encryption. Format:
     * `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}`
     *
     * Generated from protobuf field <code>string kms_key = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getKmsKey()
    {
        return $this->kms_key;
    }

    /**
     * Required. The name of customer-managed encryption key that is used to
     * secure a resource and its sub-resources. If empty, the resource is secured
     * by the default Google encryption key. Only the key in the same location as
     * this resource is allowed to be used for encryption. Format:
     * `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}`
     *
     * Generated from protobuf field <code>string kms_key = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setKmsKey($var)
    {
        GPBUtil::checkString($var, True);
        $this->kms_key = $var;

        return $this;
    }

}

