/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::DataSync::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; AddStorageSystemRequest::AddStorageSystemRequest() : m_serverConfigurationHasBeenSet(false), m_systemType(DiscoverySystemType::NOT_SET), m_systemTypeHasBeenSet(false), m_agentArnsHasBeenSet(false), m_cloudWatchLogGroupArnHasBeenSet(false), m_tagsHasBeenSet(false), m_nameHasBeenSet(false), m_clientToken(Aws::Utils::UUID::PseudoRandomUUID()), m_clientTokenHasBeenSet(true), m_credentialsHasBeenSet(false) { } Aws::String AddStorageSystemRequest::SerializePayload() const { JsonValue payload; if(m_serverConfigurationHasBeenSet) { payload.WithObject("ServerConfiguration", m_serverConfiguration.Jsonize()); } if(m_systemTypeHasBeenSet) { payload.WithString("SystemType", DiscoverySystemTypeMapper::GetNameForDiscoverySystemType(m_systemType)); } if(m_agentArnsHasBeenSet) { Aws::Utils::Array agentArnsJsonList(m_agentArns.size()); for(unsigned agentArnsIndex = 0; agentArnsIndex < agentArnsJsonList.GetLength(); ++agentArnsIndex) { agentArnsJsonList[agentArnsIndex].AsString(m_agentArns[agentArnsIndex]); } payload.WithArray("AgentArns", std::move(agentArnsJsonList)); } if(m_cloudWatchLogGroupArnHasBeenSet) { payload.WithString("CloudWatchLogGroupArn", m_cloudWatchLogGroupArn); } if(m_tagsHasBeenSet) { Aws::Utils::Array tagsJsonList(m_tags.size()); for(unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex) { tagsJsonList[tagsIndex].AsObject(m_tags[tagsIndex].Jsonize()); } payload.WithArray("Tags", std::move(tagsJsonList)); } if(m_nameHasBeenSet) { payload.WithString("Name", m_name); } if(m_clientTokenHasBeenSet) { payload.WithString("ClientToken", m_clientToken); } if(m_credentialsHasBeenSet) { payload.WithObject("Credentials", m_credentials.Jsonize()); } return payload.View().WriteReadable(); } Aws::Http::HeaderValueCollection AddStorageSystemRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "FmrsService.AddStorageSystem")); return headers; }