feat(hos_client_create, hos_client_destory): 多次调用destory不会导致重复释放

This commit is contained in:
彭宣正
2020-12-14 17:24:58 +08:00
parent 505d529c32
commit 10b370e486
55976 changed files with 8544395 additions and 2 deletions

View File

@@ -0,0 +1,133 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/transcribestreaming/TranscribeStreamingService_EXPORTS.h>
#include <aws/transcribestreaming/TranscribeStreamingServiceErrors.h>
#include <aws/core/client/AWSError.h>
#include <aws/core/client/ClientConfiguration.h>
#include <aws/core/client/AWSClient.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/NoResult.h>
#include <aws/core/client/AsyncCallerContext.h>
#include <aws/core/http/HttpTypes.h>
#include <future>
#include <functional>
namespace Aws
{
namespace Http
{
class HttpClient;
class HttpClientFactory;
} // namespace Http
namespace Utils
{
template< typename R, typename E> class Outcome;
namespace Event
{
class EventEncoderStream;
}
namespace Threading
{
class Executor;
} // namespace Threading
} // namespace Utils
namespace Auth
{
class AWSCredentials;
class AWSCredentialsProvider;
} // namespace Auth
namespace Client
{
class RetryStrategy;
} // namespace Client
namespace TranscribeStreamingService
{
namespace Model
{
class StartStreamTranscriptionRequest;
class AudioStream;
typedef Aws::Utils::Outcome<Aws::NoResult, TranscribeStreamingServiceError> StartStreamTranscriptionOutcome;
typedef std::future<StartStreamTranscriptionOutcome> StartStreamTranscriptionOutcomeCallable;
} // namespace Model
class TranscribeStreamingServiceClient;
typedef std::function<void(Model::AudioStream&)> StartStreamTranscriptionStreamReadyHandler;
typedef std::function<void(const TranscribeStreamingServiceClient*, const Model::StartStreamTranscriptionRequest&, const Model::StartStreamTranscriptionOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > StartStreamTranscriptionResponseReceivedHandler;
/**
* <p>Operations and objects for transcribing streaming speech to text.</p>
*/
class AWS_TRANSCRIBESTREAMINGSERVICE_API TranscribeStreamingServiceClient : public Aws::Client::AWSJsonClient
{
public:
typedef Aws::Client::AWSJsonClient BASECLASS;
/**
* Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config
* is not specified, it will be initialized to default values.
*/
TranscribeStreamingServiceClient(const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration());
/**
* Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config
* is not specified, it will be initialized to default values.
*/
TranscribeStreamingServiceClient(const Aws::Auth::AWSCredentials& credentials, const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration());
/**
* Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied,
* the default http client factory will be used
*/
TranscribeStreamingServiceClient(const std::shared_ptr<Aws::Auth::AWSCredentialsProvider>& credentialsProvider,
const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration());
virtual ~TranscribeStreamingServiceClient();
/**
* <p>Starts a bidirectional HTTP2 stream where audio is streamed to Amazon
* Transcribe and the transcription results are streamed to your application.</p>
* <p>The following are encoded as HTTP2 headers:</p> <ul> <li>
* <p>x-amzn-transcribe-language-code</p> </li> <li>
* <p>x-amzn-transcribe-media-encoding</p> </li> <li>
* <p>x-amzn-transcribe-sample-rate</p> </li> <li>
* <p>x-amzn-transcribe-session-id</p> </li> </ul><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/StartStreamTranscription">AWS
* API Reference</a></p>
*
* Queues the request into a thread executor.
* The streamReadyHandler is triggered when the stream is ready to be written to.
* The responseHandler is triggered when the request is finished.
*/
virtual void StartStreamTranscriptionAsync(Model::StartStreamTranscriptionRequest& request,
const StartStreamTranscriptionStreamReadyHandler& streamReadyHandler,
const StartStreamTranscriptionResponseReceivedHandler& responseHandler,
const std::shared_ptr<const Aws::Client::AsyncCallerContext>& handlerContext = nullptr) const;
void OverrideEndpoint(const Aws::String& endpoint);
private:
void init(const Aws::Client::ClientConfiguration& clientConfiguration);
Aws::String m_uri;
Aws::String m_configScheme;
std::shared_ptr<Aws::Utils::Threading::Executor> m_executor;
};
} // namespace TranscribeStreamingService
} // namespace Aws

View File

@@ -0,0 +1,21 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/transcribestreaming/TranscribeStreamingService_EXPORTS.h>
#include <aws/core/Region.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace TranscribeStreamingService
{
namespace TranscribeStreamingServiceEndpoint
{
AWS_TRANSCRIBESTREAMINGSERVICE_API Aws::String ForRegion(const Aws::String& regionName, bool useDualStack = false);
} // namespace TranscribeStreamingServiceEndpoint
} // namespace TranscribeStreamingService
} // namespace Aws

View File

@@ -0,0 +1,23 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/transcribestreaming/TranscribeStreamingService_EXPORTS.h>
#include <aws/core/client/AWSErrorMarshaller.h>
namespace Aws
{
namespace Client
{
class AWS_TRANSCRIBESTREAMINGSERVICE_API TranscribeStreamingServiceErrorMarshaller : public Aws::Client::JsonErrorMarshaller
{
public:
Aws::Client::AWSError<Aws::Client::CoreErrors> FindErrorByName(const char* exceptionName) const override;
};
} // namespace Client
} // namespace Aws

View File

@@ -0,0 +1,74 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/core/client/AWSError.h>
#include <aws/core/client/CoreErrors.h>
#include <aws/transcribestreaming/TranscribeStreamingService_EXPORTS.h>
namespace Aws
{
namespace TranscribeStreamingService
{
enum class TranscribeStreamingServiceErrors
{
//From Core//
//////////////////////////////////////////////////////////////////////////////////////////
INCOMPLETE_SIGNATURE = 0,
INTERNAL_FAILURE = 1,
INVALID_ACTION = 2,
INVALID_CLIENT_TOKEN_ID = 3,
INVALID_PARAMETER_COMBINATION = 4,
INVALID_QUERY_PARAMETER = 5,
INVALID_PARAMETER_VALUE = 6,
MISSING_ACTION = 7, // SDK should never allow
MISSING_AUTHENTICATION_TOKEN = 8, // SDK should never allow
MISSING_PARAMETER = 9, // SDK should never allow
OPT_IN_REQUIRED = 10,
REQUEST_EXPIRED = 11,
SERVICE_UNAVAILABLE = 12,
THROTTLING = 13,
VALIDATION = 14,
ACCESS_DENIED = 15,
RESOURCE_NOT_FOUND = 16,
UNRECOGNIZED_CLIENT = 17,
MALFORMED_QUERY_STRING = 18,
SLOW_DOWN = 19,
REQUEST_TIME_TOO_SKEWED = 20,
INVALID_SIGNATURE = 21,
SIGNATURE_DOES_NOT_MATCH = 22,
INVALID_ACCESS_KEY_ID = 23,
REQUEST_TIMEOUT = 24,
NETWORK_CONNECTION = 99,
UNKNOWN = 100,
///////////////////////////////////////////////////////////////////////////////////////////
BAD_REQUEST= static_cast<int>(Aws::Client::CoreErrors::SERVICE_EXTENSION_START_RANGE) + 1,
CONFLICT,
LIMIT_EXCEEDED
};
class AWS_TRANSCRIBESTREAMINGSERVICE_API TranscribeStreamingServiceError : public Aws::Client::AWSError<TranscribeStreamingServiceErrors>
{
public:
TranscribeStreamingServiceError() {}
TranscribeStreamingServiceError(const Aws::Client::AWSError<Aws::Client::CoreErrors>& rhs) : Aws::Client::AWSError<TranscribeStreamingServiceErrors>(rhs) {}
TranscribeStreamingServiceError(Aws::Client::AWSError<Aws::Client::CoreErrors>&& rhs) : Aws::Client::AWSError<TranscribeStreamingServiceErrors>(rhs) {}
TranscribeStreamingServiceError(const Aws::Client::AWSError<TranscribeStreamingServiceErrors>& rhs) : Aws::Client::AWSError<TranscribeStreamingServiceErrors>(rhs) {}
TranscribeStreamingServiceError(Aws::Client::AWSError<TranscribeStreamingServiceErrors>&& rhs) : Aws::Client::AWSError<TranscribeStreamingServiceErrors>(rhs) {}
template <typename T>
T GetModeledError();
};
namespace TranscribeStreamingServiceErrorMapper
{
AWS_TRANSCRIBESTREAMINGSERVICE_API Aws::Client::AWSError<Aws::Client::CoreErrors> GetErrorForName(const char* errorName);
}
} // namespace TranscribeStreamingService
} // namespace Aws

View File

@@ -0,0 +1,44 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/transcribestreaming/TranscribeStreamingService_EXPORTS.h>
#include <aws/core/AmazonSerializableWebServiceRequest.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <aws/core/http/HttpRequest.h>
#include <aws/core/AmazonStreamingWebServiceRequest.h>
namespace Aws
{
namespace TranscribeStreamingService
{
class AWS_TRANSCRIBESTREAMINGSERVICE_API TranscribeStreamingServiceRequest : public Aws::AmazonSerializableWebServiceRequest
{
public:
virtual ~TranscribeStreamingServiceRequest () {}
void AddParametersToRequest(Aws::Http::HttpRequest& httpRequest) const { AWS_UNREFERENCED_PARAM(httpRequest); }
inline Aws::Http::HeaderValueCollection GetHeaders() const override
{
auto headers = GetRequestSpecificHeaders();
if(headers.size() == 0 || (headers.size() > 0 && headers.count(Aws::Http::CONTENT_TYPE_HEADER) == 0))
{
headers.emplace(Aws::Http::HeaderValuePair(Aws::Http::CONTENT_TYPE_HEADER, Aws::AMZN_JSON_CONTENT_TYPE_1_1 ));
}
headers.emplace(Aws::Http::HeaderValuePair(Aws::Http::API_VERSION_HEADER, "2017-10-26"));
return headers;
}
protected:
virtual Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const { return Aws::Http::HeaderValueCollection(); }
};
typedef Aws::AmazonStreamingWebServiceRequest StreamingTranscribeStreamingServiceRequest;
} // namespace TranscribeStreamingService
} // namespace Aws

View File

@@ -0,0 +1,29 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#ifdef _MSC_VER
//disable windows complaining about max template size.
#pragma warning (disable : 4503)
#endif // _MSC_VER
#if defined (USE_WINDOWS_DLL_SEMANTICS) || defined (_WIN32)
#ifdef _MSC_VER
#pragma warning(disable : 4251)
#endif // _MSC_VER
#ifdef USE_IMPORT_EXPORT
#ifdef AWS_TRANSCRIBESTREAMINGSERVICE_EXPORTS
#define AWS_TRANSCRIBESTREAMINGSERVICE_API __declspec(dllexport)
#else
#define AWS_TRANSCRIBESTREAMINGSERVICE_API __declspec(dllimport)
#endif /* AWS_TRANSCRIBESTREAMINGSERVICE_EXPORTS */
#else
#define AWS_TRANSCRIBESTREAMINGSERVICE_API
#endif // USE_IMPORT_EXPORT
#else // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (WIN32)
#define AWS_TRANSCRIBESTREAMINGSERVICE_API
#endif // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (WIN32)

View File

@@ -0,0 +1,135 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/transcribestreaming/TranscribeStreamingService_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/transcribestreaming/model/Item.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace TranscribeStreamingService
{
namespace Model
{
/**
* <p>A list of possible transcriptions for the audio.</p><p><h3>See Also:</h3>
* <a
* href="http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/Alternative">AWS
* API Reference</a></p>
*/
class AWS_TRANSCRIBESTREAMINGSERVICE_API Alternative
{
public:
Alternative();
Alternative(Aws::Utils::Json::JsonView jsonValue);
Alternative& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>The text that was transcribed from the audio.</p>
*/
inline const Aws::String& GetTranscript() const{ return m_transcript; }
/**
* <p>The text that was transcribed from the audio.</p>
*/
inline bool TranscriptHasBeenSet() const { return m_transcriptHasBeenSet; }
/**
* <p>The text that was transcribed from the audio.</p>
*/
inline void SetTranscript(const Aws::String& value) { m_transcriptHasBeenSet = true; m_transcript = value; }
/**
* <p>The text that was transcribed from the audio.</p>
*/
inline void SetTranscript(Aws::String&& value) { m_transcriptHasBeenSet = true; m_transcript = std::move(value); }
/**
* <p>The text that was transcribed from the audio.</p>
*/
inline void SetTranscript(const char* value) { m_transcriptHasBeenSet = true; m_transcript.assign(value); }
/**
* <p>The text that was transcribed from the audio.</p>
*/
inline Alternative& WithTranscript(const Aws::String& value) { SetTranscript(value); return *this;}
/**
* <p>The text that was transcribed from the audio.</p>
*/
inline Alternative& WithTranscript(Aws::String&& value) { SetTranscript(std::move(value)); return *this;}
/**
* <p>The text that was transcribed from the audio.</p>
*/
inline Alternative& WithTranscript(const char* value) { SetTranscript(value); return *this;}
/**
* <p>One or more alternative interpretations of the input audio. </p>
*/
inline const Aws::Vector<Item>& GetItems() const{ return m_items; }
/**
* <p>One or more alternative interpretations of the input audio. </p>
*/
inline bool ItemsHasBeenSet() const { return m_itemsHasBeenSet; }
/**
* <p>One or more alternative interpretations of the input audio. </p>
*/
inline void SetItems(const Aws::Vector<Item>& value) { m_itemsHasBeenSet = true; m_items = value; }
/**
* <p>One or more alternative interpretations of the input audio. </p>
*/
inline void SetItems(Aws::Vector<Item>&& value) { m_itemsHasBeenSet = true; m_items = std::move(value); }
/**
* <p>One or more alternative interpretations of the input audio. </p>
*/
inline Alternative& WithItems(const Aws::Vector<Item>& value) { SetItems(value); return *this;}
/**
* <p>One or more alternative interpretations of the input audio. </p>
*/
inline Alternative& WithItems(Aws::Vector<Item>&& value) { SetItems(std::move(value)); return *this;}
/**
* <p>One or more alternative interpretations of the input audio. </p>
*/
inline Alternative& AddItems(const Item& value) { m_itemsHasBeenSet = true; m_items.push_back(value); return *this; }
/**
* <p>One or more alternative interpretations of the input audio. </p>
*/
inline Alternative& AddItems(Item&& value) { m_itemsHasBeenSet = true; m_items.push_back(std::move(value)); return *this; }
private:
Aws::String m_transcript;
bool m_transcriptHasBeenSet;
Aws::Vector<Item> m_items;
bool m_itemsHasBeenSet;
};
} // namespace Model
} // namespace TranscribeStreamingService
} // namespace Aws

View File

@@ -0,0 +1,73 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/transcribestreaming/TranscribeStreamingService_EXPORTS.h>
#include <aws/core/utils/Array.h>
#include <utility>
namespace Aws
{
namespace TranscribeStreamingService
{
namespace Model
{
/**
* <p>Provides a wrapper for the audio chunks that you are sending.</p><p><h3>See
* Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/AudioEvent">AWS
* API Reference</a></p>
*/
class AWS_TRANSCRIBESTREAMINGSERVICE_API AudioEvent
{
public:
AudioEvent() = default;
AudioEvent(Aws::Vector<unsigned char>&& value) { m_audioChunk = std::move(value); }
/**
* <p>An audio blob that contains the next part of the audio that you want to
* transcribe.</p>
*/
inline const Aws::Vector<unsigned char>& GetAudioChunk() const { return m_audioChunk; }
/**
* <p>An audio blob that contains the next part of the audio that you want to
* transcribe.</p>
*/
inline Aws::Vector<unsigned char>&& GetAudioChunkWithOwnership() { return std::move(m_audioChunk); }
/**
* <p>An audio blob that contains the next part of the audio that you want to
* transcribe.</p>
*/
inline void SetAudioChunk(const Aws::Vector<unsigned char>& value) { m_audioChunkHasBeenSet = true; m_audioChunk = value; }
/**
* <p>An audio blob that contains the next part of the audio that you want to
* transcribe.</p>
*/
inline void SetAudioChunk(Aws::Vector<unsigned char>&& value) { m_audioChunkHasBeenSet = true; m_audioChunk = std::move(value); }
/**
* <p>An audio blob that contains the next part of the audio that you want to
* transcribe.</p>
*/
inline AudioEvent& WithAudioChunk(const Aws::Vector<unsigned char>& value) { SetAudioChunk(value); return *this;}
/**
* <p>An audio blob that contains the next part of the audio that you want to
* transcribe.</p>
*/
inline AudioEvent& WithAudioChunk(Aws::Vector<unsigned char>&& value) { SetAudioChunk(std::move(value)); return *this;}
private:
Aws::Vector<unsigned char> m_audioChunk;
bool m_audioChunkHasBeenSet;
};
} // namespace Model
} // namespace TranscribeStreamingService
} // namespace Aws

View File

@@ -0,0 +1,43 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/transcribestreaming/TranscribeStreamingService_EXPORTS.h>
#include <aws/transcribestreaming/model/AudioEvent.h>
#include <utility>
#include <aws/core/utils/event/EventStream.h>
namespace Aws
{
namespace TranscribeStreamingService
{
namespace Model
{
/**
* <p>Represents the audio stream from your application to Amazon
* Transcribe.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/AudioStream">AWS
* API Reference</a></p>
*/
class AWS_TRANSCRIBESTREAMINGSERVICE_API AudioStream : public Aws::Utils::Event::EventEncoderStream
{
public:
AudioStream& WriteAudioEvent(const AudioEvent& value)
{
Aws::Utils::Event::Message msg;
msg.InsertEventHeader(":message-type", Aws::String("event"));
msg.InsertEventHeader(":event-type", Aws::String("AudioEvent"));
msg.InsertEventHeader(":content-type", Aws::String("application/octet-stream"));
msg.WriteEventPayload(value.GetAudioChunk());
WriteEvent(msg);
return *this;
}
};
} // namespace Model
} // namespace TranscribeStreamingService
} // namespace Aws

View File

@@ -0,0 +1,276 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/transcribestreaming/TranscribeStreamingService_EXPORTS.h>
#include <aws/transcribestreaming/model/ItemType.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace TranscribeStreamingService
{
namespace Model
{
/**
* <p>A word or phrase transcribed from the input audio.</p><p><h3>See Also:</h3>
* <a
* href="http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/Item">AWS
* API Reference</a></p>
*/
class AWS_TRANSCRIBESTREAMINGSERVICE_API Item
{
public:
Item();
Item(Aws::Utils::Json::JsonView jsonValue);
Item& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>The offset from the beginning of the audio stream to the beginning of the
* audio that resulted in the item.</p>
*/
inline double GetStartTime() const{ return m_startTime; }
/**
* <p>The offset from the beginning of the audio stream to the beginning of the
* audio that resulted in the item.</p>
*/
inline bool StartTimeHasBeenSet() const { return m_startTimeHasBeenSet; }
/**
* <p>The offset from the beginning of the audio stream to the beginning of the
* audio that resulted in the item.</p>
*/
inline void SetStartTime(double value) { m_startTimeHasBeenSet = true; m_startTime = value; }
/**
* <p>The offset from the beginning of the audio stream to the beginning of the
* audio that resulted in the item.</p>
*/
inline Item& WithStartTime(double value) { SetStartTime(value); return *this;}
/**
* <p>The offset from the beginning of the audio stream to the end of the audio
* that resulted in the item.</p>
*/
inline double GetEndTime() const{ return m_endTime; }
/**
* <p>The offset from the beginning of the audio stream to the end of the audio
* that resulted in the item.</p>
*/
inline bool EndTimeHasBeenSet() const { return m_endTimeHasBeenSet; }
/**
* <p>The offset from the beginning of the audio stream to the end of the audio
* that resulted in the item.</p>
*/
inline void SetEndTime(double value) { m_endTimeHasBeenSet = true; m_endTime = value; }
/**
* <p>The offset from the beginning of the audio stream to the end of the audio
* that resulted in the item.</p>
*/
inline Item& WithEndTime(double value) { SetEndTime(value); return *this;}
/**
* <p>The type of the item. <code>PRONUNCIATION</code> indicates that the item is a
* word that was recognized in the input audio. <code>PUNCTUATION</code> indicates
* that the item was interpreted as a pause in the input audio.</p>
*/
inline const ItemType& GetType() const{ return m_type; }
/**
* <p>The type of the item. <code>PRONUNCIATION</code> indicates that the item is a
* word that was recognized in the input audio. <code>PUNCTUATION</code> indicates
* that the item was interpreted as a pause in the input audio.</p>
*/
inline bool TypeHasBeenSet() const { return m_typeHasBeenSet; }
/**
* <p>The type of the item. <code>PRONUNCIATION</code> indicates that the item is a
* word that was recognized in the input audio. <code>PUNCTUATION</code> indicates
* that the item was interpreted as a pause in the input audio.</p>
*/
inline void SetType(const ItemType& value) { m_typeHasBeenSet = true; m_type = value; }
/**
* <p>The type of the item. <code>PRONUNCIATION</code> indicates that the item is a
* word that was recognized in the input audio. <code>PUNCTUATION</code> indicates
* that the item was interpreted as a pause in the input audio.</p>
*/
inline void SetType(ItemType&& value) { m_typeHasBeenSet = true; m_type = std::move(value); }
/**
* <p>The type of the item. <code>PRONUNCIATION</code> indicates that the item is a
* word that was recognized in the input audio. <code>PUNCTUATION</code> indicates
* that the item was interpreted as a pause in the input audio.</p>
*/
inline Item& WithType(const ItemType& value) { SetType(value); return *this;}
/**
* <p>The type of the item. <code>PRONUNCIATION</code> indicates that the item is a
* word that was recognized in the input audio. <code>PUNCTUATION</code> indicates
* that the item was interpreted as a pause in the input audio.</p>
*/
inline Item& WithType(ItemType&& value) { SetType(std::move(value)); return *this;}
/**
* <p>The word or punctuation that was recognized in the input audio.</p>
*/
inline const Aws::String& GetContent() const{ return m_content; }
/**
* <p>The word or punctuation that was recognized in the input audio.</p>
*/
inline bool ContentHasBeenSet() const { return m_contentHasBeenSet; }
/**
* <p>The word or punctuation that was recognized in the input audio.</p>
*/
inline void SetContent(const Aws::String& value) { m_contentHasBeenSet = true; m_content = value; }
/**
* <p>The word or punctuation that was recognized in the input audio.</p>
*/
inline void SetContent(Aws::String&& value) { m_contentHasBeenSet = true; m_content = std::move(value); }
/**
* <p>The word or punctuation that was recognized in the input audio.</p>
*/
inline void SetContent(const char* value) { m_contentHasBeenSet = true; m_content.assign(value); }
/**
* <p>The word or punctuation that was recognized in the input audio.</p>
*/
inline Item& WithContent(const Aws::String& value) { SetContent(value); return *this;}
/**
* <p>The word or punctuation that was recognized in the input audio.</p>
*/
inline Item& WithContent(Aws::String&& value) { SetContent(std::move(value)); return *this;}
/**
* <p>The word or punctuation that was recognized in the input audio.</p>
*/
inline Item& WithContent(const char* value) { SetContent(value); return *this;}
/**
* <p>Indicates whether a word in the item matches a word in the vocabulary filter
* you've chosen for your real-time stream. If <code>true</code> then a word in the
* item matches your vocabulary filter.</p>
*/
inline bool GetVocabularyFilterMatch() const{ return m_vocabularyFilterMatch; }
/**
* <p>Indicates whether a word in the item matches a word in the vocabulary filter
* you've chosen for your real-time stream. If <code>true</code> then a word in the
* item matches your vocabulary filter.</p>
*/
inline bool VocabularyFilterMatchHasBeenSet() const { return m_vocabularyFilterMatchHasBeenSet; }
/**
* <p>Indicates whether a word in the item matches a word in the vocabulary filter
* you've chosen for your real-time stream. If <code>true</code> then a word in the
* item matches your vocabulary filter.</p>
*/
inline void SetVocabularyFilterMatch(bool value) { m_vocabularyFilterMatchHasBeenSet = true; m_vocabularyFilterMatch = value; }
/**
* <p>Indicates whether a word in the item matches a word in the vocabulary filter
* you've chosen for your real-time stream. If <code>true</code> then a word in the
* item matches your vocabulary filter.</p>
*/
inline Item& WithVocabularyFilterMatch(bool value) { SetVocabularyFilterMatch(value); return *this;}
/**
* <p>If speaker identification is enabled, shows the speakers identified in the
* real-time stream.</p>
*/
inline const Aws::String& GetSpeaker() const{ return m_speaker; }
/**
* <p>If speaker identification is enabled, shows the speakers identified in the
* real-time stream.</p>
*/
inline bool SpeakerHasBeenSet() const { return m_speakerHasBeenSet; }
/**
* <p>If speaker identification is enabled, shows the speakers identified in the
* real-time stream.</p>
*/
inline void SetSpeaker(const Aws::String& value) { m_speakerHasBeenSet = true; m_speaker = value; }
/**
* <p>If speaker identification is enabled, shows the speakers identified in the
* real-time stream.</p>
*/
inline void SetSpeaker(Aws::String&& value) { m_speakerHasBeenSet = true; m_speaker = std::move(value); }
/**
* <p>If speaker identification is enabled, shows the speakers identified in the
* real-time stream.</p>
*/
inline void SetSpeaker(const char* value) { m_speakerHasBeenSet = true; m_speaker.assign(value); }
/**
* <p>If speaker identification is enabled, shows the speakers identified in the
* real-time stream.</p>
*/
inline Item& WithSpeaker(const Aws::String& value) { SetSpeaker(value); return *this;}
/**
* <p>If speaker identification is enabled, shows the speakers identified in the
* real-time stream.</p>
*/
inline Item& WithSpeaker(Aws::String&& value) { SetSpeaker(std::move(value)); return *this;}
/**
* <p>If speaker identification is enabled, shows the speakers identified in the
* real-time stream.</p>
*/
inline Item& WithSpeaker(const char* value) { SetSpeaker(value); return *this;}
private:
double m_startTime;
bool m_startTimeHasBeenSet;
double m_endTime;
bool m_endTimeHasBeenSet;
ItemType m_type;
bool m_typeHasBeenSet;
Aws::String m_content;
bool m_contentHasBeenSet;
bool m_vocabularyFilterMatch;
bool m_vocabularyFilterMatchHasBeenSet;
Aws::String m_speaker;
bool m_speakerHasBeenSet;
};
} // namespace Model
} // namespace TranscribeStreamingService
} // namespace Aws

View File

@@ -0,0 +1,31 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/transcribestreaming/TranscribeStreamingService_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace TranscribeStreamingService
{
namespace Model
{
enum class ItemType
{
NOT_SET,
pronunciation,
punctuation
};
namespace ItemTypeMapper
{
AWS_TRANSCRIBESTREAMINGSERVICE_API ItemType GetItemTypeForName(const Aws::String& name);
AWS_TRANSCRIBESTREAMINGSERVICE_API Aws::String GetNameForItemType(ItemType value);
} // namespace ItemTypeMapper
} // namespace Model
} // namespace TranscribeStreamingService
} // namespace Aws

View File

@@ -0,0 +1,35 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/transcribestreaming/TranscribeStreamingService_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace TranscribeStreamingService
{
namespace Model
{
enum class LanguageCode
{
NOT_SET,
en_US,
en_GB,
es_US,
fr_CA,
fr_FR,
en_AU
};
namespace LanguageCodeMapper
{
AWS_TRANSCRIBESTREAMINGSERVICE_API LanguageCode GetLanguageCodeForName(const Aws::String& name);
AWS_TRANSCRIBESTREAMINGSERVICE_API Aws::String GetNameForLanguageCode(LanguageCode value);
} // namespace LanguageCodeMapper
} // namespace Model
} // namespace TranscribeStreamingService
} // namespace Aws

View File

@@ -0,0 +1,30 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/transcribestreaming/TranscribeStreamingService_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace TranscribeStreamingService
{
namespace Model
{
enum class MediaEncoding
{
NOT_SET,
pcm
};
namespace MediaEncodingMapper
{
AWS_TRANSCRIBESTREAMINGSERVICE_API MediaEncoding GetMediaEncodingForName(const Aws::String& name);
AWS_TRANSCRIBESTREAMINGSERVICE_API Aws::String GetNameForMediaEncoding(MediaEncoding value);
} // namespace MediaEncodingMapper
} // namespace Model
} // namespace TranscribeStreamingService
} // namespace Aws

View File

@@ -0,0 +1,247 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/transcribestreaming/TranscribeStreamingService_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/transcribestreaming/model/Alternative.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace TranscribeStreamingService
{
namespace Model
{
/**
* <p>The result of transcribing a portion of the input audio stream.
* </p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/Result">AWS
* API Reference</a></p>
*/
class AWS_TRANSCRIBESTREAMINGSERVICE_API Result
{
public:
Result();
Result(Aws::Utils::Json::JsonView jsonValue);
Result& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>A unique identifier for the result. </p>
*/
inline const Aws::String& GetResultId() const{ return m_resultId; }
/**
* <p>A unique identifier for the result. </p>
*/
inline bool ResultIdHasBeenSet() const { return m_resultIdHasBeenSet; }
/**
* <p>A unique identifier for the result. </p>
*/
inline void SetResultId(const Aws::String& value) { m_resultIdHasBeenSet = true; m_resultId = value; }
/**
* <p>A unique identifier for the result. </p>
*/
inline void SetResultId(Aws::String&& value) { m_resultIdHasBeenSet = true; m_resultId = std::move(value); }
/**
* <p>A unique identifier for the result. </p>
*/
inline void SetResultId(const char* value) { m_resultIdHasBeenSet = true; m_resultId.assign(value); }
/**
* <p>A unique identifier for the result. </p>
*/
inline Result& WithResultId(const Aws::String& value) { SetResultId(value); return *this;}
/**
* <p>A unique identifier for the result. </p>
*/
inline Result& WithResultId(Aws::String&& value) { SetResultId(std::move(value)); return *this;}
/**
* <p>A unique identifier for the result. </p>
*/
inline Result& WithResultId(const char* value) { SetResultId(value); return *this;}
/**
* <p>The offset in seconds from the beginning of the audio stream to the beginning
* of the result.</p>
*/
inline double GetStartTime() const{ return m_startTime; }
/**
* <p>The offset in seconds from the beginning of the audio stream to the beginning
* of the result.</p>
*/
inline bool StartTimeHasBeenSet() const { return m_startTimeHasBeenSet; }
/**
* <p>The offset in seconds from the beginning of the audio stream to the beginning
* of the result.</p>
*/
inline void SetStartTime(double value) { m_startTimeHasBeenSet = true; m_startTime = value; }
/**
* <p>The offset in seconds from the beginning of the audio stream to the beginning
* of the result.</p>
*/
inline Result& WithStartTime(double value) { SetStartTime(value); return *this;}
/**
* <p>The offset in seconds from the beginning of the audio stream to the end of
* the result.</p>
*/
inline double GetEndTime() const{ return m_endTime; }
/**
* <p>The offset in seconds from the beginning of the audio stream to the end of
* the result.</p>
*/
inline bool EndTimeHasBeenSet() const { return m_endTimeHasBeenSet; }
/**
* <p>The offset in seconds from the beginning of the audio stream to the end of
* the result.</p>
*/
inline void SetEndTime(double value) { m_endTimeHasBeenSet = true; m_endTime = value; }
/**
* <p>The offset in seconds from the beginning of the audio stream to the end of
* the result.</p>
*/
inline Result& WithEndTime(double value) { SetEndTime(value); return *this;}
/**
* <p>Amazon Transcribe divides the incoming audio stream into segments at natural
* points in the audio. Transcription results are returned based on these segments.
* </p> <p>The <code>IsPartial</code> field is <code>true</code> to indicate that
* Amazon Transcribe has additional transcription data to send, <code>false</code>
* to indicate that this is the last transcription result for the segment.</p>
*/
inline bool GetIsPartial() const{ return m_isPartial; }
/**
* <p>Amazon Transcribe divides the incoming audio stream into segments at natural
* points in the audio. Transcription results are returned based on these segments.
* </p> <p>The <code>IsPartial</code> field is <code>true</code> to indicate that
* Amazon Transcribe has additional transcription data to send, <code>false</code>
* to indicate that this is the last transcription result for the segment.</p>
*/
inline bool IsPartialHasBeenSet() const { return m_isPartialHasBeenSet; }
/**
* <p>Amazon Transcribe divides the incoming audio stream into segments at natural
* points in the audio. Transcription results are returned based on these segments.
* </p> <p>The <code>IsPartial</code> field is <code>true</code> to indicate that
* Amazon Transcribe has additional transcription data to send, <code>false</code>
* to indicate that this is the last transcription result for the segment.</p>
*/
inline void SetIsPartial(bool value) { m_isPartialHasBeenSet = true; m_isPartial = value; }
/**
* <p>Amazon Transcribe divides the incoming audio stream into segments at natural
* points in the audio. Transcription results are returned based on these segments.
* </p> <p>The <code>IsPartial</code> field is <code>true</code> to indicate that
* Amazon Transcribe has additional transcription data to send, <code>false</code>
* to indicate that this is the last transcription result for the segment.</p>
*/
inline Result& WithIsPartial(bool value) { SetIsPartial(value); return *this;}
/**
* <p>A list of possible transcriptions for the audio. Each alternative typically
* contains one <code>item</code> that contains the result of the
* transcription.</p>
*/
inline const Aws::Vector<Alternative>& GetAlternatives() const{ return m_alternatives; }
/**
* <p>A list of possible transcriptions for the audio. Each alternative typically
* contains one <code>item</code> that contains the result of the
* transcription.</p>
*/
inline bool AlternativesHasBeenSet() const { return m_alternativesHasBeenSet; }
/**
* <p>A list of possible transcriptions for the audio. Each alternative typically
* contains one <code>item</code> that contains the result of the
* transcription.</p>
*/
inline void SetAlternatives(const Aws::Vector<Alternative>& value) { m_alternativesHasBeenSet = true; m_alternatives = value; }
/**
* <p>A list of possible transcriptions for the audio. Each alternative typically
* contains one <code>item</code> that contains the result of the
* transcription.</p>
*/
inline void SetAlternatives(Aws::Vector<Alternative>&& value) { m_alternativesHasBeenSet = true; m_alternatives = std::move(value); }
/**
* <p>A list of possible transcriptions for the audio. Each alternative typically
* contains one <code>item</code> that contains the result of the
* transcription.</p>
*/
inline Result& WithAlternatives(const Aws::Vector<Alternative>& value) { SetAlternatives(value); return *this;}
/**
* <p>A list of possible transcriptions for the audio. Each alternative typically
* contains one <code>item</code> that contains the result of the
* transcription.</p>
*/
inline Result& WithAlternatives(Aws::Vector<Alternative>&& value) { SetAlternatives(std::move(value)); return *this;}
/**
* <p>A list of possible transcriptions for the audio. Each alternative typically
* contains one <code>item</code> that contains the result of the
* transcription.</p>
*/
inline Result& AddAlternatives(const Alternative& value) { m_alternativesHasBeenSet = true; m_alternatives.push_back(value); return *this; }
/**
* <p>A list of possible transcriptions for the audio. Each alternative typically
* contains one <code>item</code> that contains the result of the
* transcription.</p>
*/
inline Result& AddAlternatives(Alternative&& value) { m_alternativesHasBeenSet = true; m_alternatives.push_back(std::move(value)); return *this; }
private:
Aws::String m_resultId;
bool m_resultIdHasBeenSet;
double m_startTime;
bool m_startTimeHasBeenSet;
double m_endTime;
bool m_endTimeHasBeenSet;
bool m_isPartial;
bool m_isPartialHasBeenSet;
Aws::Vector<Alternative> m_alternatives;
bool m_alternativesHasBeenSet;
};
} // namespace Model
} // namespace TranscribeStreamingService
} // namespace Aws

View File

@@ -0,0 +1,58 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/utils/event/EventStreamHandler.h>
#include <aws/core/client/AWSError.h>
#include <aws/transcribestreaming/TranscribeStreamingService_EXPORTS.h>
#include <aws/transcribestreaming/TranscribeStreamingServiceErrors.h>
#include <aws/transcribestreaming/model/TranscriptEvent.h>
namespace Aws
{
namespace TranscribeStreamingService
{
namespace Model
{
enum class StartStreamTranscriptionEventType
{
TRANSCRIPTEVENT,
UNKNOWN
};
class AWS_TRANSCRIBESTREAMINGSERVICE_API StartStreamTranscriptionHandler : public Aws::Utils::Event::EventStreamHandler
{
typedef std::function<void(const TranscriptEvent&)> TranscriptEventCallback;
typedef std::function<void(const Aws::Client::AWSError<TranscribeStreamingServiceErrors>& error)> ErrorCallback;
public:
StartStreamTranscriptionHandler();
StartStreamTranscriptionHandler& operator=(const StartStreamTranscriptionHandler& handler) = default;
virtual void OnEvent() override;
inline void SetTranscriptEventCallback(const TranscriptEventCallback& callback) { m_onTranscriptEvent = callback; }
inline void SetOnErrorCallback(const ErrorCallback& callback) { m_onError = callback; }
private:
void HandleEventInMessage();
void HandleErrorInMessage();
void MarshallError(const Aws::String& errorCode, const Aws::String& errorMessage);
TranscriptEventCallback m_onTranscriptEvent;
ErrorCallback m_onError;
};
namespace StartStreamTranscriptionEventMapper
{
AWS_TRANSCRIBESTREAMINGSERVICE_API StartStreamTranscriptionEventType GetStartStreamTranscriptionEventTypeForName(const Aws::String& name);
AWS_TRANSCRIBESTREAMINGSERVICE_API Aws::String GetNameForStartStreamTranscriptionEventType(StartStreamTranscriptionEventType value);
} // namespace StartStreamTranscriptionEventMapper
} // namespace Model
} // namespace TranscribeStreamingService
} // namespace Aws

View File

@@ -0,0 +1,445 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/transcribestreaming/TranscribeStreamingService_EXPORTS.h>
#include <aws/transcribestreaming/TranscribeStreamingServiceRequest.h>
#include <aws/transcribestreaming/model/StartStreamTranscriptionHandler.h>
#include <aws/core/utils/event/EventStreamDecoder.h>
#include <memory>
#include <aws/transcribestreaming/model/LanguageCode.h>
#include <aws/transcribestreaming/model/MediaEncoding.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/transcribestreaming/model/AudioStream.h>
#include <aws/transcribestreaming/model/VocabularyFilterMethod.h>
#include <utility>
namespace Aws
{
namespace TranscribeStreamingService
{
namespace Model
{
/**
*/
class AWS_TRANSCRIBESTREAMINGSERVICE_API StartStreamTranscriptionRequest : public TranscribeStreamingServiceRequest
{
public:
StartStreamTranscriptionRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "StartStreamTranscription"; }
inline virtual bool IsEventStreamRequest() const override { return true; }
// SerializePayload will not be invoked.
// This request is sent by encoding its data in event-streams which is sent as IOStream via GetBody()
Aws::String SerializePayload() const override { return {}; }
std::shared_ptr<Aws::IOStream> GetBody() const override;
Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
/**
* Underlying Event Stream Decoder.
*/
inline Aws::Utils::Event::EventStreamDecoder& GetEventStreamDecoder() { return m_decoder; }
/**
* Underlying Event Stream Handler which is used to define callback functions.
*/
inline const StartStreamTranscriptionHandler& GetEventStreamHandler() const { return m_handler; }
/**
* Underlying Event Stream Handler which is used to define callback functions.
*/
inline void SetEventStreamHandler(const StartStreamTranscriptionHandler& value) { m_handler = value; m_decoder.ResetEventStreamHandler(&m_handler); }
/**
* Underlying Event Stream Handler which is used to define callback functions.
*/
inline StartStreamTranscriptionRequest& WithEventStreamHandler(const StartStreamTranscriptionHandler& value) { SetEventStreamHandler(value); return *this; }
/**
* <p>Indicates the source language used in the input audio stream.</p>
*/
inline const LanguageCode& GetLanguageCode() const{ return m_languageCode; }
/**
* <p>Indicates the source language used in the input audio stream.</p>
*/
inline bool LanguageCodeHasBeenSet() const { return m_languageCodeHasBeenSet; }
/**
* <p>Indicates the source language used in the input audio stream.</p>
*/
inline void SetLanguageCode(const LanguageCode& value) { m_languageCodeHasBeenSet = true; m_languageCode = value; }
/**
* <p>Indicates the source language used in the input audio stream.</p>
*/
inline void SetLanguageCode(LanguageCode&& value) { m_languageCodeHasBeenSet = true; m_languageCode = std::move(value); }
/**
* <p>Indicates the source language used in the input audio stream.</p>
*/
inline StartStreamTranscriptionRequest& WithLanguageCode(const LanguageCode& value) { SetLanguageCode(value); return *this;}
/**
* <p>Indicates the source language used in the input audio stream.</p>
*/
inline StartStreamTranscriptionRequest& WithLanguageCode(LanguageCode&& value) { SetLanguageCode(std::move(value)); return *this;}
/**
* <p>The sample rate, in Hertz, of the input audio. We suggest that you use 8000
* Hz for low quality audio and 16000 Hz for high quality audio.</p>
*/
inline int GetMediaSampleRateHertz() const{ return m_mediaSampleRateHertz; }
/**
* <p>The sample rate, in Hertz, of the input audio. We suggest that you use 8000
* Hz for low quality audio and 16000 Hz for high quality audio.</p>
*/
inline bool MediaSampleRateHertzHasBeenSet() const { return m_mediaSampleRateHertzHasBeenSet; }
/**
* <p>The sample rate, in Hertz, of the input audio. We suggest that you use 8000
* Hz for low quality audio and 16000 Hz for high quality audio.</p>
*/
inline void SetMediaSampleRateHertz(int value) { m_mediaSampleRateHertzHasBeenSet = true; m_mediaSampleRateHertz = value; }
/**
* <p>The sample rate, in Hertz, of the input audio. We suggest that you use 8000
* Hz for low quality audio and 16000 Hz for high quality audio.</p>
*/
inline StartStreamTranscriptionRequest& WithMediaSampleRateHertz(int value) { SetMediaSampleRateHertz(value); return *this;}
/**
* <p>The encoding used for the input audio. <code>pcm</code> is the only valid
* value.</p>
*/
inline const MediaEncoding& GetMediaEncoding() const{ return m_mediaEncoding; }
/**
* <p>The encoding used for the input audio. <code>pcm</code> is the only valid
* value.</p>
*/
inline bool MediaEncodingHasBeenSet() const { return m_mediaEncodingHasBeenSet; }
/**
* <p>The encoding used for the input audio. <code>pcm</code> is the only valid
* value.</p>
*/
inline void SetMediaEncoding(const MediaEncoding& value) { m_mediaEncodingHasBeenSet = true; m_mediaEncoding = value; }
/**
* <p>The encoding used for the input audio. <code>pcm</code> is the only valid
* value.</p>
*/
inline void SetMediaEncoding(MediaEncoding&& value) { m_mediaEncodingHasBeenSet = true; m_mediaEncoding = std::move(value); }
/**
* <p>The encoding used for the input audio. <code>pcm</code> is the only valid
* value.</p>
*/
inline StartStreamTranscriptionRequest& WithMediaEncoding(const MediaEncoding& value) { SetMediaEncoding(value); return *this;}
/**
* <p>The encoding used for the input audio. <code>pcm</code> is the only valid
* value.</p>
*/
inline StartStreamTranscriptionRequest& WithMediaEncoding(MediaEncoding&& value) { SetMediaEncoding(std::move(value)); return *this;}
/**
* <p>The name of the vocabulary to use when processing the transcription job.</p>
*/
inline const Aws::String& GetVocabularyName() const{ return m_vocabularyName; }
/**
* <p>The name of the vocabulary to use when processing the transcription job.</p>
*/
inline bool VocabularyNameHasBeenSet() const { return m_vocabularyNameHasBeenSet; }
/**
* <p>The name of the vocabulary to use when processing the transcription job.</p>
*/
inline void SetVocabularyName(const Aws::String& value) { m_vocabularyNameHasBeenSet = true; m_vocabularyName = value; }
/**
* <p>The name of the vocabulary to use when processing the transcription job.</p>
*/
inline void SetVocabularyName(Aws::String&& value) { m_vocabularyNameHasBeenSet = true; m_vocabularyName = std::move(value); }
/**
* <p>The name of the vocabulary to use when processing the transcription job.</p>
*/
inline void SetVocabularyName(const char* value) { m_vocabularyNameHasBeenSet = true; m_vocabularyName.assign(value); }
/**
* <p>The name of the vocabulary to use when processing the transcription job.</p>
*/
inline StartStreamTranscriptionRequest& WithVocabularyName(const Aws::String& value) { SetVocabularyName(value); return *this;}
/**
* <p>The name of the vocabulary to use when processing the transcription job.</p>
*/
inline StartStreamTranscriptionRequest& WithVocabularyName(Aws::String&& value) { SetVocabularyName(std::move(value)); return *this;}
/**
* <p>The name of the vocabulary to use when processing the transcription job.</p>
*/
inline StartStreamTranscriptionRequest& WithVocabularyName(const char* value) { SetVocabularyName(value); return *this;}
/**
* <p>A identifier for the transcription session. Use this parameter when you want
* to retry a session. If you don't provide a session ID, Amazon Transcribe will
* generate one for you and return it in the response.</p>
*/
inline const Aws::String& GetSessionId() const{ return m_sessionId; }
/**
* <p>A identifier for the transcription session. Use this parameter when you want
* to retry a session. If you don't provide a session ID, Amazon Transcribe will
* generate one for you and return it in the response.</p>
*/
inline bool SessionIdHasBeenSet() const { return m_sessionIdHasBeenSet; }
/**
* <p>A identifier for the transcription session. Use this parameter when you want
* to retry a session. If you don't provide a session ID, Amazon Transcribe will
* generate one for you and return it in the response.</p>
*/
inline void SetSessionId(const Aws::String& value) { m_sessionIdHasBeenSet = true; m_sessionId = value; }
/**
* <p>A identifier for the transcription session. Use this parameter when you want
* to retry a session. If you don't provide a session ID, Amazon Transcribe will
* generate one for you and return it in the response.</p>
*/
inline void SetSessionId(Aws::String&& value) { m_sessionIdHasBeenSet = true; m_sessionId = std::move(value); }
/**
* <p>A identifier for the transcription session. Use this parameter when you want
* to retry a session. If you don't provide a session ID, Amazon Transcribe will
* generate one for you and return it in the response.</p>
*/
inline void SetSessionId(const char* value) { m_sessionIdHasBeenSet = true; m_sessionId.assign(value); }
/**
* <p>A identifier for the transcription session. Use this parameter when you want
* to retry a session. If you don't provide a session ID, Amazon Transcribe will
* generate one for you and return it in the response.</p>
*/
inline StartStreamTranscriptionRequest& WithSessionId(const Aws::String& value) { SetSessionId(value); return *this;}
/**
* <p>A identifier for the transcription session. Use this parameter when you want
* to retry a session. If you don't provide a session ID, Amazon Transcribe will
* generate one for you and return it in the response.</p>
*/
inline StartStreamTranscriptionRequest& WithSessionId(Aws::String&& value) { SetSessionId(std::move(value)); return *this;}
/**
* <p>A identifier for the transcription session. Use this parameter when you want
* to retry a session. If you don't provide a session ID, Amazon Transcribe will
* generate one for you and return it in the response.</p>
*/
inline StartStreamTranscriptionRequest& WithSessionId(const char* value) { SetSessionId(value); return *this;}
/**
* <p>PCM-encoded stream of audio blobs. The audio stream is encoded as an HTTP2
* data frame.</p>
*/
std::shared_ptr<AudioStream> GetAudioStream() const { return m_audioStream; }
/**
* <p>PCM-encoded stream of audio blobs. The audio stream is encoded as an HTTP2
* data frame.</p>
*/
void SetAudioStream(const std::shared_ptr<AudioStream>& value) { m_audioStream = value; }
/**
* <p>PCM-encoded stream of audio blobs. The audio stream is encoded as an HTTP2
* data frame.</p>
*/
StartStreamTranscriptionRequest& WithAudioStream(const std::shared_ptr<AudioStream>& value) { SetAudioStream(value); return *this;}
/**
* <p>The name of the vocabulary filter you've created that is unique to your AWS
* account. Provide the name in this field to successfully use it in a stream.</p>
*/
inline const Aws::String& GetVocabularyFilterName() const{ return m_vocabularyFilterName; }
/**
* <p>The name of the vocabulary filter you've created that is unique to your AWS
* account. Provide the name in this field to successfully use it in a stream.</p>
*/
inline bool VocabularyFilterNameHasBeenSet() const { return m_vocabularyFilterNameHasBeenSet; }
/**
* <p>The name of the vocabulary filter you've created that is unique to your AWS
* account. Provide the name in this field to successfully use it in a stream.</p>
*/
inline void SetVocabularyFilterName(const Aws::String& value) { m_vocabularyFilterNameHasBeenSet = true; m_vocabularyFilterName = value; }
/**
* <p>The name of the vocabulary filter you've created that is unique to your AWS
* account. Provide the name in this field to successfully use it in a stream.</p>
*/
inline void SetVocabularyFilterName(Aws::String&& value) { m_vocabularyFilterNameHasBeenSet = true; m_vocabularyFilterName = std::move(value); }
/**
* <p>The name of the vocabulary filter you've created that is unique to your AWS
* account. Provide the name in this field to successfully use it in a stream.</p>
*/
inline void SetVocabularyFilterName(const char* value) { m_vocabularyFilterNameHasBeenSet = true; m_vocabularyFilterName.assign(value); }
/**
* <p>The name of the vocabulary filter you've created that is unique to your AWS
* account. Provide the name in this field to successfully use it in a stream.</p>
*/
inline StartStreamTranscriptionRequest& WithVocabularyFilterName(const Aws::String& value) { SetVocabularyFilterName(value); return *this;}
/**
* <p>The name of the vocabulary filter you've created that is unique to your AWS
* account. Provide the name in this field to successfully use it in a stream.</p>
*/
inline StartStreamTranscriptionRequest& WithVocabularyFilterName(Aws::String&& value) { SetVocabularyFilterName(std::move(value)); return *this;}
/**
* <p>The name of the vocabulary filter you've created that is unique to your AWS
* account. Provide the name in this field to successfully use it in a stream.</p>
*/
inline StartStreamTranscriptionRequest& WithVocabularyFilterName(const char* value) { SetVocabularyFilterName(value); return *this;}
/**
* <p>The manner in which you use your vocabulary filter to filter words in your
* transcript. <code>Remove</code> removes filtered words from your transcription
* results. <code>Mask</code> masks those words with a <code>***</code> in your
* transcription results. <code>Tag</code> keeps the filtered words in your
* transcription results and tags them. The tag appears as
* <code>VocabularyFilterMatch</code> equal to <code>True</code> </p>
*/
inline const VocabularyFilterMethod& GetVocabularyFilterMethod() const{ return m_vocabularyFilterMethod; }
/**
* <p>The manner in which you use your vocabulary filter to filter words in your
* transcript. <code>Remove</code> removes filtered words from your transcription
* results. <code>Mask</code> masks those words with a <code>***</code> in your
* transcription results. <code>Tag</code> keeps the filtered words in your
* transcription results and tags them. The tag appears as
* <code>VocabularyFilterMatch</code> equal to <code>True</code> </p>
*/
inline bool VocabularyFilterMethodHasBeenSet() const { return m_vocabularyFilterMethodHasBeenSet; }
/**
* <p>The manner in which you use your vocabulary filter to filter words in your
* transcript. <code>Remove</code> removes filtered words from your transcription
* results. <code>Mask</code> masks those words with a <code>***</code> in your
* transcription results. <code>Tag</code> keeps the filtered words in your
* transcription results and tags them. The tag appears as
* <code>VocabularyFilterMatch</code> equal to <code>True</code> </p>
*/
inline void SetVocabularyFilterMethod(const VocabularyFilterMethod& value) { m_vocabularyFilterMethodHasBeenSet = true; m_vocabularyFilterMethod = value; }
/**
* <p>The manner in which you use your vocabulary filter to filter words in your
* transcript. <code>Remove</code> removes filtered words from your transcription
* results. <code>Mask</code> masks those words with a <code>***</code> in your
* transcription results. <code>Tag</code> keeps the filtered words in your
* transcription results and tags them. The tag appears as
* <code>VocabularyFilterMatch</code> equal to <code>True</code> </p>
*/
inline void SetVocabularyFilterMethod(VocabularyFilterMethod&& value) { m_vocabularyFilterMethodHasBeenSet = true; m_vocabularyFilterMethod = std::move(value); }
/**
* <p>The manner in which you use your vocabulary filter to filter words in your
* transcript. <code>Remove</code> removes filtered words from your transcription
* results. <code>Mask</code> masks those words with a <code>***</code> in your
* transcription results. <code>Tag</code> keeps the filtered words in your
* transcription results and tags them. The tag appears as
* <code>VocabularyFilterMatch</code> equal to <code>True</code> </p>
*/
inline StartStreamTranscriptionRequest& WithVocabularyFilterMethod(const VocabularyFilterMethod& value) { SetVocabularyFilterMethod(value); return *this;}
/**
* <p>The manner in which you use your vocabulary filter to filter words in your
* transcript. <code>Remove</code> removes filtered words from your transcription
* results. <code>Mask</code> masks those words with a <code>***</code> in your
* transcription results. <code>Tag</code> keeps the filtered words in your
* transcription results and tags them. The tag appears as
* <code>VocabularyFilterMatch</code> equal to <code>True</code> </p>
*/
inline StartStreamTranscriptionRequest& WithVocabularyFilterMethod(VocabularyFilterMethod&& value) { SetVocabularyFilterMethod(std::move(value)); return *this;}
/**
* <p>When <code>true</code>, enables speaker identification in your real-time
* stream.</p>
*/
inline bool GetShowSpeakerLabel() const{ return m_showSpeakerLabel; }
/**
* <p>When <code>true</code>, enables speaker identification in your real-time
* stream.</p>
*/
inline bool ShowSpeakerLabelHasBeenSet() const { return m_showSpeakerLabelHasBeenSet; }
/**
* <p>When <code>true</code>, enables speaker identification in your real-time
* stream.</p>
*/
inline void SetShowSpeakerLabel(bool value) { m_showSpeakerLabelHasBeenSet = true; m_showSpeakerLabel = value; }
/**
* <p>When <code>true</code>, enables speaker identification in your real-time
* stream.</p>
*/
inline StartStreamTranscriptionRequest& WithShowSpeakerLabel(bool value) { SetShowSpeakerLabel(value); return *this;}
private:
LanguageCode m_languageCode;
bool m_languageCodeHasBeenSet;
int m_mediaSampleRateHertz;
bool m_mediaSampleRateHertzHasBeenSet;
MediaEncoding m_mediaEncoding;
bool m_mediaEncodingHasBeenSet;
Aws::String m_vocabularyName;
bool m_vocabularyNameHasBeenSet;
Aws::String m_sessionId;
bool m_sessionIdHasBeenSet;
std::shared_ptr<AudioStream> m_audioStream;
Aws::String m_vocabularyFilterName;
bool m_vocabularyFilterNameHasBeenSet;
VocabularyFilterMethod m_vocabularyFilterMethod;
bool m_vocabularyFilterMethodHasBeenSet;
bool m_showSpeakerLabel;
bool m_showSpeakerLabelHasBeenSet;
Aws::Utils::Event::EventStreamDecoder m_decoder;
StartStreamTranscriptionHandler m_handler;
};
} // namespace Model
} // namespace TranscribeStreamingService
} // namespace Aws

View File

@@ -0,0 +1,97 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/transcribestreaming/TranscribeStreamingService_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/transcribestreaming/model/Result.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace TranscribeStreamingService
{
namespace Model
{
/**
* <p>The transcription in a <a>TranscriptEvent</a>.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/Transcript">AWS
* API Reference</a></p>
*/
class AWS_TRANSCRIBESTREAMINGSERVICE_API Transcript
{
public:
Transcript();
Transcript(Aws::Utils::Json::JsonView jsonValue);
Transcript& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p> <a>Result</a> objects that contain the results of transcribing a portion of
* the input audio stream. The array can be empty.</p>
*/
inline const Aws::Vector<Result>& GetResults() const{ return m_results; }
/**
* <p> <a>Result</a> objects that contain the results of transcribing a portion of
* the input audio stream. The array can be empty.</p>
*/
inline bool ResultsHasBeenSet() const { return m_resultsHasBeenSet; }
/**
* <p> <a>Result</a> objects that contain the results of transcribing a portion of
* the input audio stream. The array can be empty.</p>
*/
inline void SetResults(const Aws::Vector<Result>& value) { m_resultsHasBeenSet = true; m_results = value; }
/**
* <p> <a>Result</a> objects that contain the results of transcribing a portion of
* the input audio stream. The array can be empty.</p>
*/
inline void SetResults(Aws::Vector<Result>&& value) { m_resultsHasBeenSet = true; m_results = std::move(value); }
/**
* <p> <a>Result</a> objects that contain the results of transcribing a portion of
* the input audio stream. The array can be empty.</p>
*/
inline Transcript& WithResults(const Aws::Vector<Result>& value) { SetResults(value); return *this;}
/**
* <p> <a>Result</a> objects that contain the results of transcribing a portion of
* the input audio stream. The array can be empty.</p>
*/
inline Transcript& WithResults(Aws::Vector<Result>&& value) { SetResults(std::move(value)); return *this;}
/**
* <p> <a>Result</a> objects that contain the results of transcribing a portion of
* the input audio stream. The array can be empty.</p>
*/
inline Transcript& AddResults(const Result& value) { m_resultsHasBeenSet = true; m_results.push_back(value); return *this; }
/**
* <p> <a>Result</a> objects that contain the results of transcribing a portion of
* the input audio stream. The array can be empty.</p>
*/
inline Transcript& AddResults(Result&& value) { m_resultsHasBeenSet = true; m_results.push_back(std::move(value)); return *this; }
private:
Aws::Vector<Result> m_results;
bool m_resultsHasBeenSet;
};
} // namespace Model
} // namespace TranscribeStreamingService
} // namespace Aws

View File

@@ -0,0 +1,86 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/transcribestreaming/TranscribeStreamingService_EXPORTS.h>
#include <aws/transcribestreaming/model/Transcript.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace TranscribeStreamingService
{
namespace Model
{
/**
* <p>Represents a set of transcription results from the server to the client. It
* contains one or more segments of the transcription.</p><p><h3>See Also:</h3>
* <a
* href="http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/TranscriptEvent">AWS
* API Reference</a></p>
*/
class AWS_TRANSCRIBESTREAMINGSERVICE_API TranscriptEvent
{
public:
TranscriptEvent();
TranscriptEvent(Aws::Utils::Json::JsonView jsonValue);
TranscriptEvent& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>The transcription of the audio stream. The transcription is composed of all
* of the items in the results list.</p>
*/
inline const Transcript& GetTranscript() const{ return m_transcript; }
/**
* <p>The transcription of the audio stream. The transcription is composed of all
* of the items in the results list.</p>
*/
inline bool TranscriptHasBeenSet() const { return m_transcriptHasBeenSet; }
/**
* <p>The transcription of the audio stream. The transcription is composed of all
* of the items in the results list.</p>
*/
inline void SetTranscript(const Transcript& value) { m_transcriptHasBeenSet = true; m_transcript = value; }
/**
* <p>The transcription of the audio stream. The transcription is composed of all
* of the items in the results list.</p>
*/
inline void SetTranscript(Transcript&& value) { m_transcriptHasBeenSet = true; m_transcript = std::move(value); }
/**
* <p>The transcription of the audio stream. The transcription is composed of all
* of the items in the results list.</p>
*/
inline TranscriptEvent& WithTranscript(const Transcript& value) { SetTranscript(value); return *this;}
/**
* <p>The transcription of the audio stream. The transcription is composed of all
* of the items in the results list.</p>
*/
inline TranscriptEvent& WithTranscript(Transcript&& value) { SetTranscript(std::move(value)); return *this;}
private:
Transcript m_transcript;
bool m_transcriptHasBeenSet;
};
} // namespace Model
} // namespace TranscribeStreamingService
} // namespace Aws

View File

@@ -0,0 +1,302 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/transcribestreaming/TranscribeStreamingService_EXPORTS.h>
#include <aws/transcribestreaming/model/TranscriptEvent.h>
#include <aws/transcribestreaming/model/BadRequestException.h>
#include <aws/transcribestreaming/model/LimitExceededException.h>
#include <aws/transcribestreaming/model/InternalFailureException.h>
#include <aws/transcribestreaming/model/ConflictException.h>
#include <aws/transcribestreaming/model/ServiceUnavailableException.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
class JsonView;
} // namespace Json
} // namespace Utils
namespace TranscribeStreamingService
{
namespace Model
{
/**
* <p>Represents the transcription result stream from Amazon Transcribe to your
* application.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/TranscriptResultStream">AWS
* API Reference</a></p>
*/
class AWS_TRANSCRIBESTREAMINGSERVICE_API TranscriptResultStream
{
public:
TranscriptResultStream();
TranscriptResultStream(Aws::Utils::Json::JsonView jsonValue);
TranscriptResultStream& operator=(Aws::Utils::Json::JsonView jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/**
* <p>A portion of the transcription of the audio stream. Events are sent
* periodically from Amazon Transcribe to your application. The event can be a
* partial transcription of a section of the audio stream, or it can be the entire
* transcription of that portion of the audio stream. </p>
*/
inline const TranscriptEvent& GetTranscriptEvent() const{ return m_transcriptEvent; }
/**
* <p>A portion of the transcription of the audio stream. Events are sent
* periodically from Amazon Transcribe to your application. The event can be a
* partial transcription of a section of the audio stream, or it can be the entire
* transcription of that portion of the audio stream. </p>
*/
inline bool TranscriptEventHasBeenSet() const { return m_transcriptEventHasBeenSet; }
/**
* <p>A portion of the transcription of the audio stream. Events are sent
* periodically from Amazon Transcribe to your application. The event can be a
* partial transcription of a section of the audio stream, or it can be the entire
* transcription of that portion of the audio stream. </p>
*/
inline void SetTranscriptEvent(const TranscriptEvent& value) { m_transcriptEventHasBeenSet = true; m_transcriptEvent = value; }
/**
* <p>A portion of the transcription of the audio stream. Events are sent
* periodically from Amazon Transcribe to your application. The event can be a
* partial transcription of a section of the audio stream, or it can be the entire
* transcription of that portion of the audio stream. </p>
*/
inline void SetTranscriptEvent(TranscriptEvent&& value) { m_transcriptEventHasBeenSet = true; m_transcriptEvent = std::move(value); }
/**
* <p>A portion of the transcription of the audio stream. Events are sent
* periodically from Amazon Transcribe to your application. The event can be a
* partial transcription of a section of the audio stream, or it can be the entire
* transcription of that portion of the audio stream. </p>
*/
inline TranscriptResultStream& WithTranscriptEvent(const TranscriptEvent& value) { SetTranscriptEvent(value); return *this;}
/**
* <p>A portion of the transcription of the audio stream. Events are sent
* periodically from Amazon Transcribe to your application. The event can be a
* partial transcription of a section of the audio stream, or it can be the entire
* transcription of that portion of the audio stream. </p>
*/
inline TranscriptResultStream& WithTranscriptEvent(TranscriptEvent&& value) { SetTranscriptEvent(std::move(value)); return *this;}
/**
* <p>A client error occurred when the stream was created. Check the parameters of
* the request and try your request again.</p>
*/
inline const BadRequestException& GetBadRequestException() const{ return m_badRequestException; }
/**
* <p>A client error occurred when the stream was created. Check the parameters of
* the request and try your request again.</p>
*/
inline bool BadRequestExceptionHasBeenSet() const { return m_badRequestExceptionHasBeenSet; }
/**
* <p>A client error occurred when the stream was created. Check the parameters of
* the request and try your request again.</p>
*/
inline void SetBadRequestException(const BadRequestException& value) { m_badRequestExceptionHasBeenSet = true; m_badRequestException = value; }
/**
* <p>A client error occurred when the stream was created. Check the parameters of
* the request and try your request again.</p>
*/
inline void SetBadRequestException(BadRequestException&& value) { m_badRequestExceptionHasBeenSet = true; m_badRequestException = std::move(value); }
/**
* <p>A client error occurred when the stream was created. Check the parameters of
* the request and try your request again.</p>
*/
inline TranscriptResultStream& WithBadRequestException(const BadRequestException& value) { SetBadRequestException(value); return *this;}
/**
* <p>A client error occurred when the stream was created. Check the parameters of
* the request and try your request again.</p>
*/
inline TranscriptResultStream& WithBadRequestException(BadRequestException&& value) { SetBadRequestException(std::move(value)); return *this;}
/**
* <p>Your client has exceeded one of the Amazon Transcribe limits, typically the
* limit on audio length. Break your audio stream into smaller chunks and try your
* request again.</p>
*/
inline const LimitExceededException& GetLimitExceededException() const{ return m_limitExceededException; }
/**
* <p>Your client has exceeded one of the Amazon Transcribe limits, typically the
* limit on audio length. Break your audio stream into smaller chunks and try your
* request again.</p>
*/
inline bool LimitExceededExceptionHasBeenSet() const { return m_limitExceededExceptionHasBeenSet; }
/**
* <p>Your client has exceeded one of the Amazon Transcribe limits, typically the
* limit on audio length. Break your audio stream into smaller chunks and try your
* request again.</p>
*/
inline void SetLimitExceededException(const LimitExceededException& value) { m_limitExceededExceptionHasBeenSet = true; m_limitExceededException = value; }
/**
* <p>Your client has exceeded one of the Amazon Transcribe limits, typically the
* limit on audio length. Break your audio stream into smaller chunks and try your
* request again.</p>
*/
inline void SetLimitExceededException(LimitExceededException&& value) { m_limitExceededExceptionHasBeenSet = true; m_limitExceededException = std::move(value); }
/**
* <p>Your client has exceeded one of the Amazon Transcribe limits, typically the
* limit on audio length. Break your audio stream into smaller chunks and try your
* request again.</p>
*/
inline TranscriptResultStream& WithLimitExceededException(const LimitExceededException& value) { SetLimitExceededException(value); return *this;}
/**
* <p>Your client has exceeded one of the Amazon Transcribe limits, typically the
* limit on audio length. Break your audio stream into smaller chunks and try your
* request again.</p>
*/
inline TranscriptResultStream& WithLimitExceededException(LimitExceededException&& value) { SetLimitExceededException(std::move(value)); return *this;}
/**
* <p>A problem occurred while processing the audio. Amazon Transcribe terminated
* processing.</p>
*/
inline const InternalFailureException& GetInternalFailureException() const{ return m_internalFailureException; }
/**
* <p>A problem occurred while processing the audio. Amazon Transcribe terminated
* processing.</p>
*/
inline bool InternalFailureExceptionHasBeenSet() const { return m_internalFailureExceptionHasBeenSet; }
/**
* <p>A problem occurred while processing the audio. Amazon Transcribe terminated
* processing.</p>
*/
inline void SetInternalFailureException(const InternalFailureException& value) { m_internalFailureExceptionHasBeenSet = true; m_internalFailureException = value; }
/**
* <p>A problem occurred while processing the audio. Amazon Transcribe terminated
* processing.</p>
*/
inline void SetInternalFailureException(InternalFailureException&& value) { m_internalFailureExceptionHasBeenSet = true; m_internalFailureException = std::move(value); }
/**
* <p>A problem occurred while processing the audio. Amazon Transcribe terminated
* processing.</p>
*/
inline TranscriptResultStream& WithInternalFailureException(const InternalFailureException& value) { SetInternalFailureException(value); return *this;}
/**
* <p>A problem occurred while processing the audio. Amazon Transcribe terminated
* processing.</p>
*/
inline TranscriptResultStream& WithInternalFailureException(InternalFailureException&& value) { SetInternalFailureException(std::move(value)); return *this;}
/**
* <p>A new stream started with the same session ID. The current stream has been
* terminated.</p>
*/
inline const ConflictException& GetConflictException() const{ return m_conflictException; }
/**
* <p>A new stream started with the same session ID. The current stream has been
* terminated.</p>
*/
inline bool ConflictExceptionHasBeenSet() const { return m_conflictExceptionHasBeenSet; }
/**
* <p>A new stream started with the same session ID. The current stream has been
* terminated.</p>
*/
inline void SetConflictException(const ConflictException& value) { m_conflictExceptionHasBeenSet = true; m_conflictException = value; }
/**
* <p>A new stream started with the same session ID. The current stream has been
* terminated.</p>
*/
inline void SetConflictException(ConflictException&& value) { m_conflictExceptionHasBeenSet = true; m_conflictException = std::move(value); }
/**
* <p>A new stream started with the same session ID. The current stream has been
* terminated.</p>
*/
inline TranscriptResultStream& WithConflictException(const ConflictException& value) { SetConflictException(value); return *this;}
/**
* <p>A new stream started with the same session ID. The current stream has been
* terminated.</p>
*/
inline TranscriptResultStream& WithConflictException(ConflictException&& value) { SetConflictException(std::move(value)); return *this;}
/**
* <p>Service is currently unavailable. Try your request later.</p>
*/
inline const ServiceUnavailableException& GetServiceUnavailableException() const{ return m_serviceUnavailableException; }
/**
* <p>Service is currently unavailable. Try your request later.</p>
*/
inline bool ServiceUnavailableExceptionHasBeenSet() const { return m_serviceUnavailableExceptionHasBeenSet; }
/**
* <p>Service is currently unavailable. Try your request later.</p>
*/
inline void SetServiceUnavailableException(const ServiceUnavailableException& value) { m_serviceUnavailableExceptionHasBeenSet = true; m_serviceUnavailableException = value; }
/**
* <p>Service is currently unavailable. Try your request later.</p>
*/
inline void SetServiceUnavailableException(ServiceUnavailableException&& value) { m_serviceUnavailableExceptionHasBeenSet = true; m_serviceUnavailableException = std::move(value); }
/**
* <p>Service is currently unavailable. Try your request later.</p>
*/
inline TranscriptResultStream& WithServiceUnavailableException(const ServiceUnavailableException& value) { SetServiceUnavailableException(value); return *this;}
/**
* <p>Service is currently unavailable. Try your request later.</p>
*/
inline TranscriptResultStream& WithServiceUnavailableException(ServiceUnavailableException&& value) { SetServiceUnavailableException(std::move(value)); return *this;}
private:
TranscriptEvent m_transcriptEvent;
bool m_transcriptEventHasBeenSet;
BadRequestException m_badRequestException;
bool m_badRequestExceptionHasBeenSet;
LimitExceededException m_limitExceededException;
bool m_limitExceededExceptionHasBeenSet;
InternalFailureException m_internalFailureException;
bool m_internalFailureExceptionHasBeenSet;
ConflictException m_conflictException;
bool m_conflictExceptionHasBeenSet;
ServiceUnavailableException m_serviceUnavailableException;
bool m_serviceUnavailableExceptionHasBeenSet;
};
} // namespace Model
} // namespace TranscribeStreamingService
} // namespace Aws

View File

@@ -0,0 +1,32 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/transcribestreaming/TranscribeStreamingService_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace TranscribeStreamingService
{
namespace Model
{
enum class VocabularyFilterMethod
{
NOT_SET,
remove,
mask,
tag
};
namespace VocabularyFilterMethodMapper
{
AWS_TRANSCRIBESTREAMINGSERVICE_API VocabularyFilterMethod GetVocabularyFilterMethodForName(const Aws::String& name);
AWS_TRANSCRIBESTREAMINGSERVICE_API Aws::String GetNameForVocabularyFilterMethod(VocabularyFilterMethod value);
} // namespace VocabularyFilterMethodMapper
} // namespace Model
} // namespace TranscribeStreamingService
} // namespace Aws