/** * 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 #include namespace Aws { namespace Utils { namespace Xml { class XmlNode; } // namespace Xml } // namespace Utils namespace IAM { namespace Model { /** *

Contains information about an IAM role. This structure is returned as a * response element in several API operations that interact with * roles.

See Also:

AWS API * Reference

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

The path to the role. For more information about paths, see IAM * identifiers in the IAM User Guide.

*/ inline const Aws::String& GetPath() const{ return m_path; } /** *

The path to the role. For more information about paths, see IAM * identifiers in the IAM User Guide.

*/ inline bool PathHasBeenSet() const { return m_pathHasBeenSet; } /** *

The path to the role. For more information about paths, see IAM * identifiers in the IAM User Guide.

*/ inline void SetPath(const Aws::String& value) { m_pathHasBeenSet = true; m_path = value; } /** *

The path to the role. For more information about paths, see IAM * identifiers in the IAM User Guide.

*/ inline void SetPath(Aws::String&& value) { m_pathHasBeenSet = true; m_path = std::move(value); } /** *

The path to the role. For more information about paths, see IAM * identifiers in the IAM User Guide.

*/ inline void SetPath(const char* value) { m_pathHasBeenSet = true; m_path.assign(value); } /** *

The path to the role. For more information about paths, see IAM * identifiers in the IAM User Guide.

*/ inline Role& WithPath(const Aws::String& value) { SetPath(value); return *this;} /** *

The path to the role. For more information about paths, see IAM * identifiers in the IAM User Guide.

*/ inline Role& WithPath(Aws::String&& value) { SetPath(std::move(value)); return *this;} /** *

The path to the role. For more information about paths, see IAM * identifiers in the IAM User Guide.

*/ inline Role& WithPath(const char* value) { SetPath(value); return *this;} /** *

The friendly name that identifies the role.

*/ inline const Aws::String& GetRoleName() const{ return m_roleName; } /** *

The friendly name that identifies the role.

*/ inline bool RoleNameHasBeenSet() const { return m_roleNameHasBeenSet; } /** *

The friendly name that identifies the role.

*/ inline void SetRoleName(const Aws::String& value) { m_roleNameHasBeenSet = true; m_roleName = value; } /** *

The friendly name that identifies the role.

*/ inline void SetRoleName(Aws::String&& value) { m_roleNameHasBeenSet = true; m_roleName = std::move(value); } /** *

The friendly name that identifies the role.

*/ inline void SetRoleName(const char* value) { m_roleNameHasBeenSet = true; m_roleName.assign(value); } /** *

The friendly name that identifies the role.

*/ inline Role& WithRoleName(const Aws::String& value) { SetRoleName(value); return *this;} /** *

The friendly name that identifies the role.

*/ inline Role& WithRoleName(Aws::String&& value) { SetRoleName(std::move(value)); return *this;} /** *

The friendly name that identifies the role.

*/ inline Role& WithRoleName(const char* value) { SetRoleName(value); return *this;} /** *

The stable and unique string identifying the role. For more information * about IDs, see IAM * identifiers in the IAM User Guide.

*/ inline const Aws::String& GetRoleId() const{ return m_roleId; } /** *

The stable and unique string identifying the role. For more information * about IDs, see IAM * identifiers in the IAM User Guide.

*/ inline bool RoleIdHasBeenSet() const { return m_roleIdHasBeenSet; } /** *

The stable and unique string identifying the role. For more information * about IDs, see IAM * identifiers in the IAM User Guide.

*/ inline void SetRoleId(const Aws::String& value) { m_roleIdHasBeenSet = true; m_roleId = value; } /** *

The stable and unique string identifying the role. For more information * about IDs, see IAM * identifiers in the IAM User Guide.

*/ inline void SetRoleId(Aws::String&& value) { m_roleIdHasBeenSet = true; m_roleId = std::move(value); } /** *

The stable and unique string identifying the role. For more information * about IDs, see IAM * identifiers in the IAM User Guide.

*/ inline void SetRoleId(const char* value) { m_roleIdHasBeenSet = true; m_roleId.assign(value); } /** *

The stable and unique string identifying the role. For more information * about IDs, see IAM * identifiers in the IAM User Guide.

*/ inline Role& WithRoleId(const Aws::String& value) { SetRoleId(value); return *this;} /** *

The stable and unique string identifying the role. For more information * about IDs, see IAM * identifiers in the IAM User Guide.

*/ inline Role& WithRoleId(Aws::String&& value) { SetRoleId(std::move(value)); return *this;} /** *

The stable and unique string identifying the role. For more information * about IDs, see IAM * identifiers in the IAM User Guide.

*/ inline Role& WithRoleId(const char* value) { SetRoleId(value); return *this;} /** *

The Amazon Resource Name (ARN) specifying the role. For more information * about ARNs and how to use them in policies, see IAM * identifiers in the IAM User Guide guide.

*/ inline const Aws::String& GetArn() const{ return m_arn; } /** *

The Amazon Resource Name (ARN) specifying the role. For more information * about ARNs and how to use them in policies, see IAM * identifiers in the IAM User Guide guide.

*/ inline bool ArnHasBeenSet() const { return m_arnHasBeenSet; } /** *

The Amazon Resource Name (ARN) specifying the role. For more information * about ARNs and how to use them in policies, see IAM * identifiers in the IAM User Guide guide.

*/ inline void SetArn(const Aws::String& value) { m_arnHasBeenSet = true; m_arn = value; } /** *

The Amazon Resource Name (ARN) specifying the role. For more information * about ARNs and how to use them in policies, see IAM * identifiers in the IAM User Guide guide.

*/ inline void SetArn(Aws::String&& value) { m_arnHasBeenSet = true; m_arn = std::move(value); } /** *

The Amazon Resource Name (ARN) specifying the role. For more information * about ARNs and how to use them in policies, see IAM * identifiers in the IAM User Guide guide.

*/ inline void SetArn(const char* value) { m_arnHasBeenSet = true; m_arn.assign(value); } /** *

The Amazon Resource Name (ARN) specifying the role. For more information * about ARNs and how to use them in policies, see IAM * identifiers in the IAM User Guide guide.

*/ inline Role& WithArn(const Aws::String& value) { SetArn(value); return *this;} /** *

The Amazon Resource Name (ARN) specifying the role. For more information * about ARNs and how to use them in policies, see IAM * identifiers in the IAM User Guide guide.

*/ inline Role& WithArn(Aws::String&& value) { SetArn(std::move(value)); return *this;} /** *

The Amazon Resource Name (ARN) specifying the role. For more information * about ARNs and how to use them in policies, see IAM * identifiers in the IAM User Guide guide.

*/ inline Role& WithArn(const char* value) { SetArn(value); return *this;} /** *

The date and time, in ISO 8601 * date-time format, when the role was created.

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

The date and time, in ISO 8601 * date-time format, when the role was created.

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

The date and time, in ISO 8601 * date-time format, when the role was created.

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

The date and time, in ISO 8601 * date-time format, when the role was created.

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

The date and time, in ISO 8601 * date-time format, when the role was created.

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

The date and time, in ISO 8601 * date-time format, when the role was created.

*/ inline Role& WithCreateDate(Aws::Utils::DateTime&& value) { SetCreateDate(std::move(value)); return *this;} /** *

The policy that grants an entity permission to assume the role.

*/ inline const Aws::String& GetAssumeRolePolicyDocument() const{ return m_assumeRolePolicyDocument; } /** *

The policy that grants an entity permission to assume the role.

*/ inline bool AssumeRolePolicyDocumentHasBeenSet() const { return m_assumeRolePolicyDocumentHasBeenSet; } /** *

The policy that grants an entity permission to assume the role.

*/ inline void SetAssumeRolePolicyDocument(const Aws::String& value) { m_assumeRolePolicyDocumentHasBeenSet = true; m_assumeRolePolicyDocument = value; } /** *

The policy that grants an entity permission to assume the role.

*/ inline void SetAssumeRolePolicyDocument(Aws::String&& value) { m_assumeRolePolicyDocumentHasBeenSet = true; m_assumeRolePolicyDocument = std::move(value); } /** *

The policy that grants an entity permission to assume the role.

*/ inline void SetAssumeRolePolicyDocument(const char* value) { m_assumeRolePolicyDocumentHasBeenSet = true; m_assumeRolePolicyDocument.assign(value); } /** *

The policy that grants an entity permission to assume the role.

*/ inline Role& WithAssumeRolePolicyDocument(const Aws::String& value) { SetAssumeRolePolicyDocument(value); return *this;} /** *

The policy that grants an entity permission to assume the role.

*/ inline Role& WithAssumeRolePolicyDocument(Aws::String&& value) { SetAssumeRolePolicyDocument(std::move(value)); return *this;} /** *

The policy that grants an entity permission to assume the role.

*/ inline Role& WithAssumeRolePolicyDocument(const char* value) { SetAssumeRolePolicyDocument(value); return *this;} /** *

A description of the role that you provide.

*/ inline const Aws::String& GetDescription() const{ return m_description; } /** *

A description of the role that you provide.

*/ inline bool DescriptionHasBeenSet() const { return m_descriptionHasBeenSet; } /** *

A description of the role that you provide.

*/ inline void SetDescription(const Aws::String& value) { m_descriptionHasBeenSet = true; m_description = value; } /** *

A description of the role that you provide.

*/ inline void SetDescription(Aws::String&& value) { m_descriptionHasBeenSet = true; m_description = std::move(value); } /** *

A description of the role that you provide.

*/ inline void SetDescription(const char* value) { m_descriptionHasBeenSet = true; m_description.assign(value); } /** *

A description of the role that you provide.

*/ inline Role& WithDescription(const Aws::String& value) { SetDescription(value); return *this;} /** *

A description of the role that you provide.

*/ inline Role& WithDescription(Aws::String&& value) { SetDescription(std::move(value)); return *this;} /** *

A description of the role that you provide.

*/ inline Role& WithDescription(const char* value) { SetDescription(value); return *this;} /** *

The maximum session duration (in seconds) for the specified role. Anyone who * uses the CLI, or API to assume the role can specify the duration using the * optional DurationSeconds API parameter or * duration-seconds CLI parameter.

*/ inline int GetMaxSessionDuration() const{ return m_maxSessionDuration; } /** *

The maximum session duration (in seconds) for the specified role. Anyone who * uses the CLI, or API to assume the role can specify the duration using the * optional DurationSeconds API parameter or * duration-seconds CLI parameter.

*/ inline bool MaxSessionDurationHasBeenSet() const { return m_maxSessionDurationHasBeenSet; } /** *

The maximum session duration (in seconds) for the specified role. Anyone who * uses the CLI, or API to assume the role can specify the duration using the * optional DurationSeconds API parameter or * duration-seconds CLI parameter.

*/ inline void SetMaxSessionDuration(int value) { m_maxSessionDurationHasBeenSet = true; m_maxSessionDuration = value; } /** *

The maximum session duration (in seconds) for the specified role. Anyone who * uses the CLI, or API to assume the role can specify the duration using the * optional DurationSeconds API parameter or * duration-seconds CLI parameter.

*/ inline Role& WithMaxSessionDuration(int value) { SetMaxSessionDuration(value); return *this;} /** *

The ARN of the policy used to set the permissions boundary for the role.

*

For more information about permissions boundaries, see Permissions * boundaries for IAM identities in the IAM User Guide.

*/ inline const AttachedPermissionsBoundary& GetPermissionsBoundary() const{ return m_permissionsBoundary; } /** *

The ARN of the policy used to set the permissions boundary for the role.

*

For more information about permissions boundaries, see Permissions * boundaries for IAM identities in the IAM User Guide.

*/ inline bool PermissionsBoundaryHasBeenSet() const { return m_permissionsBoundaryHasBeenSet; } /** *

The ARN of the policy used to set the permissions boundary for the role.

*

For more information about permissions boundaries, see Permissions * boundaries for IAM identities in the IAM User Guide.

*/ inline void SetPermissionsBoundary(const AttachedPermissionsBoundary& value) { m_permissionsBoundaryHasBeenSet = true; m_permissionsBoundary = value; } /** *

The ARN of the policy used to set the permissions boundary for the role.

*

For more information about permissions boundaries, see Permissions * boundaries for IAM identities in the IAM User Guide.

*/ inline void SetPermissionsBoundary(AttachedPermissionsBoundary&& value) { m_permissionsBoundaryHasBeenSet = true; m_permissionsBoundary = std::move(value); } /** *

The ARN of the policy used to set the permissions boundary for the role.

*

For more information about permissions boundaries, see Permissions * boundaries for IAM identities in the IAM User Guide.

*/ inline Role& WithPermissionsBoundary(const AttachedPermissionsBoundary& value) { SetPermissionsBoundary(value); return *this;} /** *

The ARN of the policy used to set the permissions boundary for the role.

*

For more information about permissions boundaries, see Permissions * boundaries for IAM identities in the IAM User Guide.

*/ inline Role& WithPermissionsBoundary(AttachedPermissionsBoundary&& value) { SetPermissionsBoundary(std::move(value)); return *this;} /** *

A list of tags that are attached to the role. For more information about * tagging, see Tagging IAM * resources in the IAM User Guide.

*/ inline const Aws::Vector& GetTags() const{ return m_tags; } /** *

A list of tags that are attached to the role. For more information about * tagging, see Tagging IAM * resources in the IAM User Guide.

*/ inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; } /** *

A list of tags that are attached to the role. For more information about * tagging, see Tagging IAM * resources in the IAM User Guide.

*/ inline void SetTags(const Aws::Vector& value) { m_tagsHasBeenSet = true; m_tags = value; } /** *

A list of tags that are attached to the role. For more information about * tagging, see Tagging IAM * resources in the IAM User Guide.

*/ inline void SetTags(Aws::Vector&& value) { m_tagsHasBeenSet = true; m_tags = std::move(value); } /** *

A list of tags that are attached to the role. For more information about * tagging, see Tagging IAM * resources in the IAM User Guide.

*/ inline Role& WithTags(const Aws::Vector& value) { SetTags(value); return *this;} /** *

A list of tags that are attached to the role. For more information about * tagging, see Tagging IAM * resources in the IAM User Guide.

*/ inline Role& WithTags(Aws::Vector&& value) { SetTags(std::move(value)); return *this;} /** *

A list of tags that are attached to the role. For more information about * tagging, see Tagging IAM * resources in the IAM User Guide.

*/ inline Role& AddTags(const Tag& value) { m_tagsHasBeenSet = true; m_tags.push_back(value); return *this; } /** *

A list of tags that are attached to the role. For more information about * tagging, see Tagging IAM * resources in the IAM User Guide.

*/ inline Role& AddTags(Tag&& value) { m_tagsHasBeenSet = true; m_tags.push_back(std::move(value)); return *this; } /** *

Contains information about the last time that an IAM role was used. This * includes the date and time and the Region in which the role was last used. * Activity is only reported for the trailing 400 days. This period can be shorter * if your Region began supporting these features within the last year. The role * might have been used more than 400 days ago. For more information, see Regions * where data is tracked in the IAM user Guide.

*/ inline const RoleLastUsed& GetRoleLastUsed() const{ return m_roleLastUsed; } /** *

Contains information about the last time that an IAM role was used. This * includes the date and time and the Region in which the role was last used. * Activity is only reported for the trailing 400 days. This period can be shorter * if your Region began supporting these features within the last year. The role * might have been used more than 400 days ago. For more information, see Regions * where data is tracked in the IAM user Guide.

*/ inline bool RoleLastUsedHasBeenSet() const { return m_roleLastUsedHasBeenSet; } /** *

Contains information about the last time that an IAM role was used. This * includes the date and time and the Region in which the role was last used. * Activity is only reported for the trailing 400 days. This period can be shorter * if your Region began supporting these features within the last year. The role * might have been used more than 400 days ago. For more information, see Regions * where data is tracked in the IAM user Guide.

*/ inline void SetRoleLastUsed(const RoleLastUsed& value) { m_roleLastUsedHasBeenSet = true; m_roleLastUsed = value; } /** *

Contains information about the last time that an IAM role was used. This * includes the date and time and the Region in which the role was last used. * Activity is only reported for the trailing 400 days. This period can be shorter * if your Region began supporting these features within the last year. The role * might have been used more than 400 days ago. For more information, see Regions * where data is tracked in the IAM user Guide.

*/ inline void SetRoleLastUsed(RoleLastUsed&& value) { m_roleLastUsedHasBeenSet = true; m_roleLastUsed = std::move(value); } /** *

Contains information about the last time that an IAM role was used. This * includes the date and time and the Region in which the role was last used. * Activity is only reported for the trailing 400 days. This period can be shorter * if your Region began supporting these features within the last year. The role * might have been used more than 400 days ago. For more information, see Regions * where data is tracked in the IAM user Guide.

*/ inline Role& WithRoleLastUsed(const RoleLastUsed& value) { SetRoleLastUsed(value); return *this;} /** *

Contains information about the last time that an IAM role was used. This * includes the date and time and the Region in which the role was last used. * Activity is only reported for the trailing 400 days. This period can be shorter * if your Region began supporting these features within the last year. The role * might have been used more than 400 days ago. For more information, see Regions * where data is tracked in the IAM user Guide.

*/ inline Role& WithRoleLastUsed(RoleLastUsed&& value) { SetRoleLastUsed(std::move(value)); return *this;} private: Aws::String m_path; bool m_pathHasBeenSet = false; Aws::String m_roleName; bool m_roleNameHasBeenSet = false; Aws::String m_roleId; bool m_roleIdHasBeenSet = false; Aws::String m_arn; bool m_arnHasBeenSet = false; Aws::Utils::DateTime m_createDate; bool m_createDateHasBeenSet = false; Aws::String m_assumeRolePolicyDocument; bool m_assumeRolePolicyDocumentHasBeenSet = false; Aws::String m_description; bool m_descriptionHasBeenSet = false; int m_maxSessionDuration; bool m_maxSessionDurationHasBeenSet = false; AttachedPermissionsBoundary m_permissionsBoundary; bool m_permissionsBoundaryHasBeenSet = false; Aws::Vector m_tags; bool m_tagsHasBeenSet = false; RoleLastUsed m_roleLastUsed; bool m_roleLastUsedHasBeenSet = false; }; } // namespace Model } // namespace IAM } // namespace Aws