/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::GlobalAccelerator::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; CreateCustomRoutingAcceleratorRequest::CreateCustomRoutingAcceleratorRequest() : m_nameHasBeenSet(false), m_ipAddressType(IpAddressType::NOT_SET), m_ipAddressTypeHasBeenSet(false), m_ipAddressesHasBeenSet(false), m_enabled(false), m_enabledHasBeenSet(false), m_idempotencyToken(Aws::Utils::UUID::PseudoRandomUUID()), m_idempotencyTokenHasBeenSet(true), m_tagsHasBeenSet(false) { } Aws::String CreateCustomRoutingAcceleratorRequest::SerializePayload() const { JsonValue payload; if(m_nameHasBeenSet) { payload.WithString("Name", m_name); } if(m_ipAddressTypeHasBeenSet) { payload.WithString("IpAddressType", IpAddressTypeMapper::GetNameForIpAddressType(m_ipAddressType)); } if(m_ipAddressesHasBeenSet) { Aws::Utils::Array ipAddressesJsonList(m_ipAddresses.size()); for(unsigned ipAddressesIndex = 0; ipAddressesIndex < ipAddressesJsonList.GetLength(); ++ipAddressesIndex) { ipAddressesJsonList[ipAddressesIndex].AsString(m_ipAddresses[ipAddressesIndex]); } payload.WithArray("IpAddresses", std::move(ipAddressesJsonList)); } if(m_enabledHasBeenSet) { payload.WithBool("Enabled", m_enabled); } if(m_idempotencyTokenHasBeenSet) { payload.WithString("IdempotencyToken", m_idempotencyToken); } 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)); } return payload.View().WriteReadable(); } Aws::Http::HeaderValueCollection CreateCustomRoutingAcceleratorRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "GlobalAccelerator_V20180706.CreateCustomRoutingAccelerator")); return headers; }