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,128 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/glue/model/UserDefinedFunctionInput.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
{
UserDefinedFunctionInput::UserDefinedFunctionInput() :
m_functionNameHasBeenSet(false),
m_classNameHasBeenSet(false),
m_ownerNameHasBeenSet(false),
m_ownerType(PrincipalType::NOT_SET),
m_ownerTypeHasBeenSet(false),
m_resourceUrisHasBeenSet(false)
{
}
UserDefinedFunctionInput::UserDefinedFunctionInput(JsonView jsonValue) :
m_functionNameHasBeenSet(false),
m_classNameHasBeenSet(false),
m_ownerNameHasBeenSet(false),
m_ownerType(PrincipalType::NOT_SET),
m_ownerTypeHasBeenSet(false),
m_resourceUrisHasBeenSet(false)
{
*this = jsonValue;
}
UserDefinedFunctionInput& UserDefinedFunctionInput::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("FunctionName"))
{
m_functionName = jsonValue.GetString("FunctionName");
m_functionNameHasBeenSet = true;
}
if(jsonValue.ValueExists("ClassName"))
{
m_className = jsonValue.GetString("ClassName");
m_classNameHasBeenSet = true;
}
if(jsonValue.ValueExists("OwnerName"))
{
m_ownerName = jsonValue.GetString("OwnerName");
m_ownerNameHasBeenSet = true;
}
if(jsonValue.ValueExists("OwnerType"))
{
m_ownerType = PrincipalTypeMapper::GetPrincipalTypeForName(jsonValue.GetString("OwnerType"));
m_ownerTypeHasBeenSet = true;
}
if(jsonValue.ValueExists("ResourceUris"))
{
Array<JsonView> resourceUrisJsonList = jsonValue.GetArray("ResourceUris");
for(unsigned resourceUrisIndex = 0; resourceUrisIndex < resourceUrisJsonList.GetLength(); ++resourceUrisIndex)
{
m_resourceUris.push_back(resourceUrisJsonList[resourceUrisIndex].AsObject());
}
m_resourceUrisHasBeenSet = true;
}
return *this;
}
JsonValue UserDefinedFunctionInput::Jsonize() const
{
JsonValue payload;
if(m_functionNameHasBeenSet)
{
payload.WithString("FunctionName", m_functionName);
}
if(m_classNameHasBeenSet)
{
payload.WithString("ClassName", m_className);
}
if(m_ownerNameHasBeenSet)
{
payload.WithString("OwnerName", m_ownerName);
}
if(m_ownerTypeHasBeenSet)
{
payload.WithString("OwnerType", PrincipalTypeMapper::GetNameForPrincipalType(m_ownerType));
}
if(m_resourceUrisHasBeenSet)
{
Array<JsonValue> resourceUrisJsonList(m_resourceUris.size());
for(unsigned resourceUrisIndex = 0; resourceUrisIndex < resourceUrisJsonList.GetLength(); ++resourceUrisIndex)
{
resourceUrisJsonList[resourceUrisIndex].AsObject(m_resourceUris[resourceUrisIndex].Jsonize());
}
payload.WithArray("ResourceUris", std::move(resourceUrisJsonList));
}
return payload;
}
} // namespace Model
} // namespace Glue
} // namespace Aws