77 lines
1.4 KiB
C++
77 lines
1.4 KiB
C++
|
|
/**
|
|||
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|||
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#include <aws/personalize-runtime/model/GetRecommendationsRequest.h>
|
|||
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|||
|
|
|
|||
|
|
#include <utility>
|
|||
|
|
|
|||
|
|
using namespace Aws::PersonalizeRuntime::Model;
|
|||
|
|
using namespace Aws::Utils::Json;
|
|||
|
|
using namespace Aws::Utils;
|
|||
|
|
|
|||
|
|
GetRecommendationsRequest::GetRecommendationsRequest() :
|
|||
|
|
m_campaignArnHasBeenSet(false),
|
|||
|
|
m_itemIdHasBeenSet(false),
|
|||
|
|
m_userIdHasBeenSet(false),
|
|||
|
|
m_numResults(0),
|
|||
|
|
m_numResultsHasBeenSet(false),
|
|||
|
|
m_contextHasBeenSet(false),
|
|||
|
|
m_filterArnHasBeenSet(false)
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Aws::String GetRecommendationsRequest::SerializePayload() const
|
|||
|
|
{
|
|||
|
|
JsonValue payload;
|
|||
|
|
|
|||
|
|
if(m_campaignArnHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("campaignArn", m_campaignArn);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_itemIdHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("itemId", m_itemId);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_userIdHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("userId", m_userId);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_numResultsHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithInteger("numResults", m_numResults);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_contextHasBeenSet)
|
|||
|
|
{
|
|||
|
|
JsonValue contextJsonMap;
|
|||
|
|
for(auto& contextItem : m_context)
|
|||
|
|
{
|
|||
|
|
contextJsonMap.WithString(contextItem.first, contextItem.second);
|
|||
|
|
}
|
|||
|
|
payload.WithObject("context", std::move(contextJsonMap));
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_filterArnHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("filterArn", m_filterArn);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return payload.View().WriteReadable();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|