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-ram/source/model/Principal.cpp

120 lines
2.2 KiB
C++
Raw Normal View History

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ram/model/Principal.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace RAM
{
namespace Model
{
Principal::Principal() :
m_idHasBeenSet(false),
m_resourceShareArnHasBeenSet(false),
m_creationTimeHasBeenSet(false),
m_lastUpdatedTimeHasBeenSet(false),
m_external(false),
m_externalHasBeenSet(false)
{
}
Principal::Principal(JsonView jsonValue) :
m_idHasBeenSet(false),
m_resourceShareArnHasBeenSet(false),
m_creationTimeHasBeenSet(false),
m_lastUpdatedTimeHasBeenSet(false),
m_external(false),
m_externalHasBeenSet(false)
{
*this = jsonValue;
}
Principal& Principal::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("id"))
{
m_id = jsonValue.GetString("id");
m_idHasBeenSet = true;
}
if(jsonValue.ValueExists("resourceShareArn"))
{
m_resourceShareArn = jsonValue.GetString("resourceShareArn");
m_resourceShareArnHasBeenSet = true;
}
if(jsonValue.ValueExists("creationTime"))
{
m_creationTime = jsonValue.GetDouble("creationTime");
m_creationTimeHasBeenSet = true;
}
if(jsonValue.ValueExists("lastUpdatedTime"))
{
m_lastUpdatedTime = jsonValue.GetDouble("lastUpdatedTime");
m_lastUpdatedTimeHasBeenSet = true;
}
if(jsonValue.ValueExists("external"))
{
m_external = jsonValue.GetBool("external");
m_externalHasBeenSet = true;
}
return *this;
}
JsonValue Principal::Jsonize() const
{
JsonValue payload;
if(m_idHasBeenSet)
{
payload.WithString("id", m_id);
}
if(m_resourceShareArnHasBeenSet)
{
payload.WithString("resourceShareArn", m_resourceShareArn);
}
if(m_creationTimeHasBeenSet)
{
payload.WithDouble("creationTime", m_creationTime.SecondsWithMSPrecision());
}
if(m_lastUpdatedTimeHasBeenSet)
{
payload.WithDouble("lastUpdatedTime", m_lastUpdatedTime.SecondsWithMSPrecision());
}
if(m_externalHasBeenSet)
{
payload.WithBool("external", m_external);
}
return payload;
}
} // namespace Model
} // namespace RAM
} // namespace Aws