/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include 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) { Aws::Utils::Array 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) { Aws::Utils::Array 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(); }