84 lines
1.9 KiB
C++
84 lines
1.9 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/swf/model/PollForDecisionTaskResult.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
#include <aws/core/AmazonWebServiceResult.h>
|
|
#include <aws/core/utils/StringUtils.h>
|
|
#include <aws/core/utils/UnreferencedParam.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::SWF::Model;
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
using namespace Aws;
|
|
|
|
PollForDecisionTaskResult::PollForDecisionTaskResult() :
|
|
m_startedEventId(0),
|
|
m_previousStartedEventId(0)
|
|
{
|
|
}
|
|
|
|
PollForDecisionTaskResult::PollForDecisionTaskResult(const Aws::AmazonWebServiceResult<JsonValue>& result) :
|
|
m_startedEventId(0),
|
|
m_previousStartedEventId(0)
|
|
{
|
|
*this = result;
|
|
}
|
|
|
|
PollForDecisionTaskResult& PollForDecisionTaskResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
|
|
{
|
|
JsonView jsonValue = result.GetPayload().View();
|
|
if(jsonValue.ValueExists("taskToken"))
|
|
{
|
|
m_taskToken = jsonValue.GetString("taskToken");
|
|
|
|
}
|
|
|
|
if(jsonValue.ValueExists("startedEventId"))
|
|
{
|
|
m_startedEventId = jsonValue.GetInt64("startedEventId");
|
|
|
|
}
|
|
|
|
if(jsonValue.ValueExists("workflowExecution"))
|
|
{
|
|
m_workflowExecution = jsonValue.GetObject("workflowExecution");
|
|
|
|
}
|
|
|
|
if(jsonValue.ValueExists("workflowType"))
|
|
{
|
|
m_workflowType = jsonValue.GetObject("workflowType");
|
|
|
|
}
|
|
|
|
if(jsonValue.ValueExists("events"))
|
|
{
|
|
Array<JsonView> eventsJsonList = jsonValue.GetArray("events");
|
|
for(unsigned eventsIndex = 0; eventsIndex < eventsJsonList.GetLength(); ++eventsIndex)
|
|
{
|
|
m_events.push_back(eventsJsonList[eventsIndex].AsObject());
|
|
}
|
|
}
|
|
|
|
if(jsonValue.ValueExists("nextPageToken"))
|
|
{
|
|
m_nextPageToken = jsonValue.GetString("nextPageToken");
|
|
|
|
}
|
|
|
|
if(jsonValue.ValueExists("previousStartedEventId"))
|
|
{
|
|
m_previousStartedEventId = jsonValue.GetInt64("previousStartedEventId");
|
|
|
|
}
|
|
|
|
|
|
|
|
return *this;
|
|
}
|