/** * 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 { RealTimeInferenceRecommendation::RealTimeInferenceRecommendation() : m_recommendationIdHasBeenSet(false), m_instanceType(ProductionVariantInstanceType::NOT_SET), m_instanceTypeHasBeenSet(false), m_environmentHasBeenSet(false) { } RealTimeInferenceRecommendation::RealTimeInferenceRecommendation(JsonView jsonValue) : m_recommendationIdHasBeenSet(false), m_instanceType(ProductionVariantInstanceType::NOT_SET), m_instanceTypeHasBeenSet(false), m_environmentHasBeenSet(false) { *this = jsonValue; } RealTimeInferenceRecommendation& RealTimeInferenceRecommendation::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("RecommendationId")) { m_recommendationId = jsonValue.GetString("RecommendationId"); m_recommendationIdHasBeenSet = true; } if(jsonValue.ValueExists("InstanceType")) { m_instanceType = ProductionVariantInstanceTypeMapper::GetProductionVariantInstanceTypeForName(jsonValue.GetString("InstanceType")); m_instanceTypeHasBeenSet = true; } if(jsonValue.ValueExists("Environment")) { Aws::Map environmentJsonMap = jsonValue.GetObject("Environment").GetAllObjects(); for(auto& environmentItem : environmentJsonMap) { m_environment[environmentItem.first] = environmentItem.second.AsString(); } m_environmentHasBeenSet = true; } return *this; } JsonValue RealTimeInferenceRecommendation::Jsonize() const { JsonValue payload; if(m_recommendationIdHasBeenSet) { payload.WithString("RecommendationId", m_recommendationId); } if(m_instanceTypeHasBeenSet) { payload.WithString("InstanceType", ProductionVariantInstanceTypeMapper::GetNameForProductionVariantInstanceType(m_instanceType)); } if(m_environmentHasBeenSet) { JsonValue environmentJsonMap; for(auto& environmentItem : m_environment) { environmentJsonMap.WithString(environmentItem.first, environmentItem.second); } payload.WithObject("Environment", std::move(environmentJsonMap)); } return payload; } } // namespace Model } // namespace SageMaker } // namespace Aws