/** * 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; PutPartnerEventsResult::PutPartnerEventsResult() : m_failedEntryCount(0) { } PutPartnerEventsResult::PutPartnerEventsResult(const Aws::AmazonWebServiceResult& result) : m_failedEntryCount(0) { *this = result; } PutPartnerEventsResult& PutPartnerEventsResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("FailedEntryCount")) { m_failedEntryCount = jsonValue.GetInteger("FailedEntryCount"); } if(jsonValue.ValueExists("Entries")) { Aws::Utils::Array entriesJsonList = jsonValue.GetArray("Entries"); for(unsigned entriesIndex = 0; entriesIndex < entriesJsonList.GetLength(); ++entriesIndex) { m_entries.push_back(entriesJsonList[entriesIndex].AsObject()); } } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }