/** * 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::VPCLattice::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; UpdateRuleResult::UpdateRuleResult() : m_isDefault(false), m_priority(0) { } UpdateRuleResult::UpdateRuleResult(const Aws::AmazonWebServiceResult& result) : m_isDefault(false), m_priority(0) { *this = result; } UpdateRuleResult& UpdateRuleResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("action")) { m_action = jsonValue.GetObject("action"); } if(jsonValue.ValueExists("arn")) { m_arn = jsonValue.GetString("arn"); } if(jsonValue.ValueExists("id")) { m_id = jsonValue.GetString("id"); } if(jsonValue.ValueExists("isDefault")) { m_isDefault = jsonValue.GetBool("isDefault"); } if(jsonValue.ValueExists("match")) { m_match = jsonValue.GetObject("match"); } if(jsonValue.ValueExists("name")) { m_name = jsonValue.GetString("name"); } if(jsonValue.ValueExists("priority")) { m_priority = jsonValue.GetInteger("priority"); } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }