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,114 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/glue/model/CodeGenNode.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace Glue
{
namespace Model
{
CodeGenNode::CodeGenNode() :
m_idHasBeenSet(false),
m_nodeTypeHasBeenSet(false),
m_argsHasBeenSet(false),
m_lineNumber(0),
m_lineNumberHasBeenSet(false)
{
}
CodeGenNode::CodeGenNode(JsonView jsonValue) :
m_idHasBeenSet(false),
m_nodeTypeHasBeenSet(false),
m_argsHasBeenSet(false),
m_lineNumber(0),
m_lineNumberHasBeenSet(false)
{
*this = jsonValue;
}
CodeGenNode& CodeGenNode::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("Id"))
{
m_id = jsonValue.GetString("Id");
m_idHasBeenSet = true;
}
if(jsonValue.ValueExists("NodeType"))
{
m_nodeType = jsonValue.GetString("NodeType");
m_nodeTypeHasBeenSet = true;
}
if(jsonValue.ValueExists("Args"))
{
Array<JsonView> argsJsonList = jsonValue.GetArray("Args");
for(unsigned argsIndex = 0; argsIndex < argsJsonList.GetLength(); ++argsIndex)
{
m_args.push_back(argsJsonList[argsIndex].AsObject());
}
m_argsHasBeenSet = true;
}
if(jsonValue.ValueExists("LineNumber"))
{
m_lineNumber = jsonValue.GetInteger("LineNumber");
m_lineNumberHasBeenSet = true;
}
return *this;
}
JsonValue CodeGenNode::Jsonize() const
{
JsonValue payload;
if(m_idHasBeenSet)
{
payload.WithString("Id", m_id);
}
if(m_nodeTypeHasBeenSet)
{
payload.WithString("NodeType", m_nodeType);
}
if(m_argsHasBeenSet)
{
Array<JsonValue> argsJsonList(m_args.size());
for(unsigned argsIndex = 0; argsIndex < argsJsonList.GetLength(); ++argsIndex)
{
argsJsonList[argsIndex].AsObject(m_args[argsIndex].Jsonize());
}
payload.WithArray("Args", std::move(argsJsonList));
}
if(m_lineNumberHasBeenSet)
{
payload.WithInteger("LineNumber", m_lineNumber);
}
return payload;
}
} // namespace Model
} // namespace Glue
} // namespace Aws