/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include #include #include #include using namespace Aws::CognitoIdentity::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; DescribeIdentityPoolResult::DescribeIdentityPoolResult() : m_allowUnauthenticatedIdentities(false), m_allowClassicFlow(false) { } DescribeIdentityPoolResult::DescribeIdentityPoolResult(const Aws::AmazonWebServiceResult& result) : m_allowUnauthenticatedIdentities(false), m_allowClassicFlow(false) { *this = result; } DescribeIdentityPoolResult& DescribeIdentityPoolResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("IdentityPoolId")) { m_identityPoolId = jsonValue.GetString("IdentityPoolId"); } if(jsonValue.ValueExists("IdentityPoolName")) { m_identityPoolName = jsonValue.GetString("IdentityPoolName"); } if(jsonValue.ValueExists("AllowUnauthenticatedIdentities")) { m_allowUnauthenticatedIdentities = jsonValue.GetBool("AllowUnauthenticatedIdentities"); } if(jsonValue.ValueExists("AllowClassicFlow")) { m_allowClassicFlow = jsonValue.GetBool("AllowClassicFlow"); } if(jsonValue.ValueExists("SupportedLoginProviders")) { Aws::Map supportedLoginProvidersJsonMap = jsonValue.GetObject("SupportedLoginProviders").GetAllObjects(); for(auto& supportedLoginProvidersItem : supportedLoginProvidersJsonMap) { m_supportedLoginProviders[supportedLoginProvidersItem.first] = supportedLoginProvidersItem.second.AsString(); } } if(jsonValue.ValueExists("DeveloperProviderName")) { m_developerProviderName = jsonValue.GetString("DeveloperProviderName"); } if(jsonValue.ValueExists("OpenIdConnectProviderARNs")) { Aws::Utils::Array openIdConnectProviderARNsJsonList = jsonValue.GetArray("OpenIdConnectProviderARNs"); for(unsigned openIdConnectProviderARNsIndex = 0; openIdConnectProviderARNsIndex < openIdConnectProviderARNsJsonList.GetLength(); ++openIdConnectProviderARNsIndex) { m_openIdConnectProviderARNs.push_back(openIdConnectProviderARNsJsonList[openIdConnectProviderARNsIndex].AsString()); } } if(jsonValue.ValueExists("CognitoIdentityProviders")) { Aws::Utils::Array cognitoIdentityProvidersJsonList = jsonValue.GetArray("CognitoIdentityProviders"); for(unsigned cognitoIdentityProvidersIndex = 0; cognitoIdentityProvidersIndex < cognitoIdentityProvidersJsonList.GetLength(); ++cognitoIdentityProvidersIndex) { m_cognitoIdentityProviders.push_back(cognitoIdentityProvidersJsonList[cognitoIdentityProvidersIndex].AsObject()); } } if(jsonValue.ValueExists("SamlProviderARNs")) { Aws::Utils::Array samlProviderARNsJsonList = jsonValue.GetArray("SamlProviderARNs"); for(unsigned samlProviderARNsIndex = 0; samlProviderARNsIndex < samlProviderARNsJsonList.GetLength(); ++samlProviderARNsIndex) { m_samlProviderARNs.push_back(samlProviderARNsJsonList[samlProviderARNsIndex].AsString()); } } if(jsonValue.ValueExists("IdentityPoolTags")) { Aws::Map identityPoolTagsJsonMap = jsonValue.GetObject("IdentityPoolTags").GetAllObjects(); for(auto& identityPoolTagsItem : identityPoolTagsJsonMap) { m_identityPoolTags[identityPoolTagsItem.first] = identityPoolTagsItem.second.AsString(); } } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }