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

Describes a principal.

See Also:

AWS * API Reference

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

The type of principal.

*/ inline const PrincipalType& GetPrincipalType() const{ return m_principalType; } /** *

The type of principal.

*/ inline bool PrincipalTypeHasBeenSet() const { return m_principalTypeHasBeenSet; } /** *

The type of principal.

*/ inline void SetPrincipalType(const PrincipalType& value) { m_principalTypeHasBeenSet = true; m_principalType = value; } /** *

The type of principal.

*/ inline void SetPrincipalType(PrincipalType&& value) { m_principalTypeHasBeenSet = true; m_principalType = std::move(value); } /** *

The type of principal.

*/ inline AllowedPrincipal& WithPrincipalType(const PrincipalType& value) { SetPrincipalType(value); return *this;} /** *

The type of principal.

*/ inline AllowedPrincipal& WithPrincipalType(PrincipalType&& value) { SetPrincipalType(std::move(value)); return *this;} /** *

The Amazon Resource Name (ARN) of the principal.

*/ inline const Aws::String& GetPrincipal() const{ return m_principal; } /** *

The Amazon Resource Name (ARN) of the principal.

*/ inline bool PrincipalHasBeenSet() const { return m_principalHasBeenSet; } /** *

The Amazon Resource Name (ARN) of the principal.

*/ inline void SetPrincipal(const Aws::String& value) { m_principalHasBeenSet = true; m_principal = value; } /** *

The Amazon Resource Name (ARN) of the principal.

*/ inline void SetPrincipal(Aws::String&& value) { m_principalHasBeenSet = true; m_principal = std::move(value); } /** *

The Amazon Resource Name (ARN) of the principal.

*/ inline void SetPrincipal(const char* value) { m_principalHasBeenSet = true; m_principal.assign(value); } /** *

The Amazon Resource Name (ARN) of the principal.

*/ inline AllowedPrincipal& WithPrincipal(const Aws::String& value) { SetPrincipal(value); return *this;} /** *

The Amazon Resource Name (ARN) of the principal.

*/ inline AllowedPrincipal& WithPrincipal(Aws::String&& value) { SetPrincipal(std::move(value)); return *this;} /** *

The Amazon Resource Name (ARN) of the principal.

*/ inline AllowedPrincipal& WithPrincipal(const char* value) { SetPrincipal(value); return *this;} /** *

The ID of the service permission.

*/ inline const Aws::String& GetServicePermissionId() const{ return m_servicePermissionId; } /** *

The ID of the service permission.

*/ inline bool ServicePermissionIdHasBeenSet() const { return m_servicePermissionIdHasBeenSet; } /** *

The ID of the service permission.

*/ inline void SetServicePermissionId(const Aws::String& value) { m_servicePermissionIdHasBeenSet = true; m_servicePermissionId = value; } /** *

The ID of the service permission.

*/ inline void SetServicePermissionId(Aws::String&& value) { m_servicePermissionIdHasBeenSet = true; m_servicePermissionId = std::move(value); } /** *

The ID of the service permission.

*/ inline void SetServicePermissionId(const char* value) { m_servicePermissionIdHasBeenSet = true; m_servicePermissionId.assign(value); } /** *

The ID of the service permission.

*/ inline AllowedPrincipal& WithServicePermissionId(const Aws::String& value) { SetServicePermissionId(value); return *this;} /** *

The ID of the service permission.

*/ inline AllowedPrincipal& WithServicePermissionId(Aws::String&& value) { SetServicePermissionId(std::move(value)); return *this;} /** *

The ID of the service permission.

*/ inline AllowedPrincipal& WithServicePermissionId(const char* value) { SetServicePermissionId(value); return *this;} /** *

The tags.

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

The tags.

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

The tags.

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

The tags.

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

The tags.

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

The tags.

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

The tags.

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

The tags.

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

The ID of the service.

*/ inline const Aws::String& GetServiceId() const{ return m_serviceId; } /** *

The ID of the service.

*/ inline bool ServiceIdHasBeenSet() const { return m_serviceIdHasBeenSet; } /** *

The ID of the service.

*/ inline void SetServiceId(const Aws::String& value) { m_serviceIdHasBeenSet = true; m_serviceId = value; } /** *

The ID of the service.

*/ inline void SetServiceId(Aws::String&& value) { m_serviceIdHasBeenSet = true; m_serviceId = std::move(value); } /** *

The ID of the service.

*/ inline void SetServiceId(const char* value) { m_serviceIdHasBeenSet = true; m_serviceId.assign(value); } /** *

The ID of the service.

*/ inline AllowedPrincipal& WithServiceId(const Aws::String& value) { SetServiceId(value); return *this;} /** *

The ID of the service.

*/ inline AllowedPrincipal& WithServiceId(Aws::String&& value) { SetServiceId(std::move(value)); return *this;} /** *

The ID of the service.

*/ inline AllowedPrincipal& WithServiceId(const char* value) { SetServiceId(value); return *this;} private: PrincipalType m_principalType; bool m_principalTypeHasBeenSet = false; Aws::String m_principal; bool m_principalHasBeenSet = false; Aws::String m_servicePermissionId; bool m_servicePermissionIdHasBeenSet = false; Aws::Vector m_tags; bool m_tagsHasBeenSet = false; Aws::String m_serviceId; bool m_serviceIdHasBeenSet = false; }; } // namespace Model } // namespace EC2 } // namespace Aws