/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::CognitoIdentityProvider::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; AdminInitiateAuthRequest::AdminInitiateAuthRequest() : m_userPoolIdHasBeenSet(false), m_clientIdHasBeenSet(false), m_authFlow(AuthFlowType::NOT_SET), m_authFlowHasBeenSet(false), m_authParametersHasBeenSet(false), m_clientMetadataHasBeenSet(false), m_analyticsMetadataHasBeenSet(false), m_contextDataHasBeenSet(false) { } Aws::String AdminInitiateAuthRequest::SerializePayload() const { JsonValue payload; if(m_userPoolIdHasBeenSet) { payload.WithString("UserPoolId", m_userPoolId); } if(m_clientIdHasBeenSet) { payload.WithString("ClientId", m_clientId); } if(m_authFlowHasBeenSet) { payload.WithString("AuthFlow", AuthFlowTypeMapper::GetNameForAuthFlowType(m_authFlow)); } if(m_authParametersHasBeenSet) { JsonValue authParametersJsonMap; for(auto& authParametersItem : m_authParameters) { authParametersJsonMap.WithString(authParametersItem.first, authParametersItem.second); } payload.WithObject("AuthParameters", std::move(authParametersJsonMap)); } if(m_clientMetadataHasBeenSet) { JsonValue clientMetadataJsonMap; for(auto& clientMetadataItem : m_clientMetadata) { clientMetadataJsonMap.WithString(clientMetadataItem.first, clientMetadataItem.second); } payload.WithObject("ClientMetadata", std::move(clientMetadataJsonMap)); } if(m_analyticsMetadataHasBeenSet) { payload.WithObject("AnalyticsMetadata", m_analyticsMetadata.Jsonize()); } if(m_contextDataHasBeenSet) { payload.WithObject("ContextData", m_contextData.Jsonize()); } return payload.View().WriteReadable(); } Aws::Http::HeaderValueCollection AdminInitiateAuthRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSCognitoIdentityProviderService.AdminInitiateAuth")); return headers; }