/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace SageMaker { namespace Model { DefaultSpaceSettings::DefaultSpaceSettings() : m_executionRoleHasBeenSet(false), m_securityGroupsHasBeenSet(false), m_jupyterServerAppSettingsHasBeenSet(false), m_kernelGatewayAppSettingsHasBeenSet(false) { } DefaultSpaceSettings::DefaultSpaceSettings(JsonView jsonValue) : m_executionRoleHasBeenSet(false), m_securityGroupsHasBeenSet(false), m_jupyterServerAppSettingsHasBeenSet(false), m_kernelGatewayAppSettingsHasBeenSet(false) { *this = jsonValue; } DefaultSpaceSettings& DefaultSpaceSettings::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("ExecutionRole")) { m_executionRole = jsonValue.GetString("ExecutionRole"); m_executionRoleHasBeenSet = true; } if(jsonValue.ValueExists("SecurityGroups")) { Aws::Utils::Array securityGroupsJsonList = jsonValue.GetArray("SecurityGroups"); for(unsigned securityGroupsIndex = 0; securityGroupsIndex < securityGroupsJsonList.GetLength(); ++securityGroupsIndex) { m_securityGroups.push_back(securityGroupsJsonList[securityGroupsIndex].AsString()); } m_securityGroupsHasBeenSet = true; } if(jsonValue.ValueExists("JupyterServerAppSettings")) { m_jupyterServerAppSettings = jsonValue.GetObject("JupyterServerAppSettings"); m_jupyterServerAppSettingsHasBeenSet = true; } if(jsonValue.ValueExists("KernelGatewayAppSettings")) { m_kernelGatewayAppSettings = jsonValue.GetObject("KernelGatewayAppSettings"); m_kernelGatewayAppSettingsHasBeenSet = true; } return *this; } JsonValue DefaultSpaceSettings::Jsonize() const { JsonValue payload; if(m_executionRoleHasBeenSet) { payload.WithString("ExecutionRole", m_executionRole); } if(m_securityGroupsHasBeenSet) { Aws::Utils::Array securityGroupsJsonList(m_securityGroups.size()); for(unsigned securityGroupsIndex = 0; securityGroupsIndex < securityGroupsJsonList.GetLength(); ++securityGroupsIndex) { securityGroupsJsonList[securityGroupsIndex].AsString(m_securityGroups[securityGroupsIndex]); } payload.WithArray("SecurityGroups", std::move(securityGroupsJsonList)); } if(m_jupyterServerAppSettingsHasBeenSet) { payload.WithObject("JupyterServerAppSettings", m_jupyterServerAppSettings.Jsonize()); } if(m_kernelGatewayAppSettingsHasBeenSet) { payload.WithObject("KernelGatewayAppSettings", m_kernelGatewayAppSettings.Jsonize()); } return payload; } } // namespace Model } // namespace SageMaker } // namespace Aws