/** * 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::CloudTrail::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; UpdateEventDataStoreResult::UpdateEventDataStoreResult() : m_status(EventDataStoreStatus::NOT_SET), m_multiRegionEnabled(false), m_organizationEnabled(false), m_retentionPeriod(0), m_terminationProtectionEnabled(false) { } UpdateEventDataStoreResult::UpdateEventDataStoreResult(const Aws::AmazonWebServiceResult& result) : m_status(EventDataStoreStatus::NOT_SET), m_multiRegionEnabled(false), m_organizationEnabled(false), m_retentionPeriod(0), m_terminationProtectionEnabled(false) { *this = result; } UpdateEventDataStoreResult& UpdateEventDataStoreResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("EventDataStoreArn")) { m_eventDataStoreArn = jsonValue.GetString("EventDataStoreArn"); } if(jsonValue.ValueExists("Name")) { m_name = jsonValue.GetString("Name"); } if(jsonValue.ValueExists("Status")) { m_status = EventDataStoreStatusMapper::GetEventDataStoreStatusForName(jsonValue.GetString("Status")); } if(jsonValue.ValueExists("AdvancedEventSelectors")) { Aws::Utils::Array advancedEventSelectorsJsonList = jsonValue.GetArray("AdvancedEventSelectors"); for(unsigned advancedEventSelectorsIndex = 0; advancedEventSelectorsIndex < advancedEventSelectorsJsonList.GetLength(); ++advancedEventSelectorsIndex) { m_advancedEventSelectors.push_back(advancedEventSelectorsJsonList[advancedEventSelectorsIndex].AsObject()); } } if(jsonValue.ValueExists("MultiRegionEnabled")) { m_multiRegionEnabled = jsonValue.GetBool("MultiRegionEnabled"); } if(jsonValue.ValueExists("OrganizationEnabled")) { m_organizationEnabled = jsonValue.GetBool("OrganizationEnabled"); } if(jsonValue.ValueExists("RetentionPeriod")) { m_retentionPeriod = jsonValue.GetInteger("RetentionPeriod"); } if(jsonValue.ValueExists("TerminationProtectionEnabled")) { m_terminationProtectionEnabled = jsonValue.GetBool("TerminationProtectionEnabled"); } if(jsonValue.ValueExists("CreatedTimestamp")) { m_createdTimestamp = jsonValue.GetDouble("CreatedTimestamp"); } if(jsonValue.ValueExists("UpdatedTimestamp")) { m_updatedTimestamp = jsonValue.GetDouble("UpdatedTimestamp"); } if(jsonValue.ValueExists("KmsKeyId")) { m_kmsKeyId = jsonValue.GetString("KmsKeyId"); } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }