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,121 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/dms/model/MicrosoftSQLServerSettings.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace DatabaseMigrationService
{
namespace Model
{
MicrosoftSQLServerSettings::MicrosoftSQLServerSettings() :
m_port(0),
m_portHasBeenSet(false),
m_databaseNameHasBeenSet(false),
m_passwordHasBeenSet(false),
m_serverNameHasBeenSet(false),
m_usernameHasBeenSet(false)
{
}
MicrosoftSQLServerSettings::MicrosoftSQLServerSettings(JsonView jsonValue) :
m_port(0),
m_portHasBeenSet(false),
m_databaseNameHasBeenSet(false),
m_passwordHasBeenSet(false),
m_serverNameHasBeenSet(false),
m_usernameHasBeenSet(false)
{
*this = jsonValue;
}
MicrosoftSQLServerSettings& MicrosoftSQLServerSettings::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("Port"))
{
m_port = jsonValue.GetInteger("Port");
m_portHasBeenSet = true;
}
if(jsonValue.ValueExists("DatabaseName"))
{
m_databaseName = jsonValue.GetString("DatabaseName");
m_databaseNameHasBeenSet = true;
}
if(jsonValue.ValueExists("Password"))
{
m_password = jsonValue.GetString("Password");
m_passwordHasBeenSet = true;
}
if(jsonValue.ValueExists("ServerName"))
{
m_serverName = jsonValue.GetString("ServerName");
m_serverNameHasBeenSet = true;
}
if(jsonValue.ValueExists("Username"))
{
m_username = jsonValue.GetString("Username");
m_usernameHasBeenSet = true;
}
return *this;
}
JsonValue MicrosoftSQLServerSettings::Jsonize() const
{
JsonValue payload;
if(m_portHasBeenSet)
{
payload.WithInteger("Port", m_port);
}
if(m_databaseNameHasBeenSet)
{
payload.WithString("DatabaseName", m_databaseName);
}
if(m_passwordHasBeenSet)
{
payload.WithString("Password", m_password);
}
if(m_serverNameHasBeenSet)
{
payload.WithString("ServerName", m_serverName);
}
if(m_usernameHasBeenSet)
{
payload.WithString("Username", m_username);
}
return payload;
}
} // namespace Model
} // namespace DatabaseMigrationService
} // namespace Aws