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

namespace Google\Ads\DataManager\V1;

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

/**
 * A data encryption key wrapped by an AWS KMS key.
 *
 * Generated from protobuf message <code>google.ads.datamanager.v1.AwsWrappedKeyInfo</code>
 */
class AwsWrappedKeyInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The type of algorithm used to encrypt the data.
     *
     * Generated from protobuf field <code>.google.ads.datamanager.v1.AwsWrappedKeyInfo.KeyType key_type = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $key_type = 0;
    /**
     * Required. The Amazon Resource Name of the IAM Role to assume for KMS
     * decryption access. Should be in the format of
     * `arn:{partition}:iam::{account_id}:role/{role_name}`
     *
     * Generated from protobuf field <code>string role_arn = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $role_arn = '';
    /**
     * Required. The URI of the AWS KMS key used to decrypt the DEK. Should be in
     * the format of `arn:{partition}:kms:{region}:{account_id}:key/{key_id}` or
     * `aws-kms://arn:{partition}:kms:{region}:{account_id}:key/{key_id}`
     *
     * Generated from protobuf field <code>string kek_uri = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $kek_uri = '';
    /**
     * Required. The base64 encoded encrypted data encryption key.
     *
     * Generated from protobuf field <code>string encrypted_dek = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $encrypted_dek = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $key_type
     *           Required. The type of algorithm used to encrypt the data.
     *     @type string $role_arn
     *           Required. The Amazon Resource Name of the IAM Role to assume for KMS
     *           decryption access. Should be in the format of
     *           `arn:{partition}:iam::{account_id}:role/{role_name}`
     *     @type string $kek_uri
     *           Required. The URI of the AWS KMS key used to decrypt the DEK. Should be in
     *           the format of `arn:{partition}:kms:{region}:{account_id}:key/{key_id}` or
     *           `aws-kms://arn:{partition}:kms:{region}:{account_id}:key/{key_id}`
     *     @type string $encrypted_dek
     *           Required. The base64 encoded encrypted data encryption key.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\Datamanager\V1\EncryptionInfo::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The type of algorithm used to encrypt the data.
     *
     * Generated from protobuf field <code>.google.ads.datamanager.v1.AwsWrappedKeyInfo.KeyType key_type = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getKeyType()
    {
        return $this->key_type;
    }

    /**
     * Required. The type of algorithm used to encrypt the data.
     *
     * Generated from protobuf field <code>.google.ads.datamanager.v1.AwsWrappedKeyInfo.KeyType key_type = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setKeyType($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\DataManager\V1\AwsWrappedKeyInfo\KeyType::class);
        $this->key_type = $var;

        return $this;
    }

    /**
     * Required. The Amazon Resource Name of the IAM Role to assume for KMS
     * decryption access. Should be in the format of
     * `arn:{partition}:iam::{account_id}:role/{role_name}`
     *
     * Generated from protobuf field <code>string role_arn = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getRoleArn()
    {
        return $this->role_arn;
    }

    /**
     * Required. The Amazon Resource Name of the IAM Role to assume for KMS
     * decryption access. Should be in the format of
     * `arn:{partition}:iam::{account_id}:role/{role_name}`
     *
     * Generated from protobuf field <code>string role_arn = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setRoleArn($var)
    {
        GPBUtil::checkString($var, True);
        $this->role_arn = $var;

        return $this;
    }

    /**
     * Required. The URI of the AWS KMS key used to decrypt the DEK. Should be in
     * the format of `arn:{partition}:kms:{region}:{account_id}:key/{key_id}` or
     * `aws-kms://arn:{partition}:kms:{region}:{account_id}:key/{key_id}`
     *
     * Generated from protobuf field <code>string kek_uri = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getKekUri()
    {
        return $this->kek_uri;
    }

    /**
     * Required. The URI of the AWS KMS key used to decrypt the DEK. Should be in
     * the format of `arn:{partition}:kms:{region}:{account_id}:key/{key_id}` or
     * `aws-kms://arn:{partition}:kms:{region}:{account_id}:key/{key_id}`
     *
     * Generated from protobuf field <code>string kek_uri = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setKekUri($var)
    {
        GPBUtil::checkString($var, True);
        $this->kek_uri = $var;

        return $this;
    }

    /**
     * Required. The base64 encoded encrypted data encryption key.
     *
     * Generated from protobuf field <code>string encrypted_dek = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getEncryptedDek()
    {
        return $this->encrypted_dek;
    }

    /**
     * Required. The base64 encoded encrypted data encryption key.
     *
     * Generated from protobuf field <code>string encrypted_dek = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setEncryptedDek($var)
    {
        GPBUtil::checkString($var, True);
        $this->encrypted_dek = $var;

        return $this;
    }

}

