/** * 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 CognitoIdentity { namespace Model { /** *

A role mapping.

See Also:

AWS * API Reference

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

The role mapping type. Token will use cognito:roles and * cognito:preferred_role claims from the Cognito identity provider * token to map groups to roles. Rules will attempt to match claims from the token * to map to a role.

*/ inline const RoleMappingType& GetType() const{ return m_type; } /** *

The role mapping type. Token will use cognito:roles and * cognito:preferred_role claims from the Cognito identity provider * token to map groups to roles. Rules will attempt to match claims from the token * to map to a role.

*/ inline bool TypeHasBeenSet() const { return m_typeHasBeenSet; } /** *

The role mapping type. Token will use cognito:roles and * cognito:preferred_role claims from the Cognito identity provider * token to map groups to roles. Rules will attempt to match claims from the token * to map to a role.

*/ inline void SetType(const RoleMappingType& value) { m_typeHasBeenSet = true; m_type = value; } /** *

The role mapping type. Token will use cognito:roles and * cognito:preferred_role claims from the Cognito identity provider * token to map groups to roles. Rules will attempt to match claims from the token * to map to a role.

*/ inline void SetType(RoleMappingType&& value) { m_typeHasBeenSet = true; m_type = std::move(value); } /** *

The role mapping type. Token will use cognito:roles and * cognito:preferred_role claims from the Cognito identity provider * token to map groups to roles. Rules will attempt to match claims from the token * to map to a role.

*/ inline RoleMapping& WithType(const RoleMappingType& value) { SetType(value); return *this;} /** *

The role mapping type. Token will use cognito:roles and * cognito:preferred_role claims from the Cognito identity provider * token to map groups to roles. Rules will attempt to match claims from the token * to map to a role.

*/ inline RoleMapping& WithType(RoleMappingType&& value) { SetType(std::move(value)); return *this;} /** *

If you specify Token or Rules as the Type, * AmbiguousRoleResolution is required.

Specifies the action to * be taken if either no rules match the claim value for the Rules * type, or there is no cognito:preferred_role claim and there are * multiple cognito:roles matches for the Token type.

*/ inline const AmbiguousRoleResolutionType& GetAmbiguousRoleResolution() const{ return m_ambiguousRoleResolution; } /** *

If you specify Token or Rules as the Type, * AmbiguousRoleResolution is required.

Specifies the action to * be taken if either no rules match the claim value for the Rules * type, or there is no cognito:preferred_role claim and there are * multiple cognito:roles matches for the Token type.

*/ inline bool AmbiguousRoleResolutionHasBeenSet() const { return m_ambiguousRoleResolutionHasBeenSet; } /** *

If you specify Token or Rules as the Type, * AmbiguousRoleResolution is required.

Specifies the action to * be taken if either no rules match the claim value for the Rules * type, or there is no cognito:preferred_role claim and there are * multiple cognito:roles matches for the Token type.

*/ inline void SetAmbiguousRoleResolution(const AmbiguousRoleResolutionType& value) { m_ambiguousRoleResolutionHasBeenSet = true; m_ambiguousRoleResolution = value; } /** *

If you specify Token or Rules as the Type, * AmbiguousRoleResolution is required.

Specifies the action to * be taken if either no rules match the claim value for the Rules * type, or there is no cognito:preferred_role claim and there are * multiple cognito:roles matches for the Token type.

*/ inline void SetAmbiguousRoleResolution(AmbiguousRoleResolutionType&& value) { m_ambiguousRoleResolutionHasBeenSet = true; m_ambiguousRoleResolution = std::move(value); } /** *

If you specify Token or Rules as the Type, * AmbiguousRoleResolution is required.

Specifies the action to * be taken if either no rules match the claim value for the Rules * type, or there is no cognito:preferred_role claim and there are * multiple cognito:roles matches for the Token type.

*/ inline RoleMapping& WithAmbiguousRoleResolution(const AmbiguousRoleResolutionType& value) { SetAmbiguousRoleResolution(value); return *this;} /** *

If you specify Token or Rules as the Type, * AmbiguousRoleResolution is required.

Specifies the action to * be taken if either no rules match the claim value for the Rules * type, or there is no cognito:preferred_role claim and there are * multiple cognito:roles matches for the Token type.

*/ inline RoleMapping& WithAmbiguousRoleResolution(AmbiguousRoleResolutionType&& value) { SetAmbiguousRoleResolution(std::move(value)); return *this;} /** *

The rules to be used for mapping users to roles.

If you specify Rules * as the role mapping type, RulesConfiguration is required.

*/ inline const RulesConfigurationType& GetRulesConfiguration() const{ return m_rulesConfiguration; } /** *

The rules to be used for mapping users to roles.

If you specify Rules * as the role mapping type, RulesConfiguration is required.

*/ inline bool RulesConfigurationHasBeenSet() const { return m_rulesConfigurationHasBeenSet; } /** *

The rules to be used for mapping users to roles.

If you specify Rules * as the role mapping type, RulesConfiguration is required.

*/ inline void SetRulesConfiguration(const RulesConfigurationType& value) { m_rulesConfigurationHasBeenSet = true; m_rulesConfiguration = value; } /** *

The rules to be used for mapping users to roles.

If you specify Rules * as the role mapping type, RulesConfiguration is required.

*/ inline void SetRulesConfiguration(RulesConfigurationType&& value) { m_rulesConfigurationHasBeenSet = true; m_rulesConfiguration = std::move(value); } /** *

The rules to be used for mapping users to roles.

If you specify Rules * as the role mapping type, RulesConfiguration is required.

*/ inline RoleMapping& WithRulesConfiguration(const RulesConfigurationType& value) { SetRulesConfiguration(value); return *this;} /** *

The rules to be used for mapping users to roles.

If you specify Rules * as the role mapping type, RulesConfiguration is required.

*/ inline RoleMapping& WithRulesConfiguration(RulesConfigurationType&& value) { SetRulesConfiguration(std::move(value)); return *this;} private: RoleMappingType m_type; bool m_typeHasBeenSet = false; AmbiguousRoleResolutionType m_ambiguousRoleResolution; bool m_ambiguousRoleResolutionHasBeenSet = false; RulesConfigurationType m_rulesConfiguration; bool m_rulesConfigurationHasBeenSet = false; }; } // namespace Model } // namespace CognitoIdentity } // namespace Aws