/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include #include #include namespace Aws { namespace EC2 { namespace Model { /** */ class CreateKeyPairRequest : public EC2Request { public: AWS_EC2_API CreateKeyPairRequest(); // 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 "CreateKeyPair"; } AWS_EC2_API Aws::String SerializePayload() const override; protected: AWS_EC2_API void DumpBodyToUrl(Aws::Http::URI& uri ) const override; public: /** *

A unique name for the key pair.

Constraints: Up to 255 ASCII * characters

*/ inline const Aws::String& GetKeyName() const{ return m_keyName; } /** *

A unique name for the key pair.

Constraints: Up to 255 ASCII * characters

*/ inline bool KeyNameHasBeenSet() const { return m_keyNameHasBeenSet; } /** *

A unique name for the key pair.

Constraints: Up to 255 ASCII * characters

*/ inline void SetKeyName(const Aws::String& value) { m_keyNameHasBeenSet = true; m_keyName = value; } /** *

A unique name for the key pair.

Constraints: Up to 255 ASCII * characters

*/ inline void SetKeyName(Aws::String&& value) { m_keyNameHasBeenSet = true; m_keyName = std::move(value); } /** *

A unique name for the key pair.

Constraints: Up to 255 ASCII * characters

*/ inline void SetKeyName(const char* value) { m_keyNameHasBeenSet = true; m_keyName.assign(value); } /** *

A unique name for the key pair.

Constraints: Up to 255 ASCII * characters

*/ inline CreateKeyPairRequest& WithKeyName(const Aws::String& value) { SetKeyName(value); return *this;} /** *

A unique name for the key pair.

Constraints: Up to 255 ASCII * characters

*/ inline CreateKeyPairRequest& WithKeyName(Aws::String&& value) { SetKeyName(std::move(value)); return *this;} /** *

A unique name for the key pair.

Constraints: Up to 255 ASCII * characters

*/ inline CreateKeyPairRequest& WithKeyName(const char* value) { SetKeyName(value); return *this;} /** *

Checks whether you have the required permissions for the action, without * actually making the request, and provides an error response. If you have the * required permissions, the error response is DryRunOperation. * Otherwise, it is UnauthorizedOperation.

*/ inline bool GetDryRun() const{ return m_dryRun; } /** *

Checks whether you have the required permissions for the action, without * actually making the request, and provides an error response. If you have the * required permissions, the error response is DryRunOperation. * Otherwise, it is UnauthorizedOperation.

*/ inline bool DryRunHasBeenSet() const { return m_dryRunHasBeenSet; } /** *

Checks whether you have the required permissions for the action, without * actually making the request, and provides an error response. If you have the * required permissions, the error response is DryRunOperation. * Otherwise, it is UnauthorizedOperation.

*/ inline void SetDryRun(bool value) { m_dryRunHasBeenSet = true; m_dryRun = value; } /** *

Checks whether you have the required permissions for the action, without * actually making the request, and provides an error response. If you have the * required permissions, the error response is DryRunOperation. * Otherwise, it is UnauthorizedOperation.

*/ inline CreateKeyPairRequest& WithDryRun(bool value) { SetDryRun(value); return *this;} /** *

The type of key pair. Note that ED25519 keys are not supported for Windows * instances.

Default: rsa

*/ inline const KeyType& GetKeyType() const{ return m_keyType; } /** *

The type of key pair. Note that ED25519 keys are not supported for Windows * instances.

Default: rsa

*/ inline bool KeyTypeHasBeenSet() const { return m_keyTypeHasBeenSet; } /** *

The type of key pair. Note that ED25519 keys are not supported for Windows * instances.

Default: rsa

*/ inline void SetKeyType(const KeyType& value) { m_keyTypeHasBeenSet = true; m_keyType = value; } /** *

The type of key pair. Note that ED25519 keys are not supported for Windows * instances.

Default: rsa

*/ inline void SetKeyType(KeyType&& value) { m_keyTypeHasBeenSet = true; m_keyType = std::move(value); } /** *

The type of key pair. Note that ED25519 keys are not supported for Windows * instances.

Default: rsa

*/ inline CreateKeyPairRequest& WithKeyType(const KeyType& value) { SetKeyType(value); return *this;} /** *

The type of key pair. Note that ED25519 keys are not supported for Windows * instances.

Default: rsa

*/ inline CreateKeyPairRequest& WithKeyType(KeyType&& value) { SetKeyType(std::move(value)); return *this;} /** *

The tags to apply to the new key pair.

*/ inline const Aws::Vector& GetTagSpecifications() const{ return m_tagSpecifications; } /** *

The tags to apply to the new key pair.

*/ inline bool TagSpecificationsHasBeenSet() const { return m_tagSpecificationsHasBeenSet; } /** *

The tags to apply to the new key pair.

*/ inline void SetTagSpecifications(const Aws::Vector& value) { m_tagSpecificationsHasBeenSet = true; m_tagSpecifications = value; } /** *

The tags to apply to the new key pair.

*/ inline void SetTagSpecifications(Aws::Vector&& value) { m_tagSpecificationsHasBeenSet = true; m_tagSpecifications = std::move(value); } /** *

The tags to apply to the new key pair.

*/ inline CreateKeyPairRequest& WithTagSpecifications(const Aws::Vector& value) { SetTagSpecifications(value); return *this;} /** *

The tags to apply to the new key pair.

*/ inline CreateKeyPairRequest& WithTagSpecifications(Aws::Vector&& value) { SetTagSpecifications(std::move(value)); return *this;} /** *

The tags to apply to the new key pair.

*/ inline CreateKeyPairRequest& AddTagSpecifications(const TagSpecification& value) { m_tagSpecificationsHasBeenSet = true; m_tagSpecifications.push_back(value); return *this; } /** *

The tags to apply to the new key pair.

*/ inline CreateKeyPairRequest& AddTagSpecifications(TagSpecification&& value) { m_tagSpecificationsHasBeenSet = true; m_tagSpecifications.push_back(std::move(value)); return *this; } /** *

The format of the key pair.

Default: pem

*/ inline const KeyFormat& GetKeyFormat() const{ return m_keyFormat; } /** *

The format of the key pair.

Default: pem

*/ inline bool KeyFormatHasBeenSet() const { return m_keyFormatHasBeenSet; } /** *

The format of the key pair.

Default: pem

*/ inline void SetKeyFormat(const KeyFormat& value) { m_keyFormatHasBeenSet = true; m_keyFormat = value; } /** *

The format of the key pair.

Default: pem

*/ inline void SetKeyFormat(KeyFormat&& value) { m_keyFormatHasBeenSet = true; m_keyFormat = std::move(value); } /** *

The format of the key pair.

Default: pem

*/ inline CreateKeyPairRequest& WithKeyFormat(const KeyFormat& value) { SetKeyFormat(value); return *this;} /** *

The format of the key pair.

Default: pem

*/ inline CreateKeyPairRequest& WithKeyFormat(KeyFormat&& value) { SetKeyFormat(std::move(value)); return *this;} private: Aws::String m_keyName; bool m_keyNameHasBeenSet = false; bool m_dryRun; bool m_dryRunHasBeenSet = false; KeyType m_keyType; bool m_keyTypeHasBeenSet = false; Aws::Vector m_tagSpecifications; bool m_tagSpecificationsHasBeenSet = false; KeyFormat m_keyFormat; bool m_keyFormatHasBeenSet = false; }; } // namespace Model } // namespace EC2 } // namespace Aws