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,115 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/wafv2/model/RateBasedStatement.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace WAFV2
{
namespace Model
{
RateBasedStatement::RateBasedStatement() :
m_limit(0),
m_limitHasBeenSet(false),
m_aggregateKeyType(RateBasedStatementAggregateKeyType::NOT_SET),
m_aggregateKeyTypeHasBeenSet(false),
m_scopeDownStatementHasBeenSet(false),
m_forwardedIPConfigHasBeenSet(false)
{
}
RateBasedStatement::RateBasedStatement(JsonView jsonValue) :
m_limit(0),
m_limitHasBeenSet(false),
m_aggregateKeyType(RateBasedStatementAggregateKeyType::NOT_SET),
m_aggregateKeyTypeHasBeenSet(false),
m_scopeDownStatementHasBeenSet(false),
m_forwardedIPConfigHasBeenSet(false)
{
*this = jsonValue;
}
const Statement& RateBasedStatement::GetScopeDownStatement() const{ return m_scopeDownStatement[0]; }
bool RateBasedStatement::ScopeDownStatementHasBeenSet() const { return m_scopeDownStatementHasBeenSet; }
void RateBasedStatement::SetScopeDownStatement(const Statement& value) { m_scopeDownStatementHasBeenSet = true; m_scopeDownStatement.resize(1); m_scopeDownStatement[0] = value; }
void RateBasedStatement::SetScopeDownStatement(Statement&& value) { m_scopeDownStatementHasBeenSet = true; m_scopeDownStatement.resize(1); m_scopeDownStatement[0] = std::move(value); }
RateBasedStatement& RateBasedStatement::WithScopeDownStatement(const Statement& value) { SetScopeDownStatement(value); return *this;}
RateBasedStatement& RateBasedStatement::WithScopeDownStatement(Statement&& value) { SetScopeDownStatement(std::move(value)); return *this;}
RateBasedStatement& RateBasedStatement::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("Limit"))
{
m_limit = jsonValue.GetInt64("Limit");
m_limitHasBeenSet = true;
}
if(jsonValue.ValueExists("AggregateKeyType"))
{
m_aggregateKeyType = RateBasedStatementAggregateKeyTypeMapper::GetRateBasedStatementAggregateKeyTypeForName(jsonValue.GetString("AggregateKeyType"));
m_aggregateKeyTypeHasBeenSet = true;
}
if(jsonValue.ValueExists("ScopeDownStatement"))
{
m_scopeDownStatement.resize(1);
m_scopeDownStatement[0] = jsonValue.GetObject("ScopeDownStatement");
m_scopeDownStatementHasBeenSet = true;
}
if(jsonValue.ValueExists("ForwardedIPConfig"))
{
m_forwardedIPConfig = jsonValue.GetObject("ForwardedIPConfig");
m_forwardedIPConfigHasBeenSet = true;
}
return *this;
}
JsonValue RateBasedStatement::Jsonize() const
{
JsonValue payload;
if(m_limitHasBeenSet)
{
payload.WithInt64("Limit", m_limit);
}
if(m_aggregateKeyTypeHasBeenSet)
{
payload.WithString("AggregateKeyType", RateBasedStatementAggregateKeyTypeMapper::GetNameForRateBasedStatementAggregateKeyType(m_aggregateKeyType));
}
if(m_scopeDownStatementHasBeenSet)
{
payload.WithObject("ScopeDownStatement", m_scopeDownStatement[0].Jsonize());
}
if(m_forwardedIPConfigHasBeenSet)
{
payload.WithObject("ForwardedIPConfig", m_forwardedIPConfig.Jsonize());
}
return payload;
}
} // namespace Model
} // namespace WAFV2
} // namespace Aws