This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
pxz-hos-client-cpp-module/support/aws-sdk-cpp-master/aws-cpp-sdk-dms/source/model/PostgreSQLSettings.cpp

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/PostgreSQLSettings.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
{
PostgreSQLSettings::PostgreSQLSettings() :
m_databaseNameHasBeenSet(false),
m_passwordHasBeenSet(false),
m_port(0),
m_portHasBeenSet(false),
m_serverNameHasBeenSet(false),
m_usernameHasBeenSet(false)
{
}
PostgreSQLSettings::PostgreSQLSettings(JsonView jsonValue) :
m_databaseNameHasBeenSet(false),
m_passwordHasBeenSet(false),
m_port(0),
m_portHasBeenSet(false),
m_serverNameHasBeenSet(false),
m_usernameHasBeenSet(false)
{
*this = jsonValue;
}
PostgreSQLSettings& PostgreSQLSettings::operator =(JsonView jsonValue)
{
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("Port"))
{
m_port = jsonValue.GetInteger("Port");
m_portHasBeenSet = 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 PostgreSQLSettings::Jsonize() const
{
JsonValue payload;
if(m_databaseNameHasBeenSet)
{
payload.WithString("DatabaseName", m_databaseName);
}
if(m_passwordHasBeenSet)
{
payload.WithString("Password", m_password);
}
if(m_portHasBeenSet)
{
payload.WithInteger("Port", m_port);
}
if(m_serverNameHasBeenSet)
{
payload.WithString("ServerName", m_serverName);
}
if(m_usernameHasBeenSet)
{
payload.WithString("Username", m_username);
}
return payload;
}
} // namespace Model
} // namespace DatabaseMigrationService
} // namespace Aws