89 lines
2.1 KiB
C++
89 lines
2.1 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/ram/model/ListPrincipalsRequest.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::RAM::Model;
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
ListPrincipalsRequest::ListPrincipalsRequest() :
|
|
m_resourceOwner(ResourceOwner::NOT_SET),
|
|
m_resourceOwnerHasBeenSet(false),
|
|
m_resourceArnHasBeenSet(false),
|
|
m_principalsHasBeenSet(false),
|
|
m_resourceTypeHasBeenSet(false),
|
|
m_resourceShareArnsHasBeenSet(false),
|
|
m_nextTokenHasBeenSet(false),
|
|
m_maxResults(0),
|
|
m_maxResultsHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
Aws::String ListPrincipalsRequest::SerializePayload() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_resourceOwnerHasBeenSet)
|
|
{
|
|
payload.WithString("resourceOwner", ResourceOwnerMapper::GetNameForResourceOwner(m_resourceOwner));
|
|
}
|
|
|
|
if(m_resourceArnHasBeenSet)
|
|
{
|
|
payload.WithString("resourceArn", m_resourceArn);
|
|
|
|
}
|
|
|
|
if(m_principalsHasBeenSet)
|
|
{
|
|
Array<JsonValue> principalsJsonList(m_principals.size());
|
|
for(unsigned principalsIndex = 0; principalsIndex < principalsJsonList.GetLength(); ++principalsIndex)
|
|
{
|
|
principalsJsonList[principalsIndex].AsString(m_principals[principalsIndex]);
|
|
}
|
|
payload.WithArray("principals", std::move(principalsJsonList));
|
|
|
|
}
|
|
|
|
if(m_resourceTypeHasBeenSet)
|
|
{
|
|
payload.WithString("resourceType", m_resourceType);
|
|
|
|
}
|
|
|
|
if(m_resourceShareArnsHasBeenSet)
|
|
{
|
|
Array<JsonValue> resourceShareArnsJsonList(m_resourceShareArns.size());
|
|
for(unsigned resourceShareArnsIndex = 0; resourceShareArnsIndex < resourceShareArnsJsonList.GetLength(); ++resourceShareArnsIndex)
|
|
{
|
|
resourceShareArnsJsonList[resourceShareArnsIndex].AsString(m_resourceShareArns[resourceShareArnsIndex]);
|
|
}
|
|
payload.WithArray("resourceShareArns", std::move(resourceShareArnsJsonList));
|
|
|
|
}
|
|
|
|
if(m_nextTokenHasBeenSet)
|
|
{
|
|
payload.WithString("nextToken", m_nextToken);
|
|
|
|
}
|
|
|
|
if(m_maxResultsHasBeenSet)
|
|
{
|
|
payload.WithInteger("maxResults", m_maxResults);
|
|
|
|
}
|
|
|
|
return payload.View().WriteReadable();
|
|
}
|
|
|
|
|
|
|
|
|