This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
pxz-hos-client-cpp-module/support/aws-sdk-cpp-master/aws-cpp-sdk-cognito-identity/source/model/MappingRule.cpp

106 lines
2.0 KiB
C++

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/cognito-identity/model/MappingRule.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace CognitoIdentity
{
namespace Model
{
MappingRule::MappingRule() :
m_claimHasBeenSet(false),
m_matchType(MappingRuleMatchType::NOT_SET),
m_matchTypeHasBeenSet(false),
m_valueHasBeenSet(false),
m_roleARNHasBeenSet(false)
{
}
MappingRule::MappingRule(JsonView jsonValue) :
m_claimHasBeenSet(false),
m_matchType(MappingRuleMatchType::NOT_SET),
m_matchTypeHasBeenSet(false),
m_valueHasBeenSet(false),
m_roleARNHasBeenSet(false)
{
*this = jsonValue;
}
MappingRule& MappingRule::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("Claim"))
{
m_claim = jsonValue.GetString("Claim");
m_claimHasBeenSet = true;
}
if(jsonValue.ValueExists("MatchType"))
{
m_matchType = MappingRuleMatchTypeMapper::GetMappingRuleMatchTypeForName(jsonValue.GetString("MatchType"));
m_matchTypeHasBeenSet = true;
}
if(jsonValue.ValueExists("Value"))
{
m_value = jsonValue.GetString("Value");
m_valueHasBeenSet = true;
}
if(jsonValue.ValueExists("RoleARN"))
{
m_roleARN = jsonValue.GetString("RoleARN");
m_roleARNHasBeenSet = true;
}
return *this;
}
JsonValue MappingRule::Jsonize() const
{
JsonValue payload;
if(m_claimHasBeenSet)
{
payload.WithString("Claim", m_claim);
}
if(m_matchTypeHasBeenSet)
{
payload.WithString("MatchType", MappingRuleMatchTypeMapper::GetNameForMappingRuleMatchType(m_matchType));
}
if(m_valueHasBeenSet)
{
payload.WithString("Value", m_value);
}
if(m_roleARNHasBeenSet)
{
payload.WithString("RoleARN", m_roleARN);
}
return payload;
}
} // namespace Model
} // namespace CognitoIdentity
} // namespace Aws