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-robomaker/source/model/SimulationApplicationConfig.cpp

113 lines
2.6 KiB
C++

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/robomaker/model/SimulationApplicationConfig.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace RoboMaker
{
namespace Model
{
SimulationApplicationConfig::SimulationApplicationConfig() :
m_applicationHasBeenSet(false),
m_applicationVersionHasBeenSet(false),
m_launchConfigHasBeenSet(false),
m_worldConfigsHasBeenSet(false)
{
}
SimulationApplicationConfig::SimulationApplicationConfig(JsonView jsonValue) :
m_applicationHasBeenSet(false),
m_applicationVersionHasBeenSet(false),
m_launchConfigHasBeenSet(false),
m_worldConfigsHasBeenSet(false)
{
*this = jsonValue;
}
SimulationApplicationConfig& SimulationApplicationConfig::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("application"))
{
m_application = jsonValue.GetString("application");
m_applicationHasBeenSet = true;
}
if(jsonValue.ValueExists("applicationVersion"))
{
m_applicationVersion = jsonValue.GetString("applicationVersion");
m_applicationVersionHasBeenSet = true;
}
if(jsonValue.ValueExists("launchConfig"))
{
m_launchConfig = jsonValue.GetObject("launchConfig");
m_launchConfigHasBeenSet = true;
}
if(jsonValue.ValueExists("worldConfigs"))
{
Array<JsonView> worldConfigsJsonList = jsonValue.GetArray("worldConfigs");
for(unsigned worldConfigsIndex = 0; worldConfigsIndex < worldConfigsJsonList.GetLength(); ++worldConfigsIndex)
{
m_worldConfigs.push_back(worldConfigsJsonList[worldConfigsIndex].AsObject());
}
m_worldConfigsHasBeenSet = true;
}
return *this;
}
JsonValue SimulationApplicationConfig::Jsonize() const
{
JsonValue payload;
if(m_applicationHasBeenSet)
{
payload.WithString("application", m_application);
}
if(m_applicationVersionHasBeenSet)
{
payload.WithString("applicationVersion", m_applicationVersion);
}
if(m_launchConfigHasBeenSet)
{
payload.WithObject("launchConfig", m_launchConfig.Jsonize());
}
if(m_worldConfigsHasBeenSet)
{
Array<JsonValue> worldConfigsJsonList(m_worldConfigs.size());
for(unsigned worldConfigsIndex = 0; worldConfigsIndex < worldConfigsJsonList.GetLength(); ++worldConfigsIndex)
{
worldConfigsJsonList[worldConfigsIndex].AsObject(m_worldConfigs[worldConfigsIndex].Jsonize());
}
payload.WithArray("worldConfigs", std::move(worldConfigsJsonList));
}
return payload;
}
} // namespace Model
} // namespace RoboMaker
} // namespace Aws