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-cloud9/source/model/Environment.cpp

167 lines
3.2 KiB
C++

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/cloud9/model/Environment.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace Cloud9
{
namespace Model
{
Environment::Environment() :
m_idHasBeenSet(false),
m_nameHasBeenSet(false),
m_descriptionHasBeenSet(false),
m_type(EnvironmentType::NOT_SET),
m_typeHasBeenSet(false),
m_connectionType(ConnectionType::NOT_SET),
m_connectionTypeHasBeenSet(false),
m_arnHasBeenSet(false),
m_ownerArnHasBeenSet(false),
m_lifecycleHasBeenSet(false)
{
}
Environment::Environment(JsonView jsonValue) :
m_idHasBeenSet(false),
m_nameHasBeenSet(false),
m_descriptionHasBeenSet(false),
m_type(EnvironmentType::NOT_SET),
m_typeHasBeenSet(false),
m_connectionType(ConnectionType::NOT_SET),
m_connectionTypeHasBeenSet(false),
m_arnHasBeenSet(false),
m_ownerArnHasBeenSet(false),
m_lifecycleHasBeenSet(false)
{
*this = jsonValue;
}
Environment& Environment::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("id"))
{
m_id = jsonValue.GetString("id");
m_idHasBeenSet = true;
}
if(jsonValue.ValueExists("name"))
{
m_name = jsonValue.GetString("name");
m_nameHasBeenSet = true;
}
if(jsonValue.ValueExists("description"))
{
m_description = jsonValue.GetString("description");
m_descriptionHasBeenSet = true;
}
if(jsonValue.ValueExists("type"))
{
m_type = EnvironmentTypeMapper::GetEnvironmentTypeForName(jsonValue.GetString("type"));
m_typeHasBeenSet = true;
}
if(jsonValue.ValueExists("connectionType"))
{
m_connectionType = ConnectionTypeMapper::GetConnectionTypeForName(jsonValue.GetString("connectionType"));
m_connectionTypeHasBeenSet = true;
}
if(jsonValue.ValueExists("arn"))
{
m_arn = jsonValue.GetString("arn");
m_arnHasBeenSet = true;
}
if(jsonValue.ValueExists("ownerArn"))
{
m_ownerArn = jsonValue.GetString("ownerArn");
m_ownerArnHasBeenSet = true;
}
if(jsonValue.ValueExists("lifecycle"))
{
m_lifecycle = jsonValue.GetObject("lifecycle");
m_lifecycleHasBeenSet = true;
}
return *this;
}
JsonValue Environment::Jsonize() const
{
JsonValue payload;
if(m_idHasBeenSet)
{
payload.WithString("id", m_id);
}
if(m_nameHasBeenSet)
{
payload.WithString("name", m_name);
}
if(m_descriptionHasBeenSet)
{
payload.WithString("description", m_description);
}
if(m_typeHasBeenSet)
{
payload.WithString("type", EnvironmentTypeMapper::GetNameForEnvironmentType(m_type));
}
if(m_connectionTypeHasBeenSet)
{
payload.WithString("connectionType", ConnectionTypeMapper::GetNameForConnectionType(m_connectionType));
}
if(m_arnHasBeenSet)
{
payload.WithString("arn", m_arn);
}
if(m_ownerArnHasBeenSet)
{
payload.WithString("ownerArn", m_ownerArn);
}
if(m_lifecycleHasBeenSet)
{
payload.WithObject("lifecycle", m_lifecycle.Jsonize());
}
return payload;
}
} // namespace Model
} // namespace Cloud9
} // namespace Aws