/** * 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 Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace Lightsail { namespace Model { /** *

Describes an access key for an Amazon Lightsail bucket.

Access keys * grant full programmatic access to the specified bucket and its objects. You can * have a maximum of two access keys per bucket. Use the CreateBucketAccessKey * action to create an access key for a specific bucket. For more information about * access keys, see Creating * access keys for a bucket in Amazon Lightsail in the Amazon Lightsail * Developer Guide.

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

See Also:

AWS * API Reference

*/ class AccessKey { public: AWS_LIGHTSAIL_API AccessKey(); AWS_LIGHTSAIL_API AccessKey(Aws::Utils::Json::JsonView jsonValue); AWS_LIGHTSAIL_API AccessKey& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_LIGHTSAIL_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

The ID of the access key.

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

The ID of the access key.

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

The ID of the access key.

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

The ID of the access key.

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

The ID of the access key.

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

The ID of the access key.

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

The ID of the access key.

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

The ID of the access key.

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

The secret access key used to sign requests.

You should store the * secret access key in a safe location. We recommend that you delete the access * key if the secret access key is compromised.

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

The secret access key used to sign requests.

You should store the * secret access key in a safe location. We recommend that you delete the access * key if the secret access key is compromised.

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

The secret access key used to sign requests.

You should store the * secret access key in a safe location. We recommend that you delete the access * key if the secret access key is compromised.

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

The secret access key used to sign requests.

You should store the * secret access key in a safe location. We recommend that you delete the access * key if the secret access key is compromised.

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

The secret access key used to sign requests.

You should store the * secret access key in a safe location. We recommend that you delete the access * key if the secret access key is compromised.

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

The secret access key used to sign requests.

You should store the * secret access key in a safe location. We recommend that you delete the access * key if the secret access key is compromised.

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

The secret access key used to sign requests.

You should store the * secret access key in a safe location. We recommend that you delete the access * key if the secret access key is compromised.

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

The secret access key used to sign requests.

You should store the * secret access key in a safe location. We recommend that you delete the access * key if the secret access key is compromised.

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

The status of the access key.

A status of Active means * that the key is valid, while Inactive means it is not.

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

The status of the access key.

A status of Active means * that the key is valid, while Inactive means it is not.

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

The status of the access key.

A status of Active means * that the key is valid, while Inactive means it is not.

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

The status of the access key.

A status of Active means * that the key is valid, 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.

A status of Active means * that the key is valid, while Inactive means it is not.

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

The status of the access key.

A status of Active means * that the key is valid, while Inactive means it is not.

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

The timestamp when the access key was created.

*/ inline const Aws::Utils::DateTime& GetCreatedAt() const{ return m_createdAt; } /** *

The timestamp when the access key was created.

*/ inline bool CreatedAtHasBeenSet() const { return m_createdAtHasBeenSet; } /** *

The timestamp when the access key was created.

*/ inline void SetCreatedAt(const Aws::Utils::DateTime& value) { m_createdAtHasBeenSet = true; m_createdAt = value; } /** *

The timestamp when the access key was created.

*/ inline void SetCreatedAt(Aws::Utils::DateTime&& value) { m_createdAtHasBeenSet = true; m_createdAt = std::move(value); } /** *

The timestamp when the access key was created.

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

The timestamp when the access key was created.

*/ inline AccessKey& WithCreatedAt(Aws::Utils::DateTime&& value) { SetCreatedAt(std::move(value)); return *this;} /** *

An object that describes the last time the access key was used.

*

This object does not include data in the response of a CreateBucketAccessKey * action. If the access key has not been used, the region and * serviceName values are N/A, and the * lastUsedDate value is null.

*/ inline const AccessKeyLastUsed& GetLastUsed() const{ return m_lastUsed; } /** *

An object that describes the last time the access key was used.

*

This object does not include data in the response of a CreateBucketAccessKey * action. If the access key has not been used, the region and * serviceName values are N/A, and the * lastUsedDate value is null.

*/ inline bool LastUsedHasBeenSet() const { return m_lastUsedHasBeenSet; } /** *

An object that describes the last time the access key was used.

*

This object does not include data in the response of a CreateBucketAccessKey * action. If the access key has not been used, the region and * serviceName values are N/A, and the * lastUsedDate value is null.

*/ inline void SetLastUsed(const AccessKeyLastUsed& value) { m_lastUsedHasBeenSet = true; m_lastUsed = value; } /** *

An object that describes the last time the access key was used.

*

This object does not include data in the response of a CreateBucketAccessKey * action. If the access key has not been used, the region and * serviceName values are N/A, and the * lastUsedDate value is null.

*/ inline void SetLastUsed(AccessKeyLastUsed&& value) { m_lastUsedHasBeenSet = true; m_lastUsed = std::move(value); } /** *

An object that describes the last time the access key was used.

*

This object does not include data in the response of a CreateBucketAccessKey * action. If the access key has not been used, the region and * serviceName values are N/A, and the * lastUsedDate value is null.

*/ inline AccessKey& WithLastUsed(const AccessKeyLastUsed& value) { SetLastUsed(value); return *this;} /** *

An object that describes the last time the access key was used.

*

This object does not include data in the response of a CreateBucketAccessKey * action. If the access key has not been used, the region and * serviceName values are N/A, and the * lastUsedDate value is null.

*/ inline AccessKey& WithLastUsed(AccessKeyLastUsed&& value) { SetLastUsed(std::move(value)); return *this;} private: Aws::String m_accessKeyId; bool m_accessKeyIdHasBeenSet = false; Aws::String m_secretAccessKey; bool m_secretAccessKeyHasBeenSet = false; StatusType m_status; bool m_statusHasBeenSet = false; Aws::Utils::DateTime m_createdAt; bool m_createdAtHasBeenSet = false; AccessKeyLastUsed m_lastUsed; bool m_lastUsedHasBeenSet = false; }; } // namespace Model } // namespace Lightsail } // namespace Aws