/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::ECS::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; UpdateServiceRequest::UpdateServiceRequest() : m_clusterHasBeenSet(false), m_serviceHasBeenSet(false), m_desiredCount(0), m_desiredCountHasBeenSet(false), m_taskDefinitionHasBeenSet(false), m_capacityProviderStrategyHasBeenSet(false), m_deploymentConfigurationHasBeenSet(false), m_networkConfigurationHasBeenSet(false), m_placementConstraintsHasBeenSet(false), m_placementStrategyHasBeenSet(false), m_platformVersionHasBeenSet(false), m_forceNewDeployment(false), m_forceNewDeploymentHasBeenSet(false), m_healthCheckGracePeriodSeconds(0), m_healthCheckGracePeriodSecondsHasBeenSet(false) { } Aws::String UpdateServiceRequest::SerializePayload() const { JsonValue payload; if(m_clusterHasBeenSet) { payload.WithString("cluster", m_cluster); } if(m_serviceHasBeenSet) { payload.WithString("service", m_service); } if(m_desiredCountHasBeenSet) { payload.WithInteger("desiredCount", m_desiredCount); } if(m_taskDefinitionHasBeenSet) { payload.WithString("taskDefinition", m_taskDefinition); } if(m_capacityProviderStrategyHasBeenSet) { Array capacityProviderStrategyJsonList(m_capacityProviderStrategy.size()); for(unsigned capacityProviderStrategyIndex = 0; capacityProviderStrategyIndex < capacityProviderStrategyJsonList.GetLength(); ++capacityProviderStrategyIndex) { capacityProviderStrategyJsonList[capacityProviderStrategyIndex].AsObject(m_capacityProviderStrategy[capacityProviderStrategyIndex].Jsonize()); } payload.WithArray("capacityProviderStrategy", std::move(capacityProviderStrategyJsonList)); } if(m_deploymentConfigurationHasBeenSet) { payload.WithObject("deploymentConfiguration", m_deploymentConfiguration.Jsonize()); } if(m_networkConfigurationHasBeenSet) { payload.WithObject("networkConfiguration", m_networkConfiguration.Jsonize()); } if(m_placementConstraintsHasBeenSet) { Array placementConstraintsJsonList(m_placementConstraints.size()); for(unsigned placementConstraintsIndex = 0; placementConstraintsIndex < placementConstraintsJsonList.GetLength(); ++placementConstraintsIndex) { placementConstraintsJsonList[placementConstraintsIndex].AsObject(m_placementConstraints[placementConstraintsIndex].Jsonize()); } payload.WithArray("placementConstraints", std::move(placementConstraintsJsonList)); } if(m_placementStrategyHasBeenSet) { Array placementStrategyJsonList(m_placementStrategy.size()); for(unsigned placementStrategyIndex = 0; placementStrategyIndex < placementStrategyJsonList.GetLength(); ++placementStrategyIndex) { placementStrategyJsonList[placementStrategyIndex].AsObject(m_placementStrategy[placementStrategyIndex].Jsonize()); } payload.WithArray("placementStrategy", std::move(placementStrategyJsonList)); } if(m_platformVersionHasBeenSet) { payload.WithString("platformVersion", m_platformVersion); } if(m_forceNewDeploymentHasBeenSet) { payload.WithBool("forceNewDeployment", m_forceNewDeployment); } if(m_healthCheckGracePeriodSecondsHasBeenSet) { payload.WithInteger("healthCheckGracePeriodSeconds", m_healthCheckGracePeriodSeconds); } return payload.View().WriteReadable(); } Aws::Http::HeaderValueCollection UpdateServiceRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AmazonEC2ContainerServiceV20141113.UpdateService")); return headers; }