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

namespace Google\Cloud\Kms\V1;

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

/**
 * A [CryptoKeyVersionTemplate][google.cloud.kms.v1.CryptoKeyVersionTemplate]
 * specifies the properties to use when creating a new
 * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion], either manually
 * with
 * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion]
 * or automatically as a result of auto-rotation.
 *
 * Generated from protobuf message <code>google.cloud.kms.v1.CryptoKeyVersionTemplate</code>
 */
class CryptoKeyVersionTemplate extends \Google\Protobuf\Internal\Message
{
    /**
     * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when creating
     * a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this
     * template. Immutable. Defaults to
     * [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE].
     *
     * Generated from protobuf field <code>.google.cloud.kms.v1.ProtectionLevel protection_level = 1;</code>
     */
    protected $protection_level = 0;
    /**
     * Required.
     * [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm]
     * to use when creating a
     * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this
     * template.
     * For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both
     * this field is omitted and
     * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is
     * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
     *
     * Generated from protobuf field <code>.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $algorithm = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $protection_level
     *           [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when creating
     *           a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this
     *           template. Immutable. Defaults to
     *           [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE].
     *     @type int $algorithm
     *           Required.
     *           [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm]
     *           to use when creating a
     *           [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this
     *           template.
     *           For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both
     *           this field is omitted and
     *           [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is
     *           [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Kms\V1\Resources::initOnce();
        parent::__construct($data);
    }

    /**
     * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when creating
     * a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this
     * template. Immutable. Defaults to
     * [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE].
     *
     * Generated from protobuf field <code>.google.cloud.kms.v1.ProtectionLevel protection_level = 1;</code>
     * @return int
     */
    public function getProtectionLevel()
    {
        return $this->protection_level;
    }

    /**
     * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when creating
     * a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this
     * template. Immutable. Defaults to
     * [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE].
     *
     * Generated from protobuf field <code>.google.cloud.kms.v1.ProtectionLevel protection_level = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setProtectionLevel($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ProtectionLevel::class);
        $this->protection_level = $var;

        return $this;
    }

    /**
     * Required.
     * [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm]
     * to use when creating a
     * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this
     * template.
     * For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both
     * this field is omitted and
     * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is
     * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
     *
     * Generated from protobuf field <code>.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getAlgorithm()
    {
        return $this->algorithm;
    }

    /**
     * Required.
     * [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm]
     * to use when creating a
     * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this
     * template.
     * For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both
     * this field is omitted and
     * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is
     * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
     *
     * Generated from protobuf field <code>.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setAlgorithm($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\CryptoKeyVersion\CryptoKeyVersionAlgorithm::class);
        $this->algorithm = $var;

        return $this;
    }

}

