feat(hos_client_create, hos_client_destory): 多次调用destory不会导致重复释放

This commit is contained in:
彭宣正
2020-12-14 17:24:58 +08:00
parent 505d529c32
commit 10b370e486
55976 changed files with 8544395 additions and 2 deletions

View File

@@ -0,0 +1,273 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/kms/KMS_EXPORTS.h>
#include <aws/kms/KMSRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <utility>
namespace Aws
{
namespace KMS
{
namespace Model
{
/**
*/
class AWS_KMS_API DescribeKeyRequest : public KMSRequest
{
public:
DescribeKeyRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "DescribeKey"; }
Aws::String SerializePayload() const override;
Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
/**
* <p>Describes the specified customer master key (CMK). </p> <p>If you specify a
* predefined AWS alias (an AWS alias with no key ID), KMS associates the alias
* with an <a
* href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master_keys">AWS
* managed CMK</a> and returns its <code>KeyId</code> and <code>Arn</code> in the
* response.</p> <p>To specify a CMK, use its key ID, Amazon Resource Name (ARN),
* alias name, or alias ARN. When using an alias name, prefix it with
* <code>"alias/"</code>. To specify a CMK in a different AWS account, you must use
* the key ARN or alias ARN.</p> <p>For example:</p> <ul> <li> <p>Key ID:
* <code>1234abcd-12ab-34cd-56ef-1234567890ab</code> </p> </li> <li> <p>Key ARN:
* <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>
* </p> </li> <li> <p>Alias name: <code>alias/ExampleAlias</code> </p> </li> <li>
* <p>Alias ARN: <code>arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias</code>
* </p> </li> </ul> <p>To get the key ID and key ARN for a CMK, use <a>ListKeys</a>
* or <a>DescribeKey</a>. To get the alias name and alias ARN, use
* <a>ListAliases</a>.</p>
*/
inline const Aws::String& GetKeyId() const{ return m_keyId; }
/**
* <p>Describes the specified customer master key (CMK). </p> <p>If you specify a
* predefined AWS alias (an AWS alias with no key ID), KMS associates the alias
* with an <a
* href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master_keys">AWS
* managed CMK</a> and returns its <code>KeyId</code> and <code>Arn</code> in the
* response.</p> <p>To specify a CMK, use its key ID, Amazon Resource Name (ARN),
* alias name, or alias ARN. When using an alias name, prefix it with
* <code>"alias/"</code>. To specify a CMK in a different AWS account, you must use
* the key ARN or alias ARN.</p> <p>For example:</p> <ul> <li> <p>Key ID:
* <code>1234abcd-12ab-34cd-56ef-1234567890ab</code> </p> </li> <li> <p>Key ARN:
* <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>
* </p> </li> <li> <p>Alias name: <code>alias/ExampleAlias</code> </p> </li> <li>
* <p>Alias ARN: <code>arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias</code>
* </p> </li> </ul> <p>To get the key ID and key ARN for a CMK, use <a>ListKeys</a>
* or <a>DescribeKey</a>. To get the alias name and alias ARN, use
* <a>ListAliases</a>.</p>
*/
inline bool KeyIdHasBeenSet() const { return m_keyIdHasBeenSet; }
/**
* <p>Describes the specified customer master key (CMK). </p> <p>If you specify a
* predefined AWS alias (an AWS alias with no key ID), KMS associates the alias
* with an <a
* href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master_keys">AWS
* managed CMK</a> and returns its <code>KeyId</code> and <code>Arn</code> in the
* response.</p> <p>To specify a CMK, use its key ID, Amazon Resource Name (ARN),
* alias name, or alias ARN. When using an alias name, prefix it with
* <code>"alias/"</code>. To specify a CMK in a different AWS account, you must use
* the key ARN or alias ARN.</p> <p>For example:</p> <ul> <li> <p>Key ID:
* <code>1234abcd-12ab-34cd-56ef-1234567890ab</code> </p> </li> <li> <p>Key ARN:
* <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>
* </p> </li> <li> <p>Alias name: <code>alias/ExampleAlias</code> </p> </li> <li>
* <p>Alias ARN: <code>arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias</code>
* </p> </li> </ul> <p>To get the key ID and key ARN for a CMK, use <a>ListKeys</a>
* or <a>DescribeKey</a>. To get the alias name and alias ARN, use
* <a>ListAliases</a>.</p>
*/
inline void SetKeyId(const Aws::String& value) { m_keyIdHasBeenSet = true; m_keyId = value; }
/**
* <p>Describes the specified customer master key (CMK). </p> <p>If you specify a
* predefined AWS alias (an AWS alias with no key ID), KMS associates the alias
* with an <a
* href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master_keys">AWS
* managed CMK</a> and returns its <code>KeyId</code> and <code>Arn</code> in the
* response.</p> <p>To specify a CMK, use its key ID, Amazon Resource Name (ARN),
* alias name, or alias ARN. When using an alias name, prefix it with
* <code>"alias/"</code>. To specify a CMK in a different AWS account, you must use
* the key ARN or alias ARN.</p> <p>For example:</p> <ul> <li> <p>Key ID:
* <code>1234abcd-12ab-34cd-56ef-1234567890ab</code> </p> </li> <li> <p>Key ARN:
* <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>
* </p> </li> <li> <p>Alias name: <code>alias/ExampleAlias</code> </p> </li> <li>
* <p>Alias ARN: <code>arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias</code>
* </p> </li> </ul> <p>To get the key ID and key ARN for a CMK, use <a>ListKeys</a>
* or <a>DescribeKey</a>. To get the alias name and alias ARN, use
* <a>ListAliases</a>.</p>
*/
inline void SetKeyId(Aws::String&& value) { m_keyIdHasBeenSet = true; m_keyId = std::move(value); }
/**
* <p>Describes the specified customer master key (CMK). </p> <p>If you specify a
* predefined AWS alias (an AWS alias with no key ID), KMS associates the alias
* with an <a
* href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master_keys">AWS
* managed CMK</a> and returns its <code>KeyId</code> and <code>Arn</code> in the
* response.</p> <p>To specify a CMK, use its key ID, Amazon Resource Name (ARN),
* alias name, or alias ARN. When using an alias name, prefix it with
* <code>"alias/"</code>. To specify a CMK in a different AWS account, you must use
* the key ARN or alias ARN.</p> <p>For example:</p> <ul> <li> <p>Key ID:
* <code>1234abcd-12ab-34cd-56ef-1234567890ab</code> </p> </li> <li> <p>Key ARN:
* <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>
* </p> </li> <li> <p>Alias name: <code>alias/ExampleAlias</code> </p> </li> <li>
* <p>Alias ARN: <code>arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias</code>
* </p> </li> </ul> <p>To get the key ID and key ARN for a CMK, use <a>ListKeys</a>
* or <a>DescribeKey</a>. To get the alias name and alias ARN, use
* <a>ListAliases</a>.</p>
*/
inline void SetKeyId(const char* value) { m_keyIdHasBeenSet = true; m_keyId.assign(value); }
/**
* <p>Describes the specified customer master key (CMK). </p> <p>If you specify a
* predefined AWS alias (an AWS alias with no key ID), KMS associates the alias
* with an <a
* href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master_keys">AWS
* managed CMK</a> and returns its <code>KeyId</code> and <code>Arn</code> in the
* response.</p> <p>To specify a CMK, use its key ID, Amazon Resource Name (ARN),
* alias name, or alias ARN. When using an alias name, prefix it with
* <code>"alias/"</code>. To specify a CMK in a different AWS account, you must use
* the key ARN or alias ARN.</p> <p>For example:</p> <ul> <li> <p>Key ID:
* <code>1234abcd-12ab-34cd-56ef-1234567890ab</code> </p> </li> <li> <p>Key ARN:
* <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>
* </p> </li> <li> <p>Alias name: <code>alias/ExampleAlias</code> </p> </li> <li>
* <p>Alias ARN: <code>arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias</code>
* </p> </li> </ul> <p>To get the key ID and key ARN for a CMK, use <a>ListKeys</a>
* or <a>DescribeKey</a>. To get the alias name and alias ARN, use
* <a>ListAliases</a>.</p>
*/
inline DescribeKeyRequest& WithKeyId(const Aws::String& value) { SetKeyId(value); return *this;}
/**
* <p>Describes the specified customer master key (CMK). </p> <p>If you specify a
* predefined AWS alias (an AWS alias with no key ID), KMS associates the alias
* with an <a
* href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master_keys">AWS
* managed CMK</a> and returns its <code>KeyId</code> and <code>Arn</code> in the
* response.</p> <p>To specify a CMK, use its key ID, Amazon Resource Name (ARN),
* alias name, or alias ARN. When using an alias name, prefix it with
* <code>"alias/"</code>. To specify a CMK in a different AWS account, you must use
* the key ARN or alias ARN.</p> <p>For example:</p> <ul> <li> <p>Key ID:
* <code>1234abcd-12ab-34cd-56ef-1234567890ab</code> </p> </li> <li> <p>Key ARN:
* <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>
* </p> </li> <li> <p>Alias name: <code>alias/ExampleAlias</code> </p> </li> <li>
* <p>Alias ARN: <code>arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias</code>
* </p> </li> </ul> <p>To get the key ID and key ARN for a CMK, use <a>ListKeys</a>
* or <a>DescribeKey</a>. To get the alias name and alias ARN, use
* <a>ListAliases</a>.</p>
*/
inline DescribeKeyRequest& WithKeyId(Aws::String&& value) { SetKeyId(std::move(value)); return *this;}
/**
* <p>Describes the specified customer master key (CMK). </p> <p>If you specify a
* predefined AWS alias (an AWS alias with no key ID), KMS associates the alias
* with an <a
* href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master_keys">AWS
* managed CMK</a> and returns its <code>KeyId</code> and <code>Arn</code> in the
* response.</p> <p>To specify a CMK, use its key ID, Amazon Resource Name (ARN),
* alias name, or alias ARN. When using an alias name, prefix it with
* <code>"alias/"</code>. To specify a CMK in a different AWS account, you must use
* the key ARN or alias ARN.</p> <p>For example:</p> <ul> <li> <p>Key ID:
* <code>1234abcd-12ab-34cd-56ef-1234567890ab</code> </p> </li> <li> <p>Key ARN:
* <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>
* </p> </li> <li> <p>Alias name: <code>alias/ExampleAlias</code> </p> </li> <li>
* <p>Alias ARN: <code>arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias</code>
* </p> </li> </ul> <p>To get the key ID and key ARN for a CMK, use <a>ListKeys</a>
* or <a>DescribeKey</a>. To get the alias name and alias ARN, use
* <a>ListAliases</a>.</p>
*/
inline DescribeKeyRequest& WithKeyId(const char* value) { SetKeyId(value); return *this;}
/**
* <p>A list of grant tokens.</p> <p>For more information, see <a
* href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token">Grant
* Tokens</a> in the <i>AWS Key Management Service Developer Guide</i>.</p>
*/
inline const Aws::Vector<Aws::String>& GetGrantTokens() const{ return m_grantTokens; }
/**
* <p>A list of grant tokens.</p> <p>For more information, see <a
* href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token">Grant
* Tokens</a> in the <i>AWS Key Management Service Developer Guide</i>.</p>
*/
inline bool GrantTokensHasBeenSet() const { return m_grantTokensHasBeenSet; }
/**
* <p>A list of grant tokens.</p> <p>For more information, see <a
* href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token">Grant
* Tokens</a> in the <i>AWS Key Management Service Developer Guide</i>.</p>
*/
inline void SetGrantTokens(const Aws::Vector<Aws::String>& value) { m_grantTokensHasBeenSet = true; m_grantTokens = value; }
/**
* <p>A list of grant tokens.</p> <p>For more information, see <a
* href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token">Grant
* Tokens</a> in the <i>AWS Key Management Service Developer Guide</i>.</p>
*/
inline void SetGrantTokens(Aws::Vector<Aws::String>&& value) { m_grantTokensHasBeenSet = true; m_grantTokens = std::move(value); }
/**
* <p>A list of grant tokens.</p> <p>For more information, see <a
* href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token">Grant
* Tokens</a> in the <i>AWS Key Management Service Developer Guide</i>.</p>
*/
inline DescribeKeyRequest& WithGrantTokens(const Aws::Vector<Aws::String>& value) { SetGrantTokens(value); return *this;}
/**
* <p>A list of grant tokens.</p> <p>For more information, see <a
* href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token">Grant
* Tokens</a> in the <i>AWS Key Management Service Developer Guide</i>.</p>
*/
inline DescribeKeyRequest& WithGrantTokens(Aws::Vector<Aws::String>&& value) { SetGrantTokens(std::move(value)); return *this;}
/**
* <p>A list of grant tokens.</p> <p>For more information, see <a
* href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token">Grant
* Tokens</a> in the <i>AWS Key Management Service Developer Guide</i>.</p>
*/
inline DescribeKeyRequest& AddGrantTokens(const Aws::String& value) { m_grantTokensHasBeenSet = true; m_grantTokens.push_back(value); return *this; }
/**
* <p>A list of grant tokens.</p> <p>For more information, see <a
* href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token">Grant
* Tokens</a> in the <i>AWS Key Management Service Developer Guide</i>.</p>
*/
inline DescribeKeyRequest& AddGrantTokens(Aws::String&& value) { m_grantTokensHasBeenSet = true; m_grantTokens.push_back(std::move(value)); return *this; }
/**
* <p>A list of grant tokens.</p> <p>For more information, see <a
* href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token">Grant
* Tokens</a> in the <i>AWS Key Management Service Developer Guide</i>.</p>
*/
inline DescribeKeyRequest& AddGrantTokens(const char* value) { m_grantTokensHasBeenSet = true; m_grantTokens.push_back(value); return *this; }
private:
Aws::String m_keyId;
bool m_keyIdHasBeenSet;
Aws::Vector<Aws::String> m_grantTokens;
bool m_grantTokensHasBeenSet;
};
} // namespace Model
} // namespace KMS
} // namespace Aws