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,84 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iot/model/AddThingsToThingGroupParams.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace IoT
{
namespace Model
{
AddThingsToThingGroupParams::AddThingsToThingGroupParams() :
m_thingGroupNamesHasBeenSet(false),
m_overrideDynamicGroups(false),
m_overrideDynamicGroupsHasBeenSet(false)
{
}
AddThingsToThingGroupParams::AddThingsToThingGroupParams(JsonView jsonValue) :
m_thingGroupNamesHasBeenSet(false),
m_overrideDynamicGroups(false),
m_overrideDynamicGroupsHasBeenSet(false)
{
*this = jsonValue;
}
AddThingsToThingGroupParams& AddThingsToThingGroupParams::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("thingGroupNames"))
{
Array<JsonView> thingGroupNamesJsonList = jsonValue.GetArray("thingGroupNames");
for(unsigned thingGroupNamesIndex = 0; thingGroupNamesIndex < thingGroupNamesJsonList.GetLength(); ++thingGroupNamesIndex)
{
m_thingGroupNames.push_back(thingGroupNamesJsonList[thingGroupNamesIndex].AsString());
}
m_thingGroupNamesHasBeenSet = true;
}
if(jsonValue.ValueExists("overrideDynamicGroups"))
{
m_overrideDynamicGroups = jsonValue.GetBool("overrideDynamicGroups");
m_overrideDynamicGroupsHasBeenSet = true;
}
return *this;
}
JsonValue AddThingsToThingGroupParams::Jsonize() const
{
JsonValue payload;
if(m_thingGroupNamesHasBeenSet)
{
Array<JsonValue> thingGroupNamesJsonList(m_thingGroupNames.size());
for(unsigned thingGroupNamesIndex = 0; thingGroupNamesIndex < thingGroupNamesJsonList.GetLength(); ++thingGroupNamesIndex)
{
thingGroupNamesJsonList[thingGroupNamesIndex].AsString(m_thingGroupNames[thingGroupNamesIndex]);
}
payload.WithArray("thingGroupNames", std::move(thingGroupNamesJsonList));
}
if(m_overrideDynamicGroupsHasBeenSet)
{
payload.WithBool("overrideDynamicGroups", m_overrideDynamicGroups);
}
return payload;
}
} // namespace Model
} // namespace IoT
} // namespace Aws