/** * 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 AppStream { namespace Model { Entitlement::Entitlement() : m_nameHasBeenSet(false), m_stackNameHasBeenSet(false), m_descriptionHasBeenSet(false), m_appVisibility(AppVisibility::NOT_SET), m_appVisibilityHasBeenSet(false), m_attributesHasBeenSet(false), m_createdTimeHasBeenSet(false), m_lastModifiedTimeHasBeenSet(false) { } Entitlement::Entitlement(JsonView jsonValue) : m_nameHasBeenSet(false), m_stackNameHasBeenSet(false), m_descriptionHasBeenSet(false), m_appVisibility(AppVisibility::NOT_SET), m_appVisibilityHasBeenSet(false), m_attributesHasBeenSet(false), m_createdTimeHasBeenSet(false), m_lastModifiedTimeHasBeenSet(false) { *this = jsonValue; } Entitlement& Entitlement::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("Name")) { m_name = jsonValue.GetString("Name"); m_nameHasBeenSet = true; } if(jsonValue.ValueExists("StackName")) { m_stackName = jsonValue.GetString("StackName"); m_stackNameHasBeenSet = true; } if(jsonValue.ValueExists("Description")) { m_description = jsonValue.GetString("Description"); m_descriptionHasBeenSet = true; } if(jsonValue.ValueExists("AppVisibility")) { m_appVisibility = AppVisibilityMapper::GetAppVisibilityForName(jsonValue.GetString("AppVisibility")); m_appVisibilityHasBeenSet = true; } if(jsonValue.ValueExists("Attributes")) { Aws::Utils::Array attributesJsonList = jsonValue.GetArray("Attributes"); for(unsigned attributesIndex = 0; attributesIndex < attributesJsonList.GetLength(); ++attributesIndex) { m_attributes.push_back(attributesJsonList[attributesIndex].AsObject()); } m_attributesHasBeenSet = true; } if(jsonValue.ValueExists("CreatedTime")) { m_createdTime = jsonValue.GetDouble("CreatedTime"); m_createdTimeHasBeenSet = true; } if(jsonValue.ValueExists("LastModifiedTime")) { m_lastModifiedTime = jsonValue.GetDouble("LastModifiedTime"); m_lastModifiedTimeHasBeenSet = true; } return *this; } JsonValue Entitlement::Jsonize() const { JsonValue payload; if(m_nameHasBeenSet) { payload.WithString("Name", m_name); } if(m_stackNameHasBeenSet) { payload.WithString("StackName", m_stackName); } if(m_descriptionHasBeenSet) { payload.WithString("Description", m_description); } if(m_appVisibilityHasBeenSet) { payload.WithString("AppVisibility", AppVisibilityMapper::GetNameForAppVisibility(m_appVisibility)); } if(m_attributesHasBeenSet) { Aws::Utils::Array attributesJsonList(m_attributes.size()); for(unsigned attributesIndex = 0; attributesIndex < attributesJsonList.GetLength(); ++attributesIndex) { attributesJsonList[attributesIndex].AsObject(m_attributes[attributesIndex].Jsonize()); } payload.WithArray("Attributes", std::move(attributesJsonList)); } if(m_createdTimeHasBeenSet) { payload.WithDouble("CreatedTime", m_createdTime.SecondsWithMSPrecision()); } if(m_lastModifiedTimeHasBeenSet) { payload.WithDouble("LastModifiedTime", m_lastModifiedTime.SecondsWithMSPrecision()); } return payload; } } // namespace Model } // namespace AppStream } // namespace Aws