feat(hos_client_create, hos_client_destory): 多次调用destory不会导致重复释放

This commit is contained in:
彭宣正
2020-12-14 17:24:58 +08:00
parent 505d529c32
commit 10b370e486
55976 changed files with 8544395 additions and 2 deletions

View File

@@ -0,0 +1,90 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotevents-data/model/BatchPutMessageErrorEntry.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace IoTEventsData
{
namespace Model
{
BatchPutMessageErrorEntry::BatchPutMessageErrorEntry() :
m_messageIdHasBeenSet(false),
m_errorCode(ErrorCode::NOT_SET),
m_errorCodeHasBeenSet(false),
m_errorMessageHasBeenSet(false)
{
}
BatchPutMessageErrorEntry::BatchPutMessageErrorEntry(JsonView jsonValue) :
m_messageIdHasBeenSet(false),
m_errorCode(ErrorCode::NOT_SET),
m_errorCodeHasBeenSet(false),
m_errorMessageHasBeenSet(false)
{
*this = jsonValue;
}
BatchPutMessageErrorEntry& BatchPutMessageErrorEntry::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("messageId"))
{
m_messageId = jsonValue.GetString("messageId");
m_messageIdHasBeenSet = true;
}
if(jsonValue.ValueExists("errorCode"))
{
m_errorCode = ErrorCodeMapper::GetErrorCodeForName(jsonValue.GetString("errorCode"));
m_errorCodeHasBeenSet = true;
}
if(jsonValue.ValueExists("errorMessage"))
{
m_errorMessage = jsonValue.GetString("errorMessage");
m_errorMessageHasBeenSet = true;
}
return *this;
}
JsonValue BatchPutMessageErrorEntry::Jsonize() const
{
JsonValue payload;
if(m_messageIdHasBeenSet)
{
payload.WithString("messageId", m_messageId);
}
if(m_errorCodeHasBeenSet)
{
payload.WithString("errorCode", ErrorCodeMapper::GetNameForErrorCode(m_errorCode));
}
if(m_errorMessageHasBeenSet)
{
payload.WithString("errorMessage", m_errorMessage);
}
return payload;
}
} // namespace Model
} // namespace IoTEventsData
} // namespace Aws

View File

@@ -0,0 +1,40 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotevents-data/model/BatchPutMessageRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::IoTEventsData::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
BatchPutMessageRequest::BatchPutMessageRequest() :
m_messagesHasBeenSet(false)
{
}
Aws::String BatchPutMessageRequest::SerializePayload() const
{
JsonValue payload;
if(m_messagesHasBeenSet)
{
Array<JsonValue> messagesJsonList(m_messages.size());
for(unsigned messagesIndex = 0; messagesIndex < messagesJsonList.GetLength(); ++messagesIndex)
{
messagesJsonList[messagesIndex].AsObject(m_messages[messagesIndex].Jsonize());
}
payload.WithArray("messages", std::move(messagesJsonList));
}
return payload.View().WriteReadable();
}

View File

@@ -0,0 +1,43 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotevents-data/model/BatchPutMessageResult.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::IoTEventsData::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
BatchPutMessageResult::BatchPutMessageResult()
{
}
BatchPutMessageResult::BatchPutMessageResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
BatchPutMessageResult& BatchPutMessageResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("BatchPutMessageErrorEntries"))
{
Array<JsonView> batchPutMessageErrorEntriesJsonList = jsonValue.GetArray("BatchPutMessageErrorEntries");
for(unsigned batchPutMessageErrorEntriesIndex = 0; batchPutMessageErrorEntriesIndex < batchPutMessageErrorEntriesJsonList.GetLength(); ++batchPutMessageErrorEntriesIndex)
{
m_batchPutMessageErrorEntries.push_back(batchPutMessageErrorEntriesJsonList[batchPutMessageErrorEntriesIndex].AsObject());
}
}
return *this;
}

View File

@@ -0,0 +1,90 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotevents-data/model/BatchUpdateDetectorErrorEntry.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace IoTEventsData
{
namespace Model
{
BatchUpdateDetectorErrorEntry::BatchUpdateDetectorErrorEntry() :
m_messageIdHasBeenSet(false),
m_errorCode(ErrorCode::NOT_SET),
m_errorCodeHasBeenSet(false),
m_errorMessageHasBeenSet(false)
{
}
BatchUpdateDetectorErrorEntry::BatchUpdateDetectorErrorEntry(JsonView jsonValue) :
m_messageIdHasBeenSet(false),
m_errorCode(ErrorCode::NOT_SET),
m_errorCodeHasBeenSet(false),
m_errorMessageHasBeenSet(false)
{
*this = jsonValue;
}
BatchUpdateDetectorErrorEntry& BatchUpdateDetectorErrorEntry::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("messageId"))
{
m_messageId = jsonValue.GetString("messageId");
m_messageIdHasBeenSet = true;
}
if(jsonValue.ValueExists("errorCode"))
{
m_errorCode = ErrorCodeMapper::GetErrorCodeForName(jsonValue.GetString("errorCode"));
m_errorCodeHasBeenSet = true;
}
if(jsonValue.ValueExists("errorMessage"))
{
m_errorMessage = jsonValue.GetString("errorMessage");
m_errorMessageHasBeenSet = true;
}
return *this;
}
JsonValue BatchUpdateDetectorErrorEntry::Jsonize() const
{
JsonValue payload;
if(m_messageIdHasBeenSet)
{
payload.WithString("messageId", m_messageId);
}
if(m_errorCodeHasBeenSet)
{
payload.WithString("errorCode", ErrorCodeMapper::GetNameForErrorCode(m_errorCode));
}
if(m_errorMessageHasBeenSet)
{
payload.WithString("errorMessage", m_errorMessage);
}
return payload;
}
} // namespace Model
} // namespace IoTEventsData
} // namespace Aws

View File

@@ -0,0 +1,40 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotevents-data/model/BatchUpdateDetectorRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::IoTEventsData::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
BatchUpdateDetectorRequest::BatchUpdateDetectorRequest() :
m_detectorsHasBeenSet(false)
{
}
Aws::String BatchUpdateDetectorRequest::SerializePayload() const
{
JsonValue payload;
if(m_detectorsHasBeenSet)
{
Array<JsonValue> detectorsJsonList(m_detectors.size());
for(unsigned detectorsIndex = 0; detectorsIndex < detectorsJsonList.GetLength(); ++detectorsIndex)
{
detectorsJsonList[detectorsIndex].AsObject(m_detectors[detectorsIndex].Jsonize());
}
payload.WithArray("detectors", std::move(detectorsJsonList));
}
return payload.View().WriteReadable();
}

View File

@@ -0,0 +1,43 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotevents-data/model/BatchUpdateDetectorResult.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::IoTEventsData::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
BatchUpdateDetectorResult::BatchUpdateDetectorResult()
{
}
BatchUpdateDetectorResult::BatchUpdateDetectorResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
BatchUpdateDetectorResult& BatchUpdateDetectorResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("batchUpdateDetectorErrorEntries"))
{
Array<JsonView> batchUpdateDetectorErrorEntriesJsonList = jsonValue.GetArray("batchUpdateDetectorErrorEntries");
for(unsigned batchUpdateDetectorErrorEntriesIndex = 0; batchUpdateDetectorErrorEntriesIndex < batchUpdateDetectorErrorEntriesJsonList.GetLength(); ++batchUpdateDetectorErrorEntriesIndex)
{
m_batchUpdateDetectorErrorEntries.push_back(batchUpdateDetectorErrorEntriesJsonList[batchUpdateDetectorErrorEntriesIndex].AsObject());
}
}
return *this;
}

View File

@@ -0,0 +1,42 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotevents-data/model/DescribeDetectorRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/http/URI.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <utility>
using namespace Aws::IoTEventsData::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws::Http;
DescribeDetectorRequest::DescribeDetectorRequest() :
m_detectorModelNameHasBeenSet(false),
m_keyValueHasBeenSet(false)
{
}
Aws::String DescribeDetectorRequest::SerializePayload() const
{
return {};
}
void DescribeDetectorRequest::AddQueryStringParameters(URI& uri) const
{
Aws::StringStream ss;
if(m_keyValueHasBeenSet)
{
ss << m_keyValue;
uri.AddQueryStringParameter("keyValue", ss.str());
ss.str("");
}
}

View File

@@ -0,0 +1,40 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotevents-data/model/DescribeDetectorResult.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::IoTEventsData::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
DescribeDetectorResult::DescribeDetectorResult()
{
}
DescribeDetectorResult::DescribeDetectorResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
DescribeDetectorResult& DescribeDetectorResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("detector"))
{
m_detector = jsonValue.GetObject("detector");
}
return *this;
}

View File

@@ -0,0 +1,132 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotevents-data/model/Detector.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace IoTEventsData
{
namespace Model
{
Detector::Detector() :
m_detectorModelNameHasBeenSet(false),
m_keyValueHasBeenSet(false),
m_detectorModelVersionHasBeenSet(false),
m_stateHasBeenSet(false),
m_creationTimeHasBeenSet(false),
m_lastUpdateTimeHasBeenSet(false)
{
}
Detector::Detector(JsonView jsonValue) :
m_detectorModelNameHasBeenSet(false),
m_keyValueHasBeenSet(false),
m_detectorModelVersionHasBeenSet(false),
m_stateHasBeenSet(false),
m_creationTimeHasBeenSet(false),
m_lastUpdateTimeHasBeenSet(false)
{
*this = jsonValue;
}
Detector& Detector::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("detectorModelName"))
{
m_detectorModelName = jsonValue.GetString("detectorModelName");
m_detectorModelNameHasBeenSet = true;
}
if(jsonValue.ValueExists("keyValue"))
{
m_keyValue = jsonValue.GetString("keyValue");
m_keyValueHasBeenSet = true;
}
if(jsonValue.ValueExists("detectorModelVersion"))
{
m_detectorModelVersion = jsonValue.GetString("detectorModelVersion");
m_detectorModelVersionHasBeenSet = true;
}
if(jsonValue.ValueExists("state"))
{
m_state = jsonValue.GetObject("state");
m_stateHasBeenSet = true;
}
if(jsonValue.ValueExists("creationTime"))
{
m_creationTime = jsonValue.GetDouble("creationTime");
m_creationTimeHasBeenSet = true;
}
if(jsonValue.ValueExists("lastUpdateTime"))
{
m_lastUpdateTime = jsonValue.GetDouble("lastUpdateTime");
m_lastUpdateTimeHasBeenSet = true;
}
return *this;
}
JsonValue Detector::Jsonize() const
{
JsonValue payload;
if(m_detectorModelNameHasBeenSet)
{
payload.WithString("detectorModelName", m_detectorModelName);
}
if(m_keyValueHasBeenSet)
{
payload.WithString("keyValue", m_keyValue);
}
if(m_detectorModelVersionHasBeenSet)
{
payload.WithString("detectorModelVersion", m_detectorModelVersion);
}
if(m_stateHasBeenSet)
{
payload.WithObject("state", m_state.Jsonize());
}
if(m_creationTimeHasBeenSet)
{
payload.WithDouble("creationTime", m_creationTime.SecondsWithMSPrecision());
}
if(m_lastUpdateTimeHasBeenSet)
{
payload.WithDouble("lastUpdateTime", m_lastUpdateTime.SecondsWithMSPrecision());
}
return payload;
}
} // namespace Model
} // namespace IoTEventsData
} // namespace Aws

View File

@@ -0,0 +1,105 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotevents-data/model/DetectorState.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace IoTEventsData
{
namespace Model
{
DetectorState::DetectorState() :
m_stateNameHasBeenSet(false),
m_variablesHasBeenSet(false),
m_timersHasBeenSet(false)
{
}
DetectorState::DetectorState(JsonView jsonValue) :
m_stateNameHasBeenSet(false),
m_variablesHasBeenSet(false),
m_timersHasBeenSet(false)
{
*this = jsonValue;
}
DetectorState& DetectorState::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("stateName"))
{
m_stateName = jsonValue.GetString("stateName");
m_stateNameHasBeenSet = true;
}
if(jsonValue.ValueExists("variables"))
{
Array<JsonView> variablesJsonList = jsonValue.GetArray("variables");
for(unsigned variablesIndex = 0; variablesIndex < variablesJsonList.GetLength(); ++variablesIndex)
{
m_variables.push_back(variablesJsonList[variablesIndex].AsObject());
}
m_variablesHasBeenSet = true;
}
if(jsonValue.ValueExists("timers"))
{
Array<JsonView> timersJsonList = jsonValue.GetArray("timers");
for(unsigned timersIndex = 0; timersIndex < timersJsonList.GetLength(); ++timersIndex)
{
m_timers.push_back(timersJsonList[timersIndex].AsObject());
}
m_timersHasBeenSet = true;
}
return *this;
}
JsonValue DetectorState::Jsonize() const
{
JsonValue payload;
if(m_stateNameHasBeenSet)
{
payload.WithString("stateName", m_stateName);
}
if(m_variablesHasBeenSet)
{
Array<JsonValue> variablesJsonList(m_variables.size());
for(unsigned variablesIndex = 0; variablesIndex < variablesJsonList.GetLength(); ++variablesIndex)
{
variablesJsonList[variablesIndex].AsObject(m_variables[variablesIndex].Jsonize());
}
payload.WithArray("variables", std::move(variablesJsonList));
}
if(m_timersHasBeenSet)
{
Array<JsonValue> timersJsonList(m_timers.size());
for(unsigned timersIndex = 0; timersIndex < timersJsonList.GetLength(); ++timersIndex)
{
timersJsonList[timersIndex].AsObject(m_timers[timersIndex].Jsonize());
}
payload.WithArray("timers", std::move(timersJsonList));
}
return payload;
}
} // namespace Model
} // namespace IoTEventsData
} // namespace Aws

View File

@@ -0,0 +1,105 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotevents-data/model/DetectorStateDefinition.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace IoTEventsData
{
namespace Model
{
DetectorStateDefinition::DetectorStateDefinition() :
m_stateNameHasBeenSet(false),
m_variablesHasBeenSet(false),
m_timersHasBeenSet(false)
{
}
DetectorStateDefinition::DetectorStateDefinition(JsonView jsonValue) :
m_stateNameHasBeenSet(false),
m_variablesHasBeenSet(false),
m_timersHasBeenSet(false)
{
*this = jsonValue;
}
DetectorStateDefinition& DetectorStateDefinition::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("stateName"))
{
m_stateName = jsonValue.GetString("stateName");
m_stateNameHasBeenSet = true;
}
if(jsonValue.ValueExists("variables"))
{
Array<JsonView> variablesJsonList = jsonValue.GetArray("variables");
for(unsigned variablesIndex = 0; variablesIndex < variablesJsonList.GetLength(); ++variablesIndex)
{
m_variables.push_back(variablesJsonList[variablesIndex].AsObject());
}
m_variablesHasBeenSet = true;
}
if(jsonValue.ValueExists("timers"))
{
Array<JsonView> timersJsonList = jsonValue.GetArray("timers");
for(unsigned timersIndex = 0; timersIndex < timersJsonList.GetLength(); ++timersIndex)
{
m_timers.push_back(timersJsonList[timersIndex].AsObject());
}
m_timersHasBeenSet = true;
}
return *this;
}
JsonValue DetectorStateDefinition::Jsonize() const
{
JsonValue payload;
if(m_stateNameHasBeenSet)
{
payload.WithString("stateName", m_stateName);
}
if(m_variablesHasBeenSet)
{
Array<JsonValue> variablesJsonList(m_variables.size());
for(unsigned variablesIndex = 0; variablesIndex < variablesJsonList.GetLength(); ++variablesIndex)
{
variablesJsonList[variablesIndex].AsObject(m_variables[variablesIndex].Jsonize());
}
payload.WithArray("variables", std::move(variablesJsonList));
}
if(m_timersHasBeenSet)
{
Array<JsonValue> timersJsonList(m_timers.size());
for(unsigned timersIndex = 0; timersIndex < timersJsonList.GetLength(); ++timersIndex)
{
timersJsonList[timersIndex].AsObject(m_timers[timersIndex].Jsonize());
}
payload.WithArray("timers", std::move(timersJsonList));
}
return payload;
}
} // namespace Model
} // namespace IoTEventsData
} // namespace Aws

View File

@@ -0,0 +1,59 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotevents-data/model/DetectorStateSummary.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace IoTEventsData
{
namespace Model
{
DetectorStateSummary::DetectorStateSummary() :
m_stateNameHasBeenSet(false)
{
}
DetectorStateSummary::DetectorStateSummary(JsonView jsonValue) :
m_stateNameHasBeenSet(false)
{
*this = jsonValue;
}
DetectorStateSummary& DetectorStateSummary::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("stateName"))
{
m_stateName = jsonValue.GetString("stateName");
m_stateNameHasBeenSet = true;
}
return *this;
}
JsonValue DetectorStateSummary::Jsonize() const
{
JsonValue payload;
if(m_stateNameHasBeenSet)
{
payload.WithString("stateName", m_stateName);
}
return payload;
}
} // namespace Model
} // namespace IoTEventsData
} // namespace Aws

View File

@@ -0,0 +1,132 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotevents-data/model/DetectorSummary.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace IoTEventsData
{
namespace Model
{
DetectorSummary::DetectorSummary() :
m_detectorModelNameHasBeenSet(false),
m_keyValueHasBeenSet(false),
m_detectorModelVersionHasBeenSet(false),
m_stateHasBeenSet(false),
m_creationTimeHasBeenSet(false),
m_lastUpdateTimeHasBeenSet(false)
{
}
DetectorSummary::DetectorSummary(JsonView jsonValue) :
m_detectorModelNameHasBeenSet(false),
m_keyValueHasBeenSet(false),
m_detectorModelVersionHasBeenSet(false),
m_stateHasBeenSet(false),
m_creationTimeHasBeenSet(false),
m_lastUpdateTimeHasBeenSet(false)
{
*this = jsonValue;
}
DetectorSummary& DetectorSummary::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("detectorModelName"))
{
m_detectorModelName = jsonValue.GetString("detectorModelName");
m_detectorModelNameHasBeenSet = true;
}
if(jsonValue.ValueExists("keyValue"))
{
m_keyValue = jsonValue.GetString("keyValue");
m_keyValueHasBeenSet = true;
}
if(jsonValue.ValueExists("detectorModelVersion"))
{
m_detectorModelVersion = jsonValue.GetString("detectorModelVersion");
m_detectorModelVersionHasBeenSet = true;
}
if(jsonValue.ValueExists("state"))
{
m_state = jsonValue.GetObject("state");
m_stateHasBeenSet = true;
}
if(jsonValue.ValueExists("creationTime"))
{
m_creationTime = jsonValue.GetDouble("creationTime");
m_creationTimeHasBeenSet = true;
}
if(jsonValue.ValueExists("lastUpdateTime"))
{
m_lastUpdateTime = jsonValue.GetDouble("lastUpdateTime");
m_lastUpdateTimeHasBeenSet = true;
}
return *this;
}
JsonValue DetectorSummary::Jsonize() const
{
JsonValue payload;
if(m_detectorModelNameHasBeenSet)
{
payload.WithString("detectorModelName", m_detectorModelName);
}
if(m_keyValueHasBeenSet)
{
payload.WithString("keyValue", m_keyValue);
}
if(m_detectorModelVersionHasBeenSet)
{
payload.WithString("detectorModelVersion", m_detectorModelVersion);
}
if(m_stateHasBeenSet)
{
payload.WithObject("state", m_state.Jsonize());
}
if(m_creationTimeHasBeenSet)
{
payload.WithDouble("creationTime", m_creationTime.SecondsWithMSPrecision());
}
if(m_lastUpdateTimeHasBeenSet)
{
payload.WithDouble("lastUpdateTime", m_lastUpdateTime.SecondsWithMSPrecision());
}
return payload;
}
} // namespace Model
} // namespace IoTEventsData
} // namespace Aws

View File

@@ -0,0 +1,91 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotevents-data/model/ErrorCode.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
using namespace Aws::Utils;
namespace Aws
{
namespace IoTEventsData
{
namespace Model
{
namespace ErrorCodeMapper
{
static const int ResourceNotFoundException_HASH = HashingUtils::HashString("ResourceNotFoundException");
static const int InvalidRequestException_HASH = HashingUtils::HashString("InvalidRequestException");
static const int InternalFailureException_HASH = HashingUtils::HashString("InternalFailureException");
static const int ServiceUnavailableException_HASH = HashingUtils::HashString("ServiceUnavailableException");
static const int ThrottlingException_HASH = HashingUtils::HashString("ThrottlingException");
ErrorCode GetErrorCodeForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == ResourceNotFoundException_HASH)
{
return ErrorCode::ResourceNotFoundException;
}
else if (hashCode == InvalidRequestException_HASH)
{
return ErrorCode::InvalidRequestException;
}
else if (hashCode == InternalFailureException_HASH)
{
return ErrorCode::InternalFailureException;
}
else if (hashCode == ServiceUnavailableException_HASH)
{
return ErrorCode::ServiceUnavailableException;
}
else if (hashCode == ThrottlingException_HASH)
{
return ErrorCode::ThrottlingException;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<ErrorCode>(hashCode);
}
return ErrorCode::NOT_SET;
}
Aws::String GetNameForErrorCode(ErrorCode enumValue)
{
switch(enumValue)
{
case ErrorCode::ResourceNotFoundException:
return "ResourceNotFoundException";
case ErrorCode::InvalidRequestException:
return "InvalidRequestException";
case ErrorCode::InternalFailureException:
return "InternalFailureException";
case ErrorCode::ServiceUnavailableException:
return "ServiceUnavailableException";
case ErrorCode::ThrottlingException:
return "ThrottlingException";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace ErrorCodeMapper
} // namespace Model
} // namespace IoTEventsData
} // namespace Aws

View File

@@ -0,0 +1,59 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotevents-data/model/ListDetectorsRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/http/URI.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <utility>
using namespace Aws::IoTEventsData::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws::Http;
ListDetectorsRequest::ListDetectorsRequest() :
m_detectorModelNameHasBeenSet(false),
m_stateNameHasBeenSet(false),
m_nextTokenHasBeenSet(false),
m_maxResults(0),
m_maxResultsHasBeenSet(false)
{
}
Aws::String ListDetectorsRequest::SerializePayload() const
{
return {};
}
void ListDetectorsRequest::AddQueryStringParameters(URI& uri) const
{
Aws::StringStream ss;
if(m_stateNameHasBeenSet)
{
ss << m_stateName;
uri.AddQueryStringParameter("stateName", ss.str());
ss.str("");
}
if(m_nextTokenHasBeenSet)
{
ss << m_nextToken;
uri.AddQueryStringParameter("nextToken", ss.str());
ss.str("");
}
if(m_maxResultsHasBeenSet)
{
ss << m_maxResults;
uri.AddQueryStringParameter("maxResults", ss.str());
ss.str("");
}
}

View File

@@ -0,0 +1,49 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotevents-data/model/ListDetectorsResult.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::IoTEventsData::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
ListDetectorsResult::ListDetectorsResult()
{
}
ListDetectorsResult::ListDetectorsResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
ListDetectorsResult& ListDetectorsResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("detectorSummaries"))
{
Array<JsonView> detectorSummariesJsonList = jsonValue.GetArray("detectorSummaries");
for(unsigned detectorSummariesIndex = 0; detectorSummariesIndex < detectorSummariesJsonList.GetLength(); ++detectorSummariesIndex)
{
m_detectorSummaries.push_back(detectorSummariesJsonList[detectorSummariesIndex].AsObject());
}
}
if(jsonValue.ValueExists("nextToken"))
{
m_nextToken = jsonValue.GetString("nextToken");
}
return *this;
}

View File

@@ -0,0 +1,88 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotevents-data/model/Message.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/utils/HashingUtils.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace IoTEventsData
{
namespace Model
{
Message::Message() :
m_messageIdHasBeenSet(false),
m_inputNameHasBeenSet(false),
m_payloadHasBeenSet(false)
{
}
Message::Message(JsonView jsonValue) :
m_messageIdHasBeenSet(false),
m_inputNameHasBeenSet(false),
m_payloadHasBeenSet(false)
{
*this = jsonValue;
}
Message& Message::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("messageId"))
{
m_messageId = jsonValue.GetString("messageId");
m_messageIdHasBeenSet = true;
}
if(jsonValue.ValueExists("inputName"))
{
m_inputName = jsonValue.GetString("inputName");
m_inputNameHasBeenSet = true;
}
if(jsonValue.ValueExists("payload"))
{
m_payload = HashingUtils::Base64Decode(jsonValue.GetString("payload"));
m_payloadHasBeenSet = true;
}
return *this;
}
JsonValue Message::Jsonize() const
{
JsonValue payload;
if(m_messageIdHasBeenSet)
{
payload.WithString("messageId", m_messageId);
}
if(m_inputNameHasBeenSet)
{
payload.WithString("inputName", m_inputName);
}
if(m_payloadHasBeenSet)
{
payload.WithString("payload", HashingUtils::Base64Encode(m_payload));
}
return payload;
}
} // namespace Model
} // namespace IoTEventsData
} // namespace Aws

View File

@@ -0,0 +1,73 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotevents-data/model/Timer.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace IoTEventsData
{
namespace Model
{
Timer::Timer() :
m_nameHasBeenSet(false),
m_timestampHasBeenSet(false)
{
}
Timer::Timer(JsonView jsonValue) :
m_nameHasBeenSet(false),
m_timestampHasBeenSet(false)
{
*this = jsonValue;
}
Timer& Timer::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("name"))
{
m_name = jsonValue.GetString("name");
m_nameHasBeenSet = true;
}
if(jsonValue.ValueExists("timestamp"))
{
m_timestamp = jsonValue.GetDouble("timestamp");
m_timestampHasBeenSet = true;
}
return *this;
}
JsonValue Timer::Jsonize() const
{
JsonValue payload;
if(m_nameHasBeenSet)
{
payload.WithString("name", m_name);
}
if(m_timestampHasBeenSet)
{
payload.WithDouble("timestamp", m_timestamp.SecondsWithMSPrecision());
}
return payload;
}
} // namespace Model
} // namespace IoTEventsData
} // namespace Aws

View File

@@ -0,0 +1,76 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotevents-data/model/TimerDefinition.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace IoTEventsData
{
namespace Model
{
TimerDefinition::TimerDefinition() :
m_nameHasBeenSet(false),
m_seconds(0),
m_secondsHasBeenSet(false)
{
}
TimerDefinition::TimerDefinition(JsonView jsonValue) :
m_nameHasBeenSet(false),
m_seconds(0),
m_secondsHasBeenSet(false)
{
*this = jsonValue;
}
TimerDefinition& TimerDefinition::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("name"))
{
m_name = jsonValue.GetString("name");
m_nameHasBeenSet = true;
}
if(jsonValue.ValueExists("seconds"))
{
m_seconds = jsonValue.GetInteger("seconds");
m_secondsHasBeenSet = true;
}
return *this;
}
JsonValue TimerDefinition::Jsonize() const
{
JsonValue payload;
if(m_nameHasBeenSet)
{
payload.WithString("name", m_name);
}
if(m_secondsHasBeenSet)
{
payload.WithInteger("seconds", m_seconds);
}
return payload;
}
} // namespace Model
} // namespace IoTEventsData
} // namespace Aws

View File

@@ -0,0 +1,104 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotevents-data/model/UpdateDetectorRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace IoTEventsData
{
namespace Model
{
UpdateDetectorRequest::UpdateDetectorRequest() :
m_messageIdHasBeenSet(false),
m_detectorModelNameHasBeenSet(false),
m_keyValueHasBeenSet(false),
m_stateHasBeenSet(false)
{
}
UpdateDetectorRequest::UpdateDetectorRequest(JsonView jsonValue) :
m_messageIdHasBeenSet(false),
m_detectorModelNameHasBeenSet(false),
m_keyValueHasBeenSet(false),
m_stateHasBeenSet(false)
{
*this = jsonValue;
}
UpdateDetectorRequest& UpdateDetectorRequest::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("messageId"))
{
m_messageId = jsonValue.GetString("messageId");
m_messageIdHasBeenSet = true;
}
if(jsonValue.ValueExists("detectorModelName"))
{
m_detectorModelName = jsonValue.GetString("detectorModelName");
m_detectorModelNameHasBeenSet = true;
}
if(jsonValue.ValueExists("keyValue"))
{
m_keyValue = jsonValue.GetString("keyValue");
m_keyValueHasBeenSet = true;
}
if(jsonValue.ValueExists("state"))
{
m_state = jsonValue.GetObject("state");
m_stateHasBeenSet = true;
}
return *this;
}
JsonValue UpdateDetectorRequest::Jsonize() const
{
JsonValue payload;
if(m_messageIdHasBeenSet)
{
payload.WithString("messageId", m_messageId);
}
if(m_detectorModelNameHasBeenSet)
{
payload.WithString("detectorModelName", m_detectorModelName);
}
if(m_keyValueHasBeenSet)
{
payload.WithString("keyValue", m_keyValue);
}
if(m_stateHasBeenSet)
{
payload.WithObject("state", m_state.Jsonize());
}
return payload;
}
} // namespace Model
} // namespace IoTEventsData
} // namespace Aws

View File

@@ -0,0 +1,74 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotevents-data/model/Variable.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace IoTEventsData
{
namespace Model
{
Variable::Variable() :
m_nameHasBeenSet(false),
m_valueHasBeenSet(false)
{
}
Variable::Variable(JsonView jsonValue) :
m_nameHasBeenSet(false),
m_valueHasBeenSet(false)
{
*this = jsonValue;
}
Variable& Variable::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("name"))
{
m_name = jsonValue.GetString("name");
m_nameHasBeenSet = true;
}
if(jsonValue.ValueExists("value"))
{
m_value = jsonValue.GetString("value");
m_valueHasBeenSet = true;
}
return *this;
}
JsonValue Variable::Jsonize() const
{
JsonValue payload;
if(m_nameHasBeenSet)
{
payload.WithString("name", m_name);
}
if(m_valueHasBeenSet)
{
payload.WithString("value", m_value);
}
return payload;
}
} // namespace Model
} // namespace IoTEventsData
} // namespace Aws

View File

@@ -0,0 +1,74 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotevents-data/model/VariableDefinition.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace IoTEventsData
{
namespace Model
{
VariableDefinition::VariableDefinition() :
m_nameHasBeenSet(false),
m_valueHasBeenSet(false)
{
}
VariableDefinition::VariableDefinition(JsonView jsonValue) :
m_nameHasBeenSet(false),
m_valueHasBeenSet(false)
{
*this = jsonValue;
}
VariableDefinition& VariableDefinition::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("name"))
{
m_name = jsonValue.GetString("name");
m_nameHasBeenSet = true;
}
if(jsonValue.ValueExists("value"))
{
m_value = jsonValue.GetString("value");
m_valueHasBeenSet = true;
}
return *this;
}
JsonValue VariableDefinition::Jsonize() const
{
JsonValue payload;
if(m_nameHasBeenSet)
{
payload.WithString("name", m_name);
}
if(m_valueHasBeenSet)
{
payload.WithString("value", m_value);
}
return payload;
}
} // namespace Model
} // namespace IoTEventsData
} // namespace Aws