/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include using namespace Aws::LookoutforVision::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; CreateModelRequest::CreateModelRequest() : m_projectNameHasBeenSet(false), m_descriptionHasBeenSet(false), m_clientToken(Aws::Utils::UUID::PseudoRandomUUID()), m_clientTokenHasBeenSet(true), m_outputConfigHasBeenSet(false), m_kmsKeyIdHasBeenSet(false), m_tagsHasBeenSet(false) { } Aws::String CreateModelRequest::SerializePayload() const { JsonValue payload; if(m_descriptionHasBeenSet) { payload.WithString("Description", m_description); } if(m_outputConfigHasBeenSet) { payload.WithObject("OutputConfig", m_outputConfig.Jsonize()); } if(m_kmsKeyIdHasBeenSet) { payload.WithString("KmsKeyId", m_kmsKeyId); } 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 CreateModelRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; Aws::StringStream ss; if(m_clientTokenHasBeenSet) { ss << m_clientToken; headers.emplace("x-amzn-client-token", ss.str()); ss.str(""); } return headers; }