/** * 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 details about the permissions policies that are attached to the * specified identity (user, group, or role).

This data type is an element * of the ListPoliciesGrantingServiceAccessEntry object.

See * Also:

AWS * API Reference

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

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

The policy name.

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

The policy name.

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

The policy name.

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

The policy name.

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

The policy name.

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

The policy name.

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

The policy name.

*/ inline PolicyGrantingServiceAccess& WithPolicyName(const char* value) { SetPolicyName(value); return *this;} /** *

The policy type. For more information about these policy types, see Managed * policies and inline policies in the IAM User Guide.

*/ inline const PolicyType& GetPolicyType() const{ return m_policyType; } /** *

The policy type. For more information about these policy types, see Managed * policies and inline policies in the IAM User Guide.

*/ inline bool PolicyTypeHasBeenSet() const { return m_policyTypeHasBeenSet; } /** *

The policy type. For more information about these policy types, see Managed * policies and inline policies in the IAM User Guide.

*/ inline void SetPolicyType(const PolicyType& value) { m_policyTypeHasBeenSet = true; m_policyType = value; } /** *

The policy type. For more information about these policy types, see Managed * policies and inline policies in the IAM User Guide.

*/ inline void SetPolicyType(PolicyType&& value) { m_policyTypeHasBeenSet = true; m_policyType = std::move(value); } /** *

The policy type. For more information about these policy types, see Managed * policies and inline policies in the IAM User Guide.

*/ inline PolicyGrantingServiceAccess& WithPolicyType(const PolicyType& value) { SetPolicyType(value); return *this;} /** *

The policy type. For more information about these policy types, see Managed * policies and inline policies in the IAM User Guide.

*/ inline PolicyGrantingServiceAccess& WithPolicyType(PolicyType&& value) { SetPolicyType(std::move(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 PolicyGrantingServiceAccess& WithPolicyArn(const Aws::String& value) { SetPolicyArn(value); return *this;} inline PolicyGrantingServiceAccess& WithPolicyArn(Aws::String&& value) { SetPolicyArn(std::move(value)); return *this;} inline PolicyGrantingServiceAccess& WithPolicyArn(const char* value) { SetPolicyArn(value); return *this;} /** *

The type of entity (user or role) that used the policy to access the service * to which the inline policy is attached.

This field is null for managed * policies. For more information about these policy types, see Managed * policies and inline policies in the IAM User Guide.

*/ inline const PolicyOwnerEntityType& GetEntityType() const{ return m_entityType; } /** *

The type of entity (user or role) that used the policy to access the service * to which the inline policy is attached.

This field is null for managed * policies. For more information about these policy types, see Managed * policies and inline policies in the IAM User Guide.

*/ inline bool EntityTypeHasBeenSet() const { return m_entityTypeHasBeenSet; } /** *

The type of entity (user or role) that used the policy to access the service * to which the inline policy is attached.

This field is null for managed * policies. For more information about these policy types, see Managed * policies and inline policies in the IAM User Guide.

*/ inline void SetEntityType(const PolicyOwnerEntityType& value) { m_entityTypeHasBeenSet = true; m_entityType = value; } /** *

The type of entity (user or role) that used the policy to access the service * to which the inline policy is attached.

This field is null for managed * policies. For more information about these policy types, see Managed * policies and inline policies in the IAM User Guide.

*/ inline void SetEntityType(PolicyOwnerEntityType&& value) { m_entityTypeHasBeenSet = true; m_entityType = std::move(value); } /** *

The type of entity (user or role) that used the policy to access the service * to which the inline policy is attached.

This field is null for managed * policies. For more information about these policy types, see Managed * policies and inline policies in the IAM User Guide.

*/ inline PolicyGrantingServiceAccess& WithEntityType(const PolicyOwnerEntityType& value) { SetEntityType(value); return *this;} /** *

The type of entity (user or role) that used the policy to access the service * to which the inline policy is attached.

This field is null for managed * policies. For more information about these policy types, see Managed * policies and inline policies in the IAM User Guide.

*/ inline PolicyGrantingServiceAccess& WithEntityType(PolicyOwnerEntityType&& value) { SetEntityType(std::move(value)); return *this;} /** *

The name of the entity (user or role) to which the inline policy is * attached.

This field is null for managed policies. For more information * about these policy types, see Managed * policies and inline policies in the IAM User Guide.

*/ inline const Aws::String& GetEntityName() const{ return m_entityName; } /** *

The name of the entity (user or role) to which the inline policy is * attached.

This field is null for managed policies. For more information * about these policy types, see Managed * policies and inline policies in the IAM User Guide.

*/ inline bool EntityNameHasBeenSet() const { return m_entityNameHasBeenSet; } /** *

The name of the entity (user or role) to which the inline policy is * attached.

This field is null for managed policies. For more information * about these policy types, see Managed * policies and inline policies in the IAM User Guide.

*/ inline void SetEntityName(const Aws::String& value) { m_entityNameHasBeenSet = true; m_entityName = value; } /** *

The name of the entity (user or role) to which the inline policy is * attached.

This field is null for managed policies. For more information * about these policy types, see Managed * policies and inline policies in the IAM User Guide.

*/ inline void SetEntityName(Aws::String&& value) { m_entityNameHasBeenSet = true; m_entityName = std::move(value); } /** *

The name of the entity (user or role) to which the inline policy is * attached.

This field is null for managed policies. For more information * about these policy types, see Managed * policies and inline policies in the IAM User Guide.

*/ inline void SetEntityName(const char* value) { m_entityNameHasBeenSet = true; m_entityName.assign(value); } /** *

The name of the entity (user or role) to which the inline policy is * attached.

This field is null for managed policies. For more information * about these policy types, see Managed * policies and inline policies in the IAM User Guide.

*/ inline PolicyGrantingServiceAccess& WithEntityName(const Aws::String& value) { SetEntityName(value); return *this;} /** *

The name of the entity (user or role) to which the inline policy is * attached.

This field is null for managed policies. For more information * about these policy types, see Managed * policies and inline policies in the IAM User Guide.

*/ inline PolicyGrantingServiceAccess& WithEntityName(Aws::String&& value) { SetEntityName(std::move(value)); return *this;} /** *

The name of the entity (user or role) to which the inline policy is * attached.

This field is null for managed policies. For more information * about these policy types, see Managed * policies and inline policies in the IAM User Guide.

*/ inline PolicyGrantingServiceAccess& WithEntityName(const char* value) { SetEntityName(value); return *this;} private: Aws::String m_policyName; bool m_policyNameHasBeenSet = false; PolicyType m_policyType; bool m_policyTypeHasBeenSet = false; Aws::String m_policyArn; bool m_policyArnHasBeenSet = false; PolicyOwnerEntityType m_entityType; bool m_entityTypeHasBeenSet = false; Aws::String m_entityName; bool m_entityNameHasBeenSet = false; }; } // namespace Model } // namespace IAM } // namespace Aws