/** * 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::LexModelBuildingService::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; GetBuiltinIntentResult::GetBuiltinIntentResult() { } GetBuiltinIntentResult::GetBuiltinIntentResult(const Aws::AmazonWebServiceResult& result) { *this = result; } GetBuiltinIntentResult& GetBuiltinIntentResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("signature")) { m_signature = jsonValue.GetString("signature"); } if(jsonValue.ValueExists("supportedLocales")) { Aws::Utils::Array supportedLocalesJsonList = jsonValue.GetArray("supportedLocales"); for(unsigned supportedLocalesIndex = 0; supportedLocalesIndex < supportedLocalesJsonList.GetLength(); ++supportedLocalesIndex) { m_supportedLocales.push_back(LocaleMapper::GetLocaleForName(supportedLocalesJsonList[supportedLocalesIndex].AsString())); } } if(jsonValue.ValueExists("slots")) { Aws::Utils::Array slotsJsonList = jsonValue.GetArray("slots"); for(unsigned slotsIndex = 0; slotsIndex < slotsJsonList.GetLength(); ++slotsIndex) { m_slots.push_back(slotsJsonList[slotsIndex].AsObject()); } } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }