/** * 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::EventBridge::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; CreateEndpointResult::CreateEndpointResult() : m_state(EndpointState::NOT_SET) { } CreateEndpointResult::CreateEndpointResult(const Aws::AmazonWebServiceResult& result) : m_state(EndpointState::NOT_SET) { *this = result; } CreateEndpointResult& CreateEndpointResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("Name")) { m_name = jsonValue.GetString("Name"); } if(jsonValue.ValueExists("Arn")) { m_arn = jsonValue.GetString("Arn"); } if(jsonValue.ValueExists("RoutingConfig")) { m_routingConfig = jsonValue.GetObject("RoutingConfig"); } if(jsonValue.ValueExists("ReplicationConfig")) { m_replicationConfig = jsonValue.GetObject("ReplicationConfig"); } if(jsonValue.ValueExists("EventBuses")) { Aws::Utils::Array eventBusesJsonList = jsonValue.GetArray("EventBuses"); for(unsigned eventBusesIndex = 0; eventBusesIndex < eventBusesJsonList.GetLength(); ++eventBusesIndex) { m_eventBuses.push_back(eventBusesJsonList[eventBusesIndex].AsObject()); } } if(jsonValue.ValueExists("RoleArn")) { m_roleArn = jsonValue.GetString("RoleArn"); } if(jsonValue.ValueExists("State")) { m_state = EndpointStateMapper::GetEndpointStateForName(jsonValue.GetString("State")); } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }