96 lines
2.4 KiB
C++
96 lines
2.4 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/appsync/model/CreateGraphqlApiRequest.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::AppSync::Model;
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
CreateGraphqlApiRequest::CreateGraphqlApiRequest() :
|
|
m_nameHasBeenSet(false),
|
|
m_logConfigHasBeenSet(false),
|
|
m_authenticationType(AuthenticationType::NOT_SET),
|
|
m_authenticationTypeHasBeenSet(false),
|
|
m_userPoolConfigHasBeenSet(false),
|
|
m_openIDConnectConfigHasBeenSet(false),
|
|
m_tagsHasBeenSet(false),
|
|
m_additionalAuthenticationProvidersHasBeenSet(false),
|
|
m_xrayEnabled(false),
|
|
m_xrayEnabledHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
Aws::String CreateGraphqlApiRequest::SerializePayload() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_nameHasBeenSet)
|
|
{
|
|
payload.WithString("name", m_name);
|
|
|
|
}
|
|
|
|
if(m_logConfigHasBeenSet)
|
|
{
|
|
payload.WithObject("logConfig", m_logConfig.Jsonize());
|
|
|
|
}
|
|
|
|
if(m_authenticationTypeHasBeenSet)
|
|
{
|
|
payload.WithString("authenticationType", AuthenticationTypeMapper::GetNameForAuthenticationType(m_authenticationType));
|
|
}
|
|
|
|
if(m_userPoolConfigHasBeenSet)
|
|
{
|
|
payload.WithObject("userPoolConfig", m_userPoolConfig.Jsonize());
|
|
|
|
}
|
|
|
|
if(m_openIDConnectConfigHasBeenSet)
|
|
{
|
|
payload.WithObject("openIDConnectConfig", m_openIDConnectConfig.Jsonize());
|
|
|
|
}
|
|
|
|
if(m_tagsHasBeenSet)
|
|
{
|
|
JsonValue tagsJsonMap;
|
|
for(auto& tagsItem : m_tags)
|
|
{
|
|
tagsJsonMap.WithString(tagsItem.first, tagsItem.second);
|
|
}
|
|
payload.WithObject("tags", std::move(tagsJsonMap));
|
|
|
|
}
|
|
|
|
if(m_additionalAuthenticationProvidersHasBeenSet)
|
|
{
|
|
Array<JsonValue> additionalAuthenticationProvidersJsonList(m_additionalAuthenticationProviders.size());
|
|
for(unsigned additionalAuthenticationProvidersIndex = 0; additionalAuthenticationProvidersIndex < additionalAuthenticationProvidersJsonList.GetLength(); ++additionalAuthenticationProvidersIndex)
|
|
{
|
|
additionalAuthenticationProvidersJsonList[additionalAuthenticationProvidersIndex].AsObject(m_additionalAuthenticationProviders[additionalAuthenticationProvidersIndex].Jsonize());
|
|
}
|
|
payload.WithArray("additionalAuthenticationProviders", std::move(additionalAuthenticationProvidersJsonList));
|
|
|
|
}
|
|
|
|
if(m_xrayEnabledHasBeenSet)
|
|
{
|
|
payload.WithBool("xrayEnabled", m_xrayEnabled);
|
|
|
|
}
|
|
|
|
return payload.View().WriteReadable();
|
|
}
|
|
|
|
|
|
|
|
|