/** * 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::DataSync::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; DescribeAgentResult::DescribeAgentResult() : m_status(AgentStatus::NOT_SET), m_endpointType(EndpointType::NOT_SET) { } DescribeAgentResult::DescribeAgentResult(const Aws::AmazonWebServiceResult& result) : m_status(AgentStatus::NOT_SET), m_endpointType(EndpointType::NOT_SET) { *this = result; } DescribeAgentResult& DescribeAgentResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("AgentArn")) { m_agentArn = jsonValue.GetString("AgentArn"); } if(jsonValue.ValueExists("Name")) { m_name = jsonValue.GetString("Name"); } if(jsonValue.ValueExists("Status")) { m_status = AgentStatusMapper::GetAgentStatusForName(jsonValue.GetString("Status")); } if(jsonValue.ValueExists("LastConnectionTime")) { m_lastConnectionTime = jsonValue.GetDouble("LastConnectionTime"); } if(jsonValue.ValueExists("CreationTime")) { m_creationTime = jsonValue.GetDouble("CreationTime"); } if(jsonValue.ValueExists("EndpointType")) { m_endpointType = EndpointTypeMapper::GetEndpointTypeForName(jsonValue.GetString("EndpointType")); } if(jsonValue.ValueExists("PrivateLinkConfig")) { m_privateLinkConfig = jsonValue.GetObject("PrivateLinkConfig"); } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }