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

The rules for the given impersonation role.

See Also:

AWS * API Reference

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

The identifier of the rule.

*/ inline const Aws::String& GetImpersonationRuleId() const{ return m_impersonationRuleId; } /** *

The identifier of the rule.

*/ inline bool ImpersonationRuleIdHasBeenSet() const { return m_impersonationRuleIdHasBeenSet; } /** *

The identifier of the rule.

*/ inline void SetImpersonationRuleId(const Aws::String& value) { m_impersonationRuleIdHasBeenSet = true; m_impersonationRuleId = value; } /** *

The identifier of the rule.

*/ inline void SetImpersonationRuleId(Aws::String&& value) { m_impersonationRuleIdHasBeenSet = true; m_impersonationRuleId = std::move(value); } /** *

The identifier of the rule.

*/ inline void SetImpersonationRuleId(const char* value) { m_impersonationRuleIdHasBeenSet = true; m_impersonationRuleId.assign(value); } /** *

The identifier of the rule.

*/ inline ImpersonationRule& WithImpersonationRuleId(const Aws::String& value) { SetImpersonationRuleId(value); return *this;} /** *

The identifier of the rule.

*/ inline ImpersonationRule& WithImpersonationRuleId(Aws::String&& value) { SetImpersonationRuleId(std::move(value)); return *this;} /** *

The identifier of the rule.

*/ inline ImpersonationRule& WithImpersonationRuleId(const char* value) { SetImpersonationRuleId(value); return *this;} /** *

The rule name.

*/ inline const Aws::String& GetName() const{ return m_name; } /** *

The rule name.

*/ inline bool NameHasBeenSet() const { return m_nameHasBeenSet; } /** *

The rule name.

*/ inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; } /** *

The rule name.

*/ inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); } /** *

The rule name.

*/ inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); } /** *

The rule name.

*/ inline ImpersonationRule& WithName(const Aws::String& value) { SetName(value); return *this;} /** *

The rule name.

*/ inline ImpersonationRule& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;} /** *

The rule name.

*/ inline ImpersonationRule& WithName(const char* value) { SetName(value); return *this;} /** *

The rule description.

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

The rule description.

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

The rule description.

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

The rule description.

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

The rule description.

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

The rule description.

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

The rule description.

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

The rule description.

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

The effect of the rule when it matches the input. Allowed effect values are * ALLOW or DENY.

*/ inline const AccessEffect& GetEffect() const{ return m_effect; } /** *

The effect of the rule when it matches the input. Allowed effect values are * ALLOW or DENY.

*/ inline bool EffectHasBeenSet() const { return m_effectHasBeenSet; } /** *

The effect of the rule when it matches the input. Allowed effect values are * ALLOW or DENY.

*/ inline void SetEffect(const AccessEffect& value) { m_effectHasBeenSet = true; m_effect = value; } /** *

The effect of the rule when it matches the input. Allowed effect values are * ALLOW or DENY.

*/ inline void SetEffect(AccessEffect&& value) { m_effectHasBeenSet = true; m_effect = std::move(value); } /** *

The effect of the rule when it matches the input. Allowed effect values are * ALLOW or DENY.

*/ inline ImpersonationRule& WithEffect(const AccessEffect& value) { SetEffect(value); return *this;} /** *

The effect of the rule when it matches the input. Allowed effect values are * ALLOW or DENY.

*/ inline ImpersonationRule& WithEffect(AccessEffect&& value) { SetEffect(std::move(value)); return *this;} /** *

A list of user IDs that match the rule.

*/ inline const Aws::Vector& GetTargetUsers() const{ return m_targetUsers; } /** *

A list of user IDs that match the rule.

*/ inline bool TargetUsersHasBeenSet() const { return m_targetUsersHasBeenSet; } /** *

A list of user IDs that match the rule.

*/ inline void SetTargetUsers(const Aws::Vector& value) { m_targetUsersHasBeenSet = true; m_targetUsers = value; } /** *

A list of user IDs that match the rule.

*/ inline void SetTargetUsers(Aws::Vector&& value) { m_targetUsersHasBeenSet = true; m_targetUsers = std::move(value); } /** *

A list of user IDs that match the rule.

*/ inline ImpersonationRule& WithTargetUsers(const Aws::Vector& value) { SetTargetUsers(value); return *this;} /** *

A list of user IDs that match the rule.

*/ inline ImpersonationRule& WithTargetUsers(Aws::Vector&& value) { SetTargetUsers(std::move(value)); return *this;} /** *

A list of user IDs that match the rule.

*/ inline ImpersonationRule& AddTargetUsers(const Aws::String& value) { m_targetUsersHasBeenSet = true; m_targetUsers.push_back(value); return *this; } /** *

A list of user IDs that match the rule.

*/ inline ImpersonationRule& AddTargetUsers(Aws::String&& value) { m_targetUsersHasBeenSet = true; m_targetUsers.push_back(std::move(value)); return *this; } /** *

A list of user IDs that match the rule.

*/ inline ImpersonationRule& AddTargetUsers(const char* value) { m_targetUsersHasBeenSet = true; m_targetUsers.push_back(value); return *this; } /** *

A list of user IDs that don't match the rule.

*/ inline const Aws::Vector& GetNotTargetUsers() const{ return m_notTargetUsers; } /** *

A list of user IDs that don't match the rule.

*/ inline bool NotTargetUsersHasBeenSet() const { return m_notTargetUsersHasBeenSet; } /** *

A list of user IDs that don't match the rule.

*/ inline void SetNotTargetUsers(const Aws::Vector& value) { m_notTargetUsersHasBeenSet = true; m_notTargetUsers = value; } /** *

A list of user IDs that don't match the rule.

*/ inline void SetNotTargetUsers(Aws::Vector&& value) { m_notTargetUsersHasBeenSet = true; m_notTargetUsers = std::move(value); } /** *

A list of user IDs that don't match the rule.

*/ inline ImpersonationRule& WithNotTargetUsers(const Aws::Vector& value) { SetNotTargetUsers(value); return *this;} /** *

A list of user IDs that don't match the rule.

*/ inline ImpersonationRule& WithNotTargetUsers(Aws::Vector&& value) { SetNotTargetUsers(std::move(value)); return *this;} /** *

A list of user IDs that don't match the rule.

*/ inline ImpersonationRule& AddNotTargetUsers(const Aws::String& value) { m_notTargetUsersHasBeenSet = true; m_notTargetUsers.push_back(value); return *this; } /** *

A list of user IDs that don't match the rule.

*/ inline ImpersonationRule& AddNotTargetUsers(Aws::String&& value) { m_notTargetUsersHasBeenSet = true; m_notTargetUsers.push_back(std::move(value)); return *this; } /** *

A list of user IDs that don't match the rule.

*/ inline ImpersonationRule& AddNotTargetUsers(const char* value) { m_notTargetUsersHasBeenSet = true; m_notTargetUsers.push_back(value); return *this; } private: Aws::String m_impersonationRuleId; bool m_impersonationRuleIdHasBeenSet = false; Aws::String m_name; bool m_nameHasBeenSet = false; Aws::String m_description; bool m_descriptionHasBeenSet = false; AccessEffect m_effect; bool m_effectHasBeenSet = false; Aws::Vector m_targetUsers; bool m_targetUsersHasBeenSet = false; Aws::Vector m_notTargetUsers; bool m_notTargetUsersHasBeenSet = false; }; } // namespace Model } // namespace WorkMail } // namespace Aws