/** * 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::MQ::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; DescribeUserResult::DescribeUserResult() : m_consoleAccess(false), m_replicationUser(false) { } DescribeUserResult::DescribeUserResult(const Aws::AmazonWebServiceResult& result) : m_consoleAccess(false), m_replicationUser(false) { *this = result; } DescribeUserResult& DescribeUserResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("brokerId")) { m_brokerId = jsonValue.GetString("brokerId"); } if(jsonValue.ValueExists("consoleAccess")) { m_consoleAccess = jsonValue.GetBool("consoleAccess"); } if(jsonValue.ValueExists("groups")) { Aws::Utils::Array groupsJsonList = jsonValue.GetArray("groups"); for(unsigned groupsIndex = 0; groupsIndex < groupsJsonList.GetLength(); ++groupsIndex) { m_groups.push_back(groupsJsonList[groupsIndex].AsString()); } } if(jsonValue.ValueExists("pending")) { m_pending = jsonValue.GetObject("pending"); } if(jsonValue.ValueExists("username")) { m_username = jsonValue.GetString("username"); } if(jsonValue.ValueExists("replicationUser")) { m_replicationUser = jsonValue.GetBool("replicationUser"); } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }