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

Contains information about an attached policy.

An attached policy is a * managed policy that has been attached to a user, group, or role. This data type * is used as a response element in the ListAttachedGroupPolicies, * ListAttachedRolePolicies, ListAttachedUserPolicies, and * GetAccountAuthorizationDetails operations.

For more information * about managed policies, refer to Managed * policies and inline policies in the IAM User Guide.

See * Also:

AWS * API Reference

*/ class AttachedPolicy { public: AWS_IAM_API AttachedPolicy(); AWS_IAM_API AttachedPolicy(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_IAM_API AttachedPolicy& 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 friendly name of the attached policy.

*/ inline const Aws::String& GetPolicyName() const{ return m_policyName; } /** *

The friendly name of the attached policy.

*/ inline bool PolicyNameHasBeenSet() const { return m_policyNameHasBeenSet; } /** *

The friendly name of the attached policy.

*/ inline void SetPolicyName(const Aws::String& value) { m_policyNameHasBeenSet = true; m_policyName = value; } /** *

The friendly name of the attached policy.

*/ inline void SetPolicyName(Aws::String&& value) { m_policyNameHasBeenSet = true; m_policyName = std::move(value); } /** *

The friendly name of the attached policy.

*/ inline void SetPolicyName(const char* value) { m_policyNameHasBeenSet = true; m_policyName.assign(value); } /** *

The friendly name of the attached policy.

*/ inline AttachedPolicy& WithPolicyName(const Aws::String& value) { SetPolicyName(value); return *this;} /** *

The friendly name of the attached policy.

*/ inline AttachedPolicy& WithPolicyName(Aws::String&& value) { SetPolicyName(std::move(value)); return *this;} /** *

The friendly name of the attached policy.

*/ inline AttachedPolicy& WithPolicyName(const char* value) { SetPolicyName(value); return *this;} inline const Aws::String& GetPolicyArn() const{ return m_policyArn; } inline bool PolicyArnHasBeenSet() const { return m_policyArnHasBeenSet; } inline void SetPolicyArn(const Aws::String& value) { m_policyArnHasBeenSet = true; m_policyArn = value; } inline void SetPolicyArn(Aws::String&& value) { m_policyArnHasBeenSet = true; m_policyArn = std::move(value); } inline void SetPolicyArn(const char* value) { m_policyArnHasBeenSet = true; m_policyArn.assign(value); } inline AttachedPolicy& WithPolicyArn(const Aws::String& value) { SetPolicyArn(value); return *this;} inline AttachedPolicy& WithPolicyArn(Aws::String&& value) { SetPolicyArn(std::move(value)); return *this;} inline AttachedPolicy& WithPolicyArn(const char* value) { SetPolicyArn(value); return *this;} private: Aws::String m_policyName; bool m_policyNameHasBeenSet = false; Aws::String m_policyArn; bool m_policyArnHasBeenSet = false; }; } // namespace Model } // namespace IAM } // namespace Aws