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

namespace Google\Cloud\Memorystore\V1;

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

/**
 * EncryptionInfo describes the encryption information of a cluster.
 *
 * Generated from protobuf message <code>google.cloud.memorystore.v1.EncryptionInfo</code>
 */
class EncryptionInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. Type of encryption.
     *
     * Generated from protobuf field <code>.google.cloud.memorystore.v1.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $encryption_type = 0;
    /**
     * Output only. KMS key versions that are being used to protect the data
     * at-rest.
     *
     * Generated from protobuf field <code>repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {</code>
     */
    private $kms_key_versions;
    /**
     * Output only. The state of the primary version of the KMS key perceived by
     * the system. This field is not populated in backups.
     *
     * Generated from protobuf field <code>.google.cloud.memorystore.v1.EncryptionInfo.KmsKeyState kms_key_primary_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $kms_key_primary_state = 0;
    /**
     * Output only. The most recent time when the encryption info was updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $last_update_time = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $encryption_type
     *           Output only. Type of encryption.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $kms_key_versions
     *           Output only. KMS key versions that are being used to protect the data
     *           at-rest.
     *     @type int $kms_key_primary_state
     *           Output only. The state of the primary version of the KMS key perceived by
     *           the system. This field is not populated in backups.
     *     @type \Google\Protobuf\Timestamp $last_update_time
     *           Output only. The most recent time when the encryption info was updated.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Memorystore\V1\Memorystore::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. Type of encryption.
     *
     * Generated from protobuf field <code>.google.cloud.memorystore.v1.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getEncryptionType()
    {
        return $this->encryption_type;
    }

    /**
     * Output only. Type of encryption.
     *
     * Generated from protobuf field <code>.google.cloud.memorystore.v1.EncryptionInfo.Type encryption_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setEncryptionType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Memorystore\V1\EncryptionInfo\Type::class);
        $this->encryption_type = $var;

        return $this;
    }

    /**
     * Output only. KMS key versions that are being used to protect the data
     * at-rest.
     *
     * Generated from protobuf field <code>repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getKmsKeyVersions()
    {
        return $this->kms_key_versions;
    }

    /**
     * Output only. KMS key versions that are being used to protect the data
     * at-rest.
     *
     * Generated from protobuf field <code>repeated string kms_key_versions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setKmsKeyVersions($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->kms_key_versions = $arr;

        return $this;
    }

    /**
     * Output only. The state of the primary version of the KMS key perceived by
     * the system. This field is not populated in backups.
     *
     * Generated from protobuf field <code>.google.cloud.memorystore.v1.EncryptionInfo.KmsKeyState kms_key_primary_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getKmsKeyPrimaryState()
    {
        return $this->kms_key_primary_state;
    }

    /**
     * Output only. The state of the primary version of the KMS key perceived by
     * the system. This field is not populated in backups.
     *
     * Generated from protobuf field <code>.google.cloud.memorystore.v1.EncryptionInfo.KmsKeyState kms_key_primary_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setKmsKeyPrimaryState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Memorystore\V1\EncryptionInfo\KmsKeyState::class);
        $this->kms_key_primary_state = $var;

        return $this;
    }

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

    public function hasLastUpdateTime()
    {
        return isset($this->last_update_time);
    }

    public function clearLastUpdateTime()
    {
        unset($this->last_update_time);
    }

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

        return $this;
    }

}

