/** * 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::LexModelsV2::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; UpdateIntentResult::UpdateIntentResult() { } UpdateIntentResult::UpdateIntentResult(const Aws::AmazonWebServiceResult& result) { *this = result; } UpdateIntentResult& UpdateIntentResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("intentId")) { m_intentId = jsonValue.GetString("intentId"); } if(jsonValue.ValueExists("intentName")) { m_intentName = jsonValue.GetString("intentName"); } if(jsonValue.ValueExists("description")) { m_description = jsonValue.GetString("description"); } if(jsonValue.ValueExists("parentIntentSignature")) { m_parentIntentSignature = jsonValue.GetString("parentIntentSignature"); } if(jsonValue.ValueExists("sampleUtterances")) { Aws::Utils::Array sampleUtterancesJsonList = jsonValue.GetArray("sampleUtterances"); for(unsigned sampleUtterancesIndex = 0; sampleUtterancesIndex < sampleUtterancesJsonList.GetLength(); ++sampleUtterancesIndex) { m_sampleUtterances.push_back(sampleUtterancesJsonList[sampleUtterancesIndex].AsObject()); } } if(jsonValue.ValueExists("dialogCodeHook")) { m_dialogCodeHook = jsonValue.GetObject("dialogCodeHook"); } if(jsonValue.ValueExists("fulfillmentCodeHook")) { m_fulfillmentCodeHook = jsonValue.GetObject("fulfillmentCodeHook"); } if(jsonValue.ValueExists("slotPriorities")) { Aws::Utils::Array slotPrioritiesJsonList = jsonValue.GetArray("slotPriorities"); for(unsigned slotPrioritiesIndex = 0; slotPrioritiesIndex < slotPrioritiesJsonList.GetLength(); ++slotPrioritiesIndex) { m_slotPriorities.push_back(slotPrioritiesJsonList[slotPrioritiesIndex].AsObject()); } } if(jsonValue.ValueExists("intentConfirmationSetting")) { m_intentConfirmationSetting = jsonValue.GetObject("intentConfirmationSetting"); } if(jsonValue.ValueExists("intentClosingSetting")) { m_intentClosingSetting = jsonValue.GetObject("intentClosingSetting"); } if(jsonValue.ValueExists("inputContexts")) { Aws::Utils::Array inputContextsJsonList = jsonValue.GetArray("inputContexts"); for(unsigned inputContextsIndex = 0; inputContextsIndex < inputContextsJsonList.GetLength(); ++inputContextsIndex) { m_inputContexts.push_back(inputContextsJsonList[inputContextsIndex].AsObject()); } } if(jsonValue.ValueExists("outputContexts")) { Aws::Utils::Array outputContextsJsonList = jsonValue.GetArray("outputContexts"); for(unsigned outputContextsIndex = 0; outputContextsIndex < outputContextsJsonList.GetLength(); ++outputContextsIndex) { m_outputContexts.push_back(outputContextsJsonList[outputContextsIndex].AsObject()); } } if(jsonValue.ValueExists("kendraConfiguration")) { m_kendraConfiguration = jsonValue.GetObject("kendraConfiguration"); } if(jsonValue.ValueExists("botId")) { m_botId = jsonValue.GetString("botId"); } if(jsonValue.ValueExists("botVersion")) { m_botVersion = jsonValue.GetString("botVersion"); } if(jsonValue.ValueExists("localeId")) { m_localeId = jsonValue.GetString("localeId"); } if(jsonValue.ValueExists("creationDateTime")) { m_creationDateTime = jsonValue.GetDouble("creationDateTime"); } if(jsonValue.ValueExists("lastUpdatedDateTime")) { m_lastUpdatedDateTime = jsonValue.GetDouble("lastUpdatedDateTime"); } if(jsonValue.ValueExists("initialResponseSetting")) { m_initialResponseSetting = jsonValue.GetObject("initialResponseSetting"); } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }