83 lines
1.7 KiB
C++
83 lines
1.7 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/transcribestreaming/model/Alternative.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
namespace Aws
|
|
{
|
|
namespace TranscribeStreamingService
|
|
{
|
|
namespace Model
|
|
{
|
|
|
|
Alternative::Alternative() :
|
|
m_transcriptHasBeenSet(false),
|
|
m_itemsHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
Alternative::Alternative(JsonView jsonValue) :
|
|
m_transcriptHasBeenSet(false),
|
|
m_itemsHasBeenSet(false)
|
|
{
|
|
*this = jsonValue;
|
|
}
|
|
|
|
Alternative& Alternative::operator =(JsonView jsonValue)
|
|
{
|
|
if(jsonValue.ValueExists("Transcript"))
|
|
{
|
|
m_transcript = jsonValue.GetString("Transcript");
|
|
|
|
m_transcriptHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("Items"))
|
|
{
|
|
Array<JsonView> itemsJsonList = jsonValue.GetArray("Items");
|
|
for(unsigned itemsIndex = 0; itemsIndex < itemsJsonList.GetLength(); ++itemsIndex)
|
|
{
|
|
m_items.push_back(itemsJsonList[itemsIndex].AsObject());
|
|
}
|
|
m_itemsHasBeenSet = true;
|
|
}
|
|
|
|
return *this;
|
|
}
|
|
|
|
JsonValue Alternative::Jsonize() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_transcriptHasBeenSet)
|
|
{
|
|
payload.WithString("Transcript", m_transcript);
|
|
|
|
}
|
|
|
|
if(m_itemsHasBeenSet)
|
|
{
|
|
Array<JsonValue> itemsJsonList(m_items.size());
|
|
for(unsigned itemsIndex = 0; itemsIndex < itemsJsonList.GetLength(); ++itemsIndex)
|
|
{
|
|
itemsJsonList[itemsIndex].AsObject(m_items[itemsIndex].Jsonize());
|
|
}
|
|
payload.WithArray("Items", std::move(itemsJsonList));
|
|
|
|
}
|
|
|
|
return payload;
|
|
}
|
|
|
|
} // namespace Model
|
|
} // namespace TranscribeStreamingService
|
|
} // namespace Aws
|