/** * 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::LexModelBuildingService::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; GetExportResult::GetExportResult() : m_resourceType(ResourceType::NOT_SET), m_exportType(ExportType::NOT_SET), m_exportStatus(ExportStatus::NOT_SET) { } GetExportResult::GetExportResult(const Aws::AmazonWebServiceResult& result) : m_resourceType(ResourceType::NOT_SET), m_exportType(ExportType::NOT_SET), m_exportStatus(ExportStatus::NOT_SET) { *this = result; } GetExportResult& GetExportResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("name")) { m_name = jsonValue.GetString("name"); } if(jsonValue.ValueExists("version")) { m_version = jsonValue.GetString("version"); } if(jsonValue.ValueExists("resourceType")) { m_resourceType = ResourceTypeMapper::GetResourceTypeForName(jsonValue.GetString("resourceType")); } if(jsonValue.ValueExists("exportType")) { m_exportType = ExportTypeMapper::GetExportTypeForName(jsonValue.GetString("exportType")); } if(jsonValue.ValueExists("exportStatus")) { m_exportStatus = ExportStatusMapper::GetExportStatusForName(jsonValue.GetString("exportStatus")); } if(jsonValue.ValueExists("failureReason")) { m_failureReason = jsonValue.GetString("failureReason"); } if(jsonValue.ValueExists("url")) { m_url = jsonValue.GetString("url"); } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }