122 lines
2.2 KiB
C++
122 lines
2.2 KiB
C++
/**
|
|
* 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
|