117 lines
2.8 KiB
C++
117 lines
2.8 KiB
C++
|
|
/**
|
|||
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|||
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#include <aws/awstransfer/model/CreateServerRequest.h>
|
|||
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|||
|
|
|
|||
|
|
#include <utility>
|
|||
|
|
|
|||
|
|
using namespace Aws::Transfer::Model;
|
|||
|
|
using namespace Aws::Utils::Json;
|
|||
|
|
using namespace Aws::Utils;
|
|||
|
|
|
|||
|
|
CreateServerRequest::CreateServerRequest() :
|
|||
|
|
m_certificateHasBeenSet(false),
|
|||
|
|
m_endpointDetailsHasBeenSet(false),
|
|||
|
|
m_endpointType(EndpointType::NOT_SET),
|
|||
|
|
m_endpointTypeHasBeenSet(false),
|
|||
|
|
m_hostKeyHasBeenSet(false),
|
|||
|
|
m_identityProviderDetailsHasBeenSet(false),
|
|||
|
|
m_identityProviderType(IdentityProviderType::NOT_SET),
|
|||
|
|
m_identityProviderTypeHasBeenSet(false),
|
|||
|
|
m_loggingRoleHasBeenSet(false),
|
|||
|
|
m_protocolsHasBeenSet(false),
|
|||
|
|
m_securityPolicyNameHasBeenSet(false),
|
|||
|
|
m_tagsHasBeenSet(false)
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Aws::String CreateServerRequest::SerializePayload() const
|
|||
|
|
{
|
|||
|
|
JsonValue payload;
|
|||
|
|
|
|||
|
|
if(m_certificateHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("Certificate", m_certificate);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_endpointDetailsHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithObject("EndpointDetails", m_endpointDetails.Jsonize());
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_endpointTypeHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("EndpointType", EndpointTypeMapper::GetNameForEndpointType(m_endpointType));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_hostKeyHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("HostKey", m_hostKey);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_identityProviderDetailsHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithObject("IdentityProviderDetails", m_identityProviderDetails.Jsonize());
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_identityProviderTypeHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("IdentityProviderType", IdentityProviderTypeMapper::GetNameForIdentityProviderType(m_identityProviderType));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_loggingRoleHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("LoggingRole", m_loggingRole);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_protocolsHasBeenSet)
|
|||
|
|
{
|
|||
|
|
Array<JsonValue> protocolsJsonList(m_protocols.size());
|
|||
|
|
for(unsigned protocolsIndex = 0; protocolsIndex < protocolsJsonList.GetLength(); ++protocolsIndex)
|
|||
|
|
{
|
|||
|
|
protocolsJsonList[protocolsIndex].AsString(ProtocolMapper::GetNameForProtocol(m_protocols[protocolsIndex]));
|
|||
|
|
}
|
|||
|
|
payload.WithArray("Protocols", std::move(protocolsJsonList));
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_securityPolicyNameHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("SecurityPolicyName", m_securityPolicyName);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_tagsHasBeenSet)
|
|||
|
|
{
|
|||
|
|
Array<JsonValue> tagsJsonList(m_tags.size());
|
|||
|
|
for(unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex)
|
|||
|
|
{
|
|||
|
|
tagsJsonList[tagsIndex].AsObject(m_tags[tagsIndex].Jsonize());
|
|||
|
|
}
|
|||
|
|
payload.WithArray("Tags", std::move(tagsJsonList));
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return payload.View().WriteReadable();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Aws::Http::HeaderValueCollection CreateServerRequest::GetRequestSpecificHeaders() const
|
|||
|
|
{
|
|||
|
|
Aws::Http::HeaderValueCollection headers;
|
|||
|
|
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "TransferService.CreateServer"));
|
|||
|
|
return headers;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|