/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include #include #include using namespace Aws::Polly::Model; using namespace Aws::Utils::Stream; using namespace Aws::Utils; using namespace Aws; SynthesizeSpeechResult::SynthesizeSpeechResult() : m_requestCharacters(0) { } SynthesizeSpeechResult::SynthesizeSpeechResult(SynthesizeSpeechResult&& toMove) : m_audioStream(std::move(toMove.m_audioStream)), m_contentType(std::move(toMove.m_contentType)), m_requestCharacters(toMove.m_requestCharacters), m_requestId(std::move(toMove.m_requestId)) { } SynthesizeSpeechResult& SynthesizeSpeechResult::operator=(SynthesizeSpeechResult&& toMove) { if(this == &toMove) { return *this; } m_audioStream = std::move(toMove.m_audioStream); m_contentType = std::move(toMove.m_contentType); m_requestCharacters = toMove.m_requestCharacters; m_requestId = std::move(toMove.m_requestId); return *this; } SynthesizeSpeechResult::SynthesizeSpeechResult(Aws::AmazonWebServiceResult&& result) : m_requestCharacters(0) { *this = std::move(result); } SynthesizeSpeechResult& SynthesizeSpeechResult::operator =(Aws::AmazonWebServiceResult&& result) { m_audioStream = result.TakeOwnershipOfPayload(); const auto& headers = result.GetHeaderValueCollection(); const auto& contentTypeIter = headers.find("content-type"); if(contentTypeIter != headers.end()) { m_contentType = contentTypeIter->second; } const auto& requestCharactersIter = headers.find("x-amzn-requestcharacters"); if(requestCharactersIter != headers.end()) { m_requestCharacters = StringUtils::ConvertToInt32(requestCharactersIter->second.c_str()); } const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }