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

namespace Google\Cloud\Dataplex\V1;

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

/**
 * A Resource designed to manage encryption configurations for customers to
 * support Customer Managed Encryption Keys (CMEK).
 *
 * Generated from protobuf message <code>google.cloud.dataplex.v1.EncryptionConfig</code>
 */
class EncryptionConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Identifier. The resource name of the EncryptionConfig.
     * Format:
     * organizations/{organization}/locations/{location}/encryptionConfigs/{encryption_config}
     * Global location is not supported.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.resource_reference) = {</code>
     */
    protected $name = '';
    /**
     * Optional. If a key is chosen, it means that the customer is using CMEK.
     * If a key is not chosen, it means that the customer is using Google managed
     * encryption.
     *
     * Generated from protobuf field <code>string key = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $key = '';
    /**
     * Output only. The time when the Encryption configuration was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $create_time = null;
    /**
     * Output only. The time when the Encryption configuration was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $update_time = null;
    /**
     * Output only. The state of encryption of the databases.
     *
     * Generated from protobuf field <code>.google.cloud.dataplex.v1.EncryptionConfig.EncryptionState encryption_state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $encryption_state = 0;
    /**
     * Etag of the EncryptionConfig. This is a strong etag.
     *
     * Generated from protobuf field <code>string etag = 6;</code>
     */
    protected $etag = '';
    /**
     * Output only. Details of the failure if anything related to Cmek db fails.
     *
     * Generated from protobuf field <code>.google.cloud.dataplex.v1.EncryptionConfig.FailureDetails failure_details = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $failure_details = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Identifier. The resource name of the EncryptionConfig.
     *           Format:
     *           organizations/{organization}/locations/{location}/encryptionConfigs/{encryption_config}
     *           Global location is not supported.
     *     @type string $key
     *           Optional. If a key is chosen, it means that the customer is using CMEK.
     *           If a key is not chosen, it means that the customer is using Google managed
     *           encryption.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. The time when the Encryption configuration was created.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           Output only. The time when the Encryption configuration was last updated.
     *     @type int $encryption_state
     *           Output only. The state of encryption of the databases.
     *     @type string $etag
     *           Etag of the EncryptionConfig. This is a strong etag.
     *     @type \Google\Cloud\Dataplex\V1\EncryptionConfig\FailureDetails $failure_details
     *           Output only. Details of the failure if anything related to Cmek db fails.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dataplex\V1\Cmek::initOnce();
        parent::__construct($data);
    }

    /**
     * Identifier. The resource name of the EncryptionConfig.
     * Format:
     * organizations/{organization}/locations/{location}/encryptionConfigs/{encryption_config}
     * Global location is not supported.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Identifier. The resource name of the EncryptionConfig.
     * Format:
     * organizations/{organization}/locations/{location}/encryptionConfigs/{encryption_config}
     * Global location is not supported.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Optional. If a key is chosen, it means that the customer is using CMEK.
     * If a key is not chosen, it means that the customer is using Google managed
     * encryption.
     *
     * Generated from protobuf field <code>string key = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getKey()
    {
        return $this->key;
    }

    /**
     * Optional. If a key is chosen, it means that the customer is using CMEK.
     * If a key is not chosen, it means that the customer is using Google managed
     * encryption.
     *
     * Generated from protobuf field <code>string key = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setKey($var)
    {
        GPBUtil::checkString($var, True);
        $this->key = $var;

        return $this;
    }

    /**
     * Output only. The time when the Encryption configuration was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    public function hasCreateTime()
    {
        return isset($this->create_time);
    }

    public function clearCreateTime()
    {
        unset($this->create_time);
    }

    /**
     * Output only. The time when the Encryption configuration was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->create_time = $var;

        return $this;
    }

    /**
     * Output only. The time when the Encryption configuration was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getUpdateTime()
    {
        return $this->update_time;
    }

    public function hasUpdateTime()
    {
        return isset($this->update_time);
    }

    public function clearUpdateTime()
    {
        unset($this->update_time);
    }

    /**
     * Output only. The time when the Encryption configuration was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->update_time = $var;

        return $this;
    }

    /**
     * Output only. The state of encryption of the databases.
     *
     * Generated from protobuf field <code>.google.cloud.dataplex.v1.EncryptionConfig.EncryptionState encryption_state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getEncryptionState()
    {
        return $this->encryption_state;
    }

    /**
     * Output only. The state of encryption of the databases.
     *
     * Generated from protobuf field <code>.google.cloud.dataplex.v1.EncryptionConfig.EncryptionState encryption_state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setEncryptionState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Dataplex\V1\EncryptionConfig\EncryptionState::class);
        $this->encryption_state = $var;

        return $this;
    }

    /**
     * Etag of the EncryptionConfig. This is a strong etag.
     *
     * Generated from protobuf field <code>string etag = 6;</code>
     * @return string
     */
    public function getEtag()
    {
        return $this->etag;
    }

    /**
     * Etag of the EncryptionConfig. This is a strong etag.
     *
     * Generated from protobuf field <code>string etag = 6;</code>
     * @param string $var
     * @return $this
     */
    public function setEtag($var)
    {
        GPBUtil::checkString($var, True);
        $this->etag = $var;

        return $this;
    }

    /**
     * Output only. Details of the failure if anything related to Cmek db fails.
     *
     * Generated from protobuf field <code>.google.cloud.dataplex.v1.EncryptionConfig.FailureDetails failure_details = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Cloud\Dataplex\V1\EncryptionConfig\FailureDetails|null
     */
    public function getFailureDetails()
    {
        return $this->failure_details;
    }

    public function hasFailureDetails()
    {
        return isset($this->failure_details);
    }

    public function clearFailureDetails()
    {
        unset($this->failure_details);
    }

    /**
     * Output only. Details of the failure if anything related to Cmek db fails.
     *
     * Generated from protobuf field <code>.google.cloud.dataplex.v1.EncryptionConfig.FailureDetails failure_details = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\Dataplex\V1\EncryptionConfig\FailureDetails $var
     * @return $this
     */
    public function setFailureDetails($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataplex\V1\EncryptionConfig\FailureDetails::class);
        $this->failure_details = $var;

        return $this;
    }

}

