/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include using namespace Aws::Greengrass::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; CreateResourceDefinitionVersionRequest::CreateResourceDefinitionVersionRequest() : m_amznClientTokenHasBeenSet(false), m_resourceDefinitionIdHasBeenSet(false), m_resourcesHasBeenSet(false) { } Aws::String CreateResourceDefinitionVersionRequest::SerializePayload() const { JsonValue payload; if(m_resourcesHasBeenSet) { Aws::Utils::Array resourcesJsonList(m_resources.size()); for(unsigned resourcesIndex = 0; resourcesIndex < resourcesJsonList.GetLength(); ++resourcesIndex) { resourcesJsonList[resourcesIndex].AsObject(m_resources[resourcesIndex].Jsonize()); } payload.WithArray("Resources", std::move(resourcesJsonList)); } return payload.View().WriteReadable(); } Aws::Http::HeaderValueCollection CreateResourceDefinitionVersionRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; Aws::StringStream ss; if(m_amznClientTokenHasBeenSet) { ss << m_amznClientToken; headers.emplace("x-amzn-client-token", ss.str()); ss.str(""); } return headers; }