/** * 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; UpdateBotLocaleResult::UpdateBotLocaleResult() : m_nluIntentConfidenceThreshold(0.0), m_botLocaleStatus(BotLocaleStatus::NOT_SET) { } UpdateBotLocaleResult::UpdateBotLocaleResult(const Aws::AmazonWebServiceResult& result) : m_nluIntentConfidenceThreshold(0.0), m_botLocaleStatus(BotLocaleStatus::NOT_SET) { *this = result; } UpdateBotLocaleResult& UpdateBotLocaleResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); 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("localeName")) { m_localeName = jsonValue.GetString("localeName"); } if(jsonValue.ValueExists("description")) { m_description = jsonValue.GetString("description"); } if(jsonValue.ValueExists("nluIntentConfidenceThreshold")) { m_nluIntentConfidenceThreshold = jsonValue.GetDouble("nluIntentConfidenceThreshold"); } if(jsonValue.ValueExists("voiceSettings")) { m_voiceSettings = jsonValue.GetObject("voiceSettings"); } if(jsonValue.ValueExists("botLocaleStatus")) { m_botLocaleStatus = BotLocaleStatusMapper::GetBotLocaleStatusForName(jsonValue.GetString("botLocaleStatus")); } if(jsonValue.ValueExists("failureReasons")) { Aws::Utils::Array failureReasonsJsonList = jsonValue.GetArray("failureReasons"); for(unsigned failureReasonsIndex = 0; failureReasonsIndex < failureReasonsJsonList.GetLength(); ++failureReasonsIndex) { m_failureReasons.push_back(failureReasonsJsonList[failureReasonsIndex].AsString()); } } if(jsonValue.ValueExists("creationDateTime")) { m_creationDateTime = jsonValue.GetDouble("creationDateTime"); } if(jsonValue.ValueExists("lastUpdatedDateTime")) { m_lastUpdatedDateTime = jsonValue.GetDouble("lastUpdatedDateTime"); } if(jsonValue.ValueExists("recommendedActions")) { Aws::Utils::Array recommendedActionsJsonList = jsonValue.GetArray("recommendedActions"); for(unsigned recommendedActionsIndex = 0; recommendedActionsIndex < recommendedActionsJsonList.GetLength(); ++recommendedActionsIndex) { m_recommendedActions.push_back(recommendedActionsJsonList[recommendedActionsIndex].AsString()); } } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }