/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include namespace Aws { namespace Utils { namespace Xml { class XmlNode; } // namespace Xml } // namespace Utils namespace IAM { namespace Model { /** *

Contains information about an AWS access key.

This data type is used * as a response element in the CreateAccessKey and ListAccessKeys * operations.

The SecretAccessKey value is returned * only in response to CreateAccessKey. You can get a secret access key only * when you first create an access key; you cannot recover the secret access key * later. If you lose a secret access key, you must create a new access key.

*

See Also:

AWS API * Reference

*/ class AWS_IAM_API AccessKey { public: AccessKey(); AccessKey(const Aws::Utils::Xml::XmlNode& xmlNode); AccessKey& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const; void OutputToStream(Aws::OStream& oStream, const char* location) const; /** *

The name of the IAM user that the access key is associated with.

*/ inline const Aws::String& GetUserName() const{ return m_userName; } /** *

The name of the IAM user that the access key is associated with.

*/ inline bool UserNameHasBeenSet() const { return m_userNameHasBeenSet; } /** *

The name of the IAM user that the access key is associated with.

*/ inline void SetUserName(const Aws::String& value) { m_userNameHasBeenSet = true; m_userName = value; } /** *

The name of the IAM user that the access key is associated with.

*/ inline void SetUserName(Aws::String&& value) { m_userNameHasBeenSet = true; m_userName = std::move(value); } /** *

The name of the IAM user that the access key is associated with.

*/ inline void SetUserName(const char* value) { m_userNameHasBeenSet = true; m_userName.assign(value); } /** *

The name of the IAM user that the access key is associated with.

*/ inline AccessKey& WithUserName(const Aws::String& value) { SetUserName(value); return *this;} /** *

The name of the IAM user that the access key is associated with.

*/ inline AccessKey& WithUserName(Aws::String&& value) { SetUserName(std::move(value)); return *this;} /** *

The name of the IAM user that the access key is associated with.

*/ inline AccessKey& WithUserName(const char* value) { SetUserName(value); return *this;} /** *

The ID for this access key.

*/ inline const Aws::String& GetAccessKeyId() const{ return m_accessKeyId; } /** *

The ID for this access key.

*/ inline bool AccessKeyIdHasBeenSet() const { return m_accessKeyIdHasBeenSet; } /** *

The ID for this access key.

*/ inline void SetAccessKeyId(const Aws::String& value) { m_accessKeyIdHasBeenSet = true; m_accessKeyId = value; } /** *

The ID for this access key.

*/ inline void SetAccessKeyId(Aws::String&& value) { m_accessKeyIdHasBeenSet = true; m_accessKeyId = std::move(value); } /** *

The ID for this access key.

*/ inline void SetAccessKeyId(const char* value) { m_accessKeyIdHasBeenSet = true; m_accessKeyId.assign(value); } /** *

The ID for this access key.

*/ inline AccessKey& WithAccessKeyId(const Aws::String& value) { SetAccessKeyId(value); return *this;} /** *

The ID for this access key.

*/ inline AccessKey& WithAccessKeyId(Aws::String&& value) { SetAccessKeyId(std::move(value)); return *this;} /** *

The ID for this access key.

*/ inline AccessKey& WithAccessKeyId(const char* value) { SetAccessKeyId(value); return *this;} /** *

The status of the access key. Active means that the key is valid * for API calls, while Inactive means it is not.

*/ inline const StatusType& GetStatus() const{ return m_status; } /** *

The status of the access key. Active means that the key is valid * for API calls, while Inactive means it is not.

*/ inline bool StatusHasBeenSet() const { return m_statusHasBeenSet; } /** *

The status of the access key. Active means that the key is valid * for API calls, while Inactive means it is not.

*/ inline void SetStatus(const StatusType& value) { m_statusHasBeenSet = true; m_status = value; } /** *

The status of the access key. Active means that the key is valid * for API calls, while Inactive means it is not.

*/ inline void SetStatus(StatusType&& value) { m_statusHasBeenSet = true; m_status = std::move(value); } /** *

The status of the access key. Active means that the key is valid * for API calls, while Inactive means it is not.

*/ inline AccessKey& WithStatus(const StatusType& value) { SetStatus(value); return *this;} /** *

The status of the access key. Active means that the key is valid * for API calls, while Inactive means it is not.

*/ inline AccessKey& WithStatus(StatusType&& value) { SetStatus(std::move(value)); return *this;} /** *

The secret key used to sign requests.

*/ inline const Aws::String& GetSecretAccessKey() const{ return m_secretAccessKey; } /** *

The secret key used to sign requests.

*/ inline bool SecretAccessKeyHasBeenSet() const { return m_secretAccessKeyHasBeenSet; } /** *

The secret key used to sign requests.

*/ inline void SetSecretAccessKey(const Aws::String& value) { m_secretAccessKeyHasBeenSet = true; m_secretAccessKey = value; } /** *

The secret key used to sign requests.

*/ inline void SetSecretAccessKey(Aws::String&& value) { m_secretAccessKeyHasBeenSet = true; m_secretAccessKey = std::move(value); } /** *

The secret key used to sign requests.

*/ inline void SetSecretAccessKey(const char* value) { m_secretAccessKeyHasBeenSet = true; m_secretAccessKey.assign(value); } /** *

The secret key used to sign requests.

*/ inline AccessKey& WithSecretAccessKey(const Aws::String& value) { SetSecretAccessKey(value); return *this;} /** *

The secret key used to sign requests.

*/ inline AccessKey& WithSecretAccessKey(Aws::String&& value) { SetSecretAccessKey(std::move(value)); return *this;} /** *

The secret key used to sign requests.

*/ inline AccessKey& WithSecretAccessKey(const char* value) { SetSecretAccessKey(value); return *this;} /** *

The date when the access key was created.

*/ inline const Aws::Utils::DateTime& GetCreateDate() const{ return m_createDate; } /** *

The date when the access key was created.

*/ inline bool CreateDateHasBeenSet() const { return m_createDateHasBeenSet; } /** *

The date when the access key was created.

*/ inline void SetCreateDate(const Aws::Utils::DateTime& value) { m_createDateHasBeenSet = true; m_createDate = value; } /** *

The date when the access key was created.

*/ inline void SetCreateDate(Aws::Utils::DateTime&& value) { m_createDateHasBeenSet = true; m_createDate = std::move(value); } /** *

The date when the access key was created.

*/ inline AccessKey& WithCreateDate(const Aws::Utils::DateTime& value) { SetCreateDate(value); return *this;} /** *

The date when the access key was created.

*/ inline AccessKey& WithCreateDate(Aws::Utils::DateTime&& value) { SetCreateDate(std::move(value)); return *this;} private: Aws::String m_userName; bool m_userNameHasBeenSet; Aws::String m_accessKeyId; bool m_accessKeyIdHasBeenSet; StatusType m_status; bool m_statusHasBeenSet; Aws::String m_secretAccessKey; bool m_secretAccessKeyHasBeenSet; Aws::Utils::DateTime m_createDate; bool m_createDateHasBeenSet; }; } // namespace Model } // namespace IAM } // namespace Aws