/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include #include #include #include using namespace Aws::QuickSight::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; DescribeDashboardDefinitionResult::DescribeDashboardDefinitionResult() : m_resourceStatus(ResourceStatus::NOT_SET), m_status(0) { } DescribeDashboardDefinitionResult::DescribeDashboardDefinitionResult(const Aws::AmazonWebServiceResult& result) : m_resourceStatus(ResourceStatus::NOT_SET), m_status(0) { *this = result; } DescribeDashboardDefinitionResult& DescribeDashboardDefinitionResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("DashboardId")) { m_dashboardId = jsonValue.GetString("DashboardId"); } if(jsonValue.ValueExists("Errors")) { Aws::Utils::Array errorsJsonList = jsonValue.GetArray("Errors"); for(unsigned errorsIndex = 0; errorsIndex < errorsJsonList.GetLength(); ++errorsIndex) { m_errors.push_back(errorsJsonList[errorsIndex].AsObject()); } } if(jsonValue.ValueExists("Name")) { m_name = jsonValue.GetString("Name"); } if(jsonValue.ValueExists("ResourceStatus")) { m_resourceStatus = ResourceStatusMapper::GetResourceStatusForName(jsonValue.GetString("ResourceStatus")); } if(jsonValue.ValueExists("ThemeArn")) { m_themeArn = jsonValue.GetString("ThemeArn"); } if(jsonValue.ValueExists("Definition")) { m_definition = jsonValue.GetObject("Definition"); } if(jsonValue.ValueExists("DashboardPublishOptions")) { m_dashboardPublishOptions = jsonValue.GetObject("DashboardPublishOptions"); } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } m_status = static_cast(result.GetResponseCode()); return *this; }