/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::Glue::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; CreateSessionRequest::CreateSessionRequest() : m_idHasBeenSet(false), m_descriptionHasBeenSet(false), m_roleHasBeenSet(false), m_commandHasBeenSet(false), m_timeout(0), m_timeoutHasBeenSet(false), m_idleTimeout(0), m_idleTimeoutHasBeenSet(false), m_defaultArgumentsHasBeenSet(false), m_connectionsHasBeenSet(false), m_maxCapacity(0.0), m_maxCapacityHasBeenSet(false), m_numberOfWorkers(0), m_numberOfWorkersHasBeenSet(false), m_workerType(WorkerType::NOT_SET), m_workerTypeHasBeenSet(false), m_securityConfigurationHasBeenSet(false), m_glueVersionHasBeenSet(false), m_tagsHasBeenSet(false), m_requestOriginHasBeenSet(false) { } Aws::String CreateSessionRequest::SerializePayload() const { JsonValue payload; if(m_idHasBeenSet) { payload.WithString("Id", m_id); } if(m_descriptionHasBeenSet) { payload.WithString("Description", m_description); } if(m_roleHasBeenSet) { payload.WithString("Role", m_role); } if(m_commandHasBeenSet) { payload.WithObject("Command", m_command.Jsonize()); } if(m_timeoutHasBeenSet) { payload.WithInteger("Timeout", m_timeout); } if(m_idleTimeoutHasBeenSet) { payload.WithInteger("IdleTimeout", m_idleTimeout); } if(m_defaultArgumentsHasBeenSet) { JsonValue defaultArgumentsJsonMap; for(auto& defaultArgumentsItem : m_defaultArguments) { defaultArgumentsJsonMap.WithString(defaultArgumentsItem.first, defaultArgumentsItem.second); } payload.WithObject("DefaultArguments", std::move(defaultArgumentsJsonMap)); } if(m_connectionsHasBeenSet) { payload.WithObject("Connections", m_connections.Jsonize()); } if(m_maxCapacityHasBeenSet) { payload.WithDouble("MaxCapacity", m_maxCapacity); } if(m_numberOfWorkersHasBeenSet) { payload.WithInteger("NumberOfWorkers", m_numberOfWorkers); } if(m_workerTypeHasBeenSet) { payload.WithString("WorkerType", WorkerTypeMapper::GetNameForWorkerType(m_workerType)); } if(m_securityConfigurationHasBeenSet) { payload.WithString("SecurityConfiguration", m_securityConfiguration); } if(m_glueVersionHasBeenSet) { payload.WithString("GlueVersion", m_glueVersion); } if(m_tagsHasBeenSet) { JsonValue tagsJsonMap; for(auto& tagsItem : m_tags) { tagsJsonMap.WithString(tagsItem.first, tagsItem.second); } payload.WithObject("Tags", std::move(tagsJsonMap)); } if(m_requestOriginHasBeenSet) { payload.WithString("RequestOrigin", m_requestOrigin); } return payload.View().WriteReadable(); } Aws::Http::HeaderValueCollection CreateSessionRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSGlue.CreateSession")); return headers; }