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-translate/source/model/TranslateTextRequest.cpp

70 lines
1.7 KiB
C++

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/translate/model/TranslateTextRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Translate::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
TranslateTextRequest::TranslateTextRequest() :
m_textHasBeenSet(false),
m_terminologyNamesHasBeenSet(false),
m_sourceLanguageCodeHasBeenSet(false),
m_targetLanguageCodeHasBeenSet(false)
{
}
Aws::String TranslateTextRequest::SerializePayload() const
{
JsonValue payload;
if(m_textHasBeenSet)
{
payload.WithString("Text", m_text);
}
if(m_terminologyNamesHasBeenSet)
{
Array<JsonValue> terminologyNamesJsonList(m_terminologyNames.size());
for(unsigned terminologyNamesIndex = 0; terminologyNamesIndex < terminologyNamesJsonList.GetLength(); ++terminologyNamesIndex)
{
terminologyNamesJsonList[terminologyNamesIndex].AsString(m_terminologyNames[terminologyNamesIndex]);
}
payload.WithArray("TerminologyNames", std::move(terminologyNamesJsonList));
}
if(m_sourceLanguageCodeHasBeenSet)
{
payload.WithString("SourceLanguageCode", m_sourceLanguageCode);
}
if(m_targetLanguageCodeHasBeenSet)
{
payload.WithString("TargetLanguageCode", m_targetLanguageCode);
}
return payload.View().WriteReadable();
}
Aws::Http::HeaderValueCollection TranslateTextRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSShineFrontendService_20170701.TranslateText"));
return headers;
}