diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..98a5f30 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,58 @@ +name: ci +on: [push, pull_request] +jobs: + + test-python-service: + name: Test Python service + strategy: + matrix: + os: [ubuntu-18.04, ubuntu-20.04] + python-version: [3.5, 3.6, 3.7, 3.8, 3.9] + runs-on: ${{ matrix.os }} + + steps: + - name: checkout code + uses: actions/checkout@v2 + + - name: set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: initialize submodules + run: git submodule update --init --recursive --progress --depth 1 + + - name: build docker image + run: | + cd python + ./build_docker_image.sh "${GITHUB_REF##*/}" + + - name: run tests + run: | + docker run --rm dictation-client-python:"${GITHUB_REF##*/}" ./tests/test_service_with_script_for_local_usage.sh + ./python/tests/test_service_with_script_for_docker_usage.sh dictation-client-python:"${GITHUB_REF##*/}" + + + test-cpp-service: + name: Test C++ service + strategy: + matrix: + os: [ubuntu-18.04, ubuntu-20.04] + runs-on: ${{ matrix.os }} + + steps: + - name: checkout code + uses: actions/checkout@v2 + + - name: initialize submodules + run: git submodule update --init --recursive --progress --depth 1 + + - name: build docker image + run: | + cd cpp + ./build_docker_image.sh "${GITHUB_REF##*/}" + + - name: run tests + run: | + docker run --rm dictation-client-cpp:"${GITHUB_REF##*/}" ./cpp/tests/test_service_with_script_for_local_usage.sh + ./cpp/tests/test_service_with_script_for_docker_usage.sh dictation-client-cpp:"${GITHUB_REF##*/}" diff --git a/.github/workflows/publish-images.yml b/.github/workflows/publish-images.yml new file mode 100644 index 0000000..b6953cc --- /dev/null +++ b/.github/workflows/publish-images.yml @@ -0,0 +1,48 @@ +name: Publish deploy images +on: + release: + types: [published] + +jobs: + + python-build: + name: Build and publish Python image + runs-on: ubuntu-20.04 + + steps: + - name: checkout code + uses: actions/checkout@v2 + - name: build docker image and push to repository + env: + REPOSITORY: jaredharet/private + DOCKER_LOGIN: ${{ secrets.DOCKER_USER }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASS }} + run: | + cd python + VERSION_TAG=$(awk < VERSION.py '/__version__/ { print $NF }' | cut -d\" -f2) + ./build_docker_image.sh "${VERSION_TAG}" + docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" docker.io + docker tag dictation-client-python:"${VERSION_TAG}" "${REPOSITORY}":dictation-client-python-"${VERSION_TAG}" + docker push "${REPOSITORY}":dictation-client-python-"${VERSION_TAG}" + + cpp-build: + name: Build and publish C++ image + runs-on: ubuntu-20.04 + + steps: + - name: checkout code + uses: actions/checkout@v2 + - name: initialize submodules + run: git submodule update --init --recursive --progress --depth 1 + - name: build docker image and push to repository + env: + REPOSITORY: jaredharet/private + DOCKER_LOGIN: ${{ secrets.DOCKER_USER }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASS }} + run: | + cd cpp + VERSION_TAG=$(awk < libdictation-client/VERSION.h '/LIBDICTATION_CLIENT_VERSION/ { print $NF }' | cut -d\" -f2) + ./build_docker_image.sh "${VERSION_TAG}" + docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" docker.io + docker tag dictation-client-cpp:"${VERSION_TAG}" "${REPOSITORY}":dictation-client-cpp-"${VERSION_TAG}" + docker push "${REPOSITORY}":dictation-client-cpp-"${VERSION_TAG}" \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 00ff76b..a00a331 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ This changelog is intended for tracking content changes in whole repository. We are using single version and changelog for all components. Dev note: Remember to synchronize version in files: `python/VERSION.py` and `cpp/libdictation-client/VERSION.h` +## [2.3.4] - 2020-05-12 +### Changed + - [CPP, python] - renamed `ssl-dir` option [bool] to `tls-dir`. + ## [2.3.3] - 2021-08-01 ### Changed - [CPP] Upgrade Boost version to 1.74.0 diff --git a/README.md b/README.md index a35f099..1aab4f8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ # dictation-client + +![ci Actions Status](https://github.com/JaredHaret/dictation-client/workflows/ci/badge.svg) + Dictation ASR gRPC client Contents: diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 3d3a6fa..66ca346 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.5) set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules" ${CMAKE_MODULE_PATH}) -project(dictation VERSION 1.0 LANGUAGES CXX) +project(dictation-client VERSION 2.3.4 LANGUAGES CXX) set(CMAKE_CXX_STANDARD 14) diff --git a/Dockerfile-cpp b/cpp/Dockerfile similarity index 66% rename from Dockerfile-cpp rename to cpp/Dockerfile index 9d921e9..64aec82 100644 --- a/Dockerfile-cpp +++ b/cpp/Dockerfile @@ -1,7 +1,9 @@ -FROM ubuntu:20.04 +FROM ubuntu:20.04 AS build-stage ARG DEBIAN_FRONTEND=noninteractive +LABEL dictation_client_cpp_build_stage_tmp=true + ADD ./cpp /dictation-client/cpp ADD ./proto /dictation-client/proto ADD ./tools /dictation-client/tools @@ -36,3 +38,19 @@ RUN ./tools/install_boost.sh 4 \ RUN ./tools/build_googleapis.sh && cd cpp && ./make_proto.sh RUN cd cpp && cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release && cmake --build build -- -j 4 + +RUN strip cpp/build/dictation_client + +# ----------------------------------------------------------------------------------------------------- # + +FROM ubuntu:20.04 + +ARG DEBIAN_FRONTEND=noninteractive + +LABEL maintainer="" + +COPY --from=build-stage /dictation-client/cpp/build/dictation_client /dictation-client/cpp/build/dictation_client +COPY --from=build-stage /dictation-client/submodules/ /dictation-client/submodules/ +COPY --from=build-stage /opt /opt + +WORKDIR /dictation-client diff --git a/cpp/README.md b/cpp/README.md index 5a5c862..120adf5 100644 --- a/cpp/README.md +++ b/cpp/README.md @@ -23,16 +23,18 @@ In this case open project repository in web browser, go to the `submodules` dire ### Build docker image -To prepare the docker image with C++ implementation of the Dictation Client, open project's main directory and run following command: +To prepare the docker image with C++ implementation of the Dictation Client, use the building script: ``` -docker build -f Dockerfile-cpp -t dictation-client-cpp:2.3.2 . +./build_docker_image.sh ``` +(To set custom image tag, use the tag name as optional argument, e.g.: `./build_docker_image.sh custom_tag`) + **Note:** The build process may take a several dozen minutes (for shorter build time use the python implementation instead). When the build process is complete, following a message will be shown: ``` -Successfully tagged dictation-client-cpp:2.3.2 +Successfully tagged dictation-client-cpp:2.3.4 ``` ### Run Dictation client diff --git a/cpp/build_docker_image.sh b/cpp/build_docker_image.sh new file mode 100755 index 0000000..57785b0 --- /dev/null +++ b/cpp/build_docker_image.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# coding=utf-8 + +set -euo pipefail +IFS=$'\n\t' + +SCRIPT=$(realpath "$0") +SCRIPTPATH=$(dirname "${SCRIPT}") + +COMMIT_TAG="" + +if [[ "$#" -eq 0 ]] +then + COMMIT_TAG=$(awk < "${SCRIPTPATH}"/libdictation-client/VERSION.h '/LIBDICTATION_CLIENT_VERSION/ { print $NF }' | cut -d\" -f2) +else + COMMIT_TAG="$1" +fi + +docker build -f "${SCRIPTPATH}/Dockerfile" -t dictation-client-cpp:"${COMMIT_TAG}" "${SCRIPTPATH}/.." + +docker rmi "$(docker images --filter=label=dictation_client_cpp_build_stage_tmp=true -q)" diff --git a/cpp/dictation-client/main.cpp b/cpp/dictation-client/main.cpp index 2195858..6f198d0 100644 --- a/cpp/dictation-client/main.cpp +++ b/cpp/dictation-client/main.cpp @@ -76,8 +76,8 @@ po::options_description CreateOptionsDescription(void) { ("help", "Print help message.") ("service-address", po::value()->required(), "IP address and port (address:port) of a service the client will connect to.") - ("ssl-dir", po::value()->default_value(""), - "If set to a path with ssl credential files (client.crt, client.key, ca.crt), use ssl authentication. Otherwise use insecure channel (default).") + ("tls-dir", po::value()->default_value(""), + "If set to a path with SSL/TLS credential files (client.crt, client.key, ca.crt), use SSL/TLS authentication. Otherwise use insecure channel (default).") ("wav-path", po::value()->required(), "Path to wave file with audio content to be sent to service via RPC.") ("session-id", po::value()->default_value(""), @@ -129,7 +129,7 @@ int main(int argc, const char *const argv[]) { techmo::dictation::DictationClient dictation_client{ userOptions["service-address"].as(), - userOptions["ssl-dir"].as(), + userOptions["tls-dir"].as(), }; if (userOptions.count("streaming")) { diff --git a/cpp/docker/run_dictation_client_cpp.sh b/cpp/docker/run_dictation_client_cpp.sh index e16b828..eb28b47 100755 --- a/cpp/docker/run_dictation_client_cpp.sh +++ b/cpp/docker/run_dictation_client_cpp.sh @@ -4,11 +4,10 @@ # This script sends request to dictation service using dictation client inside docker container # Requires "dictation-client-cpp:$IMAGE_VERSION" docker image loaded locally - set -euo pipefail IFS=$'\n\t' -IMAGE_VERSION=2.3.2 +IMAGE_VERSION="2.3.4" SCRIPT=$(realpath "$0") SCRIPTPATH=$(dirname "${SCRIPT}") @@ -19,13 +18,16 @@ usage() { echo " Dictation ASR gRPC client ${IMAGE_VERSION} Dictation ASR gRPC client options: + -h, --help Print help message. - -s=ADDRESS, --service-address=ADDRESS + --custom-image=IMAGE:TAG + Uses a custom docker image instead of the default. + -s=ADDRESS, --service-address=ADDRESS IP address and port (address:port) of a service the client will connect to. - --tls If set, uses tls authentication, otherwise use insecure channel (default). The tls credential files (client.crt, client.key, ca.crt) should be placed inside 'tls' directory. - -f=WAVE, --filename=WAVE + --tls If set, uses SSL/TLS authentication, otherwise use insecure channel (default). The tls credential files (client.crt, client.key, ca.crt) should be placed inside 'tls' directory. + -f=WAVE, --filename=WAVE Path to wave file with audio content to be sent to service via RPC. - --session-id=SESSION_ID + --session-id=SESSION_ID Session ID to be passed to the service. If not specified, the service will generate a default session ID itself. --grpc-timeout=GRPC_TIMEOUT Timeout in milliseconds used to set gRPC deadline - how long the client is willing to wait for a reply from the server. If not specified, the service will set the deadline to a very large number. @@ -33,9 +35,9 @@ Dictation ASR gRPC client options: --time-offsets If true, returns also recognized word time offsets. --single-utterance If set - the recognizer will detect a single spoken utterance. --interim-results If set - messages with temporal results will be shown. - --service-settings=SETTINGS + --service-settings=SETTINGS Semicolon-separated list of key=value pairs defining settings to be sent to service via gRPC request. - --max-alternatives=MAX_ALTERNATIVES + --max-alternatives=MAX_ALTERNATIVES Maximum number of recognition hypotheses to be returned. --context-phrase=CONTEXT_PHRASE Specifies which context model to use. @@ -47,22 +49,25 @@ while getopts "f:hs:-:" optchar; do case "${optchar}" in -) case "${OPTARG}" in - help) - usage; exit 0 + custom-image=*) + docker_image=${OPTARG#*=} + ;; + help) + usage; exit 0 ;; - tls) - opts+=( "--ssl-dir" "/volume/tls" ) + tls) + opts+=( "--tls-dir" "/volume/tls" ) ;; - time-offsets) + time-offsets) opts+=( "--time-offsets=true" ) ;; - single-utterance) + single-utterance) opts+=( "--single-utterance=true" ) ;; - interim-results) + interim-results) opts+=( "--interim-results=true" ) ;; - streaming) + streaming) opts+=( "--streaming" ) ;; filename=*) @@ -81,25 +86,25 @@ while getopts "f:hs:-:" optchar; do fi ;; esac;; - f) + f) val=${OPTARG#*=} opt=${OPTARG%=$val} opts+=( "--wav-path" "/volume/wav/${val##*/}" ) ;; - h) - usage; exit 0 + h) + usage; exit 0 ;; - s) + s) val=${OPTARG#*=} opt=${OPTARG%=$val} opts+=( "--service-address" "${val}" ) ;; *) - usage + usage exit 1 ;; esac done -docker run --rm -it -v "${SCRIPTPATH}:/volume" --network host "${docker_image}" \ +docker run --rm -v "${SCRIPTPATH}:/volume" --network host "${docker_image}" \ ./cpp/build/dictation_client "${opts[@]}" diff --git a/cpp/libdictation-client/VERSION.h b/cpp/libdictation-client/VERSION.h index 7c88428..84dabcc 100644 --- a/cpp/libdictation-client/VERSION.h +++ b/cpp/libdictation-client/VERSION.h @@ -1 +1 @@ -static constexpr auto LIBDICTATION_CLIENT_VERSION = "2.3.3"; +static constexpr auto LIBDICTATION_CLIENT_VERSION = "2.3.4"; diff --git a/cpp/libdictation-client/dictation_asr.grpc.pb.cc b/cpp/libdictation-client/dictation_asr.grpc.pb.cc deleted file mode 100644 index 7e55fa9..0000000 --- a/cpp/libdictation-client/dictation_asr.grpc.pb.cc +++ /dev/null @@ -1,118 +0,0 @@ -// Generated by the gRPC C++ plugin. -// If you make any local change, they will be lost. -// source: dictation_asr.proto - -#include "dictation_asr.pb.h" -#include "dictation_asr.grpc.pb.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -namespace google { -namespace cloud { -namespace speech { -namespace v1 { - -static const char* Speech_method_names[] = { - "/google.cloud.speech.v1.Speech/Recognize", - "/google.cloud.speech.v1.Speech/StreamingRecognize", -}; - -std::unique_ptr< Speech::Stub> Speech::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) { - (void)options; - std::unique_ptr< Speech::Stub> stub(new Speech::Stub(channel)); - return stub; -} - -Speech::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel) - : channel_(channel), rpcmethod_Recognize_(Speech_method_names[0], ::grpc::internal::RpcMethod::NORMAL_RPC, channel) - , rpcmethod_StreamingRecognize_(Speech_method_names[1], ::grpc::internal::RpcMethod::BIDI_STREAMING, channel) - {} - -::grpc::Status Speech::Stub::Recognize(::grpc::ClientContext* context, const ::google::cloud::speech::v1::RecognizeRequest& request, ::google::cloud::speech::v1::RecognizeResponse* response) { - return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_Recognize_, context, request, response); -} - -void Speech::Stub::experimental_async::Recognize(::grpc::ClientContext* context, const ::google::cloud::speech::v1::RecognizeRequest* request, ::google::cloud::speech::v1::RecognizeResponse* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_Recognize_, context, request, response, std::move(f)); -} - -void Speech::Stub::experimental_async::Recognize(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::google::cloud::speech::v1::RecognizeResponse* response, std::function f) { - ::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_Recognize_, context, request, response, std::move(f)); -} - -void Speech::Stub::experimental_async::Recognize(::grpc::ClientContext* context, const ::google::cloud::speech::v1::RecognizeRequest* request, ::google::cloud::speech::v1::RecognizeResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_Recognize_, context, request, response, reactor); -} - -void Speech::Stub::experimental_async::Recognize(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::google::cloud::speech::v1::RecognizeResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) { - ::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_Recognize_, context, request, response, reactor); -} - -::grpc::ClientAsyncResponseReader< ::google::cloud::speech::v1::RecognizeResponse>* Speech::Stub::AsyncRecognizeRaw(::grpc::ClientContext* context, const ::google::cloud::speech::v1::RecognizeRequest& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::google::cloud::speech::v1::RecognizeResponse>::Create(channel_.get(), cq, rpcmethod_Recognize_, context, request, true); -} - -::grpc::ClientAsyncResponseReader< ::google::cloud::speech::v1::RecognizeResponse>* Speech::Stub::PrepareAsyncRecognizeRaw(::grpc::ClientContext* context, const ::google::cloud::speech::v1::RecognizeRequest& request, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::google::cloud::speech::v1::RecognizeResponse>::Create(channel_.get(), cq, rpcmethod_Recognize_, context, request, false); -} - -::grpc::ClientReaderWriter< ::google::cloud::speech::v1::StreamingRecognizeRequest, ::google::cloud::speech::v1::StreamingRecognizeResponse>* Speech::Stub::StreamingRecognizeRaw(::grpc::ClientContext* context) { - return ::grpc_impl::internal::ClientReaderWriterFactory< ::google::cloud::speech::v1::StreamingRecognizeRequest, ::google::cloud::speech::v1::StreamingRecognizeResponse>::Create(channel_.get(), rpcmethod_StreamingRecognize_, context); -} - -void Speech::Stub::experimental_async::StreamingRecognize(::grpc::ClientContext* context, ::grpc::experimental::ClientBidiReactor< ::google::cloud::speech::v1::StreamingRecognizeRequest,::google::cloud::speech::v1::StreamingRecognizeResponse>* reactor) { - ::grpc_impl::internal::ClientCallbackReaderWriterFactory< ::google::cloud::speech::v1::StreamingRecognizeRequest,::google::cloud::speech::v1::StreamingRecognizeResponse>::Create(stub_->channel_.get(), stub_->rpcmethod_StreamingRecognize_, context, reactor); -} - -::grpc::ClientAsyncReaderWriter< ::google::cloud::speech::v1::StreamingRecognizeRequest, ::google::cloud::speech::v1::StreamingRecognizeResponse>* Speech::Stub::AsyncStreamingRecognizeRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) { - return ::grpc_impl::internal::ClientAsyncReaderWriterFactory< ::google::cloud::speech::v1::StreamingRecognizeRequest, ::google::cloud::speech::v1::StreamingRecognizeResponse>::Create(channel_.get(), cq, rpcmethod_StreamingRecognize_, context, true, tag); -} - -::grpc::ClientAsyncReaderWriter< ::google::cloud::speech::v1::StreamingRecognizeRequest, ::google::cloud::speech::v1::StreamingRecognizeResponse>* Speech::Stub::PrepareAsyncStreamingRecognizeRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) { - return ::grpc_impl::internal::ClientAsyncReaderWriterFactory< ::google::cloud::speech::v1::StreamingRecognizeRequest, ::google::cloud::speech::v1::StreamingRecognizeResponse>::Create(channel_.get(), cq, rpcmethod_StreamingRecognize_, context, false, nullptr); -} - -Speech::Service::Service() { - AddMethod(new ::grpc::internal::RpcServiceMethod( - Speech_method_names[0], - ::grpc::internal::RpcMethod::NORMAL_RPC, - new ::grpc::internal::RpcMethodHandler< Speech::Service, ::google::cloud::speech::v1::RecognizeRequest, ::google::cloud::speech::v1::RecognizeResponse>( - std::mem_fn(&Speech::Service::Recognize), this))); - AddMethod(new ::grpc::internal::RpcServiceMethod( - Speech_method_names[1], - ::grpc::internal::RpcMethod::BIDI_STREAMING, - new ::grpc::internal::BidiStreamingHandler< Speech::Service, ::google::cloud::speech::v1::StreamingRecognizeRequest, ::google::cloud::speech::v1::StreamingRecognizeResponse>( - std::mem_fn(&Speech::Service::StreamingRecognize), this))); -} - -Speech::Service::~Service() { -} - -::grpc::Status Speech::Service::Recognize(::grpc::ServerContext* context, const ::google::cloud::speech::v1::RecognizeRequest* request, ::google::cloud::speech::v1::RecognizeResponse* response) { - (void) context; - (void) request; - (void) response; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - -::grpc::Status Speech::Service::StreamingRecognize(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::google::cloud::speech::v1::StreamingRecognizeResponse, ::google::cloud::speech::v1::StreamingRecognizeRequest>* stream) { - (void) context; - (void) stream; - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); -} - - -} // namespace google -} // namespace cloud -} // namespace speech -} // namespace v1 - diff --git a/cpp/libdictation-client/dictation_asr.grpc.pb.h b/cpp/libdictation-client/dictation_asr.grpc.pb.h deleted file mode 100644 index 7e8b711..0000000 --- a/cpp/libdictation-client/dictation_asr.grpc.pb.h +++ /dev/null @@ -1,458 +0,0 @@ -// Generated by the gRPC C++ plugin. -// If you make any local change, they will be lost. -// source: dictation_asr.proto -// Original file comments: -// Copyright 2018 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Modified by Techmo, copyright by Google. Changes include: -// 1. Additions that introduce new features to the original API. Extensions (parts that were added to the original document) by Techmo are marked with [**Extension by Techmo**] tag. -// - `MP3` audio encoding type. -// - `ConfigField` as means to provide additional configuration. -// - `ResultFinalizationCause` as means to indicate MRCPv2-related recognition result finalization cause. -// - `RecognitionLattice` and `LatticeEdge` as means to return detailed recognition results. -// 2. Modifications of comments, according to how recognition is performed by Techmo. -// - [*Unused*] tags for fields or values that are not used (ignored when provided in request, never returned in response). -// - [*Unsupported*] tags for fields or values that will result in an error when provided in request. -// 3. Removal of `LongRunningRecognize` support (commented out). -#ifndef GRPC_dictation_5fasr_2eproto__INCLUDED -#define GRPC_dictation_5fasr_2eproto__INCLUDED - -#include "dictation_asr.pb.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace grpc_impl { -class CompletionQueue; -class ServerCompletionQueue; -class ServerContext; -} // namespace grpc_impl - -namespace grpc { -namespace experimental { -template -class MessageAllocator; -} // namespace experimental -} // namespace grpc - -namespace google { -namespace cloud { -namespace speech { -namespace v1 { - -// Service that implements Google Cloud Speech API extended by Techmo. -class Speech final { - public: - static constexpr char const* service_full_name() { - return "google.cloud.speech.v1.Speech"; - } - class StubInterface { - public: - virtual ~StubInterface() {} - // Performs synchronous speech recognition: receive results after all audio - // has been sent and processed. - virtual ::grpc::Status Recognize(::grpc::ClientContext* context, const ::google::cloud::speech::v1::RecognizeRequest& request, ::google::cloud::speech::v1::RecognizeResponse* response) = 0; - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::google::cloud::speech::v1::RecognizeResponse>> AsyncRecognize(::grpc::ClientContext* context, const ::google::cloud::speech::v1::RecognizeRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::google::cloud::speech::v1::RecognizeResponse>>(AsyncRecognizeRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::google::cloud::speech::v1::RecognizeResponse>> PrepareAsyncRecognize(::grpc::ClientContext* context, const ::google::cloud::speech::v1::RecognizeRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::google::cloud::speech::v1::RecognizeResponse>>(PrepareAsyncRecognizeRaw(context, request, cq)); - } - // Performs asynchronous speech recognition: receive results via the - // google.longrunning.Operations interface. Returns either an - // `Operation.error` or an `Operation.response` which contains - // a `LongRunningRecognizeResponse` message. - // rpc LongRunningRecognize(LongRunningRecognizeRequest) returns (google.longrunning.Operation) { - // option (google.api.http) = { - // post: "/v1/speech:longrunningrecognize" - // body: "*" - // }; - // } - // - // Performs bidirectional streaming speech recognition: receive results while - // sending audio. This method is only available via the gRPC API (not REST). - std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::google::cloud::speech::v1::StreamingRecognizeRequest, ::google::cloud::speech::v1::StreamingRecognizeResponse>> StreamingRecognize(::grpc::ClientContext* context) { - return std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::google::cloud::speech::v1::StreamingRecognizeRequest, ::google::cloud::speech::v1::StreamingRecognizeResponse>>(StreamingRecognizeRaw(context)); - } - std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::google::cloud::speech::v1::StreamingRecognizeRequest, ::google::cloud::speech::v1::StreamingRecognizeResponse>> AsyncStreamingRecognize(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) { - return std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::google::cloud::speech::v1::StreamingRecognizeRequest, ::google::cloud::speech::v1::StreamingRecognizeResponse>>(AsyncStreamingRecognizeRaw(context, cq, tag)); - } - std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::google::cloud::speech::v1::StreamingRecognizeRequest, ::google::cloud::speech::v1::StreamingRecognizeResponse>> PrepareAsyncStreamingRecognize(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::google::cloud::speech::v1::StreamingRecognizeRequest, ::google::cloud::speech::v1::StreamingRecognizeResponse>>(PrepareAsyncStreamingRecognizeRaw(context, cq)); - } - class experimental_async_interface { - public: - virtual ~experimental_async_interface() {} - // Performs synchronous speech recognition: receive results after all audio - // has been sent and processed. - virtual void Recognize(::grpc::ClientContext* context, const ::google::cloud::speech::v1::RecognizeRequest* request, ::google::cloud::speech::v1::RecognizeResponse* response, std::function) = 0; - virtual void Recognize(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::google::cloud::speech::v1::RecognizeResponse* response, std::function) = 0; - virtual void Recognize(::grpc::ClientContext* context, const ::google::cloud::speech::v1::RecognizeRequest* request, ::google::cloud::speech::v1::RecognizeResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - virtual void Recognize(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::google::cloud::speech::v1::RecognizeResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) = 0; - // Performs asynchronous speech recognition: receive results via the - // google.longrunning.Operations interface. Returns either an - // `Operation.error` or an `Operation.response` which contains - // a `LongRunningRecognizeResponse` message. - // rpc LongRunningRecognize(LongRunningRecognizeRequest) returns (google.longrunning.Operation) { - // option (google.api.http) = { - // post: "/v1/speech:longrunningrecognize" - // body: "*" - // }; - // } - // - // Performs bidirectional streaming speech recognition: receive results while - // sending audio. This method is only available via the gRPC API (not REST). - virtual void StreamingRecognize(::grpc::ClientContext* context, ::grpc::experimental::ClientBidiReactor< ::google::cloud::speech::v1::StreamingRecognizeRequest,::google::cloud::speech::v1::StreamingRecognizeResponse>* reactor) = 0; - }; - virtual class experimental_async_interface* experimental_async() { return nullptr; } - private: - virtual ::grpc::ClientAsyncResponseReaderInterface< ::google::cloud::speech::v1::RecognizeResponse>* AsyncRecognizeRaw(::grpc::ClientContext* context, const ::google::cloud::speech::v1::RecognizeRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientAsyncResponseReaderInterface< ::google::cloud::speech::v1::RecognizeResponse>* PrepareAsyncRecognizeRaw(::grpc::ClientContext* context, const ::google::cloud::speech::v1::RecognizeRequest& request, ::grpc::CompletionQueue* cq) = 0; - virtual ::grpc::ClientReaderWriterInterface< ::google::cloud::speech::v1::StreamingRecognizeRequest, ::google::cloud::speech::v1::StreamingRecognizeResponse>* StreamingRecognizeRaw(::grpc::ClientContext* context) = 0; - virtual ::grpc::ClientAsyncReaderWriterInterface< ::google::cloud::speech::v1::StreamingRecognizeRequest, ::google::cloud::speech::v1::StreamingRecognizeResponse>* AsyncStreamingRecognizeRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) = 0; - virtual ::grpc::ClientAsyncReaderWriterInterface< ::google::cloud::speech::v1::StreamingRecognizeRequest, ::google::cloud::speech::v1::StreamingRecognizeResponse>* PrepareAsyncStreamingRecognizeRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) = 0; - }; - class Stub final : public StubInterface { - public: - Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel); - ::grpc::Status Recognize(::grpc::ClientContext* context, const ::google::cloud::speech::v1::RecognizeRequest& request, ::google::cloud::speech::v1::RecognizeResponse* response) override; - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::google::cloud::speech::v1::RecognizeResponse>> AsyncRecognize(::grpc::ClientContext* context, const ::google::cloud::speech::v1::RecognizeRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::google::cloud::speech::v1::RecognizeResponse>>(AsyncRecognizeRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::google::cloud::speech::v1::RecognizeResponse>> PrepareAsyncRecognize(::grpc::ClientContext* context, const ::google::cloud::speech::v1::RecognizeRequest& request, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::google::cloud::speech::v1::RecognizeResponse>>(PrepareAsyncRecognizeRaw(context, request, cq)); - } - std::unique_ptr< ::grpc::ClientReaderWriter< ::google::cloud::speech::v1::StreamingRecognizeRequest, ::google::cloud::speech::v1::StreamingRecognizeResponse>> StreamingRecognize(::grpc::ClientContext* context) { - return std::unique_ptr< ::grpc::ClientReaderWriter< ::google::cloud::speech::v1::StreamingRecognizeRequest, ::google::cloud::speech::v1::StreamingRecognizeResponse>>(StreamingRecognizeRaw(context)); - } - std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::google::cloud::speech::v1::StreamingRecognizeRequest, ::google::cloud::speech::v1::StreamingRecognizeResponse>> AsyncStreamingRecognize(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) { - return std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::google::cloud::speech::v1::StreamingRecognizeRequest, ::google::cloud::speech::v1::StreamingRecognizeResponse>>(AsyncStreamingRecognizeRaw(context, cq, tag)); - } - std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::google::cloud::speech::v1::StreamingRecognizeRequest, ::google::cloud::speech::v1::StreamingRecognizeResponse>> PrepareAsyncStreamingRecognize(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) { - return std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::google::cloud::speech::v1::StreamingRecognizeRequest, ::google::cloud::speech::v1::StreamingRecognizeResponse>>(PrepareAsyncStreamingRecognizeRaw(context, cq)); - } - class experimental_async final : - public StubInterface::experimental_async_interface { - public: - void Recognize(::grpc::ClientContext* context, const ::google::cloud::speech::v1::RecognizeRequest* request, ::google::cloud::speech::v1::RecognizeResponse* response, std::function) override; - void Recognize(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::google::cloud::speech::v1::RecognizeResponse* response, std::function) override; - void Recognize(::grpc::ClientContext* context, const ::google::cloud::speech::v1::RecognizeRequest* request, ::google::cloud::speech::v1::RecognizeResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void Recognize(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::google::cloud::speech::v1::RecognizeResponse* response, ::grpc::experimental::ClientUnaryReactor* reactor) override; - void StreamingRecognize(::grpc::ClientContext* context, ::grpc::experimental::ClientBidiReactor< ::google::cloud::speech::v1::StreamingRecognizeRequest,::google::cloud::speech::v1::StreamingRecognizeResponse>* reactor) override; - private: - friend class Stub; - explicit experimental_async(Stub* stub): stub_(stub) { } - Stub* stub() { return stub_; } - Stub* stub_; - }; - class experimental_async_interface* experimental_async() override { return &async_stub_; } - - private: - std::shared_ptr< ::grpc::ChannelInterface> channel_; - class experimental_async async_stub_{this}; - ::grpc::ClientAsyncResponseReader< ::google::cloud::speech::v1::RecognizeResponse>* AsyncRecognizeRaw(::grpc::ClientContext* context, const ::google::cloud::speech::v1::RecognizeRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientAsyncResponseReader< ::google::cloud::speech::v1::RecognizeResponse>* PrepareAsyncRecognizeRaw(::grpc::ClientContext* context, const ::google::cloud::speech::v1::RecognizeRequest& request, ::grpc::CompletionQueue* cq) override; - ::grpc::ClientReaderWriter< ::google::cloud::speech::v1::StreamingRecognizeRequest, ::google::cloud::speech::v1::StreamingRecognizeResponse>* StreamingRecognizeRaw(::grpc::ClientContext* context) override; - ::grpc::ClientAsyncReaderWriter< ::google::cloud::speech::v1::StreamingRecognizeRequest, ::google::cloud::speech::v1::StreamingRecognizeResponse>* AsyncStreamingRecognizeRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) override; - ::grpc::ClientAsyncReaderWriter< ::google::cloud::speech::v1::StreamingRecognizeRequest, ::google::cloud::speech::v1::StreamingRecognizeResponse>* PrepareAsyncStreamingRecognizeRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq) override; - const ::grpc::internal::RpcMethod rpcmethod_Recognize_; - const ::grpc::internal::RpcMethod rpcmethod_StreamingRecognize_; - }; - static std::unique_ptr NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); - - class Service : public ::grpc::Service { - public: - Service(); - virtual ~Service(); - // Performs synchronous speech recognition: receive results after all audio - // has been sent and processed. - virtual ::grpc::Status Recognize(::grpc::ServerContext* context, const ::google::cloud::speech::v1::RecognizeRequest* request, ::google::cloud::speech::v1::RecognizeResponse* response); - // Performs asynchronous speech recognition: receive results via the - // google.longrunning.Operations interface. Returns either an - // `Operation.error` or an `Operation.response` which contains - // a `LongRunningRecognizeResponse` message. - // rpc LongRunningRecognize(LongRunningRecognizeRequest) returns (google.longrunning.Operation) { - // option (google.api.http) = { - // post: "/v1/speech:longrunningrecognize" - // body: "*" - // }; - // } - // - // Performs bidirectional streaming speech recognition: receive results while - // sending audio. This method is only available via the gRPC API (not REST). - virtual ::grpc::Status StreamingRecognize(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::google::cloud::speech::v1::StreamingRecognizeResponse, ::google::cloud::speech::v1::StreamingRecognizeRequest>* stream); - }; - template - class WithAsyncMethod_Recognize : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_Recognize() { - ::grpc::Service::MarkMethodAsync(0); - } - ~WithAsyncMethod_Recognize() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Recognize(::grpc::ServerContext* /*context*/, const ::google::cloud::speech::v1::RecognizeRequest* /*request*/, ::google::cloud::speech::v1::RecognizeResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestRecognize(::grpc::ServerContext* context, ::google::cloud::speech::v1::RecognizeRequest* request, ::grpc::ServerAsyncResponseWriter< ::google::cloud::speech::v1::RecognizeResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithAsyncMethod_StreamingRecognize : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithAsyncMethod_StreamingRecognize() { - ::grpc::Service::MarkMethodAsync(1); - } - ~WithAsyncMethod_StreamingRecognize() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status StreamingRecognize(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::google::cloud::speech::v1::StreamingRecognizeResponse, ::google::cloud::speech::v1::StreamingRecognizeRequest>* /*stream*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestStreamingRecognize(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter< ::google::cloud::speech::v1::StreamingRecognizeResponse, ::google::cloud::speech::v1::StreamingRecognizeRequest>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncBidiStreaming(1, context, stream, new_call_cq, notification_cq, tag); - } - }; - typedef WithAsyncMethod_Recognize > AsyncService; - template - class ExperimentalWithCallbackMethod_Recognize : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_Recognize() { - ::grpc::Service::experimental().MarkMethodCallback(0, - new ::grpc_impl::internal::CallbackUnaryHandler< ::google::cloud::speech::v1::RecognizeRequest, ::google::cloud::speech::v1::RecognizeResponse>( - [this](::grpc::ServerContext* context, - const ::google::cloud::speech::v1::RecognizeRequest* request, - ::google::cloud::speech::v1::RecognizeResponse* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - return this->Recognize(context, request, response, controller); - })); - } - void SetMessageAllocatorFor_Recognize( - ::grpc::experimental::MessageAllocator< ::google::cloud::speech::v1::RecognizeRequest, ::google::cloud::speech::v1::RecognizeResponse>* allocator) { - static_cast<::grpc_impl::internal::CallbackUnaryHandler< ::google::cloud::speech::v1::RecognizeRequest, ::google::cloud::speech::v1::RecognizeResponse>*>( - ::grpc::Service::experimental().GetHandler(0)) - ->SetMessageAllocator(allocator); - } - ~ExperimentalWithCallbackMethod_Recognize() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Recognize(::grpc::ServerContext* /*context*/, const ::google::cloud::speech::v1::RecognizeRequest* /*request*/, ::google::cloud::speech::v1::RecognizeResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void Recognize(::grpc::ServerContext* /*context*/, const ::google::cloud::speech::v1::RecognizeRequest* /*request*/, ::google::cloud::speech::v1::RecognizeResponse* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithCallbackMethod_StreamingRecognize : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithCallbackMethod_StreamingRecognize() { - ::grpc::Service::experimental().MarkMethodCallback(1, - new ::grpc_impl::internal::CallbackBidiHandler< ::google::cloud::speech::v1::StreamingRecognizeRequest, ::google::cloud::speech::v1::StreamingRecognizeResponse>( - [this] { return this->StreamingRecognize(); })); - } - ~ExperimentalWithCallbackMethod_StreamingRecognize() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status StreamingRecognize(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::google::cloud::speech::v1::StreamingRecognizeResponse, ::google::cloud::speech::v1::StreamingRecognizeRequest>* /*stream*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::experimental::ServerBidiReactor< ::google::cloud::speech::v1::StreamingRecognizeRequest, ::google::cloud::speech::v1::StreamingRecognizeResponse>* StreamingRecognize() { - return new ::grpc_impl::internal::UnimplementedBidiReactor< - ::google::cloud::speech::v1::StreamingRecognizeRequest, ::google::cloud::speech::v1::StreamingRecognizeResponse>;} - }; - typedef ExperimentalWithCallbackMethod_Recognize > ExperimentalCallbackService; - template - class WithGenericMethod_Recognize : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_Recognize() { - ::grpc::Service::MarkMethodGeneric(0); - } - ~WithGenericMethod_Recognize() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Recognize(::grpc::ServerContext* /*context*/, const ::google::cloud::speech::v1::RecognizeRequest* /*request*/, ::google::cloud::speech::v1::RecognizeResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithGenericMethod_StreamingRecognize : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithGenericMethod_StreamingRecognize() { - ::grpc::Service::MarkMethodGeneric(1); - } - ~WithGenericMethod_StreamingRecognize() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status StreamingRecognize(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::google::cloud::speech::v1::StreamingRecognizeResponse, ::google::cloud::speech::v1::StreamingRecognizeRequest>* /*stream*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - }; - template - class WithRawMethod_Recognize : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_Recognize() { - ::grpc::Service::MarkMethodRaw(0); - } - ~WithRawMethod_Recognize() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Recognize(::grpc::ServerContext* /*context*/, const ::google::cloud::speech::v1::RecognizeRequest* /*request*/, ::google::cloud::speech::v1::RecognizeResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestRecognize(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag); - } - }; - template - class WithRawMethod_StreamingRecognize : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithRawMethod_StreamingRecognize() { - ::grpc::Service::MarkMethodRaw(1); - } - ~WithRawMethod_StreamingRecognize() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status StreamingRecognize(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::google::cloud::speech::v1::StreamingRecognizeResponse, ::google::cloud::speech::v1::StreamingRecognizeRequest>* /*stream*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - void RequestStreamingRecognize(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { - ::grpc::Service::RequestAsyncBidiStreaming(1, context, stream, new_call_cq, notification_cq, tag); - } - }; - template - class ExperimentalWithRawCallbackMethod_Recognize : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_Recognize() { - ::grpc::Service::experimental().MarkMethodRawCallback(0, - new ::grpc_impl::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this](::grpc::ServerContext* context, - const ::grpc::ByteBuffer* request, - ::grpc::ByteBuffer* response, - ::grpc::experimental::ServerCallbackRpcController* controller) { - this->Recognize(context, request, response, controller); - })); - } - ~ExperimentalWithRawCallbackMethod_Recognize() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status Recognize(::grpc::ServerContext* /*context*/, const ::google::cloud::speech::v1::RecognizeRequest* /*request*/, ::google::cloud::speech::v1::RecognizeResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual void Recognize(::grpc::ServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/, ::grpc::experimental::ServerCallbackRpcController* controller) { controller->Finish(::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); } - }; - template - class ExperimentalWithRawCallbackMethod_StreamingRecognize : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - ExperimentalWithRawCallbackMethod_StreamingRecognize() { - ::grpc::Service::experimental().MarkMethodRawCallback(1, - new ::grpc_impl::internal::CallbackBidiHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>( - [this] { return this->StreamingRecognize(); })); - } - ~ExperimentalWithRawCallbackMethod_StreamingRecognize() override { - BaseClassMustBeDerivedFromService(this); - } - // disable synchronous version of this method - ::grpc::Status StreamingRecognize(::grpc::ServerContext* /*context*/, ::grpc::ServerReaderWriter< ::google::cloud::speech::v1::StreamingRecognizeResponse, ::google::cloud::speech::v1::StreamingRecognizeRequest>* /*stream*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - virtual ::grpc::experimental::ServerBidiReactor< ::grpc::ByteBuffer, ::grpc::ByteBuffer>* StreamingRecognize() { - return new ::grpc_impl::internal::UnimplementedBidiReactor< - ::grpc::ByteBuffer, ::grpc::ByteBuffer>;} - }; - template - class WithStreamedUnaryMethod_Recognize : public BaseClass { - private: - void BaseClassMustBeDerivedFromService(const Service* /*service*/) {} - public: - WithStreamedUnaryMethod_Recognize() { - ::grpc::Service::MarkMethodStreamed(0, - new ::grpc::internal::StreamedUnaryHandler< ::google::cloud::speech::v1::RecognizeRequest, ::google::cloud::speech::v1::RecognizeResponse>(std::bind(&WithStreamedUnaryMethod_Recognize::StreamedRecognize, this, std::placeholders::_1, std::placeholders::_2))); - } - ~WithStreamedUnaryMethod_Recognize() override { - BaseClassMustBeDerivedFromService(this); - } - // disable regular version of this method - ::grpc::Status Recognize(::grpc::ServerContext* /*context*/, const ::google::cloud::speech::v1::RecognizeRequest* /*request*/, ::google::cloud::speech::v1::RecognizeResponse* /*response*/) override { - abort(); - return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); - } - // replace default version of method with streamed unary - virtual ::grpc::Status StreamedRecognize(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::google::cloud::speech::v1::RecognizeRequest,::google::cloud::speech::v1::RecognizeResponse>* server_unary_streamer) = 0; - }; - typedef WithStreamedUnaryMethod_Recognize StreamedUnaryService; - typedef Service SplitStreamedService; - typedef WithStreamedUnaryMethod_Recognize StreamedService; -}; - -} // namespace v1 -} // namespace speech -} // namespace cloud -} // namespace google - - -#endif // GRPC_dictation_5fasr_2eproto__INCLUDED diff --git a/cpp/libdictation-client/dictation_asr.pb.cc b/cpp/libdictation-client/dictation_asr.pb.cc deleted file mode 100644 index 3c36906..0000000 --- a/cpp/libdictation-client/dictation_asr.pb.cc +++ /dev/null @@ -1,5129 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: dictation_asr.proto - -#include "dictation_asr.pb.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -// @@protoc_insertion_point(includes) -#include -extern PROTOBUF_INTERNAL_EXPORT_dictation_5fasr_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ConfigField_dictation_5fasr_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_dictation_5fasr_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_LatticeEdge_dictation_5fasr_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_dictation_5fasr_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_RecognitionAudio_dictation_5fasr_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_dictation_5fasr_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_RecognitionConfig_dictation_5fasr_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_dictation_5fasr_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_RecognitionLattice_dictation_5fasr_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_dictation_5fasr_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_SpeechContext_dictation_5fasr_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_dictation_5fasr_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_SpeechRecognitionAlternative_dictation_5fasr_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_dictation_5fasr_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_SpeechRecognitionResult_dictation_5fasr_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_dictation_5fasr_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_StreamingRecognitionConfig_dictation_5fasr_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_dictation_5fasr_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_StreamingRecognitionResult_dictation_5fasr_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_dictation_5fasr_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_WordInfo_dictation_5fasr_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2fduration_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Duration_google_2fprotobuf_2fduration_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_google_2frpc_2fstatus_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Status_google_2frpc_2fstatus_2eproto; -namespace google { -namespace cloud { -namespace speech { -namespace v1 { -class RecognizeRequestDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _RecognizeRequest_default_instance_; -class StreamingRecognizeRequestDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; - const ::google::cloud::speech::v1::StreamingRecognitionConfig* streaming_config_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr audio_content_; -} _StreamingRecognizeRequest_default_instance_; -class StreamingRecognitionConfigDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _StreamingRecognitionConfig_default_instance_; -class RecognitionConfigDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _RecognitionConfig_default_instance_; -class SpeechContextDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _SpeechContext_default_instance_; -class ConfigFieldDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _ConfigField_default_instance_; -class RecognitionAudioDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr content_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr uri_; -} _RecognitionAudio_default_instance_; -class RecognizeResponseDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _RecognizeResponse_default_instance_; -class StreamingRecognizeResponseDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _StreamingRecognizeResponse_default_instance_; -class StreamingRecognitionResultDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _StreamingRecognitionResult_default_instance_; -class SpeechRecognitionResultDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _SpeechRecognitionResult_default_instance_; -class SpeechRecognitionAlternativeDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _SpeechRecognitionAlternative_default_instance_; -class WordInfoDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _WordInfo_default_instance_; -class RecognitionLatticeDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _RecognitionLattice_default_instance_; -class LatticeEdgeDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _LatticeEdge_default_instance_; -} // namespace v1 -} // namespace speech -} // namespace cloud -} // namespace google -static void InitDefaultsscc_info_ConfigField_dictation_5fasr_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::google::cloud::speech::v1::_ConfigField_default_instance_; - new (ptr) ::google::cloud::speech::v1::ConfigField(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::google::cloud::speech::v1::ConfigField::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ConfigField_dictation_5fasr_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_ConfigField_dictation_5fasr_2eproto}, {}}; - -static void InitDefaultsscc_info_LatticeEdge_dictation_5fasr_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::google::cloud::speech::v1::_LatticeEdge_default_instance_; - new (ptr) ::google::cloud::speech::v1::LatticeEdge(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::google::cloud::speech::v1::LatticeEdge::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_LatticeEdge_dictation_5fasr_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_LatticeEdge_dictation_5fasr_2eproto}, {}}; - -static void InitDefaultsscc_info_RecognitionAudio_dictation_5fasr_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::google::cloud::speech::v1::_RecognitionAudio_default_instance_; - new (ptr) ::google::cloud::speech::v1::RecognitionAudio(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::google::cloud::speech::v1::RecognitionAudio::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_RecognitionAudio_dictation_5fasr_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_RecognitionAudio_dictation_5fasr_2eproto}, {}}; - -static void InitDefaultsscc_info_RecognitionConfig_dictation_5fasr_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::google::cloud::speech::v1::_RecognitionConfig_default_instance_; - new (ptr) ::google::cloud::speech::v1::RecognitionConfig(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::google::cloud::speech::v1::RecognitionConfig::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_RecognitionConfig_dictation_5fasr_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, 0, InitDefaultsscc_info_RecognitionConfig_dictation_5fasr_2eproto}, { - &scc_info_SpeechContext_dictation_5fasr_2eproto.base, - &scc_info_ConfigField_dictation_5fasr_2eproto.base,}}; - -static void InitDefaultsscc_info_RecognitionLattice_dictation_5fasr_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::google::cloud::speech::v1::_RecognitionLattice_default_instance_; - new (ptr) ::google::cloud::speech::v1::RecognitionLattice(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::google::cloud::speech::v1::RecognitionLattice::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_RecognitionLattice_dictation_5fasr_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_RecognitionLattice_dictation_5fasr_2eproto}, { - &scc_info_LatticeEdge_dictation_5fasr_2eproto.base,}}; - -static void InitDefaultsscc_info_RecognizeRequest_dictation_5fasr_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::google::cloud::speech::v1::_RecognizeRequest_default_instance_; - new (ptr) ::google::cloud::speech::v1::RecognizeRequest(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::google::cloud::speech::v1::RecognizeRequest::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_RecognizeRequest_dictation_5fasr_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, 0, InitDefaultsscc_info_RecognizeRequest_dictation_5fasr_2eproto}, { - &scc_info_RecognitionConfig_dictation_5fasr_2eproto.base, - &scc_info_RecognitionAudio_dictation_5fasr_2eproto.base,}}; - -static void InitDefaultsscc_info_RecognizeResponse_dictation_5fasr_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::google::cloud::speech::v1::_RecognizeResponse_default_instance_; - new (ptr) ::google::cloud::speech::v1::RecognizeResponse(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::google::cloud::speech::v1::RecognizeResponse::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_RecognizeResponse_dictation_5fasr_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_RecognizeResponse_dictation_5fasr_2eproto}, { - &scc_info_SpeechRecognitionResult_dictation_5fasr_2eproto.base,}}; - -static void InitDefaultsscc_info_SpeechContext_dictation_5fasr_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::google::cloud::speech::v1::_SpeechContext_default_instance_; - new (ptr) ::google::cloud::speech::v1::SpeechContext(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::google::cloud::speech::v1::SpeechContext::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_SpeechContext_dictation_5fasr_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_SpeechContext_dictation_5fasr_2eproto}, {}}; - -static void InitDefaultsscc_info_SpeechRecognitionAlternative_dictation_5fasr_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::google::cloud::speech::v1::_SpeechRecognitionAlternative_default_instance_; - new (ptr) ::google::cloud::speech::v1::SpeechRecognitionAlternative(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::google::cloud::speech::v1::SpeechRecognitionAlternative::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_SpeechRecognitionAlternative_dictation_5fasr_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_SpeechRecognitionAlternative_dictation_5fasr_2eproto}, { - &scc_info_WordInfo_dictation_5fasr_2eproto.base,}}; - -static void InitDefaultsscc_info_SpeechRecognitionResult_dictation_5fasr_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::google::cloud::speech::v1::_SpeechRecognitionResult_default_instance_; - new (ptr) ::google::cloud::speech::v1::SpeechRecognitionResult(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::google::cloud::speech::v1::SpeechRecognitionResult::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_SpeechRecognitionResult_dictation_5fasr_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, 0, InitDefaultsscc_info_SpeechRecognitionResult_dictation_5fasr_2eproto}, { - &scc_info_SpeechRecognitionAlternative_dictation_5fasr_2eproto.base, - &scc_info_RecognitionLattice_dictation_5fasr_2eproto.base,}}; - -static void InitDefaultsscc_info_StreamingRecognitionConfig_dictation_5fasr_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::google::cloud::speech::v1::_StreamingRecognitionConfig_default_instance_; - new (ptr) ::google::cloud::speech::v1::StreamingRecognitionConfig(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::google::cloud::speech::v1::StreamingRecognitionConfig::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_StreamingRecognitionConfig_dictation_5fasr_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_StreamingRecognitionConfig_dictation_5fasr_2eproto}, { - &scc_info_RecognitionConfig_dictation_5fasr_2eproto.base,}}; - -static void InitDefaultsscc_info_StreamingRecognitionResult_dictation_5fasr_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::google::cloud::speech::v1::_StreamingRecognitionResult_default_instance_; - new (ptr) ::google::cloud::speech::v1::StreamingRecognitionResult(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::google::cloud::speech::v1::StreamingRecognitionResult::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_StreamingRecognitionResult_dictation_5fasr_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, 0, InitDefaultsscc_info_StreamingRecognitionResult_dictation_5fasr_2eproto}, { - &scc_info_SpeechRecognitionAlternative_dictation_5fasr_2eproto.base, - &scc_info_RecognitionLattice_dictation_5fasr_2eproto.base,}}; - -static void InitDefaultsscc_info_StreamingRecognizeRequest_dictation_5fasr_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::google::cloud::speech::v1::_StreamingRecognizeRequest_default_instance_; - new (ptr) ::google::cloud::speech::v1::StreamingRecognizeRequest(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::google::cloud::speech::v1::StreamingRecognizeRequest::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_StreamingRecognizeRequest_dictation_5fasr_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_StreamingRecognizeRequest_dictation_5fasr_2eproto}, { - &scc_info_StreamingRecognitionConfig_dictation_5fasr_2eproto.base,}}; - -static void InitDefaultsscc_info_StreamingRecognizeResponse_dictation_5fasr_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::google::cloud::speech::v1::_StreamingRecognizeResponse_default_instance_; - new (ptr) ::google::cloud::speech::v1::StreamingRecognizeResponse(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::google::cloud::speech::v1::StreamingRecognizeResponse::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_StreamingRecognizeResponse_dictation_5fasr_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, 0, InitDefaultsscc_info_StreamingRecognizeResponse_dictation_5fasr_2eproto}, { - &scc_info_Status_google_2frpc_2fstatus_2eproto.base, - &scc_info_StreamingRecognitionResult_dictation_5fasr_2eproto.base,}}; - -static void InitDefaultsscc_info_WordInfo_dictation_5fasr_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::google::cloud::speech::v1::_WordInfo_default_instance_; - new (ptr) ::google::cloud::speech::v1::WordInfo(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::google::cloud::speech::v1::WordInfo::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_WordInfo_dictation_5fasr_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_WordInfo_dictation_5fasr_2eproto}, { - &scc_info_Duration_google_2fprotobuf_2fduration_2eproto.base,}}; - -static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_dictation_5fasr_2eproto[15]; -static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_dictation_5fasr_2eproto[3]; -static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_dictation_5fasr_2eproto = nullptr; - -const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_dictation_5fasr_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::RecognizeRequest, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::RecognizeRequest, config_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::RecognizeRequest, audio_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::StreamingRecognizeRequest, _internal_metadata_), - ~0u, // no _extensions_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::StreamingRecognizeRequest, _oneof_case_[0]), - ~0u, // no _weak_field_map_ - offsetof(::google::cloud::speech::v1::StreamingRecognizeRequestDefaultTypeInternal, streaming_config_), - offsetof(::google::cloud::speech::v1::StreamingRecognizeRequestDefaultTypeInternal, audio_content_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::StreamingRecognizeRequest, streaming_request_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::StreamingRecognitionConfig, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::StreamingRecognitionConfig, config_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::StreamingRecognitionConfig, single_utterance_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::StreamingRecognitionConfig, interim_results_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::RecognitionConfig, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::RecognitionConfig, encoding_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::RecognitionConfig, sample_rate_hertz_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::RecognitionConfig, language_code_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::RecognitionConfig, max_alternatives_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::RecognitionConfig, profanity_filter_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::RecognitionConfig, speech_contexts_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::RecognitionConfig, enable_word_time_offsets_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::RecognitionConfig, enable_automatic_punctuation_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::RecognitionConfig, config_fields_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::RecognitionConfig, model_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::RecognitionConfig, use_enhanced_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::SpeechContext, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::SpeechContext, phrases_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::ConfigField, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::ConfigField, key_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::ConfigField, value_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::RecognitionAudio, _internal_metadata_), - ~0u, // no _extensions_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::RecognitionAudio, _oneof_case_[0]), - ~0u, // no _weak_field_map_ - offsetof(::google::cloud::speech::v1::RecognitionAudioDefaultTypeInternal, content_), - offsetof(::google::cloud::speech::v1::RecognitionAudioDefaultTypeInternal, uri_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::RecognitionAudio, audio_source_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::RecognizeResponse, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::RecognizeResponse, results_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::StreamingRecognizeResponse, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::StreamingRecognizeResponse, error_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::StreamingRecognizeResponse, results_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::StreamingRecognizeResponse, speech_event_type_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::StreamingRecognitionResult, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::StreamingRecognitionResult, alternatives_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::StreamingRecognitionResult, is_final_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::StreamingRecognitionResult, stability_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::StreamingRecognitionResult, result_finalization_cause_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::StreamingRecognitionResult, lattice_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::SpeechRecognitionResult, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::SpeechRecognitionResult, alternatives_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::SpeechRecognitionResult, lattice_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::SpeechRecognitionAlternative, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::SpeechRecognitionAlternative, transcript_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::SpeechRecognitionAlternative, confidence_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::SpeechRecognitionAlternative, words_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::WordInfo, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::WordInfo, start_time_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::WordInfo, end_time_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::WordInfo, word_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::RecognitionLattice, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::RecognitionLattice, final_nodes_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::RecognitionLattice, edges_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::LatticeEdge, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::LatticeEdge, start_node_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::LatticeEdge, end_node_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::LatticeEdge, symbol_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::LatticeEdge, language_cost_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::LatticeEdge, acoustic_cost_), - PROTOBUF_FIELD_OFFSET(::google::cloud::speech::v1::LatticeEdge, duration_), -}; -static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, sizeof(::google::cloud::speech::v1::RecognizeRequest)}, - { 7, -1, sizeof(::google::cloud::speech::v1::StreamingRecognizeRequest)}, - { 15, -1, sizeof(::google::cloud::speech::v1::StreamingRecognitionConfig)}, - { 23, -1, sizeof(::google::cloud::speech::v1::RecognitionConfig)}, - { 39, -1, sizeof(::google::cloud::speech::v1::SpeechContext)}, - { 45, -1, sizeof(::google::cloud::speech::v1::ConfigField)}, - { 52, -1, sizeof(::google::cloud::speech::v1::RecognitionAudio)}, - { 60, -1, sizeof(::google::cloud::speech::v1::RecognizeResponse)}, - { 66, -1, sizeof(::google::cloud::speech::v1::StreamingRecognizeResponse)}, - { 74, -1, sizeof(::google::cloud::speech::v1::StreamingRecognitionResult)}, - { 84, -1, sizeof(::google::cloud::speech::v1::SpeechRecognitionResult)}, - { 91, -1, sizeof(::google::cloud::speech::v1::SpeechRecognitionAlternative)}, - { 99, -1, sizeof(::google::cloud::speech::v1::WordInfo)}, - { 107, -1, sizeof(::google::cloud::speech::v1::RecognitionLattice)}, - { 114, -1, sizeof(::google::cloud::speech::v1::LatticeEdge)}, -}; - -static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { - reinterpret_cast(&::google::cloud::speech::v1::_RecognizeRequest_default_instance_), - reinterpret_cast(&::google::cloud::speech::v1::_StreamingRecognizeRequest_default_instance_), - reinterpret_cast(&::google::cloud::speech::v1::_StreamingRecognitionConfig_default_instance_), - reinterpret_cast(&::google::cloud::speech::v1::_RecognitionConfig_default_instance_), - reinterpret_cast(&::google::cloud::speech::v1::_SpeechContext_default_instance_), - reinterpret_cast(&::google::cloud::speech::v1::_ConfigField_default_instance_), - reinterpret_cast(&::google::cloud::speech::v1::_RecognitionAudio_default_instance_), - reinterpret_cast(&::google::cloud::speech::v1::_RecognizeResponse_default_instance_), - reinterpret_cast(&::google::cloud::speech::v1::_StreamingRecognizeResponse_default_instance_), - reinterpret_cast(&::google::cloud::speech::v1::_StreamingRecognitionResult_default_instance_), - reinterpret_cast(&::google::cloud::speech::v1::_SpeechRecognitionResult_default_instance_), - reinterpret_cast(&::google::cloud::speech::v1::_SpeechRecognitionAlternative_default_instance_), - reinterpret_cast(&::google::cloud::speech::v1::_WordInfo_default_instance_), - reinterpret_cast(&::google::cloud::speech::v1::_RecognitionLattice_default_instance_), - reinterpret_cast(&::google::cloud::speech::v1::_LatticeEdge_default_instance_), -}; - -const char descriptor_table_protodef_dictation_5fasr_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = - "\n\023dictation_asr.proto\022\026google.cloud.spee" - "ch.v1\032\034google/api/annotations.proto\032\036goo" - "gle/protobuf/duration.proto\032\027google/rpc/" - "status.proto\"\206\001\n\020RecognizeRequest\0229\n\006con" - "fig\030\001 \001(\0132).google.cloud.speech.v1.Recog" - "nitionConfig\0227\n\005audio\030\002 \001(\0132(.google.clo" - "ud.speech.v1.RecognitionAudio\"\231\001\n\031Stream" - "ingRecognizeRequest\022N\n\020streaming_config\030" - "\001 \001(\01322.google.cloud.speech.v1.Streaming" - "RecognitionConfigH\000\022\027\n\raudio_content\030\002 \001" - "(\014H\000B\023\n\021streaming_request\"\212\001\n\032StreamingR" - "ecognitionConfig\0229\n\006config\030\001 \001(\0132).googl" - "e.cloud.speech.v1.RecognitionConfig\022\030\n\020s" - "ingle_utterance\030\002 \001(\010\022\027\n\017interim_results" - "\030\003 \001(\010\"\304\004\n\021RecognitionConfig\022I\n\010encoding" - "\030\001 \001(\01627.google.cloud.speech.v1.Recognit" - "ionConfig.AudioEncoding\022\031\n\021sample_rate_h" - "ertz\030\002 \001(\005\022\025\n\rlanguage_code\030\003 \001(\t\022\030\n\020max" - "_alternatives\030\004 \001(\005\022\030\n\020profanity_filter\030" - "\005 \001(\010\022>\n\017speech_contexts\030\006 \003(\0132%.google." - "cloud.speech.v1.SpeechContext\022 \n\030enable_" - "word_time_offsets\030\010 \001(\010\022$\n\034enable_automa" - "tic_punctuation\030\013 \001(\010\022:\n\rconfig_fields\030\014" - " \003(\0132#.google.cloud.speech.v1.ConfigFiel" - "d\022\r\n\005model\030\r \001(\t\022\024\n\014use_enhanced\030\016 \001(\010\"\224" - "\001\n\rAudioEncoding\022\030\n\024ENCODING_UNSPECIFIED" - "\020\000\022\014\n\010LINEAR16\020\001\022\010\n\004FLAC\020\002\022\t\n\005MULAW\020\003\022\007\n" - "\003AMR\020\004\022\n\n\006AMR_WB\020\005\022\014\n\010OGG_OPUS\020\006\022\032\n\026SPEE" - "X_WITH_HEADER_BYTE\020\007\022\007\n\003MP3\020\010\" \n\rSpeechC" - "ontext\022\017\n\007phrases\030\001 \003(\t\")\n\013ConfigField\022\013" - "\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t\"D\n\020Recognitio" - "nAudio\022\021\n\007content\030\001 \001(\014H\000\022\r\n\003uri\030\002 \001(\tH\000" - "B\016\n\014audio_source\"U\n\021RecognizeResponse\022@\n" - "\007results\030\002 \003(\0132/.google.cloud.speech.v1." - "SpeechRecognitionResult\"\261\002\n\032StreamingRec" - "ognizeResponse\022!\n\005error\030\001 \001(\0132\022.google.r" - "pc.Status\022C\n\007results\030\002 \003(\01322.google.clou" - "d.speech.v1.StreamingRecognitionResult\022]" - "\n\021speech_event_type\030\004 \001(\0162B.google.cloud" - ".speech.v1.StreamingRecognizeResponse.Sp" - "eechEventType\"L\n\017SpeechEventType\022\034\n\030SPEE" - "CH_EVENT_UNSPECIFIED\020\000\022\033\n\027END_OF_SINGLE_" - "UTTERANCE\020\001\"\341\003\n\032StreamingRecognitionResu" - "lt\022J\n\014alternatives\030\001 \003(\01324.google.cloud." - "speech.v1.SpeechRecognitionAlternative\022\020" - "\n\010is_final\030\002 \001(\010\022\021\n\tstability\030\003 \001(\002\022m\n\031r" - "esult_finalization_cause\030\004 \001(\0162J.google." - "cloud.speech.v1.StreamingRecognitionResu" - "lt.ResultFinalizationCause\022;\n\007lattice\030\005 " - "\003(\0132*.google.cloud.speech.v1.Recognition" - "Lattice\"\245\001\n\027ResultFinalizationCause\022)\n%R" - "ESULT_FINALIZATION_CAUSE_UNSPECIFIED\020\000\022\013" - "\n\007SUCCESS\020\001\022\024\n\020NO_INPUT_TIMEOUT\020\002\022\023\n\017SUC" - "CESS_MAXTIME\020\003\022\021\n\rPARTIAL_MATCH\020\004\022\024\n\020NO_" - "MATCH_MAXTIME\020\005\"\242\001\n\027SpeechRecognitionRes" - "ult\022J\n\014alternatives\030\001 \003(\01324.google.cloud" - ".speech.v1.SpeechRecognitionAlternative\022" - ";\n\007lattice\030\005 \003(\0132*.google.cloud.speech.v" - "1.RecognitionLattice\"w\n\034SpeechRecognitio" - "nAlternative\022\022\n\ntranscript\030\001 \001(\t\022\022\n\nconf" - "idence\030\002 \001(\002\022/\n\005words\030\003 \003(\0132 .google.clo" - "ud.speech.v1.WordInfo\"t\n\010WordInfo\022-\n\nsta" - "rt_time\030\001 \001(\0132\031.google.protobuf.Duration" - "\022+\n\010end_time\030\002 \001(\0132\031.google.protobuf.Dur" - "ation\022\014\n\004word\030\003 \001(\t\"]\n\022RecognitionLattic" - "e\022\023\n\013final_nodes\030\001 \003(\005\0222\n\005edges\030\002 \003(\0132#." - "google.cloud.speech.v1.LatticeEdge\"\203\001\n\013L" - "atticeEdge\022\022\n\nstart_node\030\001 \001(\005\022\020\n\010end_no" - "de\030\002 \001(\005\022\016\n\006symbol\030\003 \001(\t\022\025\n\rlanguage_cos" - "t\030\004 \001(\002\022\025\n\racoustic_cost\030\005 \001(\002\022\020\n\010durati" - "on\030\006 \001(\0052\220\002\n\006Speech\022\201\001\n\tRecognize\022(.goog" - "le.cloud.speech.v1.RecognizeRequest\032).go" - "ogle.cloud.speech.v1.RecognizeResponse\"\037" - "\202\323\344\223\002\031\"\024/v1/speech:recognize:\001*\022\201\001\n\022Stre" - "amingRecognize\0221.google.cloud.speech.v1." - "StreamingRecognizeRequest\0322.google.cloud" - ".speech.v1.StreamingRecognizeResponse\"\000(" - "\0010\001Bl\n\032com.google.cloud.speech.v1B\013Speec" - "hProtoP\001Z= 1900) -constexpr RecognitionConfig_AudioEncoding RecognitionConfig::ENCODING_UNSPECIFIED; -constexpr RecognitionConfig_AudioEncoding RecognitionConfig::LINEAR16; -constexpr RecognitionConfig_AudioEncoding RecognitionConfig::FLAC; -constexpr RecognitionConfig_AudioEncoding RecognitionConfig::MULAW; -constexpr RecognitionConfig_AudioEncoding RecognitionConfig::AMR; -constexpr RecognitionConfig_AudioEncoding RecognitionConfig::AMR_WB; -constexpr RecognitionConfig_AudioEncoding RecognitionConfig::OGG_OPUS; -constexpr RecognitionConfig_AudioEncoding RecognitionConfig::SPEEX_WITH_HEADER_BYTE; -constexpr RecognitionConfig_AudioEncoding RecognitionConfig::MP3; -constexpr RecognitionConfig_AudioEncoding RecognitionConfig::AudioEncoding_MIN; -constexpr RecognitionConfig_AudioEncoding RecognitionConfig::AudioEncoding_MAX; -constexpr int RecognitionConfig::AudioEncoding_ARRAYSIZE; -#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* StreamingRecognizeResponse_SpeechEventType_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_dictation_5fasr_2eproto); - return file_level_enum_descriptors_dictation_5fasr_2eproto[1]; -} -bool StreamingRecognizeResponse_SpeechEventType_IsValid(int value) { - switch (value) { - case 0: - case 1: - return true; - default: - return false; - } -} - -#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) -constexpr StreamingRecognizeResponse_SpeechEventType StreamingRecognizeResponse::SPEECH_EVENT_UNSPECIFIED; -constexpr StreamingRecognizeResponse_SpeechEventType StreamingRecognizeResponse::END_OF_SINGLE_UTTERANCE; -constexpr StreamingRecognizeResponse_SpeechEventType StreamingRecognizeResponse::SpeechEventType_MIN; -constexpr StreamingRecognizeResponse_SpeechEventType StreamingRecognizeResponse::SpeechEventType_MAX; -constexpr int StreamingRecognizeResponse::SpeechEventType_ARRAYSIZE; -#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* StreamingRecognitionResult_ResultFinalizationCause_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_dictation_5fasr_2eproto); - return file_level_enum_descriptors_dictation_5fasr_2eproto[2]; -} -bool StreamingRecognitionResult_ResultFinalizationCause_IsValid(int value) { - switch (value) { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - return true; - default: - return false; - } -} - -#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) -constexpr StreamingRecognitionResult_ResultFinalizationCause StreamingRecognitionResult::RESULT_FINALIZATION_CAUSE_UNSPECIFIED; -constexpr StreamingRecognitionResult_ResultFinalizationCause StreamingRecognitionResult::SUCCESS; -constexpr StreamingRecognitionResult_ResultFinalizationCause StreamingRecognitionResult::NO_INPUT_TIMEOUT; -constexpr StreamingRecognitionResult_ResultFinalizationCause StreamingRecognitionResult::SUCCESS_MAXTIME; -constexpr StreamingRecognitionResult_ResultFinalizationCause StreamingRecognitionResult::PARTIAL_MATCH; -constexpr StreamingRecognitionResult_ResultFinalizationCause StreamingRecognitionResult::NO_MATCH_MAXTIME; -constexpr StreamingRecognitionResult_ResultFinalizationCause StreamingRecognitionResult::ResultFinalizationCause_MIN; -constexpr StreamingRecognitionResult_ResultFinalizationCause StreamingRecognitionResult::ResultFinalizationCause_MAX; -constexpr int StreamingRecognitionResult::ResultFinalizationCause_ARRAYSIZE; -#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) - -// =================================================================== - -void RecognizeRequest::InitAsDefaultInstance() { - ::google::cloud::speech::v1::_RecognizeRequest_default_instance_._instance.get_mutable()->config_ = const_cast< ::google::cloud::speech::v1::RecognitionConfig*>( - ::google::cloud::speech::v1::RecognitionConfig::internal_default_instance()); - ::google::cloud::speech::v1::_RecognizeRequest_default_instance_._instance.get_mutable()->audio_ = const_cast< ::google::cloud::speech::v1::RecognitionAudio*>( - ::google::cloud::speech::v1::RecognitionAudio::internal_default_instance()); -} -class RecognizeRequest::_Internal { - public: - static const ::google::cloud::speech::v1::RecognitionConfig& config(const RecognizeRequest* msg); - static const ::google::cloud::speech::v1::RecognitionAudio& audio(const RecognizeRequest* msg); -}; - -const ::google::cloud::speech::v1::RecognitionConfig& -RecognizeRequest::_Internal::config(const RecognizeRequest* msg) { - return *msg->config_; -} -const ::google::cloud::speech::v1::RecognitionAudio& -RecognizeRequest::_Internal::audio(const RecognizeRequest* msg) { - return *msg->audio_; -} -void RecognizeRequest::unsafe_arena_set_allocated_config( - ::google::cloud::speech::v1::RecognitionConfig* config) { - if (GetArenaNoVirtual() == nullptr) { - delete config_; - } - config_ = config; - if (config) { - - } else { - - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.cloud.speech.v1.RecognizeRequest.config) -} -void RecognizeRequest::unsafe_arena_set_allocated_audio( - ::google::cloud::speech::v1::RecognitionAudio* audio) { - if (GetArenaNoVirtual() == nullptr) { - delete audio_; - } - audio_ = audio; - if (audio) { - - } else { - - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.cloud.speech.v1.RecognizeRequest.audio) -} -RecognizeRequest::RecognizeRequest() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:google.cloud.speech.v1.RecognizeRequest) -} -RecognizeRequest::RecognizeRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:google.cloud.speech.v1.RecognizeRequest) -} -RecognizeRequest::RecognizeRequest(const RecognizeRequest& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - if (from._internal_has_config()) { - config_ = new ::google::cloud::speech::v1::RecognitionConfig(*from.config_); - } else { - config_ = nullptr; - } - if (from._internal_has_audio()) { - audio_ = new ::google::cloud::speech::v1::RecognitionAudio(*from.audio_); - } else { - audio_ = nullptr; - } - // @@protoc_insertion_point(copy_constructor:google.cloud.speech.v1.RecognizeRequest) -} - -void RecognizeRequest::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_RecognizeRequest_dictation_5fasr_2eproto.base); - ::memset(&config_, 0, static_cast( - reinterpret_cast(&audio_) - - reinterpret_cast(&config_)) + sizeof(audio_)); -} - -RecognizeRequest::~RecognizeRequest() { - // @@protoc_insertion_point(destructor:google.cloud.speech.v1.RecognizeRequest) - SharedDtor(); -} - -void RecognizeRequest::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); - if (this != internal_default_instance()) delete config_; - if (this != internal_default_instance()) delete audio_; -} - -void RecognizeRequest::ArenaDtor(void* object) { - RecognizeRequest* _this = reinterpret_cast< RecognizeRequest* >(object); - (void)_this; -} -void RecognizeRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void RecognizeRequest::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const RecognizeRequest& RecognizeRequest::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_RecognizeRequest_dictation_5fasr_2eproto.base); - return *internal_default_instance(); -} - - -void RecognizeRequest::Clear() { -// @@protoc_insertion_point(message_clear_start:google.cloud.speech.v1.RecognizeRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - if (GetArenaNoVirtual() == nullptr && config_ != nullptr) { - delete config_; - } - config_ = nullptr; - if (GetArenaNoVirtual() == nullptr && audio_ != nullptr) { - delete audio_; - } - audio_ = nullptr; - _internal_metadata_.Clear(); -} - -const char* RecognizeRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .google.cloud.speech.v1.RecognitionConfig config = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ctx->ParseMessage(_internal_mutable_config(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .google.cloud.speech.v1.RecognitionAudio audio = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ctx->ParseMessage(_internal_mutable_audio(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* RecognizeRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:google.cloud.speech.v1.RecognizeRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .google.cloud.speech.v1.RecognitionConfig config = 1; - if (this->has_config()) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::config(this), target, stream); - } - - // .google.cloud.speech.v1.RecognitionAudio audio = 2; - if (this->has_audio()) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::audio(this), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:google.cloud.speech.v1.RecognizeRequest) - return target; -} - -size_t RecognizeRequest::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.cloud.speech.v1.RecognizeRequest) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // .google.cloud.speech.v1.RecognitionConfig config = 1; - if (this->has_config()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *config_); - } - - // .google.cloud.speech.v1.RecognitionAudio audio = 2; - if (this->has_audio()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *audio_); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void RecognizeRequest::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:google.cloud.speech.v1.RecognizeRequest) - GOOGLE_DCHECK_NE(&from, this); - const RecognizeRequest* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.cloud.speech.v1.RecognizeRequest) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:google.cloud.speech.v1.RecognizeRequest) - MergeFrom(*source); - } -} - -void RecognizeRequest::MergeFrom(const RecognizeRequest& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.cloud.speech.v1.RecognizeRequest) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.has_config()) { - _internal_mutable_config()->::google::cloud::speech::v1::RecognitionConfig::MergeFrom(from._internal_config()); - } - if (from.has_audio()) { - _internal_mutable_audio()->::google::cloud::speech::v1::RecognitionAudio::MergeFrom(from._internal_audio()); - } -} - -void RecognizeRequest::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:google.cloud.speech.v1.RecognizeRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void RecognizeRequest::CopyFrom(const RecognizeRequest& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.cloud.speech.v1.RecognizeRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool RecognizeRequest::IsInitialized() const { - return true; -} - -void RecognizeRequest::InternalSwap(RecognizeRequest* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(config_, other->config_); - swap(audio_, other->audio_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata RecognizeRequest::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void StreamingRecognizeRequest::InitAsDefaultInstance() { - ::google::cloud::speech::v1::_StreamingRecognizeRequest_default_instance_.streaming_config_ = const_cast< ::google::cloud::speech::v1::StreamingRecognitionConfig*>( - ::google::cloud::speech::v1::StreamingRecognitionConfig::internal_default_instance()); - ::google::cloud::speech::v1::_StreamingRecognizeRequest_default_instance_.audio_content_.UnsafeSetDefault( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -class StreamingRecognizeRequest::_Internal { - public: - static const ::google::cloud::speech::v1::StreamingRecognitionConfig& streaming_config(const StreamingRecognizeRequest* msg); -}; - -const ::google::cloud::speech::v1::StreamingRecognitionConfig& -StreamingRecognizeRequest::_Internal::streaming_config(const StreamingRecognizeRequest* msg) { - return *msg->streaming_request_.streaming_config_; -} -void StreamingRecognizeRequest::set_allocated_streaming_config(::google::cloud::speech::v1::StreamingRecognitionConfig* streaming_config) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - clear_streaming_request(); - if (streaming_config) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(streaming_config); - if (message_arena != submessage_arena) { - streaming_config = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, streaming_config, submessage_arena); - } - set_has_streaming_config(); - streaming_request_.streaming_config_ = streaming_config; - } - // @@protoc_insertion_point(field_set_allocated:google.cloud.speech.v1.StreamingRecognizeRequest.streaming_config) -} -StreamingRecognizeRequest::StreamingRecognizeRequest() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:google.cloud.speech.v1.StreamingRecognizeRequest) -} -StreamingRecognizeRequest::StreamingRecognizeRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:google.cloud.speech.v1.StreamingRecognizeRequest) -} -StreamingRecognizeRequest::StreamingRecognizeRequest(const StreamingRecognizeRequest& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - clear_has_streaming_request(); - switch (from.streaming_request_case()) { - case kStreamingConfig: { - _internal_mutable_streaming_config()->::google::cloud::speech::v1::StreamingRecognitionConfig::MergeFrom(from._internal_streaming_config()); - break; - } - case kAudioContent: { - _internal_set_audio_content(from._internal_audio_content()); - break; - } - case STREAMING_REQUEST_NOT_SET: { - break; - } - } - // @@protoc_insertion_point(copy_constructor:google.cloud.speech.v1.StreamingRecognizeRequest) -} - -void StreamingRecognizeRequest::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_StreamingRecognizeRequest_dictation_5fasr_2eproto.base); - clear_has_streaming_request(); -} - -StreamingRecognizeRequest::~StreamingRecognizeRequest() { - // @@protoc_insertion_point(destructor:google.cloud.speech.v1.StreamingRecognizeRequest) - SharedDtor(); -} - -void StreamingRecognizeRequest::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); - if (has_streaming_request()) { - clear_streaming_request(); - } -} - -void StreamingRecognizeRequest::ArenaDtor(void* object) { - StreamingRecognizeRequest* _this = reinterpret_cast< StreamingRecognizeRequest* >(object); - (void)_this; -} -void StreamingRecognizeRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void StreamingRecognizeRequest::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const StreamingRecognizeRequest& StreamingRecognizeRequest::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_StreamingRecognizeRequest_dictation_5fasr_2eproto.base); - return *internal_default_instance(); -} - - -void StreamingRecognizeRequest::clear_streaming_request() { -// @@protoc_insertion_point(one_of_clear_start:google.cloud.speech.v1.StreamingRecognizeRequest) - switch (streaming_request_case()) { - case kStreamingConfig: { - if (GetArenaNoVirtual() == nullptr) { - delete streaming_request_.streaming_config_; - } - break; - } - case kAudioContent: { - streaming_request_.audio_content_.Destroy(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - break; - } - case STREAMING_REQUEST_NOT_SET: { - break; - } - } - _oneof_case_[0] = STREAMING_REQUEST_NOT_SET; -} - - -void StreamingRecognizeRequest::Clear() { -// @@protoc_insertion_point(message_clear_start:google.cloud.speech.v1.StreamingRecognizeRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - clear_streaming_request(); - _internal_metadata_.Clear(); -} - -const char* StreamingRecognizeRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ctx->ParseMessage(_internal_mutable_streaming_config(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bytes audio_content = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - auto str = _internal_mutable_audio_content(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* StreamingRecognizeRequest::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:google.cloud.speech.v1.StreamingRecognizeRequest) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - if (_internal_has_streaming_config()) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::streaming_config(this), target, stream); - } - - // bytes audio_content = 2; - if (_internal_has_audio_content()) { - target = stream->WriteBytesMaybeAliased( - 2, this->_internal_audio_content(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:google.cloud.speech.v1.StreamingRecognizeRequest) - return target; -} - -size_t StreamingRecognizeRequest::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.cloud.speech.v1.StreamingRecognizeRequest) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - switch (streaming_request_case()) { - // .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - case kStreamingConfig: { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *streaming_request_.streaming_config_); - break; - } - // bytes audio_content = 2; - case kAudioContent: { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_audio_content()); - break; - } - case STREAMING_REQUEST_NOT_SET: { - break; - } - } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void StreamingRecognizeRequest::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:google.cloud.speech.v1.StreamingRecognizeRequest) - GOOGLE_DCHECK_NE(&from, this); - const StreamingRecognizeRequest* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.cloud.speech.v1.StreamingRecognizeRequest) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:google.cloud.speech.v1.StreamingRecognizeRequest) - MergeFrom(*source); - } -} - -void StreamingRecognizeRequest::MergeFrom(const StreamingRecognizeRequest& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.cloud.speech.v1.StreamingRecognizeRequest) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - switch (from.streaming_request_case()) { - case kStreamingConfig: { - _internal_mutable_streaming_config()->::google::cloud::speech::v1::StreamingRecognitionConfig::MergeFrom(from._internal_streaming_config()); - break; - } - case kAudioContent: { - _internal_set_audio_content(from._internal_audio_content()); - break; - } - case STREAMING_REQUEST_NOT_SET: { - break; - } - } -} - -void StreamingRecognizeRequest::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:google.cloud.speech.v1.StreamingRecognizeRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void StreamingRecognizeRequest::CopyFrom(const StreamingRecognizeRequest& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.cloud.speech.v1.StreamingRecognizeRequest) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool StreamingRecognizeRequest::IsInitialized() const { - return true; -} - -void StreamingRecognizeRequest::InternalSwap(StreamingRecognizeRequest* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(streaming_request_, other->streaming_request_); - swap(_oneof_case_[0], other->_oneof_case_[0]); -} - -::PROTOBUF_NAMESPACE_ID::Metadata StreamingRecognizeRequest::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void StreamingRecognitionConfig::InitAsDefaultInstance() { - ::google::cloud::speech::v1::_StreamingRecognitionConfig_default_instance_._instance.get_mutable()->config_ = const_cast< ::google::cloud::speech::v1::RecognitionConfig*>( - ::google::cloud::speech::v1::RecognitionConfig::internal_default_instance()); -} -class StreamingRecognitionConfig::_Internal { - public: - static const ::google::cloud::speech::v1::RecognitionConfig& config(const StreamingRecognitionConfig* msg); -}; - -const ::google::cloud::speech::v1::RecognitionConfig& -StreamingRecognitionConfig::_Internal::config(const StreamingRecognitionConfig* msg) { - return *msg->config_; -} -void StreamingRecognitionConfig::unsafe_arena_set_allocated_config( - ::google::cloud::speech::v1::RecognitionConfig* config) { - if (GetArenaNoVirtual() == nullptr) { - delete config_; - } - config_ = config; - if (config) { - - } else { - - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.cloud.speech.v1.StreamingRecognitionConfig.config) -} -StreamingRecognitionConfig::StreamingRecognitionConfig() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:google.cloud.speech.v1.StreamingRecognitionConfig) -} -StreamingRecognitionConfig::StreamingRecognitionConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:google.cloud.speech.v1.StreamingRecognitionConfig) -} -StreamingRecognitionConfig::StreamingRecognitionConfig(const StreamingRecognitionConfig& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - if (from._internal_has_config()) { - config_ = new ::google::cloud::speech::v1::RecognitionConfig(*from.config_); - } else { - config_ = nullptr; - } - ::memcpy(&single_utterance_, &from.single_utterance_, - static_cast(reinterpret_cast(&interim_results_) - - reinterpret_cast(&single_utterance_)) + sizeof(interim_results_)); - // @@protoc_insertion_point(copy_constructor:google.cloud.speech.v1.StreamingRecognitionConfig) -} - -void StreamingRecognitionConfig::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_StreamingRecognitionConfig_dictation_5fasr_2eproto.base); - ::memset(&config_, 0, static_cast( - reinterpret_cast(&interim_results_) - - reinterpret_cast(&config_)) + sizeof(interim_results_)); -} - -StreamingRecognitionConfig::~StreamingRecognitionConfig() { - // @@protoc_insertion_point(destructor:google.cloud.speech.v1.StreamingRecognitionConfig) - SharedDtor(); -} - -void StreamingRecognitionConfig::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); - if (this != internal_default_instance()) delete config_; -} - -void StreamingRecognitionConfig::ArenaDtor(void* object) { - StreamingRecognitionConfig* _this = reinterpret_cast< StreamingRecognitionConfig* >(object); - (void)_this; -} -void StreamingRecognitionConfig::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void StreamingRecognitionConfig::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const StreamingRecognitionConfig& StreamingRecognitionConfig::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_StreamingRecognitionConfig_dictation_5fasr_2eproto.base); - return *internal_default_instance(); -} - - -void StreamingRecognitionConfig::Clear() { -// @@protoc_insertion_point(message_clear_start:google.cloud.speech.v1.StreamingRecognitionConfig) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - if (GetArenaNoVirtual() == nullptr && config_ != nullptr) { - delete config_; - } - config_ = nullptr; - ::memset(&single_utterance_, 0, static_cast( - reinterpret_cast(&interim_results_) - - reinterpret_cast(&single_utterance_)) + sizeof(interim_results_)); - _internal_metadata_.Clear(); -} - -const char* StreamingRecognitionConfig::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .google.cloud.speech.v1.RecognitionConfig config = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ctx->ParseMessage(_internal_mutable_config(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool single_utterance = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - single_utterance_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool interim_results = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - interim_results_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* StreamingRecognitionConfig::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:google.cloud.speech.v1.StreamingRecognitionConfig) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .google.cloud.speech.v1.RecognitionConfig config = 1; - if (this->has_config()) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::config(this), target, stream); - } - - // bool single_utterance = 2; - if (this->single_utterance() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_single_utterance(), target); - } - - // bool interim_results = 3; - if (this->interim_results() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_interim_results(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:google.cloud.speech.v1.StreamingRecognitionConfig) - return target; -} - -size_t StreamingRecognitionConfig::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.cloud.speech.v1.StreamingRecognitionConfig) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // .google.cloud.speech.v1.RecognitionConfig config = 1; - if (this->has_config()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *config_); - } - - // bool single_utterance = 2; - if (this->single_utterance() != 0) { - total_size += 1 + 1; - } - - // bool interim_results = 3; - if (this->interim_results() != 0) { - total_size += 1 + 1; - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void StreamingRecognitionConfig::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:google.cloud.speech.v1.StreamingRecognitionConfig) - GOOGLE_DCHECK_NE(&from, this); - const StreamingRecognitionConfig* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.cloud.speech.v1.StreamingRecognitionConfig) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:google.cloud.speech.v1.StreamingRecognitionConfig) - MergeFrom(*source); - } -} - -void StreamingRecognitionConfig::MergeFrom(const StreamingRecognitionConfig& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.cloud.speech.v1.StreamingRecognitionConfig) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.has_config()) { - _internal_mutable_config()->::google::cloud::speech::v1::RecognitionConfig::MergeFrom(from._internal_config()); - } - if (from.single_utterance() != 0) { - _internal_set_single_utterance(from._internal_single_utterance()); - } - if (from.interim_results() != 0) { - _internal_set_interim_results(from._internal_interim_results()); - } -} - -void StreamingRecognitionConfig::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:google.cloud.speech.v1.StreamingRecognitionConfig) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void StreamingRecognitionConfig::CopyFrom(const StreamingRecognitionConfig& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.cloud.speech.v1.StreamingRecognitionConfig) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool StreamingRecognitionConfig::IsInitialized() const { - return true; -} - -void StreamingRecognitionConfig::InternalSwap(StreamingRecognitionConfig* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(config_, other->config_); - swap(single_utterance_, other->single_utterance_); - swap(interim_results_, other->interim_results_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata StreamingRecognitionConfig::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void RecognitionConfig::InitAsDefaultInstance() { -} -class RecognitionConfig::_Internal { - public: -}; - -RecognitionConfig::RecognitionConfig() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:google.cloud.speech.v1.RecognitionConfig) -} -RecognitionConfig::RecognitionConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(arena), - speech_contexts_(arena), - config_fields_(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:google.cloud.speech.v1.RecognitionConfig) -} -RecognitionConfig::RecognitionConfig(const RecognitionConfig& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - speech_contexts_(from.speech_contexts_), - config_fields_(from.config_fields_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - language_code_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from._internal_language_code().empty()) { - language_code_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_language_code(), - GetArenaNoVirtual()); - } - model_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from._internal_model().empty()) { - model_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_model(), - GetArenaNoVirtual()); - } - ::memcpy(&encoding_, &from.encoding_, - static_cast(reinterpret_cast(&use_enhanced_) - - reinterpret_cast(&encoding_)) + sizeof(use_enhanced_)); - // @@protoc_insertion_point(copy_constructor:google.cloud.speech.v1.RecognitionConfig) -} - -void RecognitionConfig::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_RecognitionConfig_dictation_5fasr_2eproto.base); - language_code_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - model_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&encoding_, 0, static_cast( - reinterpret_cast(&use_enhanced_) - - reinterpret_cast(&encoding_)) + sizeof(use_enhanced_)); -} - -RecognitionConfig::~RecognitionConfig() { - // @@protoc_insertion_point(destructor:google.cloud.speech.v1.RecognitionConfig) - SharedDtor(); -} - -void RecognitionConfig::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); - language_code_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - model_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void RecognitionConfig::ArenaDtor(void* object) { - RecognitionConfig* _this = reinterpret_cast< RecognitionConfig* >(object); - (void)_this; -} -void RecognitionConfig::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void RecognitionConfig::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const RecognitionConfig& RecognitionConfig::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_RecognitionConfig_dictation_5fasr_2eproto.base); - return *internal_default_instance(); -} - - -void RecognitionConfig::Clear() { -// @@protoc_insertion_point(message_clear_start:google.cloud.speech.v1.RecognitionConfig) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - speech_contexts_.Clear(); - config_fields_.Clear(); - language_code_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); - model_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); - ::memset(&encoding_, 0, static_cast( - reinterpret_cast(&use_enhanced_) - - reinterpret_cast(&encoding_)) + sizeof(use_enhanced_)); - _internal_metadata_.Clear(); -} - -const char* RecognitionConfig::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - _internal_set_encoding(static_cast<::google::cloud::speech::v1::RecognitionConfig_AudioEncoding>(val)); - } else goto handle_unusual; - continue; - // int32 sample_rate_hertz = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - sample_rate_hertz_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string language_code = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - auto str = _internal_mutable_language_code(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.cloud.speech.v1.RecognitionConfig.language_code")); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int32 max_alternatives = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - max_alternatives_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool profanity_filter = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { - profanity_filter_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_speech_contexts(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<50>(ptr)); - } else goto handle_unusual; - continue; - // bool enable_word_time_offsets = 8; - case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) { - enable_word_time_offsets_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool enable_automatic_punctuation = 11; - case 11: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 88)) { - enable_automatic_punctuation_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated .google.cloud.speech.v1.ConfigField config_fields = 12; - case 12: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 98)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_config_fields(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<98>(ptr)); - } else goto handle_unusual; - continue; - // string model = 13; - case 13: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 106)) { - auto str = _internal_mutable_model(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.cloud.speech.v1.RecognitionConfig.model")); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool use_enhanced = 14; - case 14: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 112)) { - use_enhanced_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* RecognitionConfig::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:google.cloud.speech.v1.RecognitionConfig) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; - if (this->encoding() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 1, this->_internal_encoding(), target); - } - - // int32 sample_rate_hertz = 2; - if (this->sample_rate_hertz() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_sample_rate_hertz(), target); - } - - // string language_code = 3; - if (this->language_code().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_language_code().data(), static_cast(this->_internal_language_code().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "google.cloud.speech.v1.RecognitionConfig.language_code"); - target = stream->WriteStringMaybeAliased( - 3, this->_internal_language_code(), target); - } - - // int32 max_alternatives = 4; - if (this->max_alternatives() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->_internal_max_alternatives(), target); - } - - // bool profanity_filter = 5; - if (this->profanity_filter() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->_internal_profanity_filter(), target); - } - - // repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - for (unsigned int i = 0, - n = static_cast(this->_internal_speech_contexts_size()); i < n; i++) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(6, this->_internal_speech_contexts(i), target, stream); - } - - // bool enable_word_time_offsets = 8; - if (this->enable_word_time_offsets() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(8, this->_internal_enable_word_time_offsets(), target); - } - - // bool enable_automatic_punctuation = 11; - if (this->enable_automatic_punctuation() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(11, this->_internal_enable_automatic_punctuation(), target); - } - - // repeated .google.cloud.speech.v1.ConfigField config_fields = 12; - for (unsigned int i = 0, - n = static_cast(this->_internal_config_fields_size()); i < n; i++) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(12, this->_internal_config_fields(i), target, stream); - } - - // string model = 13; - if (this->model().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_model().data(), static_cast(this->_internal_model().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "google.cloud.speech.v1.RecognitionConfig.model"); - target = stream->WriteStringMaybeAliased( - 13, this->_internal_model(), target); - } - - // bool use_enhanced = 14; - if (this->use_enhanced() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(14, this->_internal_use_enhanced(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:google.cloud.speech.v1.RecognitionConfig) - return target; -} - -size_t RecognitionConfig::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.cloud.speech.v1.RecognitionConfig) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - total_size += 1UL * this->_internal_speech_contexts_size(); - for (const auto& msg : this->speech_contexts_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - // repeated .google.cloud.speech.v1.ConfigField config_fields = 12; - total_size += 1UL * this->_internal_config_fields_size(); - for (const auto& msg : this->config_fields_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - // string language_code = 3; - if (this->language_code().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_language_code()); - } - - // string model = 13; - if (this->model().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_model()); - } - - // .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; - if (this->encoding() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_encoding()); - } - - // int32 sample_rate_hertz = 2; - if (this->sample_rate_hertz() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - this->_internal_sample_rate_hertz()); - } - - // int32 max_alternatives = 4; - if (this->max_alternatives() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - this->_internal_max_alternatives()); - } - - // bool profanity_filter = 5; - if (this->profanity_filter() != 0) { - total_size += 1 + 1; - } - - // bool enable_word_time_offsets = 8; - if (this->enable_word_time_offsets() != 0) { - total_size += 1 + 1; - } - - // bool enable_automatic_punctuation = 11; - if (this->enable_automatic_punctuation() != 0) { - total_size += 1 + 1; - } - - // bool use_enhanced = 14; - if (this->use_enhanced() != 0) { - total_size += 1 + 1; - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void RecognitionConfig::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:google.cloud.speech.v1.RecognitionConfig) - GOOGLE_DCHECK_NE(&from, this); - const RecognitionConfig* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.cloud.speech.v1.RecognitionConfig) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:google.cloud.speech.v1.RecognitionConfig) - MergeFrom(*source); - } -} - -void RecognitionConfig::MergeFrom(const RecognitionConfig& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.cloud.speech.v1.RecognitionConfig) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - speech_contexts_.MergeFrom(from.speech_contexts_); - config_fields_.MergeFrom(from.config_fields_); - if (from.language_code().size() > 0) { - _internal_set_language_code(from._internal_language_code()); - } - if (from.model().size() > 0) { - _internal_set_model(from._internal_model()); - } - if (from.encoding() != 0) { - _internal_set_encoding(from._internal_encoding()); - } - if (from.sample_rate_hertz() != 0) { - _internal_set_sample_rate_hertz(from._internal_sample_rate_hertz()); - } - if (from.max_alternatives() != 0) { - _internal_set_max_alternatives(from._internal_max_alternatives()); - } - if (from.profanity_filter() != 0) { - _internal_set_profanity_filter(from._internal_profanity_filter()); - } - if (from.enable_word_time_offsets() != 0) { - _internal_set_enable_word_time_offsets(from._internal_enable_word_time_offsets()); - } - if (from.enable_automatic_punctuation() != 0) { - _internal_set_enable_automatic_punctuation(from._internal_enable_automatic_punctuation()); - } - if (from.use_enhanced() != 0) { - _internal_set_use_enhanced(from._internal_use_enhanced()); - } -} - -void RecognitionConfig::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:google.cloud.speech.v1.RecognitionConfig) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void RecognitionConfig::CopyFrom(const RecognitionConfig& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.cloud.speech.v1.RecognitionConfig) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool RecognitionConfig::IsInitialized() const { - return true; -} - -void RecognitionConfig::InternalSwap(RecognitionConfig* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - speech_contexts_.InternalSwap(&other->speech_contexts_); - config_fields_.InternalSwap(&other->config_fields_); - language_code_.Swap(&other->language_code_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - model_.Swap(&other->model_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(encoding_, other->encoding_); - swap(sample_rate_hertz_, other->sample_rate_hertz_); - swap(max_alternatives_, other->max_alternatives_); - swap(profanity_filter_, other->profanity_filter_); - swap(enable_word_time_offsets_, other->enable_word_time_offsets_); - swap(enable_automatic_punctuation_, other->enable_automatic_punctuation_); - swap(use_enhanced_, other->use_enhanced_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata RecognitionConfig::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void SpeechContext::InitAsDefaultInstance() { -} -class SpeechContext::_Internal { - public: -}; - -SpeechContext::SpeechContext() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:google.cloud.speech.v1.SpeechContext) -} -SpeechContext::SpeechContext(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(arena), - phrases_(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:google.cloud.speech.v1.SpeechContext) -} -SpeechContext::SpeechContext(const SpeechContext& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - phrases_(from.phrases_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - // @@protoc_insertion_point(copy_constructor:google.cloud.speech.v1.SpeechContext) -} - -void SpeechContext::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_SpeechContext_dictation_5fasr_2eproto.base); -} - -SpeechContext::~SpeechContext() { - // @@protoc_insertion_point(destructor:google.cloud.speech.v1.SpeechContext) - SharedDtor(); -} - -void SpeechContext::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); -} - -void SpeechContext::ArenaDtor(void* object) { - SpeechContext* _this = reinterpret_cast< SpeechContext* >(object); - (void)_this; -} -void SpeechContext::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void SpeechContext::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const SpeechContext& SpeechContext::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_SpeechContext_dictation_5fasr_2eproto.base); - return *internal_default_instance(); -} - - -void SpeechContext::Clear() { -// @@protoc_insertion_point(message_clear_start:google.cloud.speech.v1.SpeechContext) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - phrases_.Clear(); - _internal_metadata_.Clear(); -} - -const char* SpeechContext::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // repeated string phrases = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr -= 1; - do { - ptr += 1; - auto str = _internal_add_phrases(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.cloud.speech.v1.SpeechContext.phrases")); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr)); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* SpeechContext::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:google.cloud.speech.v1.SpeechContext) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // repeated string phrases = 1; - for (int i = 0, n = this->_internal_phrases_size(); i < n; i++) { - const auto& s = this->_internal_phrases(i); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - s.data(), static_cast(s.length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "google.cloud.speech.v1.SpeechContext.phrases"); - target = stream->WriteString(1, s, target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:google.cloud.speech.v1.SpeechContext) - return target; -} - -size_t SpeechContext::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.cloud.speech.v1.SpeechContext) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated string phrases = 1; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(phrases_.size()); - for (int i = 0, n = phrases_.size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - phrases_.Get(i)); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void SpeechContext::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:google.cloud.speech.v1.SpeechContext) - GOOGLE_DCHECK_NE(&from, this); - const SpeechContext* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.cloud.speech.v1.SpeechContext) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:google.cloud.speech.v1.SpeechContext) - MergeFrom(*source); - } -} - -void SpeechContext::MergeFrom(const SpeechContext& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.cloud.speech.v1.SpeechContext) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - phrases_.MergeFrom(from.phrases_); -} - -void SpeechContext::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:google.cloud.speech.v1.SpeechContext) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void SpeechContext::CopyFrom(const SpeechContext& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.cloud.speech.v1.SpeechContext) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool SpeechContext::IsInitialized() const { - return true; -} - -void SpeechContext::InternalSwap(SpeechContext* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - phrases_.InternalSwap(&other->phrases_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata SpeechContext::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void ConfigField::InitAsDefaultInstance() { -} -class ConfigField::_Internal { - public: -}; - -ConfigField::ConfigField() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:google.cloud.speech.v1.ConfigField) -} -ConfigField::ConfigField(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:google.cloud.speech.v1.ConfigField) -} -ConfigField::ConfigField(const ConfigField& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - key_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from._internal_key().empty()) { - key_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_key(), - GetArenaNoVirtual()); - } - value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from._internal_value().empty()) { - value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_value(), - GetArenaNoVirtual()); - } - // @@protoc_insertion_point(copy_constructor:google.cloud.speech.v1.ConfigField) -} - -void ConfigField::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ConfigField_dictation_5fasr_2eproto.base); - key_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -ConfigField::~ConfigField() { - // @@protoc_insertion_point(destructor:google.cloud.speech.v1.ConfigField) - SharedDtor(); -} - -void ConfigField::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); - key_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - value_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void ConfigField::ArenaDtor(void* object) { - ConfigField* _this = reinterpret_cast< ConfigField* >(object); - (void)_this; -} -void ConfigField::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void ConfigField::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const ConfigField& ConfigField::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ConfigField_dictation_5fasr_2eproto.base); - return *internal_default_instance(); -} - - -void ConfigField::Clear() { -// @@protoc_insertion_point(message_clear_start:google.cloud.speech.v1.ConfigField) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - key_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); - value_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); - _internal_metadata_.Clear(); -} - -const char* ConfigField::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // string key = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - auto str = _internal_mutable_key(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.cloud.speech.v1.ConfigField.key")); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string value = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - auto str = _internal_mutable_value(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.cloud.speech.v1.ConfigField.value")); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* ConfigField::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:google.cloud.speech.v1.ConfigField) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string key = 1; - if (this->key().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_key().data(), static_cast(this->_internal_key().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "google.cloud.speech.v1.ConfigField.key"); - target = stream->WriteStringMaybeAliased( - 1, this->_internal_key(), target); - } - - // string value = 2; - if (this->value().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_value().data(), static_cast(this->_internal_value().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "google.cloud.speech.v1.ConfigField.value"); - target = stream->WriteStringMaybeAliased( - 2, this->_internal_value(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:google.cloud.speech.v1.ConfigField) - return target; -} - -size_t ConfigField::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.cloud.speech.v1.ConfigField) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string key = 1; - if (this->key().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_key()); - } - - // string value = 2; - if (this->value().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_value()); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void ConfigField::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:google.cloud.speech.v1.ConfigField) - GOOGLE_DCHECK_NE(&from, this); - const ConfigField* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.cloud.speech.v1.ConfigField) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:google.cloud.speech.v1.ConfigField) - MergeFrom(*source); - } -} - -void ConfigField::MergeFrom(const ConfigField& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.cloud.speech.v1.ConfigField) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.key().size() > 0) { - _internal_set_key(from._internal_key()); - } - if (from.value().size() > 0) { - _internal_set_value(from._internal_value()); - } -} - -void ConfigField::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:google.cloud.speech.v1.ConfigField) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void ConfigField::CopyFrom(const ConfigField& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.cloud.speech.v1.ConfigField) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool ConfigField::IsInitialized() const { - return true; -} - -void ConfigField::InternalSwap(ConfigField* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - key_.Swap(&other->key_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - value_.Swap(&other->value_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} - -::PROTOBUF_NAMESPACE_ID::Metadata ConfigField::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void RecognitionAudio::InitAsDefaultInstance() { - ::google::cloud::speech::v1::_RecognitionAudio_default_instance_.content_.UnsafeSetDefault( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::google::cloud::speech::v1::_RecognitionAudio_default_instance_.uri_.UnsafeSetDefault( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} -class RecognitionAudio::_Internal { - public: -}; - -RecognitionAudio::RecognitionAudio() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:google.cloud.speech.v1.RecognitionAudio) -} -RecognitionAudio::RecognitionAudio(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:google.cloud.speech.v1.RecognitionAudio) -} -RecognitionAudio::RecognitionAudio(const RecognitionAudio& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - clear_has_audio_source(); - switch (from.audio_source_case()) { - case kContent: { - _internal_set_content(from._internal_content()); - break; - } - case kUri: { - _internal_set_uri(from._internal_uri()); - break; - } - case AUDIO_SOURCE_NOT_SET: { - break; - } - } - // @@protoc_insertion_point(copy_constructor:google.cloud.speech.v1.RecognitionAudio) -} - -void RecognitionAudio::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_RecognitionAudio_dictation_5fasr_2eproto.base); - clear_has_audio_source(); -} - -RecognitionAudio::~RecognitionAudio() { - // @@protoc_insertion_point(destructor:google.cloud.speech.v1.RecognitionAudio) - SharedDtor(); -} - -void RecognitionAudio::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); - if (has_audio_source()) { - clear_audio_source(); - } -} - -void RecognitionAudio::ArenaDtor(void* object) { - RecognitionAudio* _this = reinterpret_cast< RecognitionAudio* >(object); - (void)_this; -} -void RecognitionAudio::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void RecognitionAudio::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const RecognitionAudio& RecognitionAudio::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_RecognitionAudio_dictation_5fasr_2eproto.base); - return *internal_default_instance(); -} - - -void RecognitionAudio::clear_audio_source() { -// @@protoc_insertion_point(one_of_clear_start:google.cloud.speech.v1.RecognitionAudio) - switch (audio_source_case()) { - case kContent: { - audio_source_.content_.Destroy(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - break; - } - case kUri: { - audio_source_.uri_.Destroy(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - break; - } - case AUDIO_SOURCE_NOT_SET: { - break; - } - } - _oneof_case_[0] = AUDIO_SOURCE_NOT_SET; -} - - -void RecognitionAudio::Clear() { -// @@protoc_insertion_point(message_clear_start:google.cloud.speech.v1.RecognitionAudio) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - clear_audio_source(); - _internal_metadata_.Clear(); -} - -const char* RecognitionAudio::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // bytes content = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - auto str = _internal_mutable_content(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string uri = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - auto str = _internal_mutable_uri(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.cloud.speech.v1.RecognitionAudio.uri")); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* RecognitionAudio::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:google.cloud.speech.v1.RecognitionAudio) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // bytes content = 1; - if (_internal_has_content()) { - target = stream->WriteBytesMaybeAliased( - 1, this->_internal_content(), target); - } - - // string uri = 2; - if (_internal_has_uri()) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_uri().data(), static_cast(this->_internal_uri().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "google.cloud.speech.v1.RecognitionAudio.uri"); - target = stream->WriteStringMaybeAliased( - 2, this->_internal_uri(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:google.cloud.speech.v1.RecognitionAudio) - return target; -} - -size_t RecognitionAudio::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.cloud.speech.v1.RecognitionAudio) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - switch (audio_source_case()) { - // bytes content = 1; - case kContent: { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( - this->_internal_content()); - break; - } - // string uri = 2; - case kUri: { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_uri()); - break; - } - case AUDIO_SOURCE_NOT_SET: { - break; - } - } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void RecognitionAudio::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:google.cloud.speech.v1.RecognitionAudio) - GOOGLE_DCHECK_NE(&from, this); - const RecognitionAudio* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.cloud.speech.v1.RecognitionAudio) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:google.cloud.speech.v1.RecognitionAudio) - MergeFrom(*source); - } -} - -void RecognitionAudio::MergeFrom(const RecognitionAudio& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.cloud.speech.v1.RecognitionAudio) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - switch (from.audio_source_case()) { - case kContent: { - _internal_set_content(from._internal_content()); - break; - } - case kUri: { - _internal_set_uri(from._internal_uri()); - break; - } - case AUDIO_SOURCE_NOT_SET: { - break; - } - } -} - -void RecognitionAudio::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:google.cloud.speech.v1.RecognitionAudio) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void RecognitionAudio::CopyFrom(const RecognitionAudio& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.cloud.speech.v1.RecognitionAudio) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool RecognitionAudio::IsInitialized() const { - return true; -} - -void RecognitionAudio::InternalSwap(RecognitionAudio* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(audio_source_, other->audio_source_); - swap(_oneof_case_[0], other->_oneof_case_[0]); -} - -::PROTOBUF_NAMESPACE_ID::Metadata RecognitionAudio::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void RecognizeResponse::InitAsDefaultInstance() { -} -class RecognizeResponse::_Internal { - public: -}; - -RecognizeResponse::RecognizeResponse() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:google.cloud.speech.v1.RecognizeResponse) -} -RecognizeResponse::RecognizeResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(arena), - results_(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:google.cloud.speech.v1.RecognizeResponse) -} -RecognizeResponse::RecognizeResponse(const RecognizeResponse& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - results_(from.results_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - // @@protoc_insertion_point(copy_constructor:google.cloud.speech.v1.RecognizeResponse) -} - -void RecognizeResponse::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_RecognizeResponse_dictation_5fasr_2eproto.base); -} - -RecognizeResponse::~RecognizeResponse() { - // @@protoc_insertion_point(destructor:google.cloud.speech.v1.RecognizeResponse) - SharedDtor(); -} - -void RecognizeResponse::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); -} - -void RecognizeResponse::ArenaDtor(void* object) { - RecognizeResponse* _this = reinterpret_cast< RecognizeResponse* >(object); - (void)_this; -} -void RecognizeResponse::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void RecognizeResponse::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const RecognizeResponse& RecognizeResponse::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_RecognizeResponse_dictation_5fasr_2eproto.base); - return *internal_default_instance(); -} - - -void RecognizeResponse::Clear() { -// @@protoc_insertion_point(message_clear_start:google.cloud.speech.v1.RecognizeResponse) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - results_.Clear(); - _internal_metadata_.Clear(); -} - -const char* RecognizeResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_results(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* RecognizeResponse::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:google.cloud.speech.v1.RecognizeResponse) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - for (unsigned int i = 0, - n = static_cast(this->_internal_results_size()); i < n; i++) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(2, this->_internal_results(i), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:google.cloud.speech.v1.RecognizeResponse) - return target; -} - -size_t RecognizeResponse::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.cloud.speech.v1.RecognizeResponse) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - total_size += 1UL * this->_internal_results_size(); - for (const auto& msg : this->results_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void RecognizeResponse::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:google.cloud.speech.v1.RecognizeResponse) - GOOGLE_DCHECK_NE(&from, this); - const RecognizeResponse* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.cloud.speech.v1.RecognizeResponse) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:google.cloud.speech.v1.RecognizeResponse) - MergeFrom(*source); - } -} - -void RecognizeResponse::MergeFrom(const RecognizeResponse& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.cloud.speech.v1.RecognizeResponse) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - results_.MergeFrom(from.results_); -} - -void RecognizeResponse::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:google.cloud.speech.v1.RecognizeResponse) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void RecognizeResponse::CopyFrom(const RecognizeResponse& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.cloud.speech.v1.RecognizeResponse) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool RecognizeResponse::IsInitialized() const { - return true; -} - -void RecognizeResponse::InternalSwap(RecognizeResponse* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - results_.InternalSwap(&other->results_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata RecognizeResponse::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void StreamingRecognizeResponse::InitAsDefaultInstance() { - ::google::cloud::speech::v1::_StreamingRecognizeResponse_default_instance_._instance.get_mutable()->error_ = const_cast< ::google::rpc::Status*>( - ::google::rpc::Status::internal_default_instance()); -} -class StreamingRecognizeResponse::_Internal { - public: - static const ::google::rpc::Status& error(const StreamingRecognizeResponse* msg); -}; - -const ::google::rpc::Status& -StreamingRecognizeResponse::_Internal::error(const StreamingRecognizeResponse* msg) { - return *msg->error_; -} -void StreamingRecognizeResponse::unsafe_arena_set_allocated_error( - ::google::rpc::Status* error) { - if (GetArenaNoVirtual() == nullptr) { - delete error_; - } - error_ = error; - if (error) { - - } else { - - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.cloud.speech.v1.StreamingRecognizeResponse.error) -} -void StreamingRecognizeResponse::clear_error() { - if (GetArenaNoVirtual() == nullptr && error_ != nullptr) { - delete error_; - } - error_ = nullptr; -} -StreamingRecognizeResponse::StreamingRecognizeResponse() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:google.cloud.speech.v1.StreamingRecognizeResponse) -} -StreamingRecognizeResponse::StreamingRecognizeResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(arena), - results_(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:google.cloud.speech.v1.StreamingRecognizeResponse) -} -StreamingRecognizeResponse::StreamingRecognizeResponse(const StreamingRecognizeResponse& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - results_(from.results_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - if (from._internal_has_error()) { - error_ = new ::google::rpc::Status(*from.error_); - } else { - error_ = nullptr; - } - speech_event_type_ = from.speech_event_type_; - // @@protoc_insertion_point(copy_constructor:google.cloud.speech.v1.StreamingRecognizeResponse) -} - -void StreamingRecognizeResponse::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_StreamingRecognizeResponse_dictation_5fasr_2eproto.base); - ::memset(&error_, 0, static_cast( - reinterpret_cast(&speech_event_type_) - - reinterpret_cast(&error_)) + sizeof(speech_event_type_)); -} - -StreamingRecognizeResponse::~StreamingRecognizeResponse() { - // @@protoc_insertion_point(destructor:google.cloud.speech.v1.StreamingRecognizeResponse) - SharedDtor(); -} - -void StreamingRecognizeResponse::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); - if (this != internal_default_instance()) delete error_; -} - -void StreamingRecognizeResponse::ArenaDtor(void* object) { - StreamingRecognizeResponse* _this = reinterpret_cast< StreamingRecognizeResponse* >(object); - (void)_this; -} -void StreamingRecognizeResponse::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void StreamingRecognizeResponse::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const StreamingRecognizeResponse& StreamingRecognizeResponse::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_StreamingRecognizeResponse_dictation_5fasr_2eproto.base); - return *internal_default_instance(); -} - - -void StreamingRecognizeResponse::Clear() { -// @@protoc_insertion_point(message_clear_start:google.cloud.speech.v1.StreamingRecognizeResponse) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - results_.Clear(); - if (GetArenaNoVirtual() == nullptr && error_ != nullptr) { - delete error_; - } - error_ = nullptr; - speech_event_type_ = 0; - _internal_metadata_.Clear(); -} - -const char* StreamingRecognizeResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .google.rpc.Status error = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ctx->ParseMessage(_internal_mutable_error(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_results(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); - } else goto handle_unusual; - continue; - // .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - _internal_set_speech_event_type(static_cast<::google::cloud::speech::v1::StreamingRecognizeResponse_SpeechEventType>(val)); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* StreamingRecognizeResponse::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:google.cloud.speech.v1.StreamingRecognizeResponse) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .google.rpc.Status error = 1; - if (this->has_error()) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::error(this), target, stream); - } - - // repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - for (unsigned int i = 0, - n = static_cast(this->_internal_results_size()); i < n; i++) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(2, this->_internal_results(i), target, stream); - } - - // .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - if (this->speech_event_type() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 4, this->_internal_speech_event_type(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:google.cloud.speech.v1.StreamingRecognizeResponse) - return target; -} - -size_t StreamingRecognizeResponse::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.cloud.speech.v1.StreamingRecognizeResponse) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - total_size += 1UL * this->_internal_results_size(); - for (const auto& msg : this->results_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - // .google.rpc.Status error = 1; - if (this->has_error()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *error_); - } - - // .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - if (this->speech_event_type() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_speech_event_type()); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void StreamingRecognizeResponse::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:google.cloud.speech.v1.StreamingRecognizeResponse) - GOOGLE_DCHECK_NE(&from, this); - const StreamingRecognizeResponse* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.cloud.speech.v1.StreamingRecognizeResponse) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:google.cloud.speech.v1.StreamingRecognizeResponse) - MergeFrom(*source); - } -} - -void StreamingRecognizeResponse::MergeFrom(const StreamingRecognizeResponse& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.cloud.speech.v1.StreamingRecognizeResponse) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - results_.MergeFrom(from.results_); - if (from.has_error()) { - _internal_mutable_error()->::google::rpc::Status::MergeFrom(from._internal_error()); - } - if (from.speech_event_type() != 0) { - _internal_set_speech_event_type(from._internal_speech_event_type()); - } -} - -void StreamingRecognizeResponse::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:google.cloud.speech.v1.StreamingRecognizeResponse) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void StreamingRecognizeResponse::CopyFrom(const StreamingRecognizeResponse& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.cloud.speech.v1.StreamingRecognizeResponse) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool StreamingRecognizeResponse::IsInitialized() const { - return true; -} - -void StreamingRecognizeResponse::InternalSwap(StreamingRecognizeResponse* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - results_.InternalSwap(&other->results_); - swap(error_, other->error_); - swap(speech_event_type_, other->speech_event_type_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata StreamingRecognizeResponse::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void StreamingRecognitionResult::InitAsDefaultInstance() { -} -class StreamingRecognitionResult::_Internal { - public: -}; - -StreamingRecognitionResult::StreamingRecognitionResult() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:google.cloud.speech.v1.StreamingRecognitionResult) -} -StreamingRecognitionResult::StreamingRecognitionResult(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(arena), - alternatives_(arena), - lattice_(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:google.cloud.speech.v1.StreamingRecognitionResult) -} -StreamingRecognitionResult::StreamingRecognitionResult(const StreamingRecognitionResult& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - alternatives_(from.alternatives_), - lattice_(from.lattice_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::memcpy(&is_final_, &from.is_final_, - static_cast(reinterpret_cast(&result_finalization_cause_) - - reinterpret_cast(&is_final_)) + sizeof(result_finalization_cause_)); - // @@protoc_insertion_point(copy_constructor:google.cloud.speech.v1.StreamingRecognitionResult) -} - -void StreamingRecognitionResult::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_StreamingRecognitionResult_dictation_5fasr_2eproto.base); - ::memset(&is_final_, 0, static_cast( - reinterpret_cast(&result_finalization_cause_) - - reinterpret_cast(&is_final_)) + sizeof(result_finalization_cause_)); -} - -StreamingRecognitionResult::~StreamingRecognitionResult() { - // @@protoc_insertion_point(destructor:google.cloud.speech.v1.StreamingRecognitionResult) - SharedDtor(); -} - -void StreamingRecognitionResult::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); -} - -void StreamingRecognitionResult::ArenaDtor(void* object) { - StreamingRecognitionResult* _this = reinterpret_cast< StreamingRecognitionResult* >(object); - (void)_this; -} -void StreamingRecognitionResult::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void StreamingRecognitionResult::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const StreamingRecognitionResult& StreamingRecognitionResult::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_StreamingRecognitionResult_dictation_5fasr_2eproto.base); - return *internal_default_instance(); -} - - -void StreamingRecognitionResult::Clear() { -// @@protoc_insertion_point(message_clear_start:google.cloud.speech.v1.StreamingRecognitionResult) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - alternatives_.Clear(); - lattice_.Clear(); - ::memset(&is_final_, 0, static_cast( - reinterpret_cast(&result_finalization_cause_) - - reinterpret_cast(&is_final_)) + sizeof(result_finalization_cause_)); - _internal_metadata_.Clear(); -} - -const char* StreamingRecognitionResult::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_alternatives(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr)); - } else goto handle_unusual; - continue; - // bool is_final = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - is_final_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // float stability = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 29)) { - stability_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); - ptr += sizeof(float); - } else goto handle_unusual; - continue; - // .google.cloud.speech.v1.StreamingRecognitionResult.ResultFinalizationCause result_finalization_cause = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - _internal_set_result_finalization_cause(static_cast<::google::cloud::speech::v1::StreamingRecognitionResult_ResultFinalizationCause>(val)); - } else goto handle_unusual; - continue; - // repeated .google.cloud.speech.v1.RecognitionLattice lattice = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_lattice(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr)); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* StreamingRecognitionResult::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:google.cloud.speech.v1.StreamingRecognitionResult) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - for (unsigned int i = 0, - n = static_cast(this->_internal_alternatives_size()); i < n; i++) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(1, this->_internal_alternatives(i), target, stream); - } - - // bool is_final = 2; - if (this->is_final() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_is_final(), target); - } - - // float stability = 3; - if (!(this->stability() <= 0 && this->stability() >= 0)) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->_internal_stability(), target); - } - - // .google.cloud.speech.v1.StreamingRecognitionResult.ResultFinalizationCause result_finalization_cause = 4; - if (this->result_finalization_cause() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 4, this->_internal_result_finalization_cause(), target); - } - - // repeated .google.cloud.speech.v1.RecognitionLattice lattice = 5; - for (unsigned int i = 0, - n = static_cast(this->_internal_lattice_size()); i < n; i++) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(5, this->_internal_lattice(i), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:google.cloud.speech.v1.StreamingRecognitionResult) - return target; -} - -size_t StreamingRecognitionResult::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.cloud.speech.v1.StreamingRecognitionResult) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - total_size += 1UL * this->_internal_alternatives_size(); - for (const auto& msg : this->alternatives_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - // repeated .google.cloud.speech.v1.RecognitionLattice lattice = 5; - total_size += 1UL * this->_internal_lattice_size(); - for (const auto& msg : this->lattice_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - // bool is_final = 2; - if (this->is_final() != 0) { - total_size += 1 + 1; - } - - // float stability = 3; - if (!(this->stability() <= 0 && this->stability() >= 0)) { - total_size += 1 + 4; - } - - // .google.cloud.speech.v1.StreamingRecognitionResult.ResultFinalizationCause result_finalization_cause = 4; - if (this->result_finalization_cause() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_result_finalization_cause()); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void StreamingRecognitionResult::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:google.cloud.speech.v1.StreamingRecognitionResult) - GOOGLE_DCHECK_NE(&from, this); - const StreamingRecognitionResult* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.cloud.speech.v1.StreamingRecognitionResult) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:google.cloud.speech.v1.StreamingRecognitionResult) - MergeFrom(*source); - } -} - -void StreamingRecognitionResult::MergeFrom(const StreamingRecognitionResult& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.cloud.speech.v1.StreamingRecognitionResult) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - alternatives_.MergeFrom(from.alternatives_); - lattice_.MergeFrom(from.lattice_); - if (from.is_final() != 0) { - _internal_set_is_final(from._internal_is_final()); - } - if (!(from.stability() <= 0 && from.stability() >= 0)) { - _internal_set_stability(from._internal_stability()); - } - if (from.result_finalization_cause() != 0) { - _internal_set_result_finalization_cause(from._internal_result_finalization_cause()); - } -} - -void StreamingRecognitionResult::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:google.cloud.speech.v1.StreamingRecognitionResult) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void StreamingRecognitionResult::CopyFrom(const StreamingRecognitionResult& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.cloud.speech.v1.StreamingRecognitionResult) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool StreamingRecognitionResult::IsInitialized() const { - return true; -} - -void StreamingRecognitionResult::InternalSwap(StreamingRecognitionResult* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - alternatives_.InternalSwap(&other->alternatives_); - lattice_.InternalSwap(&other->lattice_); - swap(is_final_, other->is_final_); - swap(stability_, other->stability_); - swap(result_finalization_cause_, other->result_finalization_cause_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata StreamingRecognitionResult::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void SpeechRecognitionResult::InitAsDefaultInstance() { -} -class SpeechRecognitionResult::_Internal { - public: -}; - -SpeechRecognitionResult::SpeechRecognitionResult() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:google.cloud.speech.v1.SpeechRecognitionResult) -} -SpeechRecognitionResult::SpeechRecognitionResult(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(arena), - alternatives_(arena), - lattice_(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:google.cloud.speech.v1.SpeechRecognitionResult) -} -SpeechRecognitionResult::SpeechRecognitionResult(const SpeechRecognitionResult& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - alternatives_(from.alternatives_), - lattice_(from.lattice_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - // @@protoc_insertion_point(copy_constructor:google.cloud.speech.v1.SpeechRecognitionResult) -} - -void SpeechRecognitionResult::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_SpeechRecognitionResult_dictation_5fasr_2eproto.base); -} - -SpeechRecognitionResult::~SpeechRecognitionResult() { - // @@protoc_insertion_point(destructor:google.cloud.speech.v1.SpeechRecognitionResult) - SharedDtor(); -} - -void SpeechRecognitionResult::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); -} - -void SpeechRecognitionResult::ArenaDtor(void* object) { - SpeechRecognitionResult* _this = reinterpret_cast< SpeechRecognitionResult* >(object); - (void)_this; -} -void SpeechRecognitionResult::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void SpeechRecognitionResult::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const SpeechRecognitionResult& SpeechRecognitionResult::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_SpeechRecognitionResult_dictation_5fasr_2eproto.base); - return *internal_default_instance(); -} - - -void SpeechRecognitionResult::Clear() { -// @@protoc_insertion_point(message_clear_start:google.cloud.speech.v1.SpeechRecognitionResult) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - alternatives_.Clear(); - lattice_.Clear(); - _internal_metadata_.Clear(); -} - -const char* SpeechRecognitionResult::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_alternatives(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr)); - } else goto handle_unusual; - continue; - // repeated .google.cloud.speech.v1.RecognitionLattice lattice = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_lattice(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr)); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* SpeechRecognitionResult::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:google.cloud.speech.v1.SpeechRecognitionResult) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - for (unsigned int i = 0, - n = static_cast(this->_internal_alternatives_size()); i < n; i++) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(1, this->_internal_alternatives(i), target, stream); - } - - // repeated .google.cloud.speech.v1.RecognitionLattice lattice = 5; - for (unsigned int i = 0, - n = static_cast(this->_internal_lattice_size()); i < n; i++) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(5, this->_internal_lattice(i), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:google.cloud.speech.v1.SpeechRecognitionResult) - return target; -} - -size_t SpeechRecognitionResult::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.cloud.speech.v1.SpeechRecognitionResult) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - total_size += 1UL * this->_internal_alternatives_size(); - for (const auto& msg : this->alternatives_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - // repeated .google.cloud.speech.v1.RecognitionLattice lattice = 5; - total_size += 1UL * this->_internal_lattice_size(); - for (const auto& msg : this->lattice_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void SpeechRecognitionResult::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:google.cloud.speech.v1.SpeechRecognitionResult) - GOOGLE_DCHECK_NE(&from, this); - const SpeechRecognitionResult* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.cloud.speech.v1.SpeechRecognitionResult) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:google.cloud.speech.v1.SpeechRecognitionResult) - MergeFrom(*source); - } -} - -void SpeechRecognitionResult::MergeFrom(const SpeechRecognitionResult& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.cloud.speech.v1.SpeechRecognitionResult) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - alternatives_.MergeFrom(from.alternatives_); - lattice_.MergeFrom(from.lattice_); -} - -void SpeechRecognitionResult::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:google.cloud.speech.v1.SpeechRecognitionResult) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void SpeechRecognitionResult::CopyFrom(const SpeechRecognitionResult& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.cloud.speech.v1.SpeechRecognitionResult) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool SpeechRecognitionResult::IsInitialized() const { - return true; -} - -void SpeechRecognitionResult::InternalSwap(SpeechRecognitionResult* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - alternatives_.InternalSwap(&other->alternatives_); - lattice_.InternalSwap(&other->lattice_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata SpeechRecognitionResult::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void SpeechRecognitionAlternative::InitAsDefaultInstance() { -} -class SpeechRecognitionAlternative::_Internal { - public: -}; - -SpeechRecognitionAlternative::SpeechRecognitionAlternative() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:google.cloud.speech.v1.SpeechRecognitionAlternative) -} -SpeechRecognitionAlternative::SpeechRecognitionAlternative(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(arena), - words_(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:google.cloud.speech.v1.SpeechRecognitionAlternative) -} -SpeechRecognitionAlternative::SpeechRecognitionAlternative(const SpeechRecognitionAlternative& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - words_(from.words_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - transcript_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from._internal_transcript().empty()) { - transcript_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_transcript(), - GetArenaNoVirtual()); - } - confidence_ = from.confidence_; - // @@protoc_insertion_point(copy_constructor:google.cloud.speech.v1.SpeechRecognitionAlternative) -} - -void SpeechRecognitionAlternative::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_SpeechRecognitionAlternative_dictation_5fasr_2eproto.base); - transcript_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - confidence_ = 0; -} - -SpeechRecognitionAlternative::~SpeechRecognitionAlternative() { - // @@protoc_insertion_point(destructor:google.cloud.speech.v1.SpeechRecognitionAlternative) - SharedDtor(); -} - -void SpeechRecognitionAlternative::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); - transcript_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void SpeechRecognitionAlternative::ArenaDtor(void* object) { - SpeechRecognitionAlternative* _this = reinterpret_cast< SpeechRecognitionAlternative* >(object); - (void)_this; -} -void SpeechRecognitionAlternative::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void SpeechRecognitionAlternative::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const SpeechRecognitionAlternative& SpeechRecognitionAlternative::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_SpeechRecognitionAlternative_dictation_5fasr_2eproto.base); - return *internal_default_instance(); -} - - -void SpeechRecognitionAlternative::Clear() { -// @@protoc_insertion_point(message_clear_start:google.cloud.speech.v1.SpeechRecognitionAlternative) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - words_.Clear(); - transcript_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); - confidence_ = 0; - _internal_metadata_.Clear(); -} - -const char* SpeechRecognitionAlternative::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // string transcript = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - auto str = _internal_mutable_transcript(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.cloud.speech.v1.SpeechRecognitionAlternative.transcript")); - CHK_(ptr); - } else goto handle_unusual; - continue; - // float confidence = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 21)) { - confidence_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); - ptr += sizeof(float); - } else goto handle_unusual; - continue; - // repeated .google.cloud.speech.v1.WordInfo words = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_words(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr)); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* SpeechRecognitionAlternative::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:google.cloud.speech.v1.SpeechRecognitionAlternative) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string transcript = 1; - if (this->transcript().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_transcript().data(), static_cast(this->_internal_transcript().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "google.cloud.speech.v1.SpeechRecognitionAlternative.transcript"); - target = stream->WriteStringMaybeAliased( - 1, this->_internal_transcript(), target); - } - - // float confidence = 2; - if (!(this->confidence() <= 0 && this->confidence() >= 0)) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(2, this->_internal_confidence(), target); - } - - // repeated .google.cloud.speech.v1.WordInfo words = 3; - for (unsigned int i = 0, - n = static_cast(this->_internal_words_size()); i < n; i++) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, this->_internal_words(i), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:google.cloud.speech.v1.SpeechRecognitionAlternative) - return target; -} - -size_t SpeechRecognitionAlternative::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.cloud.speech.v1.SpeechRecognitionAlternative) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .google.cloud.speech.v1.WordInfo words = 3; - total_size += 1UL * this->_internal_words_size(); - for (const auto& msg : this->words_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - // string transcript = 1; - if (this->transcript().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_transcript()); - } - - // float confidence = 2; - if (!(this->confidence() <= 0 && this->confidence() >= 0)) { - total_size += 1 + 4; - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void SpeechRecognitionAlternative::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:google.cloud.speech.v1.SpeechRecognitionAlternative) - GOOGLE_DCHECK_NE(&from, this); - const SpeechRecognitionAlternative* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.cloud.speech.v1.SpeechRecognitionAlternative) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:google.cloud.speech.v1.SpeechRecognitionAlternative) - MergeFrom(*source); - } -} - -void SpeechRecognitionAlternative::MergeFrom(const SpeechRecognitionAlternative& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.cloud.speech.v1.SpeechRecognitionAlternative) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - words_.MergeFrom(from.words_); - if (from.transcript().size() > 0) { - _internal_set_transcript(from._internal_transcript()); - } - if (!(from.confidence() <= 0 && from.confidence() >= 0)) { - _internal_set_confidence(from._internal_confidence()); - } -} - -void SpeechRecognitionAlternative::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:google.cloud.speech.v1.SpeechRecognitionAlternative) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void SpeechRecognitionAlternative::CopyFrom(const SpeechRecognitionAlternative& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.cloud.speech.v1.SpeechRecognitionAlternative) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool SpeechRecognitionAlternative::IsInitialized() const { - return true; -} - -void SpeechRecognitionAlternative::InternalSwap(SpeechRecognitionAlternative* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - words_.InternalSwap(&other->words_); - transcript_.Swap(&other->transcript_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(confidence_, other->confidence_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata SpeechRecognitionAlternative::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void WordInfo::InitAsDefaultInstance() { - ::google::cloud::speech::v1::_WordInfo_default_instance_._instance.get_mutable()->start_time_ = const_cast< PROTOBUF_NAMESPACE_ID::Duration*>( - PROTOBUF_NAMESPACE_ID::Duration::internal_default_instance()); - ::google::cloud::speech::v1::_WordInfo_default_instance_._instance.get_mutable()->end_time_ = const_cast< PROTOBUF_NAMESPACE_ID::Duration*>( - PROTOBUF_NAMESPACE_ID::Duration::internal_default_instance()); -} -class WordInfo::_Internal { - public: - static const PROTOBUF_NAMESPACE_ID::Duration& start_time(const WordInfo* msg); - static const PROTOBUF_NAMESPACE_ID::Duration& end_time(const WordInfo* msg); -}; - -const PROTOBUF_NAMESPACE_ID::Duration& -WordInfo::_Internal::start_time(const WordInfo* msg) { - return *msg->start_time_; -} -const PROTOBUF_NAMESPACE_ID::Duration& -WordInfo::_Internal::end_time(const WordInfo* msg) { - return *msg->end_time_; -} -void WordInfo::unsafe_arena_set_allocated_start_time( - PROTOBUF_NAMESPACE_ID::Duration* start_time) { - if (GetArenaNoVirtual() == nullptr) { - delete start_time_; - } - start_time_ = start_time; - if (start_time) { - - } else { - - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.cloud.speech.v1.WordInfo.start_time) -} -void WordInfo::clear_start_time() { - if (GetArenaNoVirtual() == nullptr && start_time_ != nullptr) { - delete start_time_; - } - start_time_ = nullptr; -} -void WordInfo::unsafe_arena_set_allocated_end_time( - PROTOBUF_NAMESPACE_ID::Duration* end_time) { - if (GetArenaNoVirtual() == nullptr) { - delete end_time_; - } - end_time_ = end_time; - if (end_time) { - - } else { - - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.cloud.speech.v1.WordInfo.end_time) -} -void WordInfo::clear_end_time() { - if (GetArenaNoVirtual() == nullptr && end_time_ != nullptr) { - delete end_time_; - } - end_time_ = nullptr; -} -WordInfo::WordInfo() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:google.cloud.speech.v1.WordInfo) -} -WordInfo::WordInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:google.cloud.speech.v1.WordInfo) -} -WordInfo::WordInfo(const WordInfo& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - word_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from._internal_word().empty()) { - word_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_word(), - GetArenaNoVirtual()); - } - if (from._internal_has_start_time()) { - start_time_ = new PROTOBUF_NAMESPACE_ID::Duration(*from.start_time_); - } else { - start_time_ = nullptr; - } - if (from._internal_has_end_time()) { - end_time_ = new PROTOBUF_NAMESPACE_ID::Duration(*from.end_time_); - } else { - end_time_ = nullptr; - } - // @@protoc_insertion_point(copy_constructor:google.cloud.speech.v1.WordInfo) -} - -void WordInfo::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_WordInfo_dictation_5fasr_2eproto.base); - word_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&start_time_, 0, static_cast( - reinterpret_cast(&end_time_) - - reinterpret_cast(&start_time_)) + sizeof(end_time_)); -} - -WordInfo::~WordInfo() { - // @@protoc_insertion_point(destructor:google.cloud.speech.v1.WordInfo) - SharedDtor(); -} - -void WordInfo::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); - word_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (this != internal_default_instance()) delete start_time_; - if (this != internal_default_instance()) delete end_time_; -} - -void WordInfo::ArenaDtor(void* object) { - WordInfo* _this = reinterpret_cast< WordInfo* >(object); - (void)_this; -} -void WordInfo::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void WordInfo::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const WordInfo& WordInfo::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_WordInfo_dictation_5fasr_2eproto.base); - return *internal_default_instance(); -} - - -void WordInfo::Clear() { -// @@protoc_insertion_point(message_clear_start:google.cloud.speech.v1.WordInfo) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - word_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); - if (GetArenaNoVirtual() == nullptr && start_time_ != nullptr) { - delete start_time_; - } - start_time_ = nullptr; - if (GetArenaNoVirtual() == nullptr && end_time_ != nullptr) { - delete end_time_; - } - end_time_ = nullptr; - _internal_metadata_.Clear(); -} - -const char* WordInfo::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .google.protobuf.Duration start_time = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ctx->ParseMessage(_internal_mutable_start_time(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .google.protobuf.Duration end_time = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ctx->ParseMessage(_internal_mutable_end_time(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string word = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - auto str = _internal_mutable_word(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.cloud.speech.v1.WordInfo.word")); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* WordInfo::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:google.cloud.speech.v1.WordInfo) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .google.protobuf.Duration start_time = 1; - if (this->has_start_time()) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::start_time(this), target, stream); - } - - // .google.protobuf.Duration end_time = 2; - if (this->has_end_time()) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::end_time(this), target, stream); - } - - // string word = 3; - if (this->word().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_word().data(), static_cast(this->_internal_word().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "google.cloud.speech.v1.WordInfo.word"); - target = stream->WriteStringMaybeAliased( - 3, this->_internal_word(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:google.cloud.speech.v1.WordInfo) - return target; -} - -size_t WordInfo::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.cloud.speech.v1.WordInfo) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string word = 3; - if (this->word().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_word()); - } - - // .google.protobuf.Duration start_time = 1; - if (this->has_start_time()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *start_time_); - } - - // .google.protobuf.Duration end_time = 2; - if (this->has_end_time()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *end_time_); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void WordInfo::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:google.cloud.speech.v1.WordInfo) - GOOGLE_DCHECK_NE(&from, this); - const WordInfo* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.cloud.speech.v1.WordInfo) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:google.cloud.speech.v1.WordInfo) - MergeFrom(*source); - } -} - -void WordInfo::MergeFrom(const WordInfo& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.cloud.speech.v1.WordInfo) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.word().size() > 0) { - _internal_set_word(from._internal_word()); - } - if (from.has_start_time()) { - _internal_mutable_start_time()->PROTOBUF_NAMESPACE_ID::Duration::MergeFrom(from._internal_start_time()); - } - if (from.has_end_time()) { - _internal_mutable_end_time()->PROTOBUF_NAMESPACE_ID::Duration::MergeFrom(from._internal_end_time()); - } -} - -void WordInfo::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:google.cloud.speech.v1.WordInfo) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void WordInfo::CopyFrom(const WordInfo& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.cloud.speech.v1.WordInfo) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool WordInfo::IsInitialized() const { - return true; -} - -void WordInfo::InternalSwap(WordInfo* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - word_.Swap(&other->word_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(start_time_, other->start_time_); - swap(end_time_, other->end_time_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata WordInfo::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void RecognitionLattice::InitAsDefaultInstance() { -} -class RecognitionLattice::_Internal { - public: -}; - -RecognitionLattice::RecognitionLattice() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:google.cloud.speech.v1.RecognitionLattice) -} -RecognitionLattice::RecognitionLattice(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(arena), - final_nodes_(arena), - edges_(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:google.cloud.speech.v1.RecognitionLattice) -} -RecognitionLattice::RecognitionLattice(const RecognitionLattice& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr), - final_nodes_(from.final_nodes_), - edges_(from.edges_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - // @@protoc_insertion_point(copy_constructor:google.cloud.speech.v1.RecognitionLattice) -} - -void RecognitionLattice::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_RecognitionLattice_dictation_5fasr_2eproto.base); -} - -RecognitionLattice::~RecognitionLattice() { - // @@protoc_insertion_point(destructor:google.cloud.speech.v1.RecognitionLattice) - SharedDtor(); -} - -void RecognitionLattice::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); -} - -void RecognitionLattice::ArenaDtor(void* object) { - RecognitionLattice* _this = reinterpret_cast< RecognitionLattice* >(object); - (void)_this; -} -void RecognitionLattice::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void RecognitionLattice::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const RecognitionLattice& RecognitionLattice::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_RecognitionLattice_dictation_5fasr_2eproto.base); - return *internal_default_instance(); -} - - -void RecognitionLattice::Clear() { -// @@protoc_insertion_point(message_clear_start:google.cloud.speech.v1.RecognitionLattice) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - final_nodes_.Clear(); - edges_.Clear(); - _internal_metadata_.Clear(); -} - -const char* RecognitionLattice::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // repeated int32 final_nodes = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_final_nodes(), ptr, ctx); - CHK_(ptr); - } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8) { - _internal_add_final_nodes(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr)); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated .google.cloud.speech.v1.LatticeEdge edges = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_edges(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* RecognitionLattice::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:google.cloud.speech.v1.RecognitionLattice) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // repeated int32 final_nodes = 1; - { - int byte_size = _final_nodes_cached_byte_size_.load(std::memory_order_relaxed); - if (byte_size > 0) { - target = stream->WriteInt32Packed( - 1, _internal_final_nodes(), byte_size, target); - } - } - - // repeated .google.cloud.speech.v1.LatticeEdge edges = 2; - for (unsigned int i = 0, - n = static_cast(this->_internal_edges_size()); i < n; i++) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(2, this->_internal_edges(i), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:google.cloud.speech.v1.RecognitionLattice) - return target; -} - -size_t RecognitionLattice::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.cloud.speech.v1.RecognitionLattice) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated int32 final_nodes = 1; - { - size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - Int32Size(this->final_nodes_); - if (data_size > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); - _final_nodes_cached_byte_size_.store(cached_size, - std::memory_order_relaxed); - total_size += data_size; - } - - // repeated .google.cloud.speech.v1.LatticeEdge edges = 2; - total_size += 1UL * this->_internal_edges_size(); - for (const auto& msg : this->edges_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void RecognitionLattice::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:google.cloud.speech.v1.RecognitionLattice) - GOOGLE_DCHECK_NE(&from, this); - const RecognitionLattice* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.cloud.speech.v1.RecognitionLattice) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:google.cloud.speech.v1.RecognitionLattice) - MergeFrom(*source); - } -} - -void RecognitionLattice::MergeFrom(const RecognitionLattice& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.cloud.speech.v1.RecognitionLattice) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - final_nodes_.MergeFrom(from.final_nodes_); - edges_.MergeFrom(from.edges_); -} - -void RecognitionLattice::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:google.cloud.speech.v1.RecognitionLattice) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void RecognitionLattice::CopyFrom(const RecognitionLattice& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.cloud.speech.v1.RecognitionLattice) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool RecognitionLattice::IsInitialized() const { - return true; -} - -void RecognitionLattice::InternalSwap(RecognitionLattice* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - final_nodes_.InternalSwap(&other->final_nodes_); - edges_.InternalSwap(&other->edges_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata RecognitionLattice::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void LatticeEdge::InitAsDefaultInstance() { -} -class LatticeEdge::_Internal { - public: -}; - -LatticeEdge::LatticeEdge() - : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { - SharedCtor(); - // @@protoc_insertion_point(constructor:google.cloud.speech.v1.LatticeEdge) -} -LatticeEdge::LatticeEdge(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:google.cloud.speech.v1.LatticeEdge) -} -LatticeEdge::LatticeEdge(const LatticeEdge& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - _internal_metadata_(nullptr) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - symbol_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from._internal_symbol().empty()) { - symbol_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_symbol(), - GetArenaNoVirtual()); - } - ::memcpy(&start_node_, &from.start_node_, - static_cast(reinterpret_cast(&duration_) - - reinterpret_cast(&start_node_)) + sizeof(duration_)); - // @@protoc_insertion_point(copy_constructor:google.cloud.speech.v1.LatticeEdge) -} - -void LatticeEdge::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_LatticeEdge_dictation_5fasr_2eproto.base); - symbol_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&start_node_, 0, static_cast( - reinterpret_cast(&duration_) - - reinterpret_cast(&start_node_)) + sizeof(duration_)); -} - -LatticeEdge::~LatticeEdge() { - // @@protoc_insertion_point(destructor:google.cloud.speech.v1.LatticeEdge) - SharedDtor(); -} - -void LatticeEdge::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); - symbol_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void LatticeEdge::ArenaDtor(void* object) { - LatticeEdge* _this = reinterpret_cast< LatticeEdge* >(object); - (void)_this; -} -void LatticeEdge::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void LatticeEdge::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const LatticeEdge& LatticeEdge::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_LatticeEdge_dictation_5fasr_2eproto.base); - return *internal_default_instance(); -} - - -void LatticeEdge::Clear() { -// @@protoc_insertion_point(message_clear_start:google.cloud.speech.v1.LatticeEdge) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - symbol_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); - ::memset(&start_node_, 0, static_cast( - reinterpret_cast(&duration_) - - reinterpret_cast(&start_node_)) + sizeof(duration_)); - _internal_metadata_.Clear(); -} - -const char* LatticeEdge::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArenaNoVirtual(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // int32 start_node = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - start_node_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int32 end_node = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - end_node_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string symbol = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - auto str = _internal_mutable_symbol(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "google.cloud.speech.v1.LatticeEdge.symbol")); - CHK_(ptr); - } else goto handle_unusual; - continue; - // float language_cost = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 37)) { - language_cost_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); - ptr += sizeof(float); - } else goto handle_unusual; - continue; - // float acoustic_cost = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 45)) { - acoustic_cost_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); - ptr += sizeof(float); - } else goto handle_unusual; - continue; - // int32 duration = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { - duration_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* LatticeEdge::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:google.cloud.speech.v1.LatticeEdge) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // int32 start_node = 1; - if (this->start_node() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_start_node(), target); - } - - // int32 end_node = 2; - if (this->end_node() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_end_node(), target); - } - - // string symbol = 3; - if (this->symbol().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_symbol().data(), static_cast(this->_internal_symbol().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "google.cloud.speech.v1.LatticeEdge.symbol"); - target = stream->WriteStringMaybeAliased( - 3, this->_internal_symbol(), target); - } - - // float language_cost = 4; - if (!(this->language_cost() <= 0 && this->language_cost() >= 0)) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(4, this->_internal_language_cost(), target); - } - - // float acoustic_cost = 5; - if (!(this->acoustic_cost() <= 0 && this->acoustic_cost() >= 0)) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(5, this->_internal_acoustic_cost(), target); - } - - // int32 duration = 6; - if (this->duration() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(6, this->_internal_duration(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields(), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:google.cloud.speech.v1.LatticeEdge) - return target; -} - -size_t LatticeEdge::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:google.cloud.speech.v1.LatticeEdge) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string symbol = 3; - if (this->symbol().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_symbol()); - } - - // int32 start_node = 1; - if (this->start_node() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - this->_internal_start_node()); - } - - // int32 end_node = 2; - if (this->end_node() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - this->_internal_end_node()); - } - - // float language_cost = 4; - if (!(this->language_cost() <= 0 && this->language_cost() >= 0)) { - total_size += 1 + 4; - } - - // float acoustic_cost = 5; - if (!(this->acoustic_cost() <= 0 && this->acoustic_cost() >= 0)) { - total_size += 1 + 4; - } - - // int32 duration = 6; - if (this->duration() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - this->_internal_duration()); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void LatticeEdge::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:google.cloud.speech.v1.LatticeEdge) - GOOGLE_DCHECK_NE(&from, this); - const LatticeEdge* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.cloud.speech.v1.LatticeEdge) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:google.cloud.speech.v1.LatticeEdge) - MergeFrom(*source); - } -} - -void LatticeEdge::MergeFrom(const LatticeEdge& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:google.cloud.speech.v1.LatticeEdge) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.symbol().size() > 0) { - _internal_set_symbol(from._internal_symbol()); - } - if (from.start_node() != 0) { - _internal_set_start_node(from._internal_start_node()); - } - if (from.end_node() != 0) { - _internal_set_end_node(from._internal_end_node()); - } - if (!(from.language_cost() <= 0 && from.language_cost() >= 0)) { - _internal_set_language_cost(from._internal_language_cost()); - } - if (!(from.acoustic_cost() <= 0 && from.acoustic_cost() >= 0)) { - _internal_set_acoustic_cost(from._internal_acoustic_cost()); - } - if (from.duration() != 0) { - _internal_set_duration(from._internal_duration()); - } -} - -void LatticeEdge::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:google.cloud.speech.v1.LatticeEdge) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void LatticeEdge::CopyFrom(const LatticeEdge& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:google.cloud.speech.v1.LatticeEdge) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool LatticeEdge::IsInitialized() const { - return true; -} - -void LatticeEdge::InternalSwap(LatticeEdge* other) { - using std::swap; - _internal_metadata_.Swap(&other->_internal_metadata_); - symbol_.Swap(&other->symbol_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(start_node_, other->start_node_); - swap(end_node_, other->end_node_); - swap(language_cost_, other->language_cost_); - swap(acoustic_cost_, other->acoustic_cost_); - swap(duration_, other->duration_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata LatticeEdge::GetMetadata() const { - return GetMetadataStatic(); -} - - -// @@protoc_insertion_point(namespace_scope) -} // namespace v1 -} // namespace speech -} // namespace cloud -} // namespace google -PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_NOINLINE ::google::cloud::speech::v1::RecognizeRequest* Arena::CreateMaybeMessage< ::google::cloud::speech::v1::RecognizeRequest >(Arena* arena) { - return Arena::CreateMessageInternal< ::google::cloud::speech::v1::RecognizeRequest >(arena); -} -template<> PROTOBUF_NOINLINE ::google::cloud::speech::v1::StreamingRecognizeRequest* Arena::CreateMaybeMessage< ::google::cloud::speech::v1::StreamingRecognizeRequest >(Arena* arena) { - return Arena::CreateMessageInternal< ::google::cloud::speech::v1::StreamingRecognizeRequest >(arena); -} -template<> PROTOBUF_NOINLINE ::google::cloud::speech::v1::StreamingRecognitionConfig* Arena::CreateMaybeMessage< ::google::cloud::speech::v1::StreamingRecognitionConfig >(Arena* arena) { - return Arena::CreateMessageInternal< ::google::cloud::speech::v1::StreamingRecognitionConfig >(arena); -} -template<> PROTOBUF_NOINLINE ::google::cloud::speech::v1::RecognitionConfig* Arena::CreateMaybeMessage< ::google::cloud::speech::v1::RecognitionConfig >(Arena* arena) { - return Arena::CreateMessageInternal< ::google::cloud::speech::v1::RecognitionConfig >(arena); -} -template<> PROTOBUF_NOINLINE ::google::cloud::speech::v1::SpeechContext* Arena::CreateMaybeMessage< ::google::cloud::speech::v1::SpeechContext >(Arena* arena) { - return Arena::CreateMessageInternal< ::google::cloud::speech::v1::SpeechContext >(arena); -} -template<> PROTOBUF_NOINLINE ::google::cloud::speech::v1::ConfigField* Arena::CreateMaybeMessage< ::google::cloud::speech::v1::ConfigField >(Arena* arena) { - return Arena::CreateMessageInternal< ::google::cloud::speech::v1::ConfigField >(arena); -} -template<> PROTOBUF_NOINLINE ::google::cloud::speech::v1::RecognitionAudio* Arena::CreateMaybeMessage< ::google::cloud::speech::v1::RecognitionAudio >(Arena* arena) { - return Arena::CreateMessageInternal< ::google::cloud::speech::v1::RecognitionAudio >(arena); -} -template<> PROTOBUF_NOINLINE ::google::cloud::speech::v1::RecognizeResponse* Arena::CreateMaybeMessage< ::google::cloud::speech::v1::RecognizeResponse >(Arena* arena) { - return Arena::CreateMessageInternal< ::google::cloud::speech::v1::RecognizeResponse >(arena); -} -template<> PROTOBUF_NOINLINE ::google::cloud::speech::v1::StreamingRecognizeResponse* Arena::CreateMaybeMessage< ::google::cloud::speech::v1::StreamingRecognizeResponse >(Arena* arena) { - return Arena::CreateMessageInternal< ::google::cloud::speech::v1::StreamingRecognizeResponse >(arena); -} -template<> PROTOBUF_NOINLINE ::google::cloud::speech::v1::StreamingRecognitionResult* Arena::CreateMaybeMessage< ::google::cloud::speech::v1::StreamingRecognitionResult >(Arena* arena) { - return Arena::CreateMessageInternal< ::google::cloud::speech::v1::StreamingRecognitionResult >(arena); -} -template<> PROTOBUF_NOINLINE ::google::cloud::speech::v1::SpeechRecognitionResult* Arena::CreateMaybeMessage< ::google::cloud::speech::v1::SpeechRecognitionResult >(Arena* arena) { - return Arena::CreateMessageInternal< ::google::cloud::speech::v1::SpeechRecognitionResult >(arena); -} -template<> PROTOBUF_NOINLINE ::google::cloud::speech::v1::SpeechRecognitionAlternative* Arena::CreateMaybeMessage< ::google::cloud::speech::v1::SpeechRecognitionAlternative >(Arena* arena) { - return Arena::CreateMessageInternal< ::google::cloud::speech::v1::SpeechRecognitionAlternative >(arena); -} -template<> PROTOBUF_NOINLINE ::google::cloud::speech::v1::WordInfo* Arena::CreateMaybeMessage< ::google::cloud::speech::v1::WordInfo >(Arena* arena) { - return Arena::CreateMessageInternal< ::google::cloud::speech::v1::WordInfo >(arena); -} -template<> PROTOBUF_NOINLINE ::google::cloud::speech::v1::RecognitionLattice* Arena::CreateMaybeMessage< ::google::cloud::speech::v1::RecognitionLattice >(Arena* arena) { - return Arena::CreateMessageInternal< ::google::cloud::speech::v1::RecognitionLattice >(arena); -} -template<> PROTOBUF_NOINLINE ::google::cloud::speech::v1::LatticeEdge* Arena::CreateMaybeMessage< ::google::cloud::speech::v1::LatticeEdge >(Arena* arena) { - return Arena::CreateMessageInternal< ::google::cloud::speech::v1::LatticeEdge >(arena); -} -PROTOBUF_NAMESPACE_CLOSE - -// @@protoc_insertion_point(global_scope) -#include diff --git a/cpp/libdictation-client/dictation_asr.pb.h b/cpp/libdictation-client/dictation_asr.pb.h deleted file mode 100644 index 1988801..0000000 --- a/cpp/libdictation-client/dictation_asr.pb.h +++ /dev/null @@ -1,5811 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: dictation_asr.proto - -#ifndef GOOGLE_PROTOBUF_INCLUDED_dictation_5fasr_2eproto -#define GOOGLE_PROTOBUF_INCLUDED_dictation_5fasr_2eproto - -#include -#include - -#include -#if PROTOBUF_VERSION < 3011000 -#error This file was generated by a newer version of protoc which is -#error incompatible with your Protocol Buffer headers. Please update -#error your headers. -#endif -#if 3011003 < PROTOBUF_MIN_PROTOC_VERSION -#error This file was generated by an older version of protoc which is -#error incompatible with your Protocol Buffer headers. Please -#error regenerate this file with a newer version of protoc. -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // IWYU pragma: export -#include // IWYU pragma: export -#include -#include -#include "google/api/annotations.pb.h" -#include -#include "google/rpc/status.pb.h" -// @@protoc_insertion_point(includes) -#include -#define PROTOBUF_INTERNAL_EXPORT_dictation_5fasr_2eproto -PROTOBUF_NAMESPACE_OPEN -namespace internal { -class AnyMetadata; -} // namespace internal -PROTOBUF_NAMESPACE_CLOSE - -// Internal implementation detail -- do not use these members. -struct TableStruct_dictation_5fasr_2eproto { - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[15] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; - static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; - static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]; -}; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_dictation_5fasr_2eproto; -namespace google { -namespace cloud { -namespace speech { -namespace v1 { -class ConfigField; -class ConfigFieldDefaultTypeInternal; -extern ConfigFieldDefaultTypeInternal _ConfigField_default_instance_; -class LatticeEdge; -class LatticeEdgeDefaultTypeInternal; -extern LatticeEdgeDefaultTypeInternal _LatticeEdge_default_instance_; -class RecognitionAudio; -class RecognitionAudioDefaultTypeInternal; -extern RecognitionAudioDefaultTypeInternal _RecognitionAudio_default_instance_; -class RecognitionConfig; -class RecognitionConfigDefaultTypeInternal; -extern RecognitionConfigDefaultTypeInternal _RecognitionConfig_default_instance_; -class RecognitionLattice; -class RecognitionLatticeDefaultTypeInternal; -extern RecognitionLatticeDefaultTypeInternal _RecognitionLattice_default_instance_; -class RecognizeRequest; -class RecognizeRequestDefaultTypeInternal; -extern RecognizeRequestDefaultTypeInternal _RecognizeRequest_default_instance_; -class RecognizeResponse; -class RecognizeResponseDefaultTypeInternal; -extern RecognizeResponseDefaultTypeInternal _RecognizeResponse_default_instance_; -class SpeechContext; -class SpeechContextDefaultTypeInternal; -extern SpeechContextDefaultTypeInternal _SpeechContext_default_instance_; -class SpeechRecognitionAlternative; -class SpeechRecognitionAlternativeDefaultTypeInternal; -extern SpeechRecognitionAlternativeDefaultTypeInternal _SpeechRecognitionAlternative_default_instance_; -class SpeechRecognitionResult; -class SpeechRecognitionResultDefaultTypeInternal; -extern SpeechRecognitionResultDefaultTypeInternal _SpeechRecognitionResult_default_instance_; -class StreamingRecognitionConfig; -class StreamingRecognitionConfigDefaultTypeInternal; -extern StreamingRecognitionConfigDefaultTypeInternal _StreamingRecognitionConfig_default_instance_; -class StreamingRecognitionResult; -class StreamingRecognitionResultDefaultTypeInternal; -extern StreamingRecognitionResultDefaultTypeInternal _StreamingRecognitionResult_default_instance_; -class StreamingRecognizeRequest; -class StreamingRecognizeRequestDefaultTypeInternal; -extern StreamingRecognizeRequestDefaultTypeInternal _StreamingRecognizeRequest_default_instance_; -class StreamingRecognizeResponse; -class StreamingRecognizeResponseDefaultTypeInternal; -extern StreamingRecognizeResponseDefaultTypeInternal _StreamingRecognizeResponse_default_instance_; -class WordInfo; -class WordInfoDefaultTypeInternal; -extern WordInfoDefaultTypeInternal _WordInfo_default_instance_; -} // namespace v1 -} // namespace speech -} // namespace cloud -} // namespace google -PROTOBUF_NAMESPACE_OPEN -template<> ::google::cloud::speech::v1::ConfigField* Arena::CreateMaybeMessage<::google::cloud::speech::v1::ConfigField>(Arena*); -template<> ::google::cloud::speech::v1::LatticeEdge* Arena::CreateMaybeMessage<::google::cloud::speech::v1::LatticeEdge>(Arena*); -template<> ::google::cloud::speech::v1::RecognitionAudio* Arena::CreateMaybeMessage<::google::cloud::speech::v1::RecognitionAudio>(Arena*); -template<> ::google::cloud::speech::v1::RecognitionConfig* Arena::CreateMaybeMessage<::google::cloud::speech::v1::RecognitionConfig>(Arena*); -template<> ::google::cloud::speech::v1::RecognitionLattice* Arena::CreateMaybeMessage<::google::cloud::speech::v1::RecognitionLattice>(Arena*); -template<> ::google::cloud::speech::v1::RecognizeRequest* Arena::CreateMaybeMessage<::google::cloud::speech::v1::RecognizeRequest>(Arena*); -template<> ::google::cloud::speech::v1::RecognizeResponse* Arena::CreateMaybeMessage<::google::cloud::speech::v1::RecognizeResponse>(Arena*); -template<> ::google::cloud::speech::v1::SpeechContext* Arena::CreateMaybeMessage<::google::cloud::speech::v1::SpeechContext>(Arena*); -template<> ::google::cloud::speech::v1::SpeechRecognitionAlternative* Arena::CreateMaybeMessage<::google::cloud::speech::v1::SpeechRecognitionAlternative>(Arena*); -template<> ::google::cloud::speech::v1::SpeechRecognitionResult* Arena::CreateMaybeMessage<::google::cloud::speech::v1::SpeechRecognitionResult>(Arena*); -template<> ::google::cloud::speech::v1::StreamingRecognitionConfig* Arena::CreateMaybeMessage<::google::cloud::speech::v1::StreamingRecognitionConfig>(Arena*); -template<> ::google::cloud::speech::v1::StreamingRecognitionResult* Arena::CreateMaybeMessage<::google::cloud::speech::v1::StreamingRecognitionResult>(Arena*); -template<> ::google::cloud::speech::v1::StreamingRecognizeRequest* Arena::CreateMaybeMessage<::google::cloud::speech::v1::StreamingRecognizeRequest>(Arena*); -template<> ::google::cloud::speech::v1::StreamingRecognizeResponse* Arena::CreateMaybeMessage<::google::cloud::speech::v1::StreamingRecognizeResponse>(Arena*); -template<> ::google::cloud::speech::v1::WordInfo* Arena::CreateMaybeMessage<::google::cloud::speech::v1::WordInfo>(Arena*); -PROTOBUF_NAMESPACE_CLOSE -namespace google { -namespace cloud { -namespace speech { -namespace v1 { - -enum RecognitionConfig_AudioEncoding : int { - RecognitionConfig_AudioEncoding_ENCODING_UNSPECIFIED = 0, - RecognitionConfig_AudioEncoding_LINEAR16 = 1, - RecognitionConfig_AudioEncoding_FLAC = 2, - RecognitionConfig_AudioEncoding_MULAW = 3, - RecognitionConfig_AudioEncoding_AMR = 4, - RecognitionConfig_AudioEncoding_AMR_WB = 5, - RecognitionConfig_AudioEncoding_OGG_OPUS = 6, - RecognitionConfig_AudioEncoding_SPEEX_WITH_HEADER_BYTE = 7, - RecognitionConfig_AudioEncoding_MP3 = 8, - RecognitionConfig_AudioEncoding_RecognitionConfig_AudioEncoding_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - RecognitionConfig_AudioEncoding_RecognitionConfig_AudioEncoding_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() -}; -bool RecognitionConfig_AudioEncoding_IsValid(int value); -constexpr RecognitionConfig_AudioEncoding RecognitionConfig_AudioEncoding_AudioEncoding_MIN = RecognitionConfig_AudioEncoding_ENCODING_UNSPECIFIED; -constexpr RecognitionConfig_AudioEncoding RecognitionConfig_AudioEncoding_AudioEncoding_MAX = RecognitionConfig_AudioEncoding_MP3; -constexpr int RecognitionConfig_AudioEncoding_AudioEncoding_ARRAYSIZE = RecognitionConfig_AudioEncoding_AudioEncoding_MAX + 1; - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* RecognitionConfig_AudioEncoding_descriptor(); -template -inline const std::string& RecognitionConfig_AudioEncoding_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function RecognitionConfig_AudioEncoding_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - RecognitionConfig_AudioEncoding_descriptor(), enum_t_value); -} -inline bool RecognitionConfig_AudioEncoding_Parse( - const std::string& name, RecognitionConfig_AudioEncoding* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - RecognitionConfig_AudioEncoding_descriptor(), name, value); -} -enum StreamingRecognizeResponse_SpeechEventType : int { - StreamingRecognizeResponse_SpeechEventType_SPEECH_EVENT_UNSPECIFIED = 0, - StreamingRecognizeResponse_SpeechEventType_END_OF_SINGLE_UTTERANCE = 1, - StreamingRecognizeResponse_SpeechEventType_StreamingRecognizeResponse_SpeechEventType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - StreamingRecognizeResponse_SpeechEventType_StreamingRecognizeResponse_SpeechEventType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() -}; -bool StreamingRecognizeResponse_SpeechEventType_IsValid(int value); -constexpr StreamingRecognizeResponse_SpeechEventType StreamingRecognizeResponse_SpeechEventType_SpeechEventType_MIN = StreamingRecognizeResponse_SpeechEventType_SPEECH_EVENT_UNSPECIFIED; -constexpr StreamingRecognizeResponse_SpeechEventType StreamingRecognizeResponse_SpeechEventType_SpeechEventType_MAX = StreamingRecognizeResponse_SpeechEventType_END_OF_SINGLE_UTTERANCE; -constexpr int StreamingRecognizeResponse_SpeechEventType_SpeechEventType_ARRAYSIZE = StreamingRecognizeResponse_SpeechEventType_SpeechEventType_MAX + 1; - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* StreamingRecognizeResponse_SpeechEventType_descriptor(); -template -inline const std::string& StreamingRecognizeResponse_SpeechEventType_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function StreamingRecognizeResponse_SpeechEventType_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - StreamingRecognizeResponse_SpeechEventType_descriptor(), enum_t_value); -} -inline bool StreamingRecognizeResponse_SpeechEventType_Parse( - const std::string& name, StreamingRecognizeResponse_SpeechEventType* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - StreamingRecognizeResponse_SpeechEventType_descriptor(), name, value); -} -enum StreamingRecognitionResult_ResultFinalizationCause : int { - StreamingRecognitionResult_ResultFinalizationCause_RESULT_FINALIZATION_CAUSE_UNSPECIFIED = 0, - StreamingRecognitionResult_ResultFinalizationCause_SUCCESS = 1, - StreamingRecognitionResult_ResultFinalizationCause_NO_INPUT_TIMEOUT = 2, - StreamingRecognitionResult_ResultFinalizationCause_SUCCESS_MAXTIME = 3, - StreamingRecognitionResult_ResultFinalizationCause_PARTIAL_MATCH = 4, - StreamingRecognitionResult_ResultFinalizationCause_NO_MATCH_MAXTIME = 5, - StreamingRecognitionResult_ResultFinalizationCause_StreamingRecognitionResult_ResultFinalizationCause_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - StreamingRecognitionResult_ResultFinalizationCause_StreamingRecognitionResult_ResultFinalizationCause_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() -}; -bool StreamingRecognitionResult_ResultFinalizationCause_IsValid(int value); -constexpr StreamingRecognitionResult_ResultFinalizationCause StreamingRecognitionResult_ResultFinalizationCause_ResultFinalizationCause_MIN = StreamingRecognitionResult_ResultFinalizationCause_RESULT_FINALIZATION_CAUSE_UNSPECIFIED; -constexpr StreamingRecognitionResult_ResultFinalizationCause StreamingRecognitionResult_ResultFinalizationCause_ResultFinalizationCause_MAX = StreamingRecognitionResult_ResultFinalizationCause_NO_MATCH_MAXTIME; -constexpr int StreamingRecognitionResult_ResultFinalizationCause_ResultFinalizationCause_ARRAYSIZE = StreamingRecognitionResult_ResultFinalizationCause_ResultFinalizationCause_MAX + 1; - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* StreamingRecognitionResult_ResultFinalizationCause_descriptor(); -template -inline const std::string& StreamingRecognitionResult_ResultFinalizationCause_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function StreamingRecognitionResult_ResultFinalizationCause_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - StreamingRecognitionResult_ResultFinalizationCause_descriptor(), enum_t_value); -} -inline bool StreamingRecognitionResult_ResultFinalizationCause_Parse( - const std::string& name, StreamingRecognitionResult_ResultFinalizationCause* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - StreamingRecognitionResult_ResultFinalizationCause_descriptor(), name, value); -} -// =================================================================== - -class RecognizeRequest : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.cloud.speech.v1.RecognizeRequest) */ { - public: - RecognizeRequest(); - virtual ~RecognizeRequest(); - - RecognizeRequest(const RecognizeRequest& from); - RecognizeRequest(RecognizeRequest&& from) noexcept - : RecognizeRequest() { - *this = ::std::move(from); - } - - inline RecognizeRequest& operator=(const RecognizeRequest& from) { - CopyFrom(from); - return *this; - } - inline RecognizeRequest& operator=(RecognizeRequest&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArena() const final { - return GetArenaNoVirtual(); - } - inline void* GetMaybeArenaPointer() const final { - return MaybeArenaPtr(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const RecognizeRequest& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const RecognizeRequest* internal_default_instance() { - return reinterpret_cast( - &_RecognizeRequest_default_instance_); - } - static constexpr int kIndexInFileMessages = - 0; - - friend void swap(RecognizeRequest& a, RecognizeRequest& b) { - a.Swap(&b); - } - inline void Swap(RecognizeRequest* other) { - if (other == this) return; - if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RecognizeRequest* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline RecognizeRequest* New() const final { - return CreateMaybeMessage(nullptr); - } - - RecognizeRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const RecognizeRequest& from); - void MergeFrom(const RecognizeRequest& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(RecognizeRequest* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "google.cloud.speech.v1.RecognizeRequest"; - } - protected: - explicit RecognizeRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return _internal_metadata_.arena(); - } - inline void* MaybeArenaPtr() const { - return _internal_metadata_.raw_arena_ptr(); - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_dictation_5fasr_2eproto); - return ::descriptor_table_dictation_5fasr_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kConfigFieldNumber = 1, - kAudioFieldNumber = 2, - }; - // .google.cloud.speech.v1.RecognitionConfig config = 1; - bool has_config() const; - private: - bool _internal_has_config() const; - public: - void clear_config(); - const ::google::cloud::speech::v1::RecognitionConfig& config() const; - ::google::cloud::speech::v1::RecognitionConfig* release_config(); - ::google::cloud::speech::v1::RecognitionConfig* mutable_config(); - void set_allocated_config(::google::cloud::speech::v1::RecognitionConfig* config); - private: - const ::google::cloud::speech::v1::RecognitionConfig& _internal_config() const; - ::google::cloud::speech::v1::RecognitionConfig* _internal_mutable_config(); - public: - void unsafe_arena_set_allocated_config( - ::google::cloud::speech::v1::RecognitionConfig* config); - ::google::cloud::speech::v1::RecognitionConfig* unsafe_arena_release_config(); - - // .google.cloud.speech.v1.RecognitionAudio audio = 2; - bool has_audio() const; - private: - bool _internal_has_audio() const; - public: - void clear_audio(); - const ::google::cloud::speech::v1::RecognitionAudio& audio() const; - ::google::cloud::speech::v1::RecognitionAudio* release_audio(); - ::google::cloud::speech::v1::RecognitionAudio* mutable_audio(); - void set_allocated_audio(::google::cloud::speech::v1::RecognitionAudio* audio); - private: - const ::google::cloud::speech::v1::RecognitionAudio& _internal_audio() const; - ::google::cloud::speech::v1::RecognitionAudio* _internal_mutable_audio(); - public: - void unsafe_arena_set_allocated_audio( - ::google::cloud::speech::v1::RecognitionAudio* audio); - ::google::cloud::speech::v1::RecognitionAudio* unsafe_arena_release_audio(); - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.RecognizeRequest) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::google::cloud::speech::v1::RecognitionConfig* config_; - ::google::cloud::speech::v1::RecognitionAudio* audio_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_dictation_5fasr_2eproto; -}; -// ------------------------------------------------------------------- - -class StreamingRecognizeRequest : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.cloud.speech.v1.StreamingRecognizeRequest) */ { - public: - StreamingRecognizeRequest(); - virtual ~StreamingRecognizeRequest(); - - StreamingRecognizeRequest(const StreamingRecognizeRequest& from); - StreamingRecognizeRequest(StreamingRecognizeRequest&& from) noexcept - : StreamingRecognizeRequest() { - *this = ::std::move(from); - } - - inline StreamingRecognizeRequest& operator=(const StreamingRecognizeRequest& from) { - CopyFrom(from); - return *this; - } - inline StreamingRecognizeRequest& operator=(StreamingRecognizeRequest&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArena() const final { - return GetArenaNoVirtual(); - } - inline void* GetMaybeArenaPointer() const final { - return MaybeArenaPtr(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const StreamingRecognizeRequest& default_instance(); - - enum StreamingRequestCase { - kStreamingConfig = 1, - kAudioContent = 2, - STREAMING_REQUEST_NOT_SET = 0, - }; - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const StreamingRecognizeRequest* internal_default_instance() { - return reinterpret_cast( - &_StreamingRecognizeRequest_default_instance_); - } - static constexpr int kIndexInFileMessages = - 1; - - friend void swap(StreamingRecognizeRequest& a, StreamingRecognizeRequest& b) { - a.Swap(&b); - } - inline void Swap(StreamingRecognizeRequest* other) { - if (other == this) return; - if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(StreamingRecognizeRequest* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline StreamingRecognizeRequest* New() const final { - return CreateMaybeMessage(nullptr); - } - - StreamingRecognizeRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const StreamingRecognizeRequest& from); - void MergeFrom(const StreamingRecognizeRequest& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(StreamingRecognizeRequest* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "google.cloud.speech.v1.StreamingRecognizeRequest"; - } - protected: - explicit StreamingRecognizeRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return _internal_metadata_.arena(); - } - inline void* MaybeArenaPtr() const { - return _internal_metadata_.raw_arena_ptr(); - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_dictation_5fasr_2eproto); - return ::descriptor_table_dictation_5fasr_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kStreamingConfigFieldNumber = 1, - kAudioContentFieldNumber = 2, - }; - // .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - bool has_streaming_config() const; - private: - bool _internal_has_streaming_config() const; - public: - void clear_streaming_config(); - const ::google::cloud::speech::v1::StreamingRecognitionConfig& streaming_config() const; - ::google::cloud::speech::v1::StreamingRecognitionConfig* release_streaming_config(); - ::google::cloud::speech::v1::StreamingRecognitionConfig* mutable_streaming_config(); - void set_allocated_streaming_config(::google::cloud::speech::v1::StreamingRecognitionConfig* streaming_config); - private: - const ::google::cloud::speech::v1::StreamingRecognitionConfig& _internal_streaming_config() const; - ::google::cloud::speech::v1::StreamingRecognitionConfig* _internal_mutable_streaming_config(); - public: - void unsafe_arena_set_allocated_streaming_config( - ::google::cloud::speech::v1::StreamingRecognitionConfig* streaming_config); - ::google::cloud::speech::v1::StreamingRecognitionConfig* unsafe_arena_release_streaming_config(); - - // bytes audio_content = 2; - private: - bool _internal_has_audio_content() const; - public: - void clear_audio_content(); - const std::string& audio_content() const; - void set_audio_content(const std::string& value); - void set_audio_content(std::string&& value); - void set_audio_content(const char* value); - void set_audio_content(const void* value, size_t size); - std::string* mutable_audio_content(); - std::string* release_audio_content(); - void set_allocated_audio_content(std::string* audio_content); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - std::string* unsafe_arena_release_audio_content(); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - void unsafe_arena_set_allocated_audio_content( - std::string* audio_content); - private: - const std::string& _internal_audio_content() const; - void _internal_set_audio_content(const std::string& value); - std::string* _internal_mutable_audio_content(); - public: - - void clear_streaming_request(); - StreamingRequestCase streaming_request_case() const; - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.StreamingRecognizeRequest) - private: - class _Internal; - void set_has_streaming_config(); - void set_has_audio_content(); - - inline bool has_streaming_request() const; - inline void clear_has_streaming_request(); - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - union StreamingRequestUnion { - StreamingRequestUnion() {} - ::google::cloud::speech::v1::StreamingRecognitionConfig* streaming_config_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr audio_content_; - } streaming_request_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::uint32 _oneof_case_[1]; - - friend struct ::TableStruct_dictation_5fasr_2eproto; -}; -// ------------------------------------------------------------------- - -class StreamingRecognitionConfig : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.cloud.speech.v1.StreamingRecognitionConfig) */ { - public: - StreamingRecognitionConfig(); - virtual ~StreamingRecognitionConfig(); - - StreamingRecognitionConfig(const StreamingRecognitionConfig& from); - StreamingRecognitionConfig(StreamingRecognitionConfig&& from) noexcept - : StreamingRecognitionConfig() { - *this = ::std::move(from); - } - - inline StreamingRecognitionConfig& operator=(const StreamingRecognitionConfig& from) { - CopyFrom(from); - return *this; - } - inline StreamingRecognitionConfig& operator=(StreamingRecognitionConfig&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArena() const final { - return GetArenaNoVirtual(); - } - inline void* GetMaybeArenaPointer() const final { - return MaybeArenaPtr(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const StreamingRecognitionConfig& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const StreamingRecognitionConfig* internal_default_instance() { - return reinterpret_cast( - &_StreamingRecognitionConfig_default_instance_); - } - static constexpr int kIndexInFileMessages = - 2; - - friend void swap(StreamingRecognitionConfig& a, StreamingRecognitionConfig& b) { - a.Swap(&b); - } - inline void Swap(StreamingRecognitionConfig* other) { - if (other == this) return; - if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(StreamingRecognitionConfig* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline StreamingRecognitionConfig* New() const final { - return CreateMaybeMessage(nullptr); - } - - StreamingRecognitionConfig* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const StreamingRecognitionConfig& from); - void MergeFrom(const StreamingRecognitionConfig& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(StreamingRecognitionConfig* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "google.cloud.speech.v1.StreamingRecognitionConfig"; - } - protected: - explicit StreamingRecognitionConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return _internal_metadata_.arena(); - } - inline void* MaybeArenaPtr() const { - return _internal_metadata_.raw_arena_ptr(); - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_dictation_5fasr_2eproto); - return ::descriptor_table_dictation_5fasr_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kConfigFieldNumber = 1, - kSingleUtteranceFieldNumber = 2, - kInterimResultsFieldNumber = 3, - }; - // .google.cloud.speech.v1.RecognitionConfig config = 1; - bool has_config() const; - private: - bool _internal_has_config() const; - public: - void clear_config(); - const ::google::cloud::speech::v1::RecognitionConfig& config() const; - ::google::cloud::speech::v1::RecognitionConfig* release_config(); - ::google::cloud::speech::v1::RecognitionConfig* mutable_config(); - void set_allocated_config(::google::cloud::speech::v1::RecognitionConfig* config); - private: - const ::google::cloud::speech::v1::RecognitionConfig& _internal_config() const; - ::google::cloud::speech::v1::RecognitionConfig* _internal_mutable_config(); - public: - void unsafe_arena_set_allocated_config( - ::google::cloud::speech::v1::RecognitionConfig* config); - ::google::cloud::speech::v1::RecognitionConfig* unsafe_arena_release_config(); - - // bool single_utterance = 2; - void clear_single_utterance(); - bool single_utterance() const; - void set_single_utterance(bool value); - private: - bool _internal_single_utterance() const; - void _internal_set_single_utterance(bool value); - public: - - // bool interim_results = 3; - void clear_interim_results(); - bool interim_results() const; - void set_interim_results(bool value); - private: - bool _internal_interim_results() const; - void _internal_set_interim_results(bool value); - public: - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.StreamingRecognitionConfig) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::google::cloud::speech::v1::RecognitionConfig* config_; - bool single_utterance_; - bool interim_results_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_dictation_5fasr_2eproto; -}; -// ------------------------------------------------------------------- - -class RecognitionConfig : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.cloud.speech.v1.RecognitionConfig) */ { - public: - RecognitionConfig(); - virtual ~RecognitionConfig(); - - RecognitionConfig(const RecognitionConfig& from); - RecognitionConfig(RecognitionConfig&& from) noexcept - : RecognitionConfig() { - *this = ::std::move(from); - } - - inline RecognitionConfig& operator=(const RecognitionConfig& from) { - CopyFrom(from); - return *this; - } - inline RecognitionConfig& operator=(RecognitionConfig&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArena() const final { - return GetArenaNoVirtual(); - } - inline void* GetMaybeArenaPointer() const final { - return MaybeArenaPtr(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const RecognitionConfig& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const RecognitionConfig* internal_default_instance() { - return reinterpret_cast( - &_RecognitionConfig_default_instance_); - } - static constexpr int kIndexInFileMessages = - 3; - - friend void swap(RecognitionConfig& a, RecognitionConfig& b) { - a.Swap(&b); - } - inline void Swap(RecognitionConfig* other) { - if (other == this) return; - if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RecognitionConfig* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline RecognitionConfig* New() const final { - return CreateMaybeMessage(nullptr); - } - - RecognitionConfig* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const RecognitionConfig& from); - void MergeFrom(const RecognitionConfig& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(RecognitionConfig* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "google.cloud.speech.v1.RecognitionConfig"; - } - protected: - explicit RecognitionConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return _internal_metadata_.arena(); - } - inline void* MaybeArenaPtr() const { - return _internal_metadata_.raw_arena_ptr(); - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_dictation_5fasr_2eproto); - return ::descriptor_table_dictation_5fasr_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - typedef RecognitionConfig_AudioEncoding AudioEncoding; - static constexpr AudioEncoding ENCODING_UNSPECIFIED = - RecognitionConfig_AudioEncoding_ENCODING_UNSPECIFIED; - static constexpr AudioEncoding LINEAR16 = - RecognitionConfig_AudioEncoding_LINEAR16; - static constexpr AudioEncoding FLAC = - RecognitionConfig_AudioEncoding_FLAC; - static constexpr AudioEncoding MULAW = - RecognitionConfig_AudioEncoding_MULAW; - static constexpr AudioEncoding AMR = - RecognitionConfig_AudioEncoding_AMR; - static constexpr AudioEncoding AMR_WB = - RecognitionConfig_AudioEncoding_AMR_WB; - static constexpr AudioEncoding OGG_OPUS = - RecognitionConfig_AudioEncoding_OGG_OPUS; - static constexpr AudioEncoding SPEEX_WITH_HEADER_BYTE = - RecognitionConfig_AudioEncoding_SPEEX_WITH_HEADER_BYTE; - static constexpr AudioEncoding MP3 = - RecognitionConfig_AudioEncoding_MP3; - static inline bool AudioEncoding_IsValid(int value) { - return RecognitionConfig_AudioEncoding_IsValid(value); - } - static constexpr AudioEncoding AudioEncoding_MIN = - RecognitionConfig_AudioEncoding_AudioEncoding_MIN; - static constexpr AudioEncoding AudioEncoding_MAX = - RecognitionConfig_AudioEncoding_AudioEncoding_MAX; - static constexpr int AudioEncoding_ARRAYSIZE = - RecognitionConfig_AudioEncoding_AudioEncoding_ARRAYSIZE; - static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* - AudioEncoding_descriptor() { - return RecognitionConfig_AudioEncoding_descriptor(); - } - template - static inline const std::string& AudioEncoding_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function AudioEncoding_Name."); - return RecognitionConfig_AudioEncoding_Name(enum_t_value); - } - static inline bool AudioEncoding_Parse(const std::string& name, - AudioEncoding* value) { - return RecognitionConfig_AudioEncoding_Parse(name, value); - } - - // accessors ------------------------------------------------------- - - enum : int { - kSpeechContextsFieldNumber = 6, - kConfigFieldsFieldNumber = 12, - kLanguageCodeFieldNumber = 3, - kModelFieldNumber = 13, - kEncodingFieldNumber = 1, - kSampleRateHertzFieldNumber = 2, - kMaxAlternativesFieldNumber = 4, - kProfanityFilterFieldNumber = 5, - kEnableWordTimeOffsetsFieldNumber = 8, - kEnableAutomaticPunctuationFieldNumber = 11, - kUseEnhancedFieldNumber = 14, - }; - // repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - int speech_contexts_size() const; - private: - int _internal_speech_contexts_size() const; - public: - void clear_speech_contexts(); - ::google::cloud::speech::v1::SpeechContext* mutable_speech_contexts(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::SpeechContext >* - mutable_speech_contexts(); - private: - const ::google::cloud::speech::v1::SpeechContext& _internal_speech_contexts(int index) const; - ::google::cloud::speech::v1::SpeechContext* _internal_add_speech_contexts(); - public: - const ::google::cloud::speech::v1::SpeechContext& speech_contexts(int index) const; - ::google::cloud::speech::v1::SpeechContext* add_speech_contexts(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::SpeechContext >& - speech_contexts() const; - - // repeated .google.cloud.speech.v1.ConfigField config_fields = 12; - int config_fields_size() const; - private: - int _internal_config_fields_size() const; - public: - void clear_config_fields(); - ::google::cloud::speech::v1::ConfigField* mutable_config_fields(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::ConfigField >* - mutable_config_fields(); - private: - const ::google::cloud::speech::v1::ConfigField& _internal_config_fields(int index) const; - ::google::cloud::speech::v1::ConfigField* _internal_add_config_fields(); - public: - const ::google::cloud::speech::v1::ConfigField& config_fields(int index) const; - ::google::cloud::speech::v1::ConfigField* add_config_fields(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::ConfigField >& - config_fields() const; - - // string language_code = 3; - void clear_language_code(); - const std::string& language_code() const; - void set_language_code(const std::string& value); - void set_language_code(std::string&& value); - void set_language_code(const char* value); - void set_language_code(const char* value, size_t size); - std::string* mutable_language_code(); - std::string* release_language_code(); - void set_allocated_language_code(std::string* language_code); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - std::string* unsafe_arena_release_language_code(); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - void unsafe_arena_set_allocated_language_code( - std::string* language_code); - private: - const std::string& _internal_language_code() const; - void _internal_set_language_code(const std::string& value); - std::string* _internal_mutable_language_code(); - public: - - // string model = 13; - void clear_model(); - const std::string& model() const; - void set_model(const std::string& value); - void set_model(std::string&& value); - void set_model(const char* value); - void set_model(const char* value, size_t size); - std::string* mutable_model(); - std::string* release_model(); - void set_allocated_model(std::string* model); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - std::string* unsafe_arena_release_model(); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - void unsafe_arena_set_allocated_model( - std::string* model); - private: - const std::string& _internal_model() const; - void _internal_set_model(const std::string& value); - std::string* _internal_mutable_model(); - public: - - // .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; - void clear_encoding(); - ::google::cloud::speech::v1::RecognitionConfig_AudioEncoding encoding() const; - void set_encoding(::google::cloud::speech::v1::RecognitionConfig_AudioEncoding value); - private: - ::google::cloud::speech::v1::RecognitionConfig_AudioEncoding _internal_encoding() const; - void _internal_set_encoding(::google::cloud::speech::v1::RecognitionConfig_AudioEncoding value); - public: - - // int32 sample_rate_hertz = 2; - void clear_sample_rate_hertz(); - ::PROTOBUF_NAMESPACE_ID::int32 sample_rate_hertz() const; - void set_sample_rate_hertz(::PROTOBUF_NAMESPACE_ID::int32 value); - private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_sample_rate_hertz() const; - void _internal_set_sample_rate_hertz(::PROTOBUF_NAMESPACE_ID::int32 value); - public: - - // int32 max_alternatives = 4; - void clear_max_alternatives(); - ::PROTOBUF_NAMESPACE_ID::int32 max_alternatives() const; - void set_max_alternatives(::PROTOBUF_NAMESPACE_ID::int32 value); - private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_max_alternatives() const; - void _internal_set_max_alternatives(::PROTOBUF_NAMESPACE_ID::int32 value); - public: - - // bool profanity_filter = 5; - void clear_profanity_filter(); - bool profanity_filter() const; - void set_profanity_filter(bool value); - private: - bool _internal_profanity_filter() const; - void _internal_set_profanity_filter(bool value); - public: - - // bool enable_word_time_offsets = 8; - void clear_enable_word_time_offsets(); - bool enable_word_time_offsets() const; - void set_enable_word_time_offsets(bool value); - private: - bool _internal_enable_word_time_offsets() const; - void _internal_set_enable_word_time_offsets(bool value); - public: - - // bool enable_automatic_punctuation = 11; - void clear_enable_automatic_punctuation(); - bool enable_automatic_punctuation() const; - void set_enable_automatic_punctuation(bool value); - private: - bool _internal_enable_automatic_punctuation() const; - void _internal_set_enable_automatic_punctuation(bool value); - public: - - // bool use_enhanced = 14; - void clear_use_enhanced(); - bool use_enhanced() const; - void set_use_enhanced(bool value); - private: - bool _internal_use_enhanced() const; - void _internal_set_use_enhanced(bool value); - public: - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.RecognitionConfig) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::SpeechContext > speech_contexts_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::ConfigField > config_fields_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr language_code_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr model_; - int encoding_; - ::PROTOBUF_NAMESPACE_ID::int32 sample_rate_hertz_; - ::PROTOBUF_NAMESPACE_ID::int32 max_alternatives_; - bool profanity_filter_; - bool enable_word_time_offsets_; - bool enable_automatic_punctuation_; - bool use_enhanced_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_dictation_5fasr_2eproto; -}; -// ------------------------------------------------------------------- - -class SpeechContext : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.cloud.speech.v1.SpeechContext) */ { - public: - SpeechContext(); - virtual ~SpeechContext(); - - SpeechContext(const SpeechContext& from); - SpeechContext(SpeechContext&& from) noexcept - : SpeechContext() { - *this = ::std::move(from); - } - - inline SpeechContext& operator=(const SpeechContext& from) { - CopyFrom(from); - return *this; - } - inline SpeechContext& operator=(SpeechContext&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArena() const final { - return GetArenaNoVirtual(); - } - inline void* GetMaybeArenaPointer() const final { - return MaybeArenaPtr(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const SpeechContext& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const SpeechContext* internal_default_instance() { - return reinterpret_cast( - &_SpeechContext_default_instance_); - } - static constexpr int kIndexInFileMessages = - 4; - - friend void swap(SpeechContext& a, SpeechContext& b) { - a.Swap(&b); - } - inline void Swap(SpeechContext* other) { - if (other == this) return; - if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(SpeechContext* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline SpeechContext* New() const final { - return CreateMaybeMessage(nullptr); - } - - SpeechContext* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const SpeechContext& from); - void MergeFrom(const SpeechContext& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(SpeechContext* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "google.cloud.speech.v1.SpeechContext"; - } - protected: - explicit SpeechContext(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return _internal_metadata_.arena(); - } - inline void* MaybeArenaPtr() const { - return _internal_metadata_.raw_arena_ptr(); - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_dictation_5fasr_2eproto); - return ::descriptor_table_dictation_5fasr_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kPhrasesFieldNumber = 1, - }; - // repeated string phrases = 1; - int phrases_size() const; - private: - int _internal_phrases_size() const; - public: - void clear_phrases(); - const std::string& phrases(int index) const; - std::string* mutable_phrases(int index); - void set_phrases(int index, const std::string& value); - void set_phrases(int index, std::string&& value); - void set_phrases(int index, const char* value); - void set_phrases(int index, const char* value, size_t size); - std::string* add_phrases(); - void add_phrases(const std::string& value); - void add_phrases(std::string&& value); - void add_phrases(const char* value); - void add_phrases(const char* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& phrases() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_phrases(); - private: - const std::string& _internal_phrases(int index) const; - std::string* _internal_add_phrases(); - public: - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.SpeechContext) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField phrases_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_dictation_5fasr_2eproto; -}; -// ------------------------------------------------------------------- - -class ConfigField : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.cloud.speech.v1.ConfigField) */ { - public: - ConfigField(); - virtual ~ConfigField(); - - ConfigField(const ConfigField& from); - ConfigField(ConfigField&& from) noexcept - : ConfigField() { - *this = ::std::move(from); - } - - inline ConfigField& operator=(const ConfigField& from) { - CopyFrom(from); - return *this; - } - inline ConfigField& operator=(ConfigField&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArena() const final { - return GetArenaNoVirtual(); - } - inline void* GetMaybeArenaPointer() const final { - return MaybeArenaPtr(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const ConfigField& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const ConfigField* internal_default_instance() { - return reinterpret_cast( - &_ConfigField_default_instance_); - } - static constexpr int kIndexInFileMessages = - 5; - - friend void swap(ConfigField& a, ConfigField& b) { - a.Swap(&b); - } - inline void Swap(ConfigField* other) { - if (other == this) return; - if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(ConfigField* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline ConfigField* New() const final { - return CreateMaybeMessage(nullptr); - } - - ConfigField* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const ConfigField& from); - void MergeFrom(const ConfigField& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(ConfigField* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "google.cloud.speech.v1.ConfigField"; - } - protected: - explicit ConfigField(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return _internal_metadata_.arena(); - } - inline void* MaybeArenaPtr() const { - return _internal_metadata_.raw_arena_ptr(); - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_dictation_5fasr_2eproto); - return ::descriptor_table_dictation_5fasr_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kKeyFieldNumber = 1, - kValueFieldNumber = 2, - }; - // string key = 1; - void clear_key(); - const std::string& key() const; - void set_key(const std::string& value); - void set_key(std::string&& value); - void set_key(const char* value); - void set_key(const char* value, size_t size); - std::string* mutable_key(); - std::string* release_key(); - void set_allocated_key(std::string* key); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - std::string* unsafe_arena_release_key(); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - void unsafe_arena_set_allocated_key( - std::string* key); - private: - const std::string& _internal_key() const; - void _internal_set_key(const std::string& value); - std::string* _internal_mutable_key(); - public: - - // string value = 2; - void clear_value(); - const std::string& value() const; - void set_value(const std::string& value); - void set_value(std::string&& value); - void set_value(const char* value); - void set_value(const char* value, size_t size); - std::string* mutable_value(); - std::string* release_value(); - void set_allocated_value(std::string* value); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - std::string* unsafe_arena_release_value(); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - void unsafe_arena_set_allocated_value( - std::string* value); - private: - const std::string& _internal_value() const; - void _internal_set_value(const std::string& value); - std::string* _internal_mutable_value(); - public: - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.ConfigField) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr key_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr value_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_dictation_5fasr_2eproto; -}; -// ------------------------------------------------------------------- - -class RecognitionAudio : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.cloud.speech.v1.RecognitionAudio) */ { - public: - RecognitionAudio(); - virtual ~RecognitionAudio(); - - RecognitionAudio(const RecognitionAudio& from); - RecognitionAudio(RecognitionAudio&& from) noexcept - : RecognitionAudio() { - *this = ::std::move(from); - } - - inline RecognitionAudio& operator=(const RecognitionAudio& from) { - CopyFrom(from); - return *this; - } - inline RecognitionAudio& operator=(RecognitionAudio&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArena() const final { - return GetArenaNoVirtual(); - } - inline void* GetMaybeArenaPointer() const final { - return MaybeArenaPtr(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const RecognitionAudio& default_instance(); - - enum AudioSourceCase { - kContent = 1, - kUri = 2, - AUDIO_SOURCE_NOT_SET = 0, - }; - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const RecognitionAudio* internal_default_instance() { - return reinterpret_cast( - &_RecognitionAudio_default_instance_); - } - static constexpr int kIndexInFileMessages = - 6; - - friend void swap(RecognitionAudio& a, RecognitionAudio& b) { - a.Swap(&b); - } - inline void Swap(RecognitionAudio* other) { - if (other == this) return; - if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RecognitionAudio* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline RecognitionAudio* New() const final { - return CreateMaybeMessage(nullptr); - } - - RecognitionAudio* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const RecognitionAudio& from); - void MergeFrom(const RecognitionAudio& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(RecognitionAudio* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "google.cloud.speech.v1.RecognitionAudio"; - } - protected: - explicit RecognitionAudio(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return _internal_metadata_.arena(); - } - inline void* MaybeArenaPtr() const { - return _internal_metadata_.raw_arena_ptr(); - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_dictation_5fasr_2eproto); - return ::descriptor_table_dictation_5fasr_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kContentFieldNumber = 1, - kUriFieldNumber = 2, - }; - // bytes content = 1; - private: - bool _internal_has_content() const; - public: - void clear_content(); - const std::string& content() const; - void set_content(const std::string& value); - void set_content(std::string&& value); - void set_content(const char* value); - void set_content(const void* value, size_t size); - std::string* mutable_content(); - std::string* release_content(); - void set_allocated_content(std::string* content); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - std::string* unsafe_arena_release_content(); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - void unsafe_arena_set_allocated_content( - std::string* content); - private: - const std::string& _internal_content() const; - void _internal_set_content(const std::string& value); - std::string* _internal_mutable_content(); - public: - - // string uri = 2; - private: - bool _internal_has_uri() const; - public: - void clear_uri(); - const std::string& uri() const; - void set_uri(const std::string& value); - void set_uri(std::string&& value); - void set_uri(const char* value); - void set_uri(const char* value, size_t size); - std::string* mutable_uri(); - std::string* release_uri(); - void set_allocated_uri(std::string* uri); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - std::string* unsafe_arena_release_uri(); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - void unsafe_arena_set_allocated_uri( - std::string* uri); - private: - const std::string& _internal_uri() const; - void _internal_set_uri(const std::string& value); - std::string* _internal_mutable_uri(); - public: - - void clear_audio_source(); - AudioSourceCase audio_source_case() const; - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.RecognitionAudio) - private: - class _Internal; - void set_has_content(); - void set_has_uri(); - - inline bool has_audio_source() const; - inline void clear_has_audio_source(); - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - union AudioSourceUnion { - AudioSourceUnion() {} - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr content_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr uri_; - } audio_source_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::uint32 _oneof_case_[1]; - - friend struct ::TableStruct_dictation_5fasr_2eproto; -}; -// ------------------------------------------------------------------- - -class RecognizeResponse : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.cloud.speech.v1.RecognizeResponse) */ { - public: - RecognizeResponse(); - virtual ~RecognizeResponse(); - - RecognizeResponse(const RecognizeResponse& from); - RecognizeResponse(RecognizeResponse&& from) noexcept - : RecognizeResponse() { - *this = ::std::move(from); - } - - inline RecognizeResponse& operator=(const RecognizeResponse& from) { - CopyFrom(from); - return *this; - } - inline RecognizeResponse& operator=(RecognizeResponse&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArena() const final { - return GetArenaNoVirtual(); - } - inline void* GetMaybeArenaPointer() const final { - return MaybeArenaPtr(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const RecognizeResponse& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const RecognizeResponse* internal_default_instance() { - return reinterpret_cast( - &_RecognizeResponse_default_instance_); - } - static constexpr int kIndexInFileMessages = - 7; - - friend void swap(RecognizeResponse& a, RecognizeResponse& b) { - a.Swap(&b); - } - inline void Swap(RecognizeResponse* other) { - if (other == this) return; - if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RecognizeResponse* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline RecognizeResponse* New() const final { - return CreateMaybeMessage(nullptr); - } - - RecognizeResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const RecognizeResponse& from); - void MergeFrom(const RecognizeResponse& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(RecognizeResponse* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "google.cloud.speech.v1.RecognizeResponse"; - } - protected: - explicit RecognizeResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return _internal_metadata_.arena(); - } - inline void* MaybeArenaPtr() const { - return _internal_metadata_.raw_arena_ptr(); - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_dictation_5fasr_2eproto); - return ::descriptor_table_dictation_5fasr_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kResultsFieldNumber = 2, - }; - // repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - int results_size() const; - private: - int _internal_results_size() const; - public: - void clear_results(); - ::google::cloud::speech::v1::SpeechRecognitionResult* mutable_results(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::SpeechRecognitionResult >* - mutable_results(); - private: - const ::google::cloud::speech::v1::SpeechRecognitionResult& _internal_results(int index) const; - ::google::cloud::speech::v1::SpeechRecognitionResult* _internal_add_results(); - public: - const ::google::cloud::speech::v1::SpeechRecognitionResult& results(int index) const; - ::google::cloud::speech::v1::SpeechRecognitionResult* add_results(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::SpeechRecognitionResult >& - results() const; - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.RecognizeResponse) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::SpeechRecognitionResult > results_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_dictation_5fasr_2eproto; -}; -// ------------------------------------------------------------------- - -class StreamingRecognizeResponse : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.cloud.speech.v1.StreamingRecognizeResponse) */ { - public: - StreamingRecognizeResponse(); - virtual ~StreamingRecognizeResponse(); - - StreamingRecognizeResponse(const StreamingRecognizeResponse& from); - StreamingRecognizeResponse(StreamingRecognizeResponse&& from) noexcept - : StreamingRecognizeResponse() { - *this = ::std::move(from); - } - - inline StreamingRecognizeResponse& operator=(const StreamingRecognizeResponse& from) { - CopyFrom(from); - return *this; - } - inline StreamingRecognizeResponse& operator=(StreamingRecognizeResponse&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArena() const final { - return GetArenaNoVirtual(); - } - inline void* GetMaybeArenaPointer() const final { - return MaybeArenaPtr(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const StreamingRecognizeResponse& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const StreamingRecognizeResponse* internal_default_instance() { - return reinterpret_cast( - &_StreamingRecognizeResponse_default_instance_); - } - static constexpr int kIndexInFileMessages = - 8; - - friend void swap(StreamingRecognizeResponse& a, StreamingRecognizeResponse& b) { - a.Swap(&b); - } - inline void Swap(StreamingRecognizeResponse* other) { - if (other == this) return; - if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(StreamingRecognizeResponse* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline StreamingRecognizeResponse* New() const final { - return CreateMaybeMessage(nullptr); - } - - StreamingRecognizeResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const StreamingRecognizeResponse& from); - void MergeFrom(const StreamingRecognizeResponse& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(StreamingRecognizeResponse* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "google.cloud.speech.v1.StreamingRecognizeResponse"; - } - protected: - explicit StreamingRecognizeResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return _internal_metadata_.arena(); - } - inline void* MaybeArenaPtr() const { - return _internal_metadata_.raw_arena_ptr(); - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_dictation_5fasr_2eproto); - return ::descriptor_table_dictation_5fasr_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - typedef StreamingRecognizeResponse_SpeechEventType SpeechEventType; - static constexpr SpeechEventType SPEECH_EVENT_UNSPECIFIED = - StreamingRecognizeResponse_SpeechEventType_SPEECH_EVENT_UNSPECIFIED; - static constexpr SpeechEventType END_OF_SINGLE_UTTERANCE = - StreamingRecognizeResponse_SpeechEventType_END_OF_SINGLE_UTTERANCE; - static inline bool SpeechEventType_IsValid(int value) { - return StreamingRecognizeResponse_SpeechEventType_IsValid(value); - } - static constexpr SpeechEventType SpeechEventType_MIN = - StreamingRecognizeResponse_SpeechEventType_SpeechEventType_MIN; - static constexpr SpeechEventType SpeechEventType_MAX = - StreamingRecognizeResponse_SpeechEventType_SpeechEventType_MAX; - static constexpr int SpeechEventType_ARRAYSIZE = - StreamingRecognizeResponse_SpeechEventType_SpeechEventType_ARRAYSIZE; - static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* - SpeechEventType_descriptor() { - return StreamingRecognizeResponse_SpeechEventType_descriptor(); - } - template - static inline const std::string& SpeechEventType_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function SpeechEventType_Name."); - return StreamingRecognizeResponse_SpeechEventType_Name(enum_t_value); - } - static inline bool SpeechEventType_Parse(const std::string& name, - SpeechEventType* value) { - return StreamingRecognizeResponse_SpeechEventType_Parse(name, value); - } - - // accessors ------------------------------------------------------- - - enum : int { - kResultsFieldNumber = 2, - kErrorFieldNumber = 1, - kSpeechEventTypeFieldNumber = 4, - }; - // repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - int results_size() const; - private: - int _internal_results_size() const; - public: - void clear_results(); - ::google::cloud::speech::v1::StreamingRecognitionResult* mutable_results(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::StreamingRecognitionResult >* - mutable_results(); - private: - const ::google::cloud::speech::v1::StreamingRecognitionResult& _internal_results(int index) const; - ::google::cloud::speech::v1::StreamingRecognitionResult* _internal_add_results(); - public: - const ::google::cloud::speech::v1::StreamingRecognitionResult& results(int index) const; - ::google::cloud::speech::v1::StreamingRecognitionResult* add_results(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::StreamingRecognitionResult >& - results() const; - - // .google.rpc.Status error = 1; - bool has_error() const; - private: - bool _internal_has_error() const; - public: - void clear_error(); - const ::google::rpc::Status& error() const; - ::google::rpc::Status* release_error(); - ::google::rpc::Status* mutable_error(); - void set_allocated_error(::google::rpc::Status* error); - private: - const ::google::rpc::Status& _internal_error() const; - ::google::rpc::Status* _internal_mutable_error(); - public: - void unsafe_arena_set_allocated_error( - ::google::rpc::Status* error); - ::google::rpc::Status* unsafe_arena_release_error(); - - // .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - void clear_speech_event_type(); - ::google::cloud::speech::v1::StreamingRecognizeResponse_SpeechEventType speech_event_type() const; - void set_speech_event_type(::google::cloud::speech::v1::StreamingRecognizeResponse_SpeechEventType value); - private: - ::google::cloud::speech::v1::StreamingRecognizeResponse_SpeechEventType _internal_speech_event_type() const; - void _internal_set_speech_event_type(::google::cloud::speech::v1::StreamingRecognizeResponse_SpeechEventType value); - public: - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.StreamingRecognizeResponse) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::StreamingRecognitionResult > results_; - ::google::rpc::Status* error_; - int speech_event_type_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_dictation_5fasr_2eproto; -}; -// ------------------------------------------------------------------- - -class StreamingRecognitionResult : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.cloud.speech.v1.StreamingRecognitionResult) */ { - public: - StreamingRecognitionResult(); - virtual ~StreamingRecognitionResult(); - - StreamingRecognitionResult(const StreamingRecognitionResult& from); - StreamingRecognitionResult(StreamingRecognitionResult&& from) noexcept - : StreamingRecognitionResult() { - *this = ::std::move(from); - } - - inline StreamingRecognitionResult& operator=(const StreamingRecognitionResult& from) { - CopyFrom(from); - return *this; - } - inline StreamingRecognitionResult& operator=(StreamingRecognitionResult&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArena() const final { - return GetArenaNoVirtual(); - } - inline void* GetMaybeArenaPointer() const final { - return MaybeArenaPtr(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const StreamingRecognitionResult& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const StreamingRecognitionResult* internal_default_instance() { - return reinterpret_cast( - &_StreamingRecognitionResult_default_instance_); - } - static constexpr int kIndexInFileMessages = - 9; - - friend void swap(StreamingRecognitionResult& a, StreamingRecognitionResult& b) { - a.Swap(&b); - } - inline void Swap(StreamingRecognitionResult* other) { - if (other == this) return; - if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(StreamingRecognitionResult* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline StreamingRecognitionResult* New() const final { - return CreateMaybeMessage(nullptr); - } - - StreamingRecognitionResult* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const StreamingRecognitionResult& from); - void MergeFrom(const StreamingRecognitionResult& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(StreamingRecognitionResult* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "google.cloud.speech.v1.StreamingRecognitionResult"; - } - protected: - explicit StreamingRecognitionResult(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return _internal_metadata_.arena(); - } - inline void* MaybeArenaPtr() const { - return _internal_metadata_.raw_arena_ptr(); - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_dictation_5fasr_2eproto); - return ::descriptor_table_dictation_5fasr_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - typedef StreamingRecognitionResult_ResultFinalizationCause ResultFinalizationCause; - static constexpr ResultFinalizationCause RESULT_FINALIZATION_CAUSE_UNSPECIFIED = - StreamingRecognitionResult_ResultFinalizationCause_RESULT_FINALIZATION_CAUSE_UNSPECIFIED; - static constexpr ResultFinalizationCause SUCCESS = - StreamingRecognitionResult_ResultFinalizationCause_SUCCESS; - static constexpr ResultFinalizationCause NO_INPUT_TIMEOUT = - StreamingRecognitionResult_ResultFinalizationCause_NO_INPUT_TIMEOUT; - static constexpr ResultFinalizationCause SUCCESS_MAXTIME = - StreamingRecognitionResult_ResultFinalizationCause_SUCCESS_MAXTIME; - static constexpr ResultFinalizationCause PARTIAL_MATCH = - StreamingRecognitionResult_ResultFinalizationCause_PARTIAL_MATCH; - static constexpr ResultFinalizationCause NO_MATCH_MAXTIME = - StreamingRecognitionResult_ResultFinalizationCause_NO_MATCH_MAXTIME; - static inline bool ResultFinalizationCause_IsValid(int value) { - return StreamingRecognitionResult_ResultFinalizationCause_IsValid(value); - } - static constexpr ResultFinalizationCause ResultFinalizationCause_MIN = - StreamingRecognitionResult_ResultFinalizationCause_ResultFinalizationCause_MIN; - static constexpr ResultFinalizationCause ResultFinalizationCause_MAX = - StreamingRecognitionResult_ResultFinalizationCause_ResultFinalizationCause_MAX; - static constexpr int ResultFinalizationCause_ARRAYSIZE = - StreamingRecognitionResult_ResultFinalizationCause_ResultFinalizationCause_ARRAYSIZE; - static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* - ResultFinalizationCause_descriptor() { - return StreamingRecognitionResult_ResultFinalizationCause_descriptor(); - } - template - static inline const std::string& ResultFinalizationCause_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function ResultFinalizationCause_Name."); - return StreamingRecognitionResult_ResultFinalizationCause_Name(enum_t_value); - } - static inline bool ResultFinalizationCause_Parse(const std::string& name, - ResultFinalizationCause* value) { - return StreamingRecognitionResult_ResultFinalizationCause_Parse(name, value); - } - - // accessors ------------------------------------------------------- - - enum : int { - kAlternativesFieldNumber = 1, - kLatticeFieldNumber = 5, - kIsFinalFieldNumber = 2, - kStabilityFieldNumber = 3, - kResultFinalizationCauseFieldNumber = 4, - }; - // repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - int alternatives_size() const; - private: - int _internal_alternatives_size() const; - public: - void clear_alternatives(); - ::google::cloud::speech::v1::SpeechRecognitionAlternative* mutable_alternatives(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::SpeechRecognitionAlternative >* - mutable_alternatives(); - private: - const ::google::cloud::speech::v1::SpeechRecognitionAlternative& _internal_alternatives(int index) const; - ::google::cloud::speech::v1::SpeechRecognitionAlternative* _internal_add_alternatives(); - public: - const ::google::cloud::speech::v1::SpeechRecognitionAlternative& alternatives(int index) const; - ::google::cloud::speech::v1::SpeechRecognitionAlternative* add_alternatives(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::SpeechRecognitionAlternative >& - alternatives() const; - - // repeated .google.cloud.speech.v1.RecognitionLattice lattice = 5; - int lattice_size() const; - private: - int _internal_lattice_size() const; - public: - void clear_lattice(); - ::google::cloud::speech::v1::RecognitionLattice* mutable_lattice(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::RecognitionLattice >* - mutable_lattice(); - private: - const ::google::cloud::speech::v1::RecognitionLattice& _internal_lattice(int index) const; - ::google::cloud::speech::v1::RecognitionLattice* _internal_add_lattice(); - public: - const ::google::cloud::speech::v1::RecognitionLattice& lattice(int index) const; - ::google::cloud::speech::v1::RecognitionLattice* add_lattice(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::RecognitionLattice >& - lattice() const; - - // bool is_final = 2; - void clear_is_final(); - bool is_final() const; - void set_is_final(bool value); - private: - bool _internal_is_final() const; - void _internal_set_is_final(bool value); - public: - - // float stability = 3; - void clear_stability(); - float stability() const; - void set_stability(float value); - private: - float _internal_stability() const; - void _internal_set_stability(float value); - public: - - // .google.cloud.speech.v1.StreamingRecognitionResult.ResultFinalizationCause result_finalization_cause = 4; - void clear_result_finalization_cause(); - ::google::cloud::speech::v1::StreamingRecognitionResult_ResultFinalizationCause result_finalization_cause() const; - void set_result_finalization_cause(::google::cloud::speech::v1::StreamingRecognitionResult_ResultFinalizationCause value); - private: - ::google::cloud::speech::v1::StreamingRecognitionResult_ResultFinalizationCause _internal_result_finalization_cause() const; - void _internal_set_result_finalization_cause(::google::cloud::speech::v1::StreamingRecognitionResult_ResultFinalizationCause value); - public: - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.StreamingRecognitionResult) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::SpeechRecognitionAlternative > alternatives_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::RecognitionLattice > lattice_; - bool is_final_; - float stability_; - int result_finalization_cause_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_dictation_5fasr_2eproto; -}; -// ------------------------------------------------------------------- - -class SpeechRecognitionResult : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.cloud.speech.v1.SpeechRecognitionResult) */ { - public: - SpeechRecognitionResult(); - virtual ~SpeechRecognitionResult(); - - SpeechRecognitionResult(const SpeechRecognitionResult& from); - SpeechRecognitionResult(SpeechRecognitionResult&& from) noexcept - : SpeechRecognitionResult() { - *this = ::std::move(from); - } - - inline SpeechRecognitionResult& operator=(const SpeechRecognitionResult& from) { - CopyFrom(from); - return *this; - } - inline SpeechRecognitionResult& operator=(SpeechRecognitionResult&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArena() const final { - return GetArenaNoVirtual(); - } - inline void* GetMaybeArenaPointer() const final { - return MaybeArenaPtr(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const SpeechRecognitionResult& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const SpeechRecognitionResult* internal_default_instance() { - return reinterpret_cast( - &_SpeechRecognitionResult_default_instance_); - } - static constexpr int kIndexInFileMessages = - 10; - - friend void swap(SpeechRecognitionResult& a, SpeechRecognitionResult& b) { - a.Swap(&b); - } - inline void Swap(SpeechRecognitionResult* other) { - if (other == this) return; - if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(SpeechRecognitionResult* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline SpeechRecognitionResult* New() const final { - return CreateMaybeMessage(nullptr); - } - - SpeechRecognitionResult* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const SpeechRecognitionResult& from); - void MergeFrom(const SpeechRecognitionResult& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(SpeechRecognitionResult* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "google.cloud.speech.v1.SpeechRecognitionResult"; - } - protected: - explicit SpeechRecognitionResult(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return _internal_metadata_.arena(); - } - inline void* MaybeArenaPtr() const { - return _internal_metadata_.raw_arena_ptr(); - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_dictation_5fasr_2eproto); - return ::descriptor_table_dictation_5fasr_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kAlternativesFieldNumber = 1, - kLatticeFieldNumber = 5, - }; - // repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - int alternatives_size() const; - private: - int _internal_alternatives_size() const; - public: - void clear_alternatives(); - ::google::cloud::speech::v1::SpeechRecognitionAlternative* mutable_alternatives(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::SpeechRecognitionAlternative >* - mutable_alternatives(); - private: - const ::google::cloud::speech::v1::SpeechRecognitionAlternative& _internal_alternatives(int index) const; - ::google::cloud::speech::v1::SpeechRecognitionAlternative* _internal_add_alternatives(); - public: - const ::google::cloud::speech::v1::SpeechRecognitionAlternative& alternatives(int index) const; - ::google::cloud::speech::v1::SpeechRecognitionAlternative* add_alternatives(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::SpeechRecognitionAlternative >& - alternatives() const; - - // repeated .google.cloud.speech.v1.RecognitionLattice lattice = 5; - int lattice_size() const; - private: - int _internal_lattice_size() const; - public: - void clear_lattice(); - ::google::cloud::speech::v1::RecognitionLattice* mutable_lattice(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::RecognitionLattice >* - mutable_lattice(); - private: - const ::google::cloud::speech::v1::RecognitionLattice& _internal_lattice(int index) const; - ::google::cloud::speech::v1::RecognitionLattice* _internal_add_lattice(); - public: - const ::google::cloud::speech::v1::RecognitionLattice& lattice(int index) const; - ::google::cloud::speech::v1::RecognitionLattice* add_lattice(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::RecognitionLattice >& - lattice() const; - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.SpeechRecognitionResult) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::SpeechRecognitionAlternative > alternatives_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::RecognitionLattice > lattice_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_dictation_5fasr_2eproto; -}; -// ------------------------------------------------------------------- - -class SpeechRecognitionAlternative : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.cloud.speech.v1.SpeechRecognitionAlternative) */ { - public: - SpeechRecognitionAlternative(); - virtual ~SpeechRecognitionAlternative(); - - SpeechRecognitionAlternative(const SpeechRecognitionAlternative& from); - SpeechRecognitionAlternative(SpeechRecognitionAlternative&& from) noexcept - : SpeechRecognitionAlternative() { - *this = ::std::move(from); - } - - inline SpeechRecognitionAlternative& operator=(const SpeechRecognitionAlternative& from) { - CopyFrom(from); - return *this; - } - inline SpeechRecognitionAlternative& operator=(SpeechRecognitionAlternative&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArena() const final { - return GetArenaNoVirtual(); - } - inline void* GetMaybeArenaPointer() const final { - return MaybeArenaPtr(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const SpeechRecognitionAlternative& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const SpeechRecognitionAlternative* internal_default_instance() { - return reinterpret_cast( - &_SpeechRecognitionAlternative_default_instance_); - } - static constexpr int kIndexInFileMessages = - 11; - - friend void swap(SpeechRecognitionAlternative& a, SpeechRecognitionAlternative& b) { - a.Swap(&b); - } - inline void Swap(SpeechRecognitionAlternative* other) { - if (other == this) return; - if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(SpeechRecognitionAlternative* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline SpeechRecognitionAlternative* New() const final { - return CreateMaybeMessage(nullptr); - } - - SpeechRecognitionAlternative* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const SpeechRecognitionAlternative& from); - void MergeFrom(const SpeechRecognitionAlternative& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(SpeechRecognitionAlternative* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "google.cloud.speech.v1.SpeechRecognitionAlternative"; - } - protected: - explicit SpeechRecognitionAlternative(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return _internal_metadata_.arena(); - } - inline void* MaybeArenaPtr() const { - return _internal_metadata_.raw_arena_ptr(); - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_dictation_5fasr_2eproto); - return ::descriptor_table_dictation_5fasr_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kWordsFieldNumber = 3, - kTranscriptFieldNumber = 1, - kConfidenceFieldNumber = 2, - }; - // repeated .google.cloud.speech.v1.WordInfo words = 3; - int words_size() const; - private: - int _internal_words_size() const; - public: - void clear_words(); - ::google::cloud::speech::v1::WordInfo* mutable_words(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::WordInfo >* - mutable_words(); - private: - const ::google::cloud::speech::v1::WordInfo& _internal_words(int index) const; - ::google::cloud::speech::v1::WordInfo* _internal_add_words(); - public: - const ::google::cloud::speech::v1::WordInfo& words(int index) const; - ::google::cloud::speech::v1::WordInfo* add_words(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::WordInfo >& - words() const; - - // string transcript = 1; - void clear_transcript(); - const std::string& transcript() const; - void set_transcript(const std::string& value); - void set_transcript(std::string&& value); - void set_transcript(const char* value); - void set_transcript(const char* value, size_t size); - std::string* mutable_transcript(); - std::string* release_transcript(); - void set_allocated_transcript(std::string* transcript); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - std::string* unsafe_arena_release_transcript(); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - void unsafe_arena_set_allocated_transcript( - std::string* transcript); - private: - const std::string& _internal_transcript() const; - void _internal_set_transcript(const std::string& value); - std::string* _internal_mutable_transcript(); - public: - - // float confidence = 2; - void clear_confidence(); - float confidence() const; - void set_confidence(float value); - private: - float _internal_confidence() const; - void _internal_set_confidence(float value); - public: - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.SpeechRecognitionAlternative) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::WordInfo > words_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr transcript_; - float confidence_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_dictation_5fasr_2eproto; -}; -// ------------------------------------------------------------------- - -class WordInfo : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.cloud.speech.v1.WordInfo) */ { - public: - WordInfo(); - virtual ~WordInfo(); - - WordInfo(const WordInfo& from); - WordInfo(WordInfo&& from) noexcept - : WordInfo() { - *this = ::std::move(from); - } - - inline WordInfo& operator=(const WordInfo& from) { - CopyFrom(from); - return *this; - } - inline WordInfo& operator=(WordInfo&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArena() const final { - return GetArenaNoVirtual(); - } - inline void* GetMaybeArenaPointer() const final { - return MaybeArenaPtr(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const WordInfo& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const WordInfo* internal_default_instance() { - return reinterpret_cast( - &_WordInfo_default_instance_); - } - static constexpr int kIndexInFileMessages = - 12; - - friend void swap(WordInfo& a, WordInfo& b) { - a.Swap(&b); - } - inline void Swap(WordInfo* other) { - if (other == this) return; - if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(WordInfo* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline WordInfo* New() const final { - return CreateMaybeMessage(nullptr); - } - - WordInfo* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const WordInfo& from); - void MergeFrom(const WordInfo& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(WordInfo* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "google.cloud.speech.v1.WordInfo"; - } - protected: - explicit WordInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return _internal_metadata_.arena(); - } - inline void* MaybeArenaPtr() const { - return _internal_metadata_.raw_arena_ptr(); - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_dictation_5fasr_2eproto); - return ::descriptor_table_dictation_5fasr_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kWordFieldNumber = 3, - kStartTimeFieldNumber = 1, - kEndTimeFieldNumber = 2, - }; - // string word = 3; - void clear_word(); - const std::string& word() const; - void set_word(const std::string& value); - void set_word(std::string&& value); - void set_word(const char* value); - void set_word(const char* value, size_t size); - std::string* mutable_word(); - std::string* release_word(); - void set_allocated_word(std::string* word); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - std::string* unsafe_arena_release_word(); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - void unsafe_arena_set_allocated_word( - std::string* word); - private: - const std::string& _internal_word() const; - void _internal_set_word(const std::string& value); - std::string* _internal_mutable_word(); - public: - - // .google.protobuf.Duration start_time = 1; - bool has_start_time() const; - private: - bool _internal_has_start_time() const; - public: - void clear_start_time(); - const PROTOBUF_NAMESPACE_ID::Duration& start_time() const; - PROTOBUF_NAMESPACE_ID::Duration* release_start_time(); - PROTOBUF_NAMESPACE_ID::Duration* mutable_start_time(); - void set_allocated_start_time(PROTOBUF_NAMESPACE_ID::Duration* start_time); - private: - const PROTOBUF_NAMESPACE_ID::Duration& _internal_start_time() const; - PROTOBUF_NAMESPACE_ID::Duration* _internal_mutable_start_time(); - public: - void unsafe_arena_set_allocated_start_time( - PROTOBUF_NAMESPACE_ID::Duration* start_time); - PROTOBUF_NAMESPACE_ID::Duration* unsafe_arena_release_start_time(); - - // .google.protobuf.Duration end_time = 2; - bool has_end_time() const; - private: - bool _internal_has_end_time() const; - public: - void clear_end_time(); - const PROTOBUF_NAMESPACE_ID::Duration& end_time() const; - PROTOBUF_NAMESPACE_ID::Duration* release_end_time(); - PROTOBUF_NAMESPACE_ID::Duration* mutable_end_time(); - void set_allocated_end_time(PROTOBUF_NAMESPACE_ID::Duration* end_time); - private: - const PROTOBUF_NAMESPACE_ID::Duration& _internal_end_time() const; - PROTOBUF_NAMESPACE_ID::Duration* _internal_mutable_end_time(); - public: - void unsafe_arena_set_allocated_end_time( - PROTOBUF_NAMESPACE_ID::Duration* end_time); - PROTOBUF_NAMESPACE_ID::Duration* unsafe_arena_release_end_time(); - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.WordInfo) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr word_; - PROTOBUF_NAMESPACE_ID::Duration* start_time_; - PROTOBUF_NAMESPACE_ID::Duration* end_time_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_dictation_5fasr_2eproto; -}; -// ------------------------------------------------------------------- - -class RecognitionLattice : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.cloud.speech.v1.RecognitionLattice) */ { - public: - RecognitionLattice(); - virtual ~RecognitionLattice(); - - RecognitionLattice(const RecognitionLattice& from); - RecognitionLattice(RecognitionLattice&& from) noexcept - : RecognitionLattice() { - *this = ::std::move(from); - } - - inline RecognitionLattice& operator=(const RecognitionLattice& from) { - CopyFrom(from); - return *this; - } - inline RecognitionLattice& operator=(RecognitionLattice&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArena() const final { - return GetArenaNoVirtual(); - } - inline void* GetMaybeArenaPointer() const final { - return MaybeArenaPtr(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const RecognitionLattice& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const RecognitionLattice* internal_default_instance() { - return reinterpret_cast( - &_RecognitionLattice_default_instance_); - } - static constexpr int kIndexInFileMessages = - 13; - - friend void swap(RecognitionLattice& a, RecognitionLattice& b) { - a.Swap(&b); - } - inline void Swap(RecognitionLattice* other) { - if (other == this) return; - if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(RecognitionLattice* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline RecognitionLattice* New() const final { - return CreateMaybeMessage(nullptr); - } - - RecognitionLattice* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const RecognitionLattice& from); - void MergeFrom(const RecognitionLattice& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(RecognitionLattice* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "google.cloud.speech.v1.RecognitionLattice"; - } - protected: - explicit RecognitionLattice(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return _internal_metadata_.arena(); - } - inline void* MaybeArenaPtr() const { - return _internal_metadata_.raw_arena_ptr(); - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_dictation_5fasr_2eproto); - return ::descriptor_table_dictation_5fasr_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kFinalNodesFieldNumber = 1, - kEdgesFieldNumber = 2, - }; - // repeated int32 final_nodes = 1; - int final_nodes_size() const; - private: - int _internal_final_nodes_size() const; - public: - void clear_final_nodes(); - private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_final_nodes(int index) const; - const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int32 >& - _internal_final_nodes() const; - void _internal_add_final_nodes(::PROTOBUF_NAMESPACE_ID::int32 value); - ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int32 >* - _internal_mutable_final_nodes(); - public: - ::PROTOBUF_NAMESPACE_ID::int32 final_nodes(int index) const; - void set_final_nodes(int index, ::PROTOBUF_NAMESPACE_ID::int32 value); - void add_final_nodes(::PROTOBUF_NAMESPACE_ID::int32 value); - const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int32 >& - final_nodes() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int32 >* - mutable_final_nodes(); - - // repeated .google.cloud.speech.v1.LatticeEdge edges = 2; - int edges_size() const; - private: - int _internal_edges_size() const; - public: - void clear_edges(); - ::google::cloud::speech::v1::LatticeEdge* mutable_edges(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::LatticeEdge >* - mutable_edges(); - private: - const ::google::cloud::speech::v1::LatticeEdge& _internal_edges(int index) const; - ::google::cloud::speech::v1::LatticeEdge* _internal_add_edges(); - public: - const ::google::cloud::speech::v1::LatticeEdge& edges(int index) const; - ::google::cloud::speech::v1::LatticeEdge* add_edges(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::LatticeEdge >& - edges() const; - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.RecognitionLattice) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int32 > final_nodes_; - mutable std::atomic _final_nodes_cached_byte_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::LatticeEdge > edges_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_dictation_5fasr_2eproto; -}; -// ------------------------------------------------------------------- - -class LatticeEdge : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:google.cloud.speech.v1.LatticeEdge) */ { - public: - LatticeEdge(); - virtual ~LatticeEdge(); - - LatticeEdge(const LatticeEdge& from); - LatticeEdge(LatticeEdge&& from) noexcept - : LatticeEdge() { - *this = ::std::move(from); - } - - inline LatticeEdge& operator=(const LatticeEdge& from) { - CopyFrom(from); - return *this; - } - inline LatticeEdge& operator=(LatticeEdge&& from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArena() const final { - return GetArenaNoVirtual(); - } - inline void* GetMaybeArenaPointer() const final { - return MaybeArenaPtr(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const LatticeEdge& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const LatticeEdge* internal_default_instance() { - return reinterpret_cast( - &_LatticeEdge_default_instance_); - } - static constexpr int kIndexInFileMessages = - 14; - - friend void swap(LatticeEdge& a, LatticeEdge& b) { - a.Swap(&b); - } - inline void Swap(LatticeEdge* other) { - if (other == this) return; - if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(LatticeEdge* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline LatticeEdge* New() const final { - return CreateMaybeMessage(nullptr); - } - - LatticeEdge* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const LatticeEdge& from); - void MergeFrom(const LatticeEdge& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(LatticeEdge* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "google.cloud.speech.v1.LatticeEdge"; - } - protected: - explicit LatticeEdge(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { - return _internal_metadata_.arena(); - } - inline void* MaybeArenaPtr() const { - return _internal_metadata_.raw_arena_ptr(); - } - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_dictation_5fasr_2eproto); - return ::descriptor_table_dictation_5fasr_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kSymbolFieldNumber = 3, - kStartNodeFieldNumber = 1, - kEndNodeFieldNumber = 2, - kLanguageCostFieldNumber = 4, - kAcousticCostFieldNumber = 5, - kDurationFieldNumber = 6, - }; - // string symbol = 3; - void clear_symbol(); - const std::string& symbol() const; - void set_symbol(const std::string& value); - void set_symbol(std::string&& value); - void set_symbol(const char* value); - void set_symbol(const char* value, size_t size); - std::string* mutable_symbol(); - std::string* release_symbol(); - void set_allocated_symbol(std::string* symbol); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - std::string* unsafe_arena_release_symbol(); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - void unsafe_arena_set_allocated_symbol( - std::string* symbol); - private: - const std::string& _internal_symbol() const; - void _internal_set_symbol(const std::string& value); - std::string* _internal_mutable_symbol(); - public: - - // int32 start_node = 1; - void clear_start_node(); - ::PROTOBUF_NAMESPACE_ID::int32 start_node() const; - void set_start_node(::PROTOBUF_NAMESPACE_ID::int32 value); - private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_start_node() const; - void _internal_set_start_node(::PROTOBUF_NAMESPACE_ID::int32 value); - public: - - // int32 end_node = 2; - void clear_end_node(); - ::PROTOBUF_NAMESPACE_ID::int32 end_node() const; - void set_end_node(::PROTOBUF_NAMESPACE_ID::int32 value); - private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_end_node() const; - void _internal_set_end_node(::PROTOBUF_NAMESPACE_ID::int32 value); - public: - - // float language_cost = 4; - void clear_language_cost(); - float language_cost() const; - void set_language_cost(float value); - private: - float _internal_language_cost() const; - void _internal_set_language_cost(float value); - public: - - // float acoustic_cost = 5; - void clear_acoustic_cost(); - float acoustic_cost() const; - void set_acoustic_cost(float value); - private: - float _internal_acoustic_cost() const; - void _internal_set_acoustic_cost(float value); - public: - - // int32 duration = 6; - void clear_duration(); - ::PROTOBUF_NAMESPACE_ID::int32 duration() const; - void set_duration(::PROTOBUF_NAMESPACE_ID::int32 value); - private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_duration() const; - void _internal_set_duration(::PROTOBUF_NAMESPACE_ID::int32 value); - public: - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.LatticeEdge) - private: - class _Internal; - - ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr symbol_; - ::PROTOBUF_NAMESPACE_ID::int32 start_node_; - ::PROTOBUF_NAMESPACE_ID::int32 end_node_; - float language_cost_; - float acoustic_cost_; - ::PROTOBUF_NAMESPACE_ID::int32 duration_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_dictation_5fasr_2eproto; -}; -// =================================================================== - - -// =================================================================== - -#ifdef __GNUC__ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif // __GNUC__ -// RecognizeRequest - -// .google.cloud.speech.v1.RecognitionConfig config = 1; -inline bool RecognizeRequest::_internal_has_config() const { - return this != internal_default_instance() && config_ != nullptr; -} -inline bool RecognizeRequest::has_config() const { - return _internal_has_config(); -} -inline void RecognizeRequest::clear_config() { - if (GetArenaNoVirtual() == nullptr && config_ != nullptr) { - delete config_; - } - config_ = nullptr; -} -inline const ::google::cloud::speech::v1::RecognitionConfig& RecognizeRequest::_internal_config() const { - const ::google::cloud::speech::v1::RecognitionConfig* p = config_; - return p != nullptr ? *p : *reinterpret_cast( - &::google::cloud::speech::v1::_RecognitionConfig_default_instance_); -} -inline const ::google::cloud::speech::v1::RecognitionConfig& RecognizeRequest::config() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.RecognizeRequest.config) - return _internal_config(); -} -inline ::google::cloud::speech::v1::RecognitionConfig* RecognizeRequest::release_config() { - auto temp = unsafe_arena_release_config(); - if (GetArenaNoVirtual() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } - return temp; -} -inline ::google::cloud::speech::v1::RecognitionConfig* RecognizeRequest::unsafe_arena_release_config() { - // @@protoc_insertion_point(field_release:google.cloud.speech.v1.RecognizeRequest.config) - - ::google::cloud::speech::v1::RecognitionConfig* temp = config_; - config_ = nullptr; - return temp; -} -inline ::google::cloud::speech::v1::RecognitionConfig* RecognizeRequest::_internal_mutable_config() { - - if (config_ == nullptr) { - auto* p = CreateMaybeMessage<::google::cloud::speech::v1::RecognitionConfig>(GetArenaNoVirtual()); - config_ = p; - } - return config_; -} -inline ::google::cloud::speech::v1::RecognitionConfig* RecognizeRequest::mutable_config() { - // @@protoc_insertion_point(field_mutable:google.cloud.speech.v1.RecognizeRequest.config) - return _internal_mutable_config(); -} -inline void RecognizeRequest::set_allocated_config(::google::cloud::speech::v1::RecognitionConfig* config) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete config_; - } - if (config) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(config); - if (message_arena != submessage_arena) { - config = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, config, submessage_arena); - } - - } else { - - } - config_ = config; - // @@protoc_insertion_point(field_set_allocated:google.cloud.speech.v1.RecognizeRequest.config) -} - -// .google.cloud.speech.v1.RecognitionAudio audio = 2; -inline bool RecognizeRequest::_internal_has_audio() const { - return this != internal_default_instance() && audio_ != nullptr; -} -inline bool RecognizeRequest::has_audio() const { - return _internal_has_audio(); -} -inline void RecognizeRequest::clear_audio() { - if (GetArenaNoVirtual() == nullptr && audio_ != nullptr) { - delete audio_; - } - audio_ = nullptr; -} -inline const ::google::cloud::speech::v1::RecognitionAudio& RecognizeRequest::_internal_audio() const { - const ::google::cloud::speech::v1::RecognitionAudio* p = audio_; - return p != nullptr ? *p : *reinterpret_cast( - &::google::cloud::speech::v1::_RecognitionAudio_default_instance_); -} -inline const ::google::cloud::speech::v1::RecognitionAudio& RecognizeRequest::audio() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.RecognizeRequest.audio) - return _internal_audio(); -} -inline ::google::cloud::speech::v1::RecognitionAudio* RecognizeRequest::release_audio() { - auto temp = unsafe_arena_release_audio(); - if (GetArenaNoVirtual() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } - return temp; -} -inline ::google::cloud::speech::v1::RecognitionAudio* RecognizeRequest::unsafe_arena_release_audio() { - // @@protoc_insertion_point(field_release:google.cloud.speech.v1.RecognizeRequest.audio) - - ::google::cloud::speech::v1::RecognitionAudio* temp = audio_; - audio_ = nullptr; - return temp; -} -inline ::google::cloud::speech::v1::RecognitionAudio* RecognizeRequest::_internal_mutable_audio() { - - if (audio_ == nullptr) { - auto* p = CreateMaybeMessage<::google::cloud::speech::v1::RecognitionAudio>(GetArenaNoVirtual()); - audio_ = p; - } - return audio_; -} -inline ::google::cloud::speech::v1::RecognitionAudio* RecognizeRequest::mutable_audio() { - // @@protoc_insertion_point(field_mutable:google.cloud.speech.v1.RecognizeRequest.audio) - return _internal_mutable_audio(); -} -inline void RecognizeRequest::set_allocated_audio(::google::cloud::speech::v1::RecognitionAudio* audio) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete audio_; - } - if (audio) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(audio); - if (message_arena != submessage_arena) { - audio = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, audio, submessage_arena); - } - - } else { - - } - audio_ = audio; - // @@protoc_insertion_point(field_set_allocated:google.cloud.speech.v1.RecognizeRequest.audio) -} - -// ------------------------------------------------------------------- - -// StreamingRecognizeRequest - -// .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; -inline bool StreamingRecognizeRequest::_internal_has_streaming_config() const { - return streaming_request_case() == kStreamingConfig; -} -inline bool StreamingRecognizeRequest::has_streaming_config() const { - return _internal_has_streaming_config(); -} -inline void StreamingRecognizeRequest::set_has_streaming_config() { - _oneof_case_[0] = kStreamingConfig; -} -inline void StreamingRecognizeRequest::clear_streaming_config() { - if (_internal_has_streaming_config()) { - if (GetArenaNoVirtual() == nullptr) { - delete streaming_request_.streaming_config_; - } - clear_has_streaming_request(); - } -} -inline ::google::cloud::speech::v1::StreamingRecognitionConfig* StreamingRecognizeRequest::release_streaming_config() { - // @@protoc_insertion_point(field_release:google.cloud.speech.v1.StreamingRecognizeRequest.streaming_config) - if (_internal_has_streaming_config()) { - clear_has_streaming_request(); - ::google::cloud::speech::v1::StreamingRecognitionConfig* temp = streaming_request_.streaming_config_; - if (GetArenaNoVirtual() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } - streaming_request_.streaming_config_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::google::cloud::speech::v1::StreamingRecognitionConfig& StreamingRecognizeRequest::_internal_streaming_config() const { - return _internal_has_streaming_config() - ? *streaming_request_.streaming_config_ - : *reinterpret_cast< ::google::cloud::speech::v1::StreamingRecognitionConfig*>(&::google::cloud::speech::v1::_StreamingRecognitionConfig_default_instance_); -} -inline const ::google::cloud::speech::v1::StreamingRecognitionConfig& StreamingRecognizeRequest::streaming_config() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.StreamingRecognizeRequest.streaming_config) - return _internal_streaming_config(); -} -inline ::google::cloud::speech::v1::StreamingRecognitionConfig* StreamingRecognizeRequest::unsafe_arena_release_streaming_config() { - // @@protoc_insertion_point(field_unsafe_arena_release:google.cloud.speech.v1.StreamingRecognizeRequest.streaming_config) - if (_internal_has_streaming_config()) { - clear_has_streaming_request(); - ::google::cloud::speech::v1::StreamingRecognitionConfig* temp = streaming_request_.streaming_config_; - streaming_request_.streaming_config_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline void StreamingRecognizeRequest::unsafe_arena_set_allocated_streaming_config(::google::cloud::speech::v1::StreamingRecognitionConfig* streaming_config) { - clear_streaming_request(); - if (streaming_config) { - set_has_streaming_config(); - streaming_request_.streaming_config_ = streaming_config; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.cloud.speech.v1.StreamingRecognizeRequest.streaming_config) -} -inline ::google::cloud::speech::v1::StreamingRecognitionConfig* StreamingRecognizeRequest::_internal_mutable_streaming_config() { - if (!_internal_has_streaming_config()) { - clear_streaming_request(); - set_has_streaming_config(); - streaming_request_.streaming_config_ = CreateMaybeMessage< ::google::cloud::speech::v1::StreamingRecognitionConfig >( - GetArenaNoVirtual()); - } - return streaming_request_.streaming_config_; -} -inline ::google::cloud::speech::v1::StreamingRecognitionConfig* StreamingRecognizeRequest::mutable_streaming_config() { - // @@protoc_insertion_point(field_mutable:google.cloud.speech.v1.StreamingRecognizeRequest.streaming_config) - return _internal_mutable_streaming_config(); -} - -// bytes audio_content = 2; -inline bool StreamingRecognizeRequest::_internal_has_audio_content() const { - return streaming_request_case() == kAudioContent; -} -inline void StreamingRecognizeRequest::set_has_audio_content() { - _oneof_case_[0] = kAudioContent; -} -inline void StreamingRecognizeRequest::clear_audio_content() { - if (_internal_has_audio_content()) { - streaming_request_.audio_content_.Destroy(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - clear_has_streaming_request(); - } -} -inline const std::string& StreamingRecognizeRequest::audio_content() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.StreamingRecognizeRequest.audio_content) - return _internal_audio_content(); -} -inline void StreamingRecognizeRequest::set_audio_content(const std::string& value) { - _internal_set_audio_content(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.StreamingRecognizeRequest.audio_content) -} -inline std::string* StreamingRecognizeRequest::mutable_audio_content() { - // @@protoc_insertion_point(field_mutable:google.cloud.speech.v1.StreamingRecognizeRequest.audio_content) - return _internal_mutable_audio_content(); -} -inline const std::string& StreamingRecognizeRequest::_internal_audio_content() const { - if (_internal_has_audio_content()) { - return streaming_request_.audio_content_.Get(); - } - return *&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(); -} -inline void StreamingRecognizeRequest::_internal_set_audio_content(const std::string& value) { - if (!_internal_has_audio_content()) { - clear_streaming_request(); - set_has_audio_content(); - streaming_request_.audio_content_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - } - streaming_request_.audio_content_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, - GetArenaNoVirtual()); -} -inline void StreamingRecognizeRequest::set_audio_content(std::string&& value) { - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.StreamingRecognizeRequest.audio_content) - if (!_internal_has_audio_content()) { - clear_streaming_request(); - set_has_audio_content(); - streaming_request_.audio_content_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - } - streaming_request_.audio_content_.Set( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_rvalue:google.cloud.speech.v1.StreamingRecognizeRequest.audio_content) -} -inline void StreamingRecognizeRequest::set_audio_content(const char* value) { - GOOGLE_DCHECK(value != nullptr); - if (!_internal_has_audio_content()) { - clear_streaming_request(); - set_has_audio_content(); - streaming_request_.audio_content_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - } - streaming_request_.audio_content_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(value), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_char:google.cloud.speech.v1.StreamingRecognizeRequest.audio_content) -} -inline void StreamingRecognizeRequest::set_audio_content(const void* value, - size_t size) { - if (!_internal_has_audio_content()) { - clear_streaming_request(); - set_has_audio_content(); - streaming_request_.audio_content_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - } - streaming_request_.audio_content_.Set( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( - reinterpret_cast(value), size), - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_pointer:google.cloud.speech.v1.StreamingRecognizeRequest.audio_content) -} -inline std::string* StreamingRecognizeRequest::_internal_mutable_audio_content() { - if (!_internal_has_audio_content()) { - clear_streaming_request(); - set_has_audio_content(); - streaming_request_.audio_content_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - } - return streaming_request_.audio_content_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} -inline std::string* StreamingRecognizeRequest::release_audio_content() { - // @@protoc_insertion_point(field_release:google.cloud.speech.v1.StreamingRecognizeRequest.audio_content) - if (_internal_has_audio_content()) { - clear_has_streaming_request(); - return streaming_request_.audio_content_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - } else { - return nullptr; - } -} -inline void StreamingRecognizeRequest::set_allocated_audio_content(std::string* audio_content) { - if (has_streaming_request()) { - clear_streaming_request(); - } - if (audio_content != nullptr) { - set_has_audio_content(); - streaming_request_.audio_content_.UnsafeSetDefault(audio_content); - } - // @@protoc_insertion_point(field_set_allocated:google.cloud.speech.v1.StreamingRecognizeRequest.audio_content) -} -inline std::string* StreamingRecognizeRequest::unsafe_arena_release_audio_content() { - // @@protoc_insertion_point(field_unsafe_arena_release:google.cloud.speech.v1.StreamingRecognizeRequest.audio_content) - GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); - if (_internal_has_audio_content()) { - clear_has_streaming_request(); - return streaming_request_.audio_content_.UnsafeArenaRelease( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); - } else { - return nullptr; - } -} -inline void StreamingRecognizeRequest::unsafe_arena_set_allocated_audio_content(std::string* audio_content) { - GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); - if (!_internal_has_audio_content()) { - streaming_request_.audio_content_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - } - clear_streaming_request(); - if (audio_content) { - set_has_audio_content(); - streaming_request_.audio_content_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), audio_content, GetArenaNoVirtual()); - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.cloud.speech.v1.StreamingRecognizeRequest.audio_content) -} - -inline bool StreamingRecognizeRequest::has_streaming_request() const { - return streaming_request_case() != STREAMING_REQUEST_NOT_SET; -} -inline void StreamingRecognizeRequest::clear_has_streaming_request() { - _oneof_case_[0] = STREAMING_REQUEST_NOT_SET; -} -inline StreamingRecognizeRequest::StreamingRequestCase StreamingRecognizeRequest::streaming_request_case() const { - return StreamingRecognizeRequest::StreamingRequestCase(_oneof_case_[0]); -} -// ------------------------------------------------------------------- - -// StreamingRecognitionConfig - -// .google.cloud.speech.v1.RecognitionConfig config = 1; -inline bool StreamingRecognitionConfig::_internal_has_config() const { - return this != internal_default_instance() && config_ != nullptr; -} -inline bool StreamingRecognitionConfig::has_config() const { - return _internal_has_config(); -} -inline void StreamingRecognitionConfig::clear_config() { - if (GetArenaNoVirtual() == nullptr && config_ != nullptr) { - delete config_; - } - config_ = nullptr; -} -inline const ::google::cloud::speech::v1::RecognitionConfig& StreamingRecognitionConfig::_internal_config() const { - const ::google::cloud::speech::v1::RecognitionConfig* p = config_; - return p != nullptr ? *p : *reinterpret_cast( - &::google::cloud::speech::v1::_RecognitionConfig_default_instance_); -} -inline const ::google::cloud::speech::v1::RecognitionConfig& StreamingRecognitionConfig::config() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.StreamingRecognitionConfig.config) - return _internal_config(); -} -inline ::google::cloud::speech::v1::RecognitionConfig* StreamingRecognitionConfig::release_config() { - auto temp = unsafe_arena_release_config(); - if (GetArenaNoVirtual() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } - return temp; -} -inline ::google::cloud::speech::v1::RecognitionConfig* StreamingRecognitionConfig::unsafe_arena_release_config() { - // @@protoc_insertion_point(field_release:google.cloud.speech.v1.StreamingRecognitionConfig.config) - - ::google::cloud::speech::v1::RecognitionConfig* temp = config_; - config_ = nullptr; - return temp; -} -inline ::google::cloud::speech::v1::RecognitionConfig* StreamingRecognitionConfig::_internal_mutable_config() { - - if (config_ == nullptr) { - auto* p = CreateMaybeMessage<::google::cloud::speech::v1::RecognitionConfig>(GetArenaNoVirtual()); - config_ = p; - } - return config_; -} -inline ::google::cloud::speech::v1::RecognitionConfig* StreamingRecognitionConfig::mutable_config() { - // @@protoc_insertion_point(field_mutable:google.cloud.speech.v1.StreamingRecognitionConfig.config) - return _internal_mutable_config(); -} -inline void StreamingRecognitionConfig::set_allocated_config(::google::cloud::speech::v1::RecognitionConfig* config) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete config_; - } - if (config) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(config); - if (message_arena != submessage_arena) { - config = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, config, submessage_arena); - } - - } else { - - } - config_ = config; - // @@protoc_insertion_point(field_set_allocated:google.cloud.speech.v1.StreamingRecognitionConfig.config) -} - -// bool single_utterance = 2; -inline void StreamingRecognitionConfig::clear_single_utterance() { - single_utterance_ = false; -} -inline bool StreamingRecognitionConfig::_internal_single_utterance() const { - return single_utterance_; -} -inline bool StreamingRecognitionConfig::single_utterance() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.StreamingRecognitionConfig.single_utterance) - return _internal_single_utterance(); -} -inline void StreamingRecognitionConfig::_internal_set_single_utterance(bool value) { - - single_utterance_ = value; -} -inline void StreamingRecognitionConfig::set_single_utterance(bool value) { - _internal_set_single_utterance(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.StreamingRecognitionConfig.single_utterance) -} - -// bool interim_results = 3; -inline void StreamingRecognitionConfig::clear_interim_results() { - interim_results_ = false; -} -inline bool StreamingRecognitionConfig::_internal_interim_results() const { - return interim_results_; -} -inline bool StreamingRecognitionConfig::interim_results() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.StreamingRecognitionConfig.interim_results) - return _internal_interim_results(); -} -inline void StreamingRecognitionConfig::_internal_set_interim_results(bool value) { - - interim_results_ = value; -} -inline void StreamingRecognitionConfig::set_interim_results(bool value) { - _internal_set_interim_results(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.StreamingRecognitionConfig.interim_results) -} - -// ------------------------------------------------------------------- - -// RecognitionConfig - -// .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; -inline void RecognitionConfig::clear_encoding() { - encoding_ = 0; -} -inline ::google::cloud::speech::v1::RecognitionConfig_AudioEncoding RecognitionConfig::_internal_encoding() const { - return static_cast< ::google::cloud::speech::v1::RecognitionConfig_AudioEncoding >(encoding_); -} -inline ::google::cloud::speech::v1::RecognitionConfig_AudioEncoding RecognitionConfig::encoding() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.RecognitionConfig.encoding) - return _internal_encoding(); -} -inline void RecognitionConfig::_internal_set_encoding(::google::cloud::speech::v1::RecognitionConfig_AudioEncoding value) { - - encoding_ = value; -} -inline void RecognitionConfig::set_encoding(::google::cloud::speech::v1::RecognitionConfig_AudioEncoding value) { - _internal_set_encoding(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.RecognitionConfig.encoding) -} - -// int32 sample_rate_hertz = 2; -inline void RecognitionConfig::clear_sample_rate_hertz() { - sample_rate_hertz_ = 0; -} -inline ::PROTOBUF_NAMESPACE_ID::int32 RecognitionConfig::_internal_sample_rate_hertz() const { - return sample_rate_hertz_; -} -inline ::PROTOBUF_NAMESPACE_ID::int32 RecognitionConfig::sample_rate_hertz() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.RecognitionConfig.sample_rate_hertz) - return _internal_sample_rate_hertz(); -} -inline void RecognitionConfig::_internal_set_sample_rate_hertz(::PROTOBUF_NAMESPACE_ID::int32 value) { - - sample_rate_hertz_ = value; -} -inline void RecognitionConfig::set_sample_rate_hertz(::PROTOBUF_NAMESPACE_ID::int32 value) { - _internal_set_sample_rate_hertz(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.RecognitionConfig.sample_rate_hertz) -} - -// string language_code = 3; -inline void RecognitionConfig::clear_language_code() { - language_code_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -inline const std::string& RecognitionConfig::language_code() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.RecognitionConfig.language_code) - return _internal_language_code(); -} -inline void RecognitionConfig::set_language_code(const std::string& value) { - _internal_set_language_code(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.RecognitionConfig.language_code) -} -inline std::string* RecognitionConfig::mutable_language_code() { - // @@protoc_insertion_point(field_mutable:google.cloud.speech.v1.RecognitionConfig.language_code) - return _internal_mutable_language_code(); -} -inline const std::string& RecognitionConfig::_internal_language_code() const { - return language_code_.Get(); -} -inline void RecognitionConfig::_internal_set_language_code(const std::string& value) { - - language_code_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); -} -inline void RecognitionConfig::set_language_code(std::string&& value) { - - language_code_.Set( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_rvalue:google.cloud.speech.v1.RecognitionConfig.language_code) -} -inline void RecognitionConfig::set_language_code(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - language_code_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_char:google.cloud.speech.v1.RecognitionConfig.language_code) -} -inline void RecognitionConfig::set_language_code(const char* value, - size_t size) { - - language_code_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( - reinterpret_cast(value), size), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_pointer:google.cloud.speech.v1.RecognitionConfig.language_code) -} -inline std::string* RecognitionConfig::_internal_mutable_language_code() { - - return language_code_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -inline std::string* RecognitionConfig::release_language_code() { - // @@protoc_insertion_point(field_release:google.cloud.speech.v1.RecognitionConfig.language_code) - - return language_code_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -inline void RecognitionConfig::set_allocated_language_code(std::string* language_code) { - if (language_code != nullptr) { - - } else { - - } - language_code_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), language_code, - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_allocated:google.cloud.speech.v1.RecognitionConfig.language_code) -} -inline std::string* RecognitionConfig::unsafe_arena_release_language_code() { - // @@protoc_insertion_point(field_unsafe_arena_release:google.cloud.speech.v1.RecognitionConfig.language_code) - GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); - - return language_code_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} -inline void RecognitionConfig::unsafe_arena_set_allocated_language_code( - std::string* language_code) { - GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); - if (language_code != nullptr) { - - } else { - - } - language_code_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - language_code, GetArenaNoVirtual()); - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.cloud.speech.v1.RecognitionConfig.language_code) -} - -// int32 max_alternatives = 4; -inline void RecognitionConfig::clear_max_alternatives() { - max_alternatives_ = 0; -} -inline ::PROTOBUF_NAMESPACE_ID::int32 RecognitionConfig::_internal_max_alternatives() const { - return max_alternatives_; -} -inline ::PROTOBUF_NAMESPACE_ID::int32 RecognitionConfig::max_alternatives() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.RecognitionConfig.max_alternatives) - return _internal_max_alternatives(); -} -inline void RecognitionConfig::_internal_set_max_alternatives(::PROTOBUF_NAMESPACE_ID::int32 value) { - - max_alternatives_ = value; -} -inline void RecognitionConfig::set_max_alternatives(::PROTOBUF_NAMESPACE_ID::int32 value) { - _internal_set_max_alternatives(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.RecognitionConfig.max_alternatives) -} - -// bool profanity_filter = 5; -inline void RecognitionConfig::clear_profanity_filter() { - profanity_filter_ = false; -} -inline bool RecognitionConfig::_internal_profanity_filter() const { - return profanity_filter_; -} -inline bool RecognitionConfig::profanity_filter() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.RecognitionConfig.profanity_filter) - return _internal_profanity_filter(); -} -inline void RecognitionConfig::_internal_set_profanity_filter(bool value) { - - profanity_filter_ = value; -} -inline void RecognitionConfig::set_profanity_filter(bool value) { - _internal_set_profanity_filter(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.RecognitionConfig.profanity_filter) -} - -// repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; -inline int RecognitionConfig::_internal_speech_contexts_size() const { - return speech_contexts_.size(); -} -inline int RecognitionConfig::speech_contexts_size() const { - return _internal_speech_contexts_size(); -} -inline void RecognitionConfig::clear_speech_contexts() { - speech_contexts_.Clear(); -} -inline ::google::cloud::speech::v1::SpeechContext* RecognitionConfig::mutable_speech_contexts(int index) { - // @@protoc_insertion_point(field_mutable:google.cloud.speech.v1.RecognitionConfig.speech_contexts) - return speech_contexts_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::SpeechContext >* -RecognitionConfig::mutable_speech_contexts() { - // @@protoc_insertion_point(field_mutable_list:google.cloud.speech.v1.RecognitionConfig.speech_contexts) - return &speech_contexts_; -} -inline const ::google::cloud::speech::v1::SpeechContext& RecognitionConfig::_internal_speech_contexts(int index) const { - return speech_contexts_.Get(index); -} -inline const ::google::cloud::speech::v1::SpeechContext& RecognitionConfig::speech_contexts(int index) const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.RecognitionConfig.speech_contexts) - return _internal_speech_contexts(index); -} -inline ::google::cloud::speech::v1::SpeechContext* RecognitionConfig::_internal_add_speech_contexts() { - return speech_contexts_.Add(); -} -inline ::google::cloud::speech::v1::SpeechContext* RecognitionConfig::add_speech_contexts() { - // @@protoc_insertion_point(field_add:google.cloud.speech.v1.RecognitionConfig.speech_contexts) - return _internal_add_speech_contexts(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::SpeechContext >& -RecognitionConfig::speech_contexts() const { - // @@protoc_insertion_point(field_list:google.cloud.speech.v1.RecognitionConfig.speech_contexts) - return speech_contexts_; -} - -// bool enable_word_time_offsets = 8; -inline void RecognitionConfig::clear_enable_word_time_offsets() { - enable_word_time_offsets_ = false; -} -inline bool RecognitionConfig::_internal_enable_word_time_offsets() const { - return enable_word_time_offsets_; -} -inline bool RecognitionConfig::enable_word_time_offsets() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.RecognitionConfig.enable_word_time_offsets) - return _internal_enable_word_time_offsets(); -} -inline void RecognitionConfig::_internal_set_enable_word_time_offsets(bool value) { - - enable_word_time_offsets_ = value; -} -inline void RecognitionConfig::set_enable_word_time_offsets(bool value) { - _internal_set_enable_word_time_offsets(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.RecognitionConfig.enable_word_time_offsets) -} - -// bool enable_automatic_punctuation = 11; -inline void RecognitionConfig::clear_enable_automatic_punctuation() { - enable_automatic_punctuation_ = false; -} -inline bool RecognitionConfig::_internal_enable_automatic_punctuation() const { - return enable_automatic_punctuation_; -} -inline bool RecognitionConfig::enable_automatic_punctuation() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.RecognitionConfig.enable_automatic_punctuation) - return _internal_enable_automatic_punctuation(); -} -inline void RecognitionConfig::_internal_set_enable_automatic_punctuation(bool value) { - - enable_automatic_punctuation_ = value; -} -inline void RecognitionConfig::set_enable_automatic_punctuation(bool value) { - _internal_set_enable_automatic_punctuation(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.RecognitionConfig.enable_automatic_punctuation) -} - -// repeated .google.cloud.speech.v1.ConfigField config_fields = 12; -inline int RecognitionConfig::_internal_config_fields_size() const { - return config_fields_.size(); -} -inline int RecognitionConfig::config_fields_size() const { - return _internal_config_fields_size(); -} -inline void RecognitionConfig::clear_config_fields() { - config_fields_.Clear(); -} -inline ::google::cloud::speech::v1::ConfigField* RecognitionConfig::mutable_config_fields(int index) { - // @@protoc_insertion_point(field_mutable:google.cloud.speech.v1.RecognitionConfig.config_fields) - return config_fields_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::ConfigField >* -RecognitionConfig::mutable_config_fields() { - // @@protoc_insertion_point(field_mutable_list:google.cloud.speech.v1.RecognitionConfig.config_fields) - return &config_fields_; -} -inline const ::google::cloud::speech::v1::ConfigField& RecognitionConfig::_internal_config_fields(int index) const { - return config_fields_.Get(index); -} -inline const ::google::cloud::speech::v1::ConfigField& RecognitionConfig::config_fields(int index) const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.RecognitionConfig.config_fields) - return _internal_config_fields(index); -} -inline ::google::cloud::speech::v1::ConfigField* RecognitionConfig::_internal_add_config_fields() { - return config_fields_.Add(); -} -inline ::google::cloud::speech::v1::ConfigField* RecognitionConfig::add_config_fields() { - // @@protoc_insertion_point(field_add:google.cloud.speech.v1.RecognitionConfig.config_fields) - return _internal_add_config_fields(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::ConfigField >& -RecognitionConfig::config_fields() const { - // @@protoc_insertion_point(field_list:google.cloud.speech.v1.RecognitionConfig.config_fields) - return config_fields_; -} - -// string model = 13; -inline void RecognitionConfig::clear_model() { - model_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -inline const std::string& RecognitionConfig::model() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.RecognitionConfig.model) - return _internal_model(); -} -inline void RecognitionConfig::set_model(const std::string& value) { - _internal_set_model(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.RecognitionConfig.model) -} -inline std::string* RecognitionConfig::mutable_model() { - // @@protoc_insertion_point(field_mutable:google.cloud.speech.v1.RecognitionConfig.model) - return _internal_mutable_model(); -} -inline const std::string& RecognitionConfig::_internal_model() const { - return model_.Get(); -} -inline void RecognitionConfig::_internal_set_model(const std::string& value) { - - model_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); -} -inline void RecognitionConfig::set_model(std::string&& value) { - - model_.Set( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_rvalue:google.cloud.speech.v1.RecognitionConfig.model) -} -inline void RecognitionConfig::set_model(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - model_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_char:google.cloud.speech.v1.RecognitionConfig.model) -} -inline void RecognitionConfig::set_model(const char* value, - size_t size) { - - model_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( - reinterpret_cast(value), size), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_pointer:google.cloud.speech.v1.RecognitionConfig.model) -} -inline std::string* RecognitionConfig::_internal_mutable_model() { - - return model_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -inline std::string* RecognitionConfig::release_model() { - // @@protoc_insertion_point(field_release:google.cloud.speech.v1.RecognitionConfig.model) - - return model_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -inline void RecognitionConfig::set_allocated_model(std::string* model) { - if (model != nullptr) { - - } else { - - } - model_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), model, - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_allocated:google.cloud.speech.v1.RecognitionConfig.model) -} -inline std::string* RecognitionConfig::unsafe_arena_release_model() { - // @@protoc_insertion_point(field_unsafe_arena_release:google.cloud.speech.v1.RecognitionConfig.model) - GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); - - return model_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} -inline void RecognitionConfig::unsafe_arena_set_allocated_model( - std::string* model) { - GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); - if (model != nullptr) { - - } else { - - } - model_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - model, GetArenaNoVirtual()); - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.cloud.speech.v1.RecognitionConfig.model) -} - -// bool use_enhanced = 14; -inline void RecognitionConfig::clear_use_enhanced() { - use_enhanced_ = false; -} -inline bool RecognitionConfig::_internal_use_enhanced() const { - return use_enhanced_; -} -inline bool RecognitionConfig::use_enhanced() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.RecognitionConfig.use_enhanced) - return _internal_use_enhanced(); -} -inline void RecognitionConfig::_internal_set_use_enhanced(bool value) { - - use_enhanced_ = value; -} -inline void RecognitionConfig::set_use_enhanced(bool value) { - _internal_set_use_enhanced(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.RecognitionConfig.use_enhanced) -} - -// ------------------------------------------------------------------- - -// SpeechContext - -// repeated string phrases = 1; -inline int SpeechContext::_internal_phrases_size() const { - return phrases_.size(); -} -inline int SpeechContext::phrases_size() const { - return _internal_phrases_size(); -} -inline void SpeechContext::clear_phrases() { - phrases_.Clear(); -} -inline std::string* SpeechContext::add_phrases() { - // @@protoc_insertion_point(field_add_mutable:google.cloud.speech.v1.SpeechContext.phrases) - return _internal_add_phrases(); -} -inline const std::string& SpeechContext::_internal_phrases(int index) const { - return phrases_.Get(index); -} -inline const std::string& SpeechContext::phrases(int index) const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.SpeechContext.phrases) - return _internal_phrases(index); -} -inline std::string* SpeechContext::mutable_phrases(int index) { - // @@protoc_insertion_point(field_mutable:google.cloud.speech.v1.SpeechContext.phrases) - return phrases_.Mutable(index); -} -inline void SpeechContext::set_phrases(int index, const std::string& value) { - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.SpeechContext.phrases) - phrases_.Mutable(index)->assign(value); -} -inline void SpeechContext::set_phrases(int index, std::string&& value) { - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.SpeechContext.phrases) - phrases_.Mutable(index)->assign(std::move(value)); -} -inline void SpeechContext::set_phrases(int index, const char* value) { - GOOGLE_DCHECK(value != nullptr); - phrases_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:google.cloud.speech.v1.SpeechContext.phrases) -} -inline void SpeechContext::set_phrases(int index, const char* value, size_t size) { - phrases_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:google.cloud.speech.v1.SpeechContext.phrases) -} -inline std::string* SpeechContext::_internal_add_phrases() { - return phrases_.Add(); -} -inline void SpeechContext::add_phrases(const std::string& value) { - phrases_.Add()->assign(value); - // @@protoc_insertion_point(field_add:google.cloud.speech.v1.SpeechContext.phrases) -} -inline void SpeechContext::add_phrases(std::string&& value) { - phrases_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:google.cloud.speech.v1.SpeechContext.phrases) -} -inline void SpeechContext::add_phrases(const char* value) { - GOOGLE_DCHECK(value != nullptr); - phrases_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:google.cloud.speech.v1.SpeechContext.phrases) -} -inline void SpeechContext::add_phrases(const char* value, size_t size) { - phrases_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:google.cloud.speech.v1.SpeechContext.phrases) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -SpeechContext::phrases() const { - // @@protoc_insertion_point(field_list:google.cloud.speech.v1.SpeechContext.phrases) - return phrases_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -SpeechContext::mutable_phrases() { - // @@protoc_insertion_point(field_mutable_list:google.cloud.speech.v1.SpeechContext.phrases) - return &phrases_; -} - -// ------------------------------------------------------------------- - -// ConfigField - -// string key = 1; -inline void ConfigField::clear_key() { - key_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -inline const std::string& ConfigField::key() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.ConfigField.key) - return _internal_key(); -} -inline void ConfigField::set_key(const std::string& value) { - _internal_set_key(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.ConfigField.key) -} -inline std::string* ConfigField::mutable_key() { - // @@protoc_insertion_point(field_mutable:google.cloud.speech.v1.ConfigField.key) - return _internal_mutable_key(); -} -inline const std::string& ConfigField::_internal_key() const { - return key_.Get(); -} -inline void ConfigField::_internal_set_key(const std::string& value) { - - key_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); -} -inline void ConfigField::set_key(std::string&& value) { - - key_.Set( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_rvalue:google.cloud.speech.v1.ConfigField.key) -} -inline void ConfigField::set_key(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - key_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_char:google.cloud.speech.v1.ConfigField.key) -} -inline void ConfigField::set_key(const char* value, - size_t size) { - - key_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( - reinterpret_cast(value), size), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_pointer:google.cloud.speech.v1.ConfigField.key) -} -inline std::string* ConfigField::_internal_mutable_key() { - - return key_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -inline std::string* ConfigField::release_key() { - // @@protoc_insertion_point(field_release:google.cloud.speech.v1.ConfigField.key) - - return key_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -inline void ConfigField::set_allocated_key(std::string* key) { - if (key != nullptr) { - - } else { - - } - key_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), key, - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_allocated:google.cloud.speech.v1.ConfigField.key) -} -inline std::string* ConfigField::unsafe_arena_release_key() { - // @@protoc_insertion_point(field_unsafe_arena_release:google.cloud.speech.v1.ConfigField.key) - GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); - - return key_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} -inline void ConfigField::unsafe_arena_set_allocated_key( - std::string* key) { - GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); - if (key != nullptr) { - - } else { - - } - key_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - key, GetArenaNoVirtual()); - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.cloud.speech.v1.ConfigField.key) -} - -// string value = 2; -inline void ConfigField::clear_value() { - value_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -inline const std::string& ConfigField::value() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.ConfigField.value) - return _internal_value(); -} -inline void ConfigField::set_value(const std::string& value) { - _internal_set_value(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.ConfigField.value) -} -inline std::string* ConfigField::mutable_value() { - // @@protoc_insertion_point(field_mutable:google.cloud.speech.v1.ConfigField.value) - return _internal_mutable_value(); -} -inline const std::string& ConfigField::_internal_value() const { - return value_.Get(); -} -inline void ConfigField::_internal_set_value(const std::string& value) { - - value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); -} -inline void ConfigField::set_value(std::string&& value) { - - value_.Set( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_rvalue:google.cloud.speech.v1.ConfigField.value) -} -inline void ConfigField::set_value(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_char:google.cloud.speech.v1.ConfigField.value) -} -inline void ConfigField::set_value(const char* value, - size_t size) { - - value_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( - reinterpret_cast(value), size), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_pointer:google.cloud.speech.v1.ConfigField.value) -} -inline std::string* ConfigField::_internal_mutable_value() { - - return value_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -inline std::string* ConfigField::release_value() { - // @@protoc_insertion_point(field_release:google.cloud.speech.v1.ConfigField.value) - - return value_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -inline void ConfigField::set_allocated_value(std::string* value) { - if (value != nullptr) { - - } else { - - } - value_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_allocated:google.cloud.speech.v1.ConfigField.value) -} -inline std::string* ConfigField::unsafe_arena_release_value() { - // @@protoc_insertion_point(field_unsafe_arena_release:google.cloud.speech.v1.ConfigField.value) - GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); - - return value_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} -inline void ConfigField::unsafe_arena_set_allocated_value( - std::string* value) { - GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); - if (value != nullptr) { - - } else { - - } - value_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - value, GetArenaNoVirtual()); - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.cloud.speech.v1.ConfigField.value) -} - -// ------------------------------------------------------------------- - -// RecognitionAudio - -// bytes content = 1; -inline bool RecognitionAudio::_internal_has_content() const { - return audio_source_case() == kContent; -} -inline void RecognitionAudio::set_has_content() { - _oneof_case_[0] = kContent; -} -inline void RecognitionAudio::clear_content() { - if (_internal_has_content()) { - audio_source_.content_.Destroy(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - clear_has_audio_source(); - } -} -inline const std::string& RecognitionAudio::content() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.RecognitionAudio.content) - return _internal_content(); -} -inline void RecognitionAudio::set_content(const std::string& value) { - _internal_set_content(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.RecognitionAudio.content) -} -inline std::string* RecognitionAudio::mutable_content() { - // @@protoc_insertion_point(field_mutable:google.cloud.speech.v1.RecognitionAudio.content) - return _internal_mutable_content(); -} -inline const std::string& RecognitionAudio::_internal_content() const { - if (_internal_has_content()) { - return audio_source_.content_.Get(); - } - return *&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(); -} -inline void RecognitionAudio::_internal_set_content(const std::string& value) { - if (!_internal_has_content()) { - clear_audio_source(); - set_has_content(); - audio_source_.content_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - } - audio_source_.content_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, - GetArenaNoVirtual()); -} -inline void RecognitionAudio::set_content(std::string&& value) { - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.RecognitionAudio.content) - if (!_internal_has_content()) { - clear_audio_source(); - set_has_content(); - audio_source_.content_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - } - audio_source_.content_.Set( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_rvalue:google.cloud.speech.v1.RecognitionAudio.content) -} -inline void RecognitionAudio::set_content(const char* value) { - GOOGLE_DCHECK(value != nullptr); - if (!_internal_has_content()) { - clear_audio_source(); - set_has_content(); - audio_source_.content_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - } - audio_source_.content_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(value), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_char:google.cloud.speech.v1.RecognitionAudio.content) -} -inline void RecognitionAudio::set_content(const void* value, - size_t size) { - if (!_internal_has_content()) { - clear_audio_source(); - set_has_content(); - audio_source_.content_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - } - audio_source_.content_.Set( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( - reinterpret_cast(value), size), - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_pointer:google.cloud.speech.v1.RecognitionAudio.content) -} -inline std::string* RecognitionAudio::_internal_mutable_content() { - if (!_internal_has_content()) { - clear_audio_source(); - set_has_content(); - audio_source_.content_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - } - return audio_source_.content_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} -inline std::string* RecognitionAudio::release_content() { - // @@protoc_insertion_point(field_release:google.cloud.speech.v1.RecognitionAudio.content) - if (_internal_has_content()) { - clear_has_audio_source(); - return audio_source_.content_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - } else { - return nullptr; - } -} -inline void RecognitionAudio::set_allocated_content(std::string* content) { - if (has_audio_source()) { - clear_audio_source(); - } - if (content != nullptr) { - set_has_content(); - audio_source_.content_.UnsafeSetDefault(content); - } - // @@protoc_insertion_point(field_set_allocated:google.cloud.speech.v1.RecognitionAudio.content) -} -inline std::string* RecognitionAudio::unsafe_arena_release_content() { - // @@protoc_insertion_point(field_unsafe_arena_release:google.cloud.speech.v1.RecognitionAudio.content) - GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); - if (_internal_has_content()) { - clear_has_audio_source(); - return audio_source_.content_.UnsafeArenaRelease( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); - } else { - return nullptr; - } -} -inline void RecognitionAudio::unsafe_arena_set_allocated_content(std::string* content) { - GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); - if (!_internal_has_content()) { - audio_source_.content_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - } - clear_audio_source(); - if (content) { - set_has_content(); - audio_source_.content_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), content, GetArenaNoVirtual()); - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.cloud.speech.v1.RecognitionAudio.content) -} - -// string uri = 2; -inline bool RecognitionAudio::_internal_has_uri() const { - return audio_source_case() == kUri; -} -inline void RecognitionAudio::set_has_uri() { - _oneof_case_[0] = kUri; -} -inline void RecognitionAudio::clear_uri() { - if (_internal_has_uri()) { - audio_source_.uri_.Destroy(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - clear_has_audio_source(); - } -} -inline const std::string& RecognitionAudio::uri() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.RecognitionAudio.uri) - return _internal_uri(); -} -inline void RecognitionAudio::set_uri(const std::string& value) { - _internal_set_uri(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.RecognitionAudio.uri) -} -inline std::string* RecognitionAudio::mutable_uri() { - // @@protoc_insertion_point(field_mutable:google.cloud.speech.v1.RecognitionAudio.uri) - return _internal_mutable_uri(); -} -inline const std::string& RecognitionAudio::_internal_uri() const { - if (_internal_has_uri()) { - return audio_source_.uri_.Get(); - } - return *&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(); -} -inline void RecognitionAudio::_internal_set_uri(const std::string& value) { - if (!_internal_has_uri()) { - clear_audio_source(); - set_has_uri(); - audio_source_.uri_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - } - audio_source_.uri_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, - GetArenaNoVirtual()); -} -inline void RecognitionAudio::set_uri(std::string&& value) { - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.RecognitionAudio.uri) - if (!_internal_has_uri()) { - clear_audio_source(); - set_has_uri(); - audio_source_.uri_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - } - audio_source_.uri_.Set( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_rvalue:google.cloud.speech.v1.RecognitionAudio.uri) -} -inline void RecognitionAudio::set_uri(const char* value) { - GOOGLE_DCHECK(value != nullptr); - if (!_internal_has_uri()) { - clear_audio_source(); - set_has_uri(); - audio_source_.uri_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - } - audio_source_.uri_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - ::std::string(value), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_char:google.cloud.speech.v1.RecognitionAudio.uri) -} -inline void RecognitionAudio::set_uri(const char* value, - size_t size) { - if (!_internal_has_uri()) { - clear_audio_source(); - set_has_uri(); - audio_source_.uri_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - } - audio_source_.uri_.Set( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( - reinterpret_cast(value), size), - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_pointer:google.cloud.speech.v1.RecognitionAudio.uri) -} -inline std::string* RecognitionAudio::_internal_mutable_uri() { - if (!_internal_has_uri()) { - clear_audio_source(); - set_has_uri(); - audio_source_.uri_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - } - return audio_source_.uri_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} -inline std::string* RecognitionAudio::release_uri() { - // @@protoc_insertion_point(field_release:google.cloud.speech.v1.RecognitionAudio.uri) - if (_internal_has_uri()) { - clear_has_audio_source(); - return audio_source_.uri_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - } else { - return nullptr; - } -} -inline void RecognitionAudio::set_allocated_uri(std::string* uri) { - if (has_audio_source()) { - clear_audio_source(); - } - if (uri != nullptr) { - set_has_uri(); - audio_source_.uri_.UnsafeSetDefault(uri); - } - // @@protoc_insertion_point(field_set_allocated:google.cloud.speech.v1.RecognitionAudio.uri) -} -inline std::string* RecognitionAudio::unsafe_arena_release_uri() { - // @@protoc_insertion_point(field_unsafe_arena_release:google.cloud.speech.v1.RecognitionAudio.uri) - GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); - if (_internal_has_uri()) { - clear_has_audio_source(); - return audio_source_.uri_.UnsafeArenaRelease( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); - } else { - return nullptr; - } -} -inline void RecognitionAudio::unsafe_arena_set_allocated_uri(std::string* uri) { - GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); - if (!_internal_has_uri()) { - audio_source_.uri_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - } - clear_audio_source(); - if (uri) { - set_has_uri(); - audio_source_.uri_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), uri, GetArenaNoVirtual()); - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.cloud.speech.v1.RecognitionAudio.uri) -} - -inline bool RecognitionAudio::has_audio_source() const { - return audio_source_case() != AUDIO_SOURCE_NOT_SET; -} -inline void RecognitionAudio::clear_has_audio_source() { - _oneof_case_[0] = AUDIO_SOURCE_NOT_SET; -} -inline RecognitionAudio::AudioSourceCase RecognitionAudio::audio_source_case() const { - return RecognitionAudio::AudioSourceCase(_oneof_case_[0]); -} -// ------------------------------------------------------------------- - -// RecognizeResponse - -// repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; -inline int RecognizeResponse::_internal_results_size() const { - return results_.size(); -} -inline int RecognizeResponse::results_size() const { - return _internal_results_size(); -} -inline void RecognizeResponse::clear_results() { - results_.Clear(); -} -inline ::google::cloud::speech::v1::SpeechRecognitionResult* RecognizeResponse::mutable_results(int index) { - // @@protoc_insertion_point(field_mutable:google.cloud.speech.v1.RecognizeResponse.results) - return results_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::SpeechRecognitionResult >* -RecognizeResponse::mutable_results() { - // @@protoc_insertion_point(field_mutable_list:google.cloud.speech.v1.RecognizeResponse.results) - return &results_; -} -inline const ::google::cloud::speech::v1::SpeechRecognitionResult& RecognizeResponse::_internal_results(int index) const { - return results_.Get(index); -} -inline const ::google::cloud::speech::v1::SpeechRecognitionResult& RecognizeResponse::results(int index) const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.RecognizeResponse.results) - return _internal_results(index); -} -inline ::google::cloud::speech::v1::SpeechRecognitionResult* RecognizeResponse::_internal_add_results() { - return results_.Add(); -} -inline ::google::cloud::speech::v1::SpeechRecognitionResult* RecognizeResponse::add_results() { - // @@protoc_insertion_point(field_add:google.cloud.speech.v1.RecognizeResponse.results) - return _internal_add_results(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::SpeechRecognitionResult >& -RecognizeResponse::results() const { - // @@protoc_insertion_point(field_list:google.cloud.speech.v1.RecognizeResponse.results) - return results_; -} - -// ------------------------------------------------------------------- - -// StreamingRecognizeResponse - -// .google.rpc.Status error = 1; -inline bool StreamingRecognizeResponse::_internal_has_error() const { - return this != internal_default_instance() && error_ != nullptr; -} -inline bool StreamingRecognizeResponse::has_error() const { - return _internal_has_error(); -} -inline const ::google::rpc::Status& StreamingRecognizeResponse::_internal_error() const { - const ::google::rpc::Status* p = error_; - return p != nullptr ? *p : *reinterpret_cast( - &::google::rpc::_Status_default_instance_); -} -inline const ::google::rpc::Status& StreamingRecognizeResponse::error() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.StreamingRecognizeResponse.error) - return _internal_error(); -} -inline ::google::rpc::Status* StreamingRecognizeResponse::release_error() { - auto temp = unsafe_arena_release_error(); - if (GetArenaNoVirtual() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } - return temp; -} -inline ::google::rpc::Status* StreamingRecognizeResponse::unsafe_arena_release_error() { - // @@protoc_insertion_point(field_release:google.cloud.speech.v1.StreamingRecognizeResponse.error) - - ::google::rpc::Status* temp = error_; - error_ = nullptr; - return temp; -} -inline ::google::rpc::Status* StreamingRecognizeResponse::_internal_mutable_error() { - - if (error_ == nullptr) { - auto* p = CreateMaybeMessage<::google::rpc::Status>(GetArenaNoVirtual()); - error_ = p; - } - return error_; -} -inline ::google::rpc::Status* StreamingRecognizeResponse::mutable_error() { - // @@protoc_insertion_point(field_mutable:google.cloud.speech.v1.StreamingRecognizeResponse.error) - return _internal_mutable_error(); -} -inline void StreamingRecognizeResponse::set_allocated_error(::google::rpc::Status* error) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(error_); - } - if (error) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; - if (message_arena != submessage_arena) { - error = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, error, submessage_arena); - } - - } else { - - } - error_ = error; - // @@protoc_insertion_point(field_set_allocated:google.cloud.speech.v1.StreamingRecognizeResponse.error) -} - -// repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; -inline int StreamingRecognizeResponse::_internal_results_size() const { - return results_.size(); -} -inline int StreamingRecognizeResponse::results_size() const { - return _internal_results_size(); -} -inline void StreamingRecognizeResponse::clear_results() { - results_.Clear(); -} -inline ::google::cloud::speech::v1::StreamingRecognitionResult* StreamingRecognizeResponse::mutable_results(int index) { - // @@protoc_insertion_point(field_mutable:google.cloud.speech.v1.StreamingRecognizeResponse.results) - return results_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::StreamingRecognitionResult >* -StreamingRecognizeResponse::mutable_results() { - // @@protoc_insertion_point(field_mutable_list:google.cloud.speech.v1.StreamingRecognizeResponse.results) - return &results_; -} -inline const ::google::cloud::speech::v1::StreamingRecognitionResult& StreamingRecognizeResponse::_internal_results(int index) const { - return results_.Get(index); -} -inline const ::google::cloud::speech::v1::StreamingRecognitionResult& StreamingRecognizeResponse::results(int index) const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.StreamingRecognizeResponse.results) - return _internal_results(index); -} -inline ::google::cloud::speech::v1::StreamingRecognitionResult* StreamingRecognizeResponse::_internal_add_results() { - return results_.Add(); -} -inline ::google::cloud::speech::v1::StreamingRecognitionResult* StreamingRecognizeResponse::add_results() { - // @@protoc_insertion_point(field_add:google.cloud.speech.v1.StreamingRecognizeResponse.results) - return _internal_add_results(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::StreamingRecognitionResult >& -StreamingRecognizeResponse::results() const { - // @@protoc_insertion_point(field_list:google.cloud.speech.v1.StreamingRecognizeResponse.results) - return results_; -} - -// .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; -inline void StreamingRecognizeResponse::clear_speech_event_type() { - speech_event_type_ = 0; -} -inline ::google::cloud::speech::v1::StreamingRecognizeResponse_SpeechEventType StreamingRecognizeResponse::_internal_speech_event_type() const { - return static_cast< ::google::cloud::speech::v1::StreamingRecognizeResponse_SpeechEventType >(speech_event_type_); -} -inline ::google::cloud::speech::v1::StreamingRecognizeResponse_SpeechEventType StreamingRecognizeResponse::speech_event_type() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.StreamingRecognizeResponse.speech_event_type) - return _internal_speech_event_type(); -} -inline void StreamingRecognizeResponse::_internal_set_speech_event_type(::google::cloud::speech::v1::StreamingRecognizeResponse_SpeechEventType value) { - - speech_event_type_ = value; -} -inline void StreamingRecognizeResponse::set_speech_event_type(::google::cloud::speech::v1::StreamingRecognizeResponse_SpeechEventType value) { - _internal_set_speech_event_type(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.StreamingRecognizeResponse.speech_event_type) -} - -// ------------------------------------------------------------------- - -// StreamingRecognitionResult - -// repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; -inline int StreamingRecognitionResult::_internal_alternatives_size() const { - return alternatives_.size(); -} -inline int StreamingRecognitionResult::alternatives_size() const { - return _internal_alternatives_size(); -} -inline void StreamingRecognitionResult::clear_alternatives() { - alternatives_.Clear(); -} -inline ::google::cloud::speech::v1::SpeechRecognitionAlternative* StreamingRecognitionResult::mutable_alternatives(int index) { - // @@protoc_insertion_point(field_mutable:google.cloud.speech.v1.StreamingRecognitionResult.alternatives) - return alternatives_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::SpeechRecognitionAlternative >* -StreamingRecognitionResult::mutable_alternatives() { - // @@protoc_insertion_point(field_mutable_list:google.cloud.speech.v1.StreamingRecognitionResult.alternatives) - return &alternatives_; -} -inline const ::google::cloud::speech::v1::SpeechRecognitionAlternative& StreamingRecognitionResult::_internal_alternatives(int index) const { - return alternatives_.Get(index); -} -inline const ::google::cloud::speech::v1::SpeechRecognitionAlternative& StreamingRecognitionResult::alternatives(int index) const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.StreamingRecognitionResult.alternatives) - return _internal_alternatives(index); -} -inline ::google::cloud::speech::v1::SpeechRecognitionAlternative* StreamingRecognitionResult::_internal_add_alternatives() { - return alternatives_.Add(); -} -inline ::google::cloud::speech::v1::SpeechRecognitionAlternative* StreamingRecognitionResult::add_alternatives() { - // @@protoc_insertion_point(field_add:google.cloud.speech.v1.StreamingRecognitionResult.alternatives) - return _internal_add_alternatives(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::SpeechRecognitionAlternative >& -StreamingRecognitionResult::alternatives() const { - // @@protoc_insertion_point(field_list:google.cloud.speech.v1.StreamingRecognitionResult.alternatives) - return alternatives_; -} - -// bool is_final = 2; -inline void StreamingRecognitionResult::clear_is_final() { - is_final_ = false; -} -inline bool StreamingRecognitionResult::_internal_is_final() const { - return is_final_; -} -inline bool StreamingRecognitionResult::is_final() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.StreamingRecognitionResult.is_final) - return _internal_is_final(); -} -inline void StreamingRecognitionResult::_internal_set_is_final(bool value) { - - is_final_ = value; -} -inline void StreamingRecognitionResult::set_is_final(bool value) { - _internal_set_is_final(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.StreamingRecognitionResult.is_final) -} - -// float stability = 3; -inline void StreamingRecognitionResult::clear_stability() { - stability_ = 0; -} -inline float StreamingRecognitionResult::_internal_stability() const { - return stability_; -} -inline float StreamingRecognitionResult::stability() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.StreamingRecognitionResult.stability) - return _internal_stability(); -} -inline void StreamingRecognitionResult::_internal_set_stability(float value) { - - stability_ = value; -} -inline void StreamingRecognitionResult::set_stability(float value) { - _internal_set_stability(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.StreamingRecognitionResult.stability) -} - -// .google.cloud.speech.v1.StreamingRecognitionResult.ResultFinalizationCause result_finalization_cause = 4; -inline void StreamingRecognitionResult::clear_result_finalization_cause() { - result_finalization_cause_ = 0; -} -inline ::google::cloud::speech::v1::StreamingRecognitionResult_ResultFinalizationCause StreamingRecognitionResult::_internal_result_finalization_cause() const { - return static_cast< ::google::cloud::speech::v1::StreamingRecognitionResult_ResultFinalizationCause >(result_finalization_cause_); -} -inline ::google::cloud::speech::v1::StreamingRecognitionResult_ResultFinalizationCause StreamingRecognitionResult::result_finalization_cause() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.StreamingRecognitionResult.result_finalization_cause) - return _internal_result_finalization_cause(); -} -inline void StreamingRecognitionResult::_internal_set_result_finalization_cause(::google::cloud::speech::v1::StreamingRecognitionResult_ResultFinalizationCause value) { - - result_finalization_cause_ = value; -} -inline void StreamingRecognitionResult::set_result_finalization_cause(::google::cloud::speech::v1::StreamingRecognitionResult_ResultFinalizationCause value) { - _internal_set_result_finalization_cause(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.StreamingRecognitionResult.result_finalization_cause) -} - -// repeated .google.cloud.speech.v1.RecognitionLattice lattice = 5; -inline int StreamingRecognitionResult::_internal_lattice_size() const { - return lattice_.size(); -} -inline int StreamingRecognitionResult::lattice_size() const { - return _internal_lattice_size(); -} -inline void StreamingRecognitionResult::clear_lattice() { - lattice_.Clear(); -} -inline ::google::cloud::speech::v1::RecognitionLattice* StreamingRecognitionResult::mutable_lattice(int index) { - // @@protoc_insertion_point(field_mutable:google.cloud.speech.v1.StreamingRecognitionResult.lattice) - return lattice_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::RecognitionLattice >* -StreamingRecognitionResult::mutable_lattice() { - // @@protoc_insertion_point(field_mutable_list:google.cloud.speech.v1.StreamingRecognitionResult.lattice) - return &lattice_; -} -inline const ::google::cloud::speech::v1::RecognitionLattice& StreamingRecognitionResult::_internal_lattice(int index) const { - return lattice_.Get(index); -} -inline const ::google::cloud::speech::v1::RecognitionLattice& StreamingRecognitionResult::lattice(int index) const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.StreamingRecognitionResult.lattice) - return _internal_lattice(index); -} -inline ::google::cloud::speech::v1::RecognitionLattice* StreamingRecognitionResult::_internal_add_lattice() { - return lattice_.Add(); -} -inline ::google::cloud::speech::v1::RecognitionLattice* StreamingRecognitionResult::add_lattice() { - // @@protoc_insertion_point(field_add:google.cloud.speech.v1.StreamingRecognitionResult.lattice) - return _internal_add_lattice(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::RecognitionLattice >& -StreamingRecognitionResult::lattice() const { - // @@protoc_insertion_point(field_list:google.cloud.speech.v1.StreamingRecognitionResult.lattice) - return lattice_; -} - -// ------------------------------------------------------------------- - -// SpeechRecognitionResult - -// repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; -inline int SpeechRecognitionResult::_internal_alternatives_size() const { - return alternatives_.size(); -} -inline int SpeechRecognitionResult::alternatives_size() const { - return _internal_alternatives_size(); -} -inline void SpeechRecognitionResult::clear_alternatives() { - alternatives_.Clear(); -} -inline ::google::cloud::speech::v1::SpeechRecognitionAlternative* SpeechRecognitionResult::mutable_alternatives(int index) { - // @@protoc_insertion_point(field_mutable:google.cloud.speech.v1.SpeechRecognitionResult.alternatives) - return alternatives_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::SpeechRecognitionAlternative >* -SpeechRecognitionResult::mutable_alternatives() { - // @@protoc_insertion_point(field_mutable_list:google.cloud.speech.v1.SpeechRecognitionResult.alternatives) - return &alternatives_; -} -inline const ::google::cloud::speech::v1::SpeechRecognitionAlternative& SpeechRecognitionResult::_internal_alternatives(int index) const { - return alternatives_.Get(index); -} -inline const ::google::cloud::speech::v1::SpeechRecognitionAlternative& SpeechRecognitionResult::alternatives(int index) const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.SpeechRecognitionResult.alternatives) - return _internal_alternatives(index); -} -inline ::google::cloud::speech::v1::SpeechRecognitionAlternative* SpeechRecognitionResult::_internal_add_alternatives() { - return alternatives_.Add(); -} -inline ::google::cloud::speech::v1::SpeechRecognitionAlternative* SpeechRecognitionResult::add_alternatives() { - // @@protoc_insertion_point(field_add:google.cloud.speech.v1.SpeechRecognitionResult.alternatives) - return _internal_add_alternatives(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::SpeechRecognitionAlternative >& -SpeechRecognitionResult::alternatives() const { - // @@protoc_insertion_point(field_list:google.cloud.speech.v1.SpeechRecognitionResult.alternatives) - return alternatives_; -} - -// repeated .google.cloud.speech.v1.RecognitionLattice lattice = 5; -inline int SpeechRecognitionResult::_internal_lattice_size() const { - return lattice_.size(); -} -inline int SpeechRecognitionResult::lattice_size() const { - return _internal_lattice_size(); -} -inline void SpeechRecognitionResult::clear_lattice() { - lattice_.Clear(); -} -inline ::google::cloud::speech::v1::RecognitionLattice* SpeechRecognitionResult::mutable_lattice(int index) { - // @@protoc_insertion_point(field_mutable:google.cloud.speech.v1.SpeechRecognitionResult.lattice) - return lattice_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::RecognitionLattice >* -SpeechRecognitionResult::mutable_lattice() { - // @@protoc_insertion_point(field_mutable_list:google.cloud.speech.v1.SpeechRecognitionResult.lattice) - return &lattice_; -} -inline const ::google::cloud::speech::v1::RecognitionLattice& SpeechRecognitionResult::_internal_lattice(int index) const { - return lattice_.Get(index); -} -inline const ::google::cloud::speech::v1::RecognitionLattice& SpeechRecognitionResult::lattice(int index) const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.SpeechRecognitionResult.lattice) - return _internal_lattice(index); -} -inline ::google::cloud::speech::v1::RecognitionLattice* SpeechRecognitionResult::_internal_add_lattice() { - return lattice_.Add(); -} -inline ::google::cloud::speech::v1::RecognitionLattice* SpeechRecognitionResult::add_lattice() { - // @@protoc_insertion_point(field_add:google.cloud.speech.v1.SpeechRecognitionResult.lattice) - return _internal_add_lattice(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::RecognitionLattice >& -SpeechRecognitionResult::lattice() const { - // @@protoc_insertion_point(field_list:google.cloud.speech.v1.SpeechRecognitionResult.lattice) - return lattice_; -} - -// ------------------------------------------------------------------- - -// SpeechRecognitionAlternative - -// string transcript = 1; -inline void SpeechRecognitionAlternative::clear_transcript() { - transcript_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -inline const std::string& SpeechRecognitionAlternative::transcript() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.SpeechRecognitionAlternative.transcript) - return _internal_transcript(); -} -inline void SpeechRecognitionAlternative::set_transcript(const std::string& value) { - _internal_set_transcript(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.SpeechRecognitionAlternative.transcript) -} -inline std::string* SpeechRecognitionAlternative::mutable_transcript() { - // @@protoc_insertion_point(field_mutable:google.cloud.speech.v1.SpeechRecognitionAlternative.transcript) - return _internal_mutable_transcript(); -} -inline const std::string& SpeechRecognitionAlternative::_internal_transcript() const { - return transcript_.Get(); -} -inline void SpeechRecognitionAlternative::_internal_set_transcript(const std::string& value) { - - transcript_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); -} -inline void SpeechRecognitionAlternative::set_transcript(std::string&& value) { - - transcript_.Set( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_rvalue:google.cloud.speech.v1.SpeechRecognitionAlternative.transcript) -} -inline void SpeechRecognitionAlternative::set_transcript(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - transcript_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_char:google.cloud.speech.v1.SpeechRecognitionAlternative.transcript) -} -inline void SpeechRecognitionAlternative::set_transcript(const char* value, - size_t size) { - - transcript_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( - reinterpret_cast(value), size), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_pointer:google.cloud.speech.v1.SpeechRecognitionAlternative.transcript) -} -inline std::string* SpeechRecognitionAlternative::_internal_mutable_transcript() { - - return transcript_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -inline std::string* SpeechRecognitionAlternative::release_transcript() { - // @@protoc_insertion_point(field_release:google.cloud.speech.v1.SpeechRecognitionAlternative.transcript) - - return transcript_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -inline void SpeechRecognitionAlternative::set_allocated_transcript(std::string* transcript) { - if (transcript != nullptr) { - - } else { - - } - transcript_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), transcript, - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_allocated:google.cloud.speech.v1.SpeechRecognitionAlternative.transcript) -} -inline std::string* SpeechRecognitionAlternative::unsafe_arena_release_transcript() { - // @@protoc_insertion_point(field_unsafe_arena_release:google.cloud.speech.v1.SpeechRecognitionAlternative.transcript) - GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); - - return transcript_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} -inline void SpeechRecognitionAlternative::unsafe_arena_set_allocated_transcript( - std::string* transcript) { - GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); - if (transcript != nullptr) { - - } else { - - } - transcript_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - transcript, GetArenaNoVirtual()); - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.cloud.speech.v1.SpeechRecognitionAlternative.transcript) -} - -// float confidence = 2; -inline void SpeechRecognitionAlternative::clear_confidence() { - confidence_ = 0; -} -inline float SpeechRecognitionAlternative::_internal_confidence() const { - return confidence_; -} -inline float SpeechRecognitionAlternative::confidence() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.SpeechRecognitionAlternative.confidence) - return _internal_confidence(); -} -inline void SpeechRecognitionAlternative::_internal_set_confidence(float value) { - - confidence_ = value; -} -inline void SpeechRecognitionAlternative::set_confidence(float value) { - _internal_set_confidence(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.SpeechRecognitionAlternative.confidence) -} - -// repeated .google.cloud.speech.v1.WordInfo words = 3; -inline int SpeechRecognitionAlternative::_internal_words_size() const { - return words_.size(); -} -inline int SpeechRecognitionAlternative::words_size() const { - return _internal_words_size(); -} -inline void SpeechRecognitionAlternative::clear_words() { - words_.Clear(); -} -inline ::google::cloud::speech::v1::WordInfo* SpeechRecognitionAlternative::mutable_words(int index) { - // @@protoc_insertion_point(field_mutable:google.cloud.speech.v1.SpeechRecognitionAlternative.words) - return words_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::WordInfo >* -SpeechRecognitionAlternative::mutable_words() { - // @@protoc_insertion_point(field_mutable_list:google.cloud.speech.v1.SpeechRecognitionAlternative.words) - return &words_; -} -inline const ::google::cloud::speech::v1::WordInfo& SpeechRecognitionAlternative::_internal_words(int index) const { - return words_.Get(index); -} -inline const ::google::cloud::speech::v1::WordInfo& SpeechRecognitionAlternative::words(int index) const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.SpeechRecognitionAlternative.words) - return _internal_words(index); -} -inline ::google::cloud::speech::v1::WordInfo* SpeechRecognitionAlternative::_internal_add_words() { - return words_.Add(); -} -inline ::google::cloud::speech::v1::WordInfo* SpeechRecognitionAlternative::add_words() { - // @@protoc_insertion_point(field_add:google.cloud.speech.v1.SpeechRecognitionAlternative.words) - return _internal_add_words(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::WordInfo >& -SpeechRecognitionAlternative::words() const { - // @@protoc_insertion_point(field_list:google.cloud.speech.v1.SpeechRecognitionAlternative.words) - return words_; -} - -// ------------------------------------------------------------------- - -// WordInfo - -// .google.protobuf.Duration start_time = 1; -inline bool WordInfo::_internal_has_start_time() const { - return this != internal_default_instance() && start_time_ != nullptr; -} -inline bool WordInfo::has_start_time() const { - return _internal_has_start_time(); -} -inline const PROTOBUF_NAMESPACE_ID::Duration& WordInfo::_internal_start_time() const { - const PROTOBUF_NAMESPACE_ID::Duration* p = start_time_; - return p != nullptr ? *p : *reinterpret_cast( - &PROTOBUF_NAMESPACE_ID::_Duration_default_instance_); -} -inline const PROTOBUF_NAMESPACE_ID::Duration& WordInfo::start_time() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.WordInfo.start_time) - return _internal_start_time(); -} -inline PROTOBUF_NAMESPACE_ID::Duration* WordInfo::release_start_time() { - auto temp = unsafe_arena_release_start_time(); - if (GetArenaNoVirtual() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } - return temp; -} -inline PROTOBUF_NAMESPACE_ID::Duration* WordInfo::unsafe_arena_release_start_time() { - // @@protoc_insertion_point(field_release:google.cloud.speech.v1.WordInfo.start_time) - - PROTOBUF_NAMESPACE_ID::Duration* temp = start_time_; - start_time_ = nullptr; - return temp; -} -inline PROTOBUF_NAMESPACE_ID::Duration* WordInfo::_internal_mutable_start_time() { - - if (start_time_ == nullptr) { - auto* p = CreateMaybeMessage(GetArenaNoVirtual()); - start_time_ = p; - } - return start_time_; -} -inline PROTOBUF_NAMESPACE_ID::Duration* WordInfo::mutable_start_time() { - // @@protoc_insertion_point(field_mutable:google.cloud.speech.v1.WordInfo.start_time) - return _internal_mutable_start_time(); -} -inline void WordInfo::set_allocated_start_time(PROTOBUF_NAMESPACE_ID::Duration* start_time) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(start_time_); - } - if (start_time) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(start_time)->GetArena(); - if (message_arena != submessage_arena) { - start_time = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, start_time, submessage_arena); - } - - } else { - - } - start_time_ = start_time; - // @@protoc_insertion_point(field_set_allocated:google.cloud.speech.v1.WordInfo.start_time) -} - -// .google.protobuf.Duration end_time = 2; -inline bool WordInfo::_internal_has_end_time() const { - return this != internal_default_instance() && end_time_ != nullptr; -} -inline bool WordInfo::has_end_time() const { - return _internal_has_end_time(); -} -inline const PROTOBUF_NAMESPACE_ID::Duration& WordInfo::_internal_end_time() const { - const PROTOBUF_NAMESPACE_ID::Duration* p = end_time_; - return p != nullptr ? *p : *reinterpret_cast( - &PROTOBUF_NAMESPACE_ID::_Duration_default_instance_); -} -inline const PROTOBUF_NAMESPACE_ID::Duration& WordInfo::end_time() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.WordInfo.end_time) - return _internal_end_time(); -} -inline PROTOBUF_NAMESPACE_ID::Duration* WordInfo::release_end_time() { - auto temp = unsafe_arena_release_end_time(); - if (GetArenaNoVirtual() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } - return temp; -} -inline PROTOBUF_NAMESPACE_ID::Duration* WordInfo::unsafe_arena_release_end_time() { - // @@protoc_insertion_point(field_release:google.cloud.speech.v1.WordInfo.end_time) - - PROTOBUF_NAMESPACE_ID::Duration* temp = end_time_; - end_time_ = nullptr; - return temp; -} -inline PROTOBUF_NAMESPACE_ID::Duration* WordInfo::_internal_mutable_end_time() { - - if (end_time_ == nullptr) { - auto* p = CreateMaybeMessage(GetArenaNoVirtual()); - end_time_ = p; - } - return end_time_; -} -inline PROTOBUF_NAMESPACE_ID::Duration* WordInfo::mutable_end_time() { - // @@protoc_insertion_point(field_mutable:google.cloud.speech.v1.WordInfo.end_time) - return _internal_mutable_end_time(); -} -inline void WordInfo::set_allocated_end_time(PROTOBUF_NAMESPACE_ID::Duration* end_time) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == nullptr) { - delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(end_time_); - } - if (end_time) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(end_time)->GetArena(); - if (message_arena != submessage_arena) { - end_time = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, end_time, submessage_arena); - } - - } else { - - } - end_time_ = end_time; - // @@protoc_insertion_point(field_set_allocated:google.cloud.speech.v1.WordInfo.end_time) -} - -// string word = 3; -inline void WordInfo::clear_word() { - word_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -inline const std::string& WordInfo::word() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.WordInfo.word) - return _internal_word(); -} -inline void WordInfo::set_word(const std::string& value) { - _internal_set_word(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.WordInfo.word) -} -inline std::string* WordInfo::mutable_word() { - // @@protoc_insertion_point(field_mutable:google.cloud.speech.v1.WordInfo.word) - return _internal_mutable_word(); -} -inline const std::string& WordInfo::_internal_word() const { - return word_.Get(); -} -inline void WordInfo::_internal_set_word(const std::string& value) { - - word_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); -} -inline void WordInfo::set_word(std::string&& value) { - - word_.Set( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_rvalue:google.cloud.speech.v1.WordInfo.word) -} -inline void WordInfo::set_word(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - word_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_char:google.cloud.speech.v1.WordInfo.word) -} -inline void WordInfo::set_word(const char* value, - size_t size) { - - word_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( - reinterpret_cast(value), size), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_pointer:google.cloud.speech.v1.WordInfo.word) -} -inline std::string* WordInfo::_internal_mutable_word() { - - return word_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -inline std::string* WordInfo::release_word() { - // @@protoc_insertion_point(field_release:google.cloud.speech.v1.WordInfo.word) - - return word_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -inline void WordInfo::set_allocated_word(std::string* word) { - if (word != nullptr) { - - } else { - - } - word_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), word, - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_allocated:google.cloud.speech.v1.WordInfo.word) -} -inline std::string* WordInfo::unsafe_arena_release_word() { - // @@protoc_insertion_point(field_unsafe_arena_release:google.cloud.speech.v1.WordInfo.word) - GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); - - return word_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} -inline void WordInfo::unsafe_arena_set_allocated_word( - std::string* word) { - GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); - if (word != nullptr) { - - } else { - - } - word_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - word, GetArenaNoVirtual()); - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.cloud.speech.v1.WordInfo.word) -} - -// ------------------------------------------------------------------- - -// RecognitionLattice - -// repeated int32 final_nodes = 1; -inline int RecognitionLattice::_internal_final_nodes_size() const { - return final_nodes_.size(); -} -inline int RecognitionLattice::final_nodes_size() const { - return _internal_final_nodes_size(); -} -inline void RecognitionLattice::clear_final_nodes() { - final_nodes_.Clear(); -} -inline ::PROTOBUF_NAMESPACE_ID::int32 RecognitionLattice::_internal_final_nodes(int index) const { - return final_nodes_.Get(index); -} -inline ::PROTOBUF_NAMESPACE_ID::int32 RecognitionLattice::final_nodes(int index) const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.RecognitionLattice.final_nodes) - return _internal_final_nodes(index); -} -inline void RecognitionLattice::set_final_nodes(int index, ::PROTOBUF_NAMESPACE_ID::int32 value) { - final_nodes_.Set(index, value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.RecognitionLattice.final_nodes) -} -inline void RecognitionLattice::_internal_add_final_nodes(::PROTOBUF_NAMESPACE_ID::int32 value) { - final_nodes_.Add(value); -} -inline void RecognitionLattice::add_final_nodes(::PROTOBUF_NAMESPACE_ID::int32 value) { - _internal_add_final_nodes(value); - // @@protoc_insertion_point(field_add:google.cloud.speech.v1.RecognitionLattice.final_nodes) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int32 >& -RecognitionLattice::_internal_final_nodes() const { - return final_nodes_; -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int32 >& -RecognitionLattice::final_nodes() const { - // @@protoc_insertion_point(field_list:google.cloud.speech.v1.RecognitionLattice.final_nodes) - return _internal_final_nodes(); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int32 >* -RecognitionLattice::_internal_mutable_final_nodes() { - return &final_nodes_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int32 >* -RecognitionLattice::mutable_final_nodes() { - // @@protoc_insertion_point(field_mutable_list:google.cloud.speech.v1.RecognitionLattice.final_nodes) - return _internal_mutable_final_nodes(); -} - -// repeated .google.cloud.speech.v1.LatticeEdge edges = 2; -inline int RecognitionLattice::_internal_edges_size() const { - return edges_.size(); -} -inline int RecognitionLattice::edges_size() const { - return _internal_edges_size(); -} -inline void RecognitionLattice::clear_edges() { - edges_.Clear(); -} -inline ::google::cloud::speech::v1::LatticeEdge* RecognitionLattice::mutable_edges(int index) { - // @@protoc_insertion_point(field_mutable:google.cloud.speech.v1.RecognitionLattice.edges) - return edges_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::LatticeEdge >* -RecognitionLattice::mutable_edges() { - // @@protoc_insertion_point(field_mutable_list:google.cloud.speech.v1.RecognitionLattice.edges) - return &edges_; -} -inline const ::google::cloud::speech::v1::LatticeEdge& RecognitionLattice::_internal_edges(int index) const { - return edges_.Get(index); -} -inline const ::google::cloud::speech::v1::LatticeEdge& RecognitionLattice::edges(int index) const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.RecognitionLattice.edges) - return _internal_edges(index); -} -inline ::google::cloud::speech::v1::LatticeEdge* RecognitionLattice::_internal_add_edges() { - return edges_.Add(); -} -inline ::google::cloud::speech::v1::LatticeEdge* RecognitionLattice::add_edges() { - // @@protoc_insertion_point(field_add:google.cloud.speech.v1.RecognitionLattice.edges) - return _internal_add_edges(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::google::cloud::speech::v1::LatticeEdge >& -RecognitionLattice::edges() const { - // @@protoc_insertion_point(field_list:google.cloud.speech.v1.RecognitionLattice.edges) - return edges_; -} - -// ------------------------------------------------------------------- - -// LatticeEdge - -// int32 start_node = 1; -inline void LatticeEdge::clear_start_node() { - start_node_ = 0; -} -inline ::PROTOBUF_NAMESPACE_ID::int32 LatticeEdge::_internal_start_node() const { - return start_node_; -} -inline ::PROTOBUF_NAMESPACE_ID::int32 LatticeEdge::start_node() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.LatticeEdge.start_node) - return _internal_start_node(); -} -inline void LatticeEdge::_internal_set_start_node(::PROTOBUF_NAMESPACE_ID::int32 value) { - - start_node_ = value; -} -inline void LatticeEdge::set_start_node(::PROTOBUF_NAMESPACE_ID::int32 value) { - _internal_set_start_node(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.LatticeEdge.start_node) -} - -// int32 end_node = 2; -inline void LatticeEdge::clear_end_node() { - end_node_ = 0; -} -inline ::PROTOBUF_NAMESPACE_ID::int32 LatticeEdge::_internal_end_node() const { - return end_node_; -} -inline ::PROTOBUF_NAMESPACE_ID::int32 LatticeEdge::end_node() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.LatticeEdge.end_node) - return _internal_end_node(); -} -inline void LatticeEdge::_internal_set_end_node(::PROTOBUF_NAMESPACE_ID::int32 value) { - - end_node_ = value; -} -inline void LatticeEdge::set_end_node(::PROTOBUF_NAMESPACE_ID::int32 value) { - _internal_set_end_node(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.LatticeEdge.end_node) -} - -// string symbol = 3; -inline void LatticeEdge::clear_symbol() { - symbol_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -inline const std::string& LatticeEdge::symbol() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.LatticeEdge.symbol) - return _internal_symbol(); -} -inline void LatticeEdge::set_symbol(const std::string& value) { - _internal_set_symbol(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.LatticeEdge.symbol) -} -inline std::string* LatticeEdge::mutable_symbol() { - // @@protoc_insertion_point(field_mutable:google.cloud.speech.v1.LatticeEdge.symbol) - return _internal_mutable_symbol(); -} -inline const std::string& LatticeEdge::_internal_symbol() const { - return symbol_.Get(); -} -inline void LatticeEdge::_internal_set_symbol(const std::string& value) { - - symbol_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); -} -inline void LatticeEdge::set_symbol(std::string&& value) { - - symbol_.Set( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_rvalue:google.cloud.speech.v1.LatticeEdge.symbol) -} -inline void LatticeEdge::set_symbol(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - symbol_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_char:google.cloud.speech.v1.LatticeEdge.symbol) -} -inline void LatticeEdge::set_symbol(const char* value, - size_t size) { - - symbol_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( - reinterpret_cast(value), size), GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_pointer:google.cloud.speech.v1.LatticeEdge.symbol) -} -inline std::string* LatticeEdge::_internal_mutable_symbol() { - - return symbol_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -inline std::string* LatticeEdge::release_symbol() { - // @@protoc_insertion_point(field_release:google.cloud.speech.v1.LatticeEdge.symbol) - - return symbol_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); -} -inline void LatticeEdge::set_allocated_symbol(std::string* symbol) { - if (symbol != nullptr) { - - } else { - - } - symbol_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), symbol, - GetArenaNoVirtual()); - // @@protoc_insertion_point(field_set_allocated:google.cloud.speech.v1.LatticeEdge.symbol) -} -inline std::string* LatticeEdge::unsafe_arena_release_symbol() { - // @@protoc_insertion_point(field_unsafe_arena_release:google.cloud.speech.v1.LatticeEdge.symbol) - GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); - - return symbol_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); -} -inline void LatticeEdge::unsafe_arena_set_allocated_symbol( - std::string* symbol) { - GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); - if (symbol != nullptr) { - - } else { - - } - symbol_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - symbol, GetArenaNoVirtual()); - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.cloud.speech.v1.LatticeEdge.symbol) -} - -// float language_cost = 4; -inline void LatticeEdge::clear_language_cost() { - language_cost_ = 0; -} -inline float LatticeEdge::_internal_language_cost() const { - return language_cost_; -} -inline float LatticeEdge::language_cost() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.LatticeEdge.language_cost) - return _internal_language_cost(); -} -inline void LatticeEdge::_internal_set_language_cost(float value) { - - language_cost_ = value; -} -inline void LatticeEdge::set_language_cost(float value) { - _internal_set_language_cost(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.LatticeEdge.language_cost) -} - -// float acoustic_cost = 5; -inline void LatticeEdge::clear_acoustic_cost() { - acoustic_cost_ = 0; -} -inline float LatticeEdge::_internal_acoustic_cost() const { - return acoustic_cost_; -} -inline float LatticeEdge::acoustic_cost() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.LatticeEdge.acoustic_cost) - return _internal_acoustic_cost(); -} -inline void LatticeEdge::_internal_set_acoustic_cost(float value) { - - acoustic_cost_ = value; -} -inline void LatticeEdge::set_acoustic_cost(float value) { - _internal_set_acoustic_cost(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.LatticeEdge.acoustic_cost) -} - -// int32 duration = 6; -inline void LatticeEdge::clear_duration() { - duration_ = 0; -} -inline ::PROTOBUF_NAMESPACE_ID::int32 LatticeEdge::_internal_duration() const { - return duration_; -} -inline ::PROTOBUF_NAMESPACE_ID::int32 LatticeEdge::duration() const { - // @@protoc_insertion_point(field_get:google.cloud.speech.v1.LatticeEdge.duration) - return _internal_duration(); -} -inline void LatticeEdge::_internal_set_duration(::PROTOBUF_NAMESPACE_ID::int32 value) { - - duration_ = value; -} -inline void LatticeEdge::set_duration(::PROTOBUF_NAMESPACE_ID::int32 value) { - _internal_set_duration(value); - // @@protoc_insertion_point(field_set:google.cloud.speech.v1.LatticeEdge.duration) -} - -#ifdef __GNUC__ - #pragma GCC diagnostic pop -#endif // __GNUC__ -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - - -// @@protoc_insertion_point(namespace_scope) - -} // namespace v1 -} // namespace speech -} // namespace cloud -} // namespace google - -PROTOBUF_NAMESPACE_OPEN - -template <> struct is_proto_enum< ::google::cloud::speech::v1::RecognitionConfig_AudioEncoding> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::google::cloud::speech::v1::RecognitionConfig_AudioEncoding>() { - return ::google::cloud::speech::v1::RecognitionConfig_AudioEncoding_descriptor(); -} -template <> struct is_proto_enum< ::google::cloud::speech::v1::StreamingRecognizeResponse_SpeechEventType> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::google::cloud::speech::v1::StreamingRecognizeResponse_SpeechEventType>() { - return ::google::cloud::speech::v1::StreamingRecognizeResponse_SpeechEventType_descriptor(); -} -template <> struct is_proto_enum< ::google::cloud::speech::v1::StreamingRecognitionResult_ResultFinalizationCause> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::google::cloud::speech::v1::StreamingRecognitionResult_ResultFinalizationCause>() { - return ::google::cloud::speech::v1::StreamingRecognitionResult_ResultFinalizationCause_descriptor(); -} - -PROTOBUF_NAMESPACE_CLOSE - -// @@protoc_insertion_point(global_scope) - -#include -#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_dictation_5fasr_2eproto diff --git a/cpp/libdictation-client/dictation_client.cpp b/cpp/libdictation-client/dictation_client.cpp index 2ccac91..87605f9 100644 --- a/cpp/libdictation-client/dictation_client.cpp +++ b/cpp/libdictation-client/dictation_client.cpp @@ -23,15 +23,15 @@ namespace { } - std::shared_ptr create_channel_credentials(const std::string& ssl_directory) { - if (ssl_directory.empty()) + std::shared_ptr create_channel_credentials(const std::string& tls_directory) { + if (tls_directory.empty()) { return grpc::InsecureChannelCredentials(); } - std::string cert = read_file(ssl_directory + "/client.crt"); - std::string key = read_file(ssl_directory + "/client.key"); - std::string root = read_file(ssl_directory + "/ca.crt"); + std::string cert = read_file(tls_directory + "/client.crt"); + std::string key = read_file(tls_directory + "/client.key"); + std::string root = read_file(tls_directory + "/ca.crt"); grpc::SslCredentialsOptions opts = {root, key, cert}; return grpc::SslCredentials(opts); @@ -55,7 +55,7 @@ gsapi::RecognizeResponse DictationClient::Recognize(DictationSessionConfig& conf gsapi::RecognizeResponse response; - auto stub = gsapi::Speech::NewStub(grpc::CreateChannel(service_address_, create_channel_credentials(ssl_directory_))); + auto stub = gsapi::Speech::NewStub(grpc::CreateChannel(service_address_, create_channel_credentials(tls_directory_))); grpc::ClientContext context; prepare_context(context, config); @@ -71,7 +71,7 @@ gsapi::RecognizeResponse DictationClient::Recognize(DictationSessionConfig& conf std::vector DictationClient::StreamingRecognize(DictationSessionConfig& config, const WAV_DATA& wav_data) const { - auto stub = gsapi::Speech::NewStub(grpc::CreateChannel(service_address_, create_channel_credentials(ssl_directory_))); + auto stub = gsapi::Speech::NewStub(grpc::CreateChannel(service_address_, create_channel_credentials(tls_directory_))); grpc::ClientContext context; prepare_context(context, config); diff --git a/cpp/libdictation-client/dictation_client.h b/cpp/libdictation-client/dictation_client.h index dbba625..3c45612 100644 --- a/cpp/libdictation-client/dictation_client.h +++ b/cpp/libdictation-client/dictation_client.h @@ -29,9 +29,9 @@ struct DictationSessionConfig { class DictationClient { public: - DictationClient(const std::string& service_address, const std::string& ssl_directory) + DictationClient(const std::string& service_address, const std::string& tls_directory) : service_address_{ service_address } - , ssl_directory_{ ssl_directory } + , tls_directory_{ tls_directory } { } @@ -43,7 +43,7 @@ class DictationClient { DictationClient(); // Disable default constructor. const std::string service_address_; // IP address and port (address:port) of a service the client will connect to. - const std::string ssl_directory_; + const std::string tls_directory_; }; }} diff --git a/cpp/tests/data/test.wav b/cpp/tests/data/test.wav new file mode 100644 index 0000000..6a9906b Binary files /dev/null and b/cpp/tests/data/test.wav differ diff --git a/cpp/tests/data/test_context.wav b/cpp/tests/data/test_context.wav new file mode 100644 index 0000000..501ed25 Binary files /dev/null and b/cpp/tests/data/test_context.wav differ diff --git a/cpp/tests/test_service_with_script_for_docker_usage.sh b/cpp/tests/test_service_with_script_for_docker_usage.sh new file mode 100755 index 0000000..2a80b7f --- /dev/null +++ b/cpp/tests/test_service_with_script_for_docker_usage.sh @@ -0,0 +1,85 @@ +#!/bin/bash +# coding=utf-8 + +set -euo pipefail +IFS=$'\n\t' + +SCRIPT=$(realpath "$0") +SCRIPTPATH=$(dirname "${SCRIPT}") + +service_image="$1" + +test_result="fail" +test_service_address="demo.devtechmo.pl:51190" + +cp "${SCRIPTPATH}/data/test.wav" "${SCRIPTPATH}/../docker/wav/ci_tmp_test.wav" +cp "${SCRIPTPATH}/data/test_context.wav" "${SCRIPTPATH}/../docker/wav/ci_tmp_test_context.wav" + +test_wave="ci_tmp_test.wav" +test_context_wave="ci_tmp_test_context.wav" + +function on_exit { + + if [[ $test_result == "fail" ]]; then + echo "--------------------------------------------------" + echo " SERVICE TEST WITH SCRIPT FOR DOCKER USAGE FAILED!" + echo "--------------------------------------------------" + else + echo "------------------------------------------------------------------" + echo " SERVICE TEST WITH SCRIPT FOR DOCKER USAGE COMPLETED SUCCESSFULLY!" + echo "------------------------------------------------------------------" + fi + rm "${SCRIPTPATH}/../docker/wav/ci_tmp_test.wav" "${SCRIPTPATH}/../docker/wav/ci_tmp_test_context.wav" +} +trap on_exit EXIT + + +function check_output () { + + cmd="$1" + phrase="$2" + + set +e + output=$({ eval "$cmd" 1>&2; } 2>&1 ) # we want grep over output whether the command succeeds or not + set -e + echo "${output}" | grep "$phrase" > /dev/null 2>&1; # if this line returns non-0-code, 'set -e' will cause exit + echo "--> OK" +} + +echo +echo "------------------------------------------" +echo " SERVICE TEST WITH SCRIPT FOR DOCKER USAGE" +echo "------------------------------------------" + +echo +echo "Testing: basic recognition" +cmd="${SCRIPTPATH}/../docker/run_dictation_client_cpp.sh --custom-image=${service_image} --service-address=${test_service_address} --filename=${test_wave}" +phrase="serwis testowy" +check_output "${cmd}" "${phrase}" + +echo +echo "Testing: --interim-results" +cmd="${SCRIPTPATH}/../docker/run_dictation_client_cpp.sh --custom-image=${service_image} --service-address=${test_service_address} --filename=${test_wave} --interim-results" +phrase="serwis" +check_output "${cmd}" "${phrase}" + +echo +echo "Testing: --grpc-timeout" +cmd="${SCRIPTPATH}/../docker/run_dictation_client_cpp.sh --custom-image=${service_image} --service-address=${test_service_address} --filename=${test_wave} --grpc-timeout=50" +phrase="DEADLINE_EXCEEDED" +check_output "${cmd}" "${phrase}" + +echo +echo "Testing: --time-offsets" +cmd="${SCRIPTPATH}/../docker/run_dictation_client_cpp.sh --custom-image=${service_image} --service-address=${test_service_address} --filename=${test_wave} --time-offsets" +phrase="nanos: 60000000" +check_output "${cmd}" "${phrase}" + +echo +echo "Testing: --context-phrase" +cmd="${SCRIPTPATH}/../docker/run_dictation_client_cpp.sh --custom-image=${service_image} --service-address=${test_service_address} --filename=${test_context_wave} --context-phrase=context" +phrase="przedsi\\\\304\\\\231wzi\\\\304\\\\231cie" +check_output "${cmd}" "${phrase}" + + +test_result="success" diff --git a/cpp/tests/test_service_with_script_for_local_usage.sh b/cpp/tests/test_service_with_script_for_local_usage.sh new file mode 100755 index 0000000..5a2703a --- /dev/null +++ b/cpp/tests/test_service_with_script_for_local_usage.sh @@ -0,0 +1,79 @@ +#!/bin/bash +# coding=utf-8 + +set -euo pipefail +IFS=$'\n\t' + +SCRIPT=$(realpath "$0") +SCRIPTPATH=$(dirname "${SCRIPT}") + +test_result="fail" +test_service_address="demo.devtechmo.pl:51190" +test_wave="${SCRIPTPATH}/data/test.wav" +test_context_wave="${SCRIPTPATH}/data/test_context.wav" + +function on_exit { + + if [[ $test_result == "fail" ]]; then + echo "-------------------------------------------------" + echo " SERVICE TEST WITH SCRIPT FOR LOCAL USAGE FAILED!" + echo "-------------------------------------------------" + else + echo "-----------------------------------------------------------------" + echo " SERVICE TEST WITH SCRIPT FOR LOCAL USAGE COMPLETED SUCCESSFULLY!" + echo "-----------------------------------------------------------------" + fi +} +trap on_exit EXIT + + +function check_output () { + + cmd="$1" + phrase="$2" + + set +e + output=$({ eval "$cmd" 1>&2; } 2>&1 ) # we want grep over output whether the command succeeds or not + set -e + echo "${output}" | grep "$phrase" > /dev/null 2>&1; # if this line returns non-0-code, 'set -e' will cause exit + echo "--> OK" +} + + +echo +echo "------------------------------------------" +echo " SERVICE TEST WITH SCRIPT FOR LOCAL USAGE" +echo "------------------------------------------" + +echo +echo "Testing: basic recognition" +cmd="${SCRIPTPATH}/../build/dictation_client --service-address ${test_service_address} --wav-path ${test_wave}" +phrase="serwis testowy" +check_output "${cmd}" "${phrase}" + +echo +echo "Testing: --interim-results" +cmd="${SCRIPTPATH}/../build/dictation_client --service-address ${test_service_address} --wav-path ${test_wave} --streaming --interim-results true" +phrase="transcript: \"serwis\"" +check_output "${cmd}" "${phrase}" + +echo +echo "Testing: --grpc-timeout" +cmd="${SCRIPTPATH}/../build/dictation_client --service-address ${test_service_address} --wav-path ${test_wave} --grpc-timeout 50" +phrase="DEADLINE_EXCEEDED" +check_output "${cmd}" "${phrase}" + +echo +echo "Testing: --time-offsets" +cmd="${SCRIPTPATH}/../build/dictation_client --service-address ${test_service_address} --wav-path ${test_wave} --time-offsets true" +phrase="nanos: 60000000" +check_output "${cmd}" "${phrase}" + +echo +echo "Testing: --context-phrase" +cmd="${SCRIPTPATH}/../build/dictation_client --service-address ${test_service_address} --wav-path ${test_context_wave} --context-phrase context" +phrase="przedsi\\\\304\\\\231wzi\\\\304\\\\231cie" +check_output "${cmd}" "${phrase}" + + +test_result="success" diff --git a/python/Dockerfile b/python/Dockerfile index 54ea78c..0a6a93c 100644 --- a/python/Dockerfile +++ b/python/Dockerfile @@ -2,9 +2,11 @@ FROM python:3.6-slim ARG DEBIAN_FRONTEND=noninteractive -ADD ./python /dictation_client_python +ADD ./python /dictation-client/python +ADD ./proto /dictation-client/proto +ADD ./submodules /dictation-client/submodules -WORKDIR /dictation_client_python +WORKDIR /dictation-client/python RUN ./setup.sh -y diff --git a/python/README.md b/python/README.md index a444df2..1d6e25c 100755 --- a/python/README.md +++ b/python/README.md @@ -14,7 +14,7 @@ To prepare a docker image with Python implementation of the Dictation Client, us The build process will take several minutes. When the build process is complete, you will receive a message: ``` -Successfully tagged dictation-client-python:2.3.2 +Successfully tagged dictation-client-python:2.3.4 ``` ### Run Dictation client @@ -90,9 +90,11 @@ Then install the required dependencies inside the virtual environment (this step Use Python 3 with the virtual environment and install required packages (supported Python versions are: 3.5, 3.6, 3.7, 3.8, 3.9): ``` -virtualenv -p python3 .env +python3 -m venv .env source .env/bin/activate -pip install -r requirements.txt +pip3 install --upgrade pip +pip3 install wheel +pip3 install -r requirements.txt ``` - On Windows 10: @@ -107,9 +109,11 @@ then confirm your choice. Use Python 3 with virtual environment and install required packages (supported Python versions are: 3.5, 3.6, 3.7, 3.8, 3.9): ``` -virtualenv -p python3 .env -.\.env\Scripts\activate -pip install -r requirements.txt +python3 -m venv .env +source .env/bin/activate +pip3 install --upgrade pip +pip3 install wheel +pip3 install -r requirements.txt ``` To switch back PowerShell's execution policy to the default, use command: @@ -120,12 +124,10 @@ Set-ExecutionPolicy Restricted ##### Proto sources -[Optional] To regenerate the sources from `.proto`, run: +To build the sources from `.proto`, run: ``` ./make_proto.sh ``` -This might be required when using other gRPC or Protocol Buffers version. - #### Run @@ -159,9 +161,9 @@ Available options: --service-address ADDRESS IP address and port (address:port) of a service the client will connect to. - --ssl-dir SSL_DIRECTORY - If set to a path with ssl credential files - (client.crt, client.key, ca.crt), use ssl + --tls-dir TLS_DIRECTORY + If set to a path with SSL/TLS credential files + (client.crt, client.key, ca.crt), use SSL/TLS authentication. Otherwise use insecure channel (default). --wave-path WAVE Path to wave file with speech to be recognized. Should @@ -248,7 +250,7 @@ On the Linux operating systems using Advanced Linux Sound Architecture (ALSA) mi If you get the following output after runing request: ``` -Dictation ASR gRPC client 2.3.2 +Dictation ASR gRPC client 2.3.4 ALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_open) unable to open slave ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe diff --git a/python/VERSION.py b/python/VERSION.py index ed5cc17..4618fe6 100644 --- a/python/VERSION.py +++ b/python/VERSION.py @@ -1 +1 @@ -__version__ = "2.3.3" +__version__ = "2.3.4" diff --git a/python/dictation_client.py b/python/dictation_client.py index e926da6..ca18127 100755 --- a/python/dictation_client.py +++ b/python/dictation_client.py @@ -41,8 +41,8 @@ def create_audio_stream(args): parser = ArgumentParser() parser.add_argument("--service-address", dest="address", required=True, help="IP address and port (address:port) of a service the client will connect to.", type=str) - parser.add_argument("--ssl-dir", dest="ssl_directory", default="", - help="If set to a path with ssl credential files (client.crt, client.key, ca.crt), use ssl authentication. Otherwise use insecure channel (default).", type=str) + parser.add_argument("--tls-dir", dest="tls_directory", default="", + help="If set to a path with SSL/TLS credential files (client.crt, client.key, ca.crt), use SSL/TLS authentication. Otherwise use insecure channel (default).", type=str) parser.add_argument("--wave-path", dest="wave", help="Path to wave file with speech to be recognized. Should be mono, 8kHz or 16kHz.") parser.add_argument("--mic", help="Use microphone as an audio source (instead of wave file).", action='store_true') @@ -76,7 +76,7 @@ def create_audio_stream(args): if args.wave is not None or args.mic: with create_audio_stream(args) as stream: settings = DictationSettings(args) - recognizer = StreamingRecognizer(args.address, args.ssl_directory, settings) + recognizer = StreamingRecognizer(args.address, args.tls_directory, settings) print('Recognizing...') results = recognizer.recognize(stream) diff --git a/python/docker/run_dictation_client_python.sh b/python/docker/run_dictation_client_python.sh index c4eeee3..1a67197 100755 --- a/python/docker/run_dictation_client_python.sh +++ b/python/docker/run_dictation_client_python.sh @@ -7,7 +7,7 @@ set -euo pipefail IFS=$'\n\t' -IMAGE_VERSION=2.3.2 +IMAGE_VERSION="2.3.4" SCRIPT=$(realpath "$0") SCRIPTPATH=$(dirname "${SCRIPT}") @@ -19,12 +19,14 @@ echo " Dictation ASR gRPC client ${IMAGE_VERSION} -h, --help show this help message and exit + --custom-image=IMAGE:TAG + Uses a custom docker image instead of the default. -s=ADDRESS, --service-address=ADDRESS IP address and port (address:port) of a service the client will connect to. - -f=WAVE, --filename=WAVE + -f=WAVE, --filename=WAVE Name of the wave file with speech to be recognized. File should be inside 'wav' directory. Should be mono, 8kHz or 16kHz. -m, --mic Use microphone as an audio source (instead of wave file). - --tls If set, uses tls authentication, otherwise use insecure channel (default). The tls credential files (client.crt, client.key, ca.crt) should be placed inside 'tls' directory. + --tls If set, uses SSL/TLS authentication, otherwise use insecure channel (default). The tls credential files (client.crt, client.key, ca.crt) should be placed inside 'tls' directory. --session-id=SESSION_ID Session ID to be passed to the service. If not specified, the service will generate a default session ID itself. --grpc-timeout=GRPC_TIMEOUT @@ -53,19 +55,22 @@ while getopts "f:hms:-:" optchar; do case "${optchar}" in -) case "${OPTARG}" in - help) - usage; exit 0 + custom-image=*) + docker_image=${OPTARG#*=} ;; - tls) - opts+=( "--ssl-dir" "/volume/tls" ) + help) + usage; exit 0 ;; - time-offsets) + tls) + opts+=( "--tls-dir" "/volume/tls" ) + ;; + time-offsets) opts+=( "--time-offsets" ) ;; - single-utterance) + single-utterance) opts+=( "--single-utterance" ) ;; - interim-results) + interim-results) opts+=( "--interim-results" ) ;; mic) @@ -93,15 +98,15 @@ while getopts "f:hms:-:" optchar; do fi ;; esac;; - f) + f) val=${OPTARG#*=} opt=${OPTARG%=$val} opts+=( "--wave-path" "/volume/wav/${val##*/}" ) ;; - h) - usage; exit 0 + h) + usage; exit 0 ;; - m) + m) opts+=("--mic") set +e if [ ! -S /tmp/pulseaudio.socket ]; @@ -110,7 +115,7 @@ while getopts "f:hms:-:" optchar; do fi set -e ;; - s) + s) val=${OPTARG#*=} opt=${OPTARG%=$val} opts+=( "--service-address" "${val}" ) @@ -123,7 +128,7 @@ while getopts "f:hms:-:" optchar; do esac done -docker run --rm -it \ +docker run --rm \ --env PULSE_SERVER=unix:/tmp/pulseaudio.socket \ --env PULSE_COOKIE=/tmp/pulseaudio.cookie \ -v "${SCRIPTPATH}:/volume" \ @@ -135,4 +140,4 @@ docker run --rm -it \ --group-add audio \ --network host \ "${docker_image}" \ -/dictation_client_python/run.sh "${opts[@]}" 2>/dev/null +/dictation-client/python/run.sh "${opts[@]}" diff --git a/python/make_proto.sh b/python/make_proto.sh index b1455e0..e0d9eea 100755 --- a/python/make_proto.sh +++ b/python/make_proto.sh @@ -3,10 +3,11 @@ set -eo pipefail -virtualenv -p python3 proto_env -# shellcheck disable=SC1091 -source proto_env/bin/activate -pip install grpcio-tools==1.7.0 +python3 -m venv proto_env +source .env/bin/activate +pip3 install --upgrade pip +pip3 install wheel +pip3 install grpcio-tools==1.38.1 function cleanup() { # shellcheck disable=SC1091 diff --git a/python/requirements.txt b/python/requirements.txt index eb60a3c..a60ca98 100755 --- a/python/requirements.txt +++ b/python/requirements.txt @@ -11,7 +11,7 @@ google-auth-httplib2==0.0.3 google-cloud-core==1.0.2 google-cloud-speech==1.0.0 googleapis-common-protos==1.6.0 -httplib2==0.14.0 +httplib2==0.19.0 oauth2client==2.0.0 pydub==0.23.1 pyaudio==0.2.11 diff --git a/python/service/dictation_asr_pb2.py b/python/service/dictation_asr_pb2.py deleted file mode 100644 index 85421b9..0000000 --- a/python/service/dictation_asr_pb2.py +++ /dev/null @@ -1,1039 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: dictation_asr.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -from google.protobuf import descriptor_pb2 -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='dictation_asr.proto', - package='google.cloud.speech.v1', - syntax='proto3', - serialized_pb=_b('\n\x13\x64ictation_asr.proto\x12\x16google.cloud.speech.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x17google/rpc/status.proto\"\x86\x01\n\x10RecognizeRequest\x12\x39\n\x06\x63onfig\x18\x01 \x01(\x0b\x32).google.cloud.speech.v1.RecognitionConfig\x12\x37\n\x05\x61udio\x18\x02 \x01(\x0b\x32(.google.cloud.speech.v1.RecognitionAudio\"\x99\x01\n\x19StreamingRecognizeRequest\x12N\n\x10streaming_config\x18\x01 \x01(\x0b\x32\x32.google.cloud.speech.v1.StreamingRecognitionConfigH\x00\x12\x17\n\raudio_content\x18\x02 \x01(\x0cH\x00\x42\x13\n\x11streaming_request\"\x8a\x01\n\x1aStreamingRecognitionConfig\x12\x39\n\x06\x63onfig\x18\x01 \x01(\x0b\x32).google.cloud.speech.v1.RecognitionConfig\x12\x18\n\x10single_utterance\x18\x02 \x01(\x08\x12\x17\n\x0finterim_results\x18\x03 \x01(\x08\"\xc4\x04\n\x11RecognitionConfig\x12I\n\x08\x65ncoding\x18\x01 \x01(\x0e\x32\x37.google.cloud.speech.v1.RecognitionConfig.AudioEncoding\x12\x19\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\x12\x18\n\x10max_alternatives\x18\x04 \x01(\x05\x12\x18\n\x10profanity_filter\x18\x05 \x01(\x08\x12>\n\x0fspeech_contexts\x18\x06 \x03(\x0b\x32%.google.cloud.speech.v1.SpeechContext\x12 \n\x18\x65nable_word_time_offsets\x18\x08 \x01(\x08\x12$\n\x1c\x65nable_automatic_punctuation\x18\x0b \x01(\x08\x12:\n\rconfig_fields\x18\x0c \x03(\x0b\x32#.google.cloud.speech.v1.ConfigField\x12\r\n\x05model\x18\r \x01(\t\x12\x14\n\x0cuse_enhanced\x18\x0e \x01(\x08\"\x94\x01\n\rAudioEncoding\x12\x18\n\x14\x45NCODING_UNSPECIFIED\x10\x00\x12\x0c\n\x08LINEAR16\x10\x01\x12\x08\n\x04\x46LAC\x10\x02\x12\t\n\x05MULAW\x10\x03\x12\x07\n\x03\x41MR\x10\x04\x12\n\n\x06\x41MR_WB\x10\x05\x12\x0c\n\x08OGG_OPUS\x10\x06\x12\x1a\n\x16SPEEX_WITH_HEADER_BYTE\x10\x07\x12\x07\n\x03MP3\x10\x08\" \n\rSpeechContext\x12\x0f\n\x07phrases\x18\x01 \x03(\t\")\n\x0b\x43onfigField\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\"D\n\x10RecognitionAudio\x12\x11\n\x07\x63ontent\x18\x01 \x01(\x0cH\x00\x12\r\n\x03uri\x18\x02 \x01(\tH\x00\x42\x0e\n\x0c\x61udio_source\"U\n\x11RecognizeResponse\x12@\n\x07results\x18\x02 \x03(\x0b\x32/.google.cloud.speech.v1.SpeechRecognitionResult\"\xb1\x02\n\x1aStreamingRecognizeResponse\x12!\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x12.google.rpc.Status\x12\x43\n\x07results\x18\x02 \x03(\x0b\x32\x32.google.cloud.speech.v1.StreamingRecognitionResult\x12]\n\x11speech_event_type\x18\x04 \x01(\x0e\x32\x42.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType\"L\n\x0fSpeechEventType\x12\x1c\n\x18SPEECH_EVENT_UNSPECIFIED\x10\x00\x12\x1b\n\x17\x45ND_OF_SINGLE_UTTERANCE\x10\x01\"\xe1\x03\n\x1aStreamingRecognitionResult\x12J\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32\x34.google.cloud.speech.v1.SpeechRecognitionAlternative\x12\x10\n\x08is_final\x18\x02 \x01(\x08\x12\x11\n\tstability\x18\x03 \x01(\x02\x12m\n\x19result_finalization_cause\x18\x04 \x01(\x0e\x32J.google.cloud.speech.v1.StreamingRecognitionResult.ResultFinalizationCause\x12;\n\x07lattice\x18\x05 \x03(\x0b\x32*.google.cloud.speech.v1.RecognitionLattice\"\xa5\x01\n\x17ResultFinalizationCause\x12)\n%RESULT_FINALIZATION_CAUSE_UNSPECIFIED\x10\x00\x12\x0b\n\x07SUCCESS\x10\x01\x12\x14\n\x10NO_INPUT_TIMEOUT\x10\x02\x12\x13\n\x0fSUCCESS_MAXTIME\x10\x03\x12\x11\n\rPARTIAL_MATCH\x10\x04\x12\x14\n\x10NO_MATCH_MAXTIME\x10\x05\"\xa2\x01\n\x17SpeechRecognitionResult\x12J\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32\x34.google.cloud.speech.v1.SpeechRecognitionAlternative\x12;\n\x07lattice\x18\x05 \x03(\x0b\x32*.google.cloud.speech.v1.RecognitionLattice\"w\n\x1cSpeechRecognitionAlternative\x12\x12\n\ntranscript\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12/\n\x05words\x18\x03 \x03(\x0b\x32 .google.cloud.speech.v1.WordInfo\"t\n\x08WordInfo\x12-\n\nstart_time\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12+\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x0c\n\x04word\x18\x03 \x01(\t\"]\n\x12RecognitionLattice\x12\x13\n\x0b\x66inal_nodes\x18\x01 \x03(\x05\x12\x32\n\x05\x65\x64ges\x18\x02 \x03(\x0b\x32#.google.cloud.speech.v1.LatticeEdge\"\x83\x01\n\x0bLatticeEdge\x12\x12\n\nstart_node\x18\x01 \x01(\x05\x12\x10\n\x08\x65nd_node\x18\x02 \x01(\x05\x12\x0e\n\x06symbol\x18\x03 \x01(\t\x12\x15\n\rlanguage_cost\x18\x04 \x01(\x02\x12\x15\n\racoustic_cost\x18\x05 \x01(\x02\x12\x10\n\x08\x64uration\x18\x06 \x01(\x05\x32\x90\x02\n\x06Speech\x12\x81\x01\n\tRecognize\x12(.google.cloud.speech.v1.RecognizeRequest\x1a).google.cloud.speech.v1.RecognizeResponse\"\x1f\x82\xd3\xe4\x93\x02\x19\"\x14/v1/speech:recognize:\x01*\x12\x81\x01\n\x12StreamingRecognize\x12\x31.google.cloud.speech.v1.StreamingRecognizeRequest\x1a\x32.google.cloud.speech.v1.StreamingRecognizeResponse\"\x00(\x01\x30\x01\x42l\n\x1a\x63om.google.cloud.speech.v1B\x0bSpeechProtoP\x01Z&2; } 2>&1 ) # we want grep over output whether the command succeeds or not + set -e + echo "${output}" | grep "$phrase" > /dev/null 2>&1; # if this line returns non-0-code, 'set -e' will cause exit + echo "--> OK" +} + +echo +echo "------------------------------------------" +echo " SERVICE TEST WITH SCRIPT FOR DOCKER USAGE" +echo "------------------------------------------" + +echo +echo "Testing: basic recognition" +cmd="${SCRIPTPATH}/../docker/run_dictation_client_python.sh --custom-image=${service_image} --service-address=${test_service_address} --filename=${test_wave}" +phrase="serwis testowy" +check_output "${cmd}" "${phrase}" + +echo +echo "Testing: --interim-results" +cmd="${SCRIPTPATH}/../docker/run_dictation_client_python.sh --custom-image=${service_image} --service-address=${test_service_address} --filename=${test_wave} --interim-results" +phrase="serwis" +check_output "${cmd}" "${phrase}" + +echo +echo "Testing: --grpc-timeout" +cmd="${SCRIPTPATH}/../docker/run_dictation_client_python.sh --custom-image=${service_image} --service-address=${test_service_address} --filename=${test_wave} --grpc-timeout=50" +phrase="\"grpc_status\":4}" +check_output "${cmd}" "${phrase}" + +echo +echo "Testing: --time-offsets" +cmd="${SCRIPTPATH}/../docker/run_dictation_client_python.sh --custom-image=${service_image} --service-address=${test_service_address} --filename=${test_wave} --time-offsets" +phrase="testowy \[0.51 - 1.20\]" +check_output "${cmd}" "${phrase}" + +echo +echo "Testing: --recognition-timeout" +cmd="${SCRIPTPATH}/../docker/run_dictation_client_python.sh --custom-image=${service_image} --service-address=${test_service_address} --filename=${test_wave} --recognition-timeout=10" +phrase="serwis" +check_output "${cmd}" "${phrase}" + +echo +echo "Testing: --context-phrase" +cmd="${SCRIPTPATH}/../docker/run_dictation_client_python.sh --custom-image=${service_image} --service-address=${test_service_address} --filename=${test_context_wave} --context-phrase=context" +phrase="przedsięwzięcie" +check_output "${cmd}" "${phrase}" + + +test_result="success" diff --git a/python/tests/test_service_with_script_for_local_usage.sh b/python/tests/test_service_with_script_for_local_usage.sh new file mode 100755 index 0000000..b87b532 --- /dev/null +++ b/python/tests/test_service_with_script_for_local_usage.sh @@ -0,0 +1,85 @@ +#!/bin/bash +# coding=utf-8 + +set -euo pipefail +IFS=$'\n\t' + +SCRIPT=$(realpath "$0") +SCRIPTPATH=$(dirname "${SCRIPT}") + +test_result="fail" +test_service_address="demo.devtechmo.pl:51190" +test_wave="${SCRIPTPATH}/data/test.wav" +test_context_wave="${SCRIPTPATH}/data/test_context.wav" + + +function on_exit { + + if [[ $test_result == "fail" ]]; then + echo "-------------------------------------------------" + echo " SERVICE TEST WITH SCRIPT FOR LOCAL USAGE FAILED!" + echo "-------------------------------------------------" + else + echo "-----------------------------------------------------------------" + echo " SERVICE TEST WITH SCRIPT FOR LOCAL USAGE COMPLETED SUCCESSFULLY!" + echo "-----------------------------------------------------------------" + fi +} +trap on_exit EXIT + + +function check_output () { + + cmd="$1" + phrase="$2" + + set +e + output=$({ eval "$cmd" 1>&2; } 2>&1 ) # we want grep over output whether the command succeeds or not + set -e + echo "${output}" | grep "$phrase" > /dev/null 2>&1; # if this line returns non-0-code, 'set -e' will cause exit + echo "--> OK" +} + +echo +echo "------------------------------------------" +echo " SERVICE TEST WITH SCRIPT FOR LOCAL USAGE" +echo "------------------------------------------" + +echo +echo "Testing: basic recognition" +cmd="${SCRIPTPATH}/../run.sh --service-address ${test_service_address} --wave-path ${test_wave}" +phrase="serwis testowy" +check_output "${cmd}" "${phrase}" + +echo +echo "Testing: --interim-results" +cmd="${SCRIPTPATH}/../run.sh --service-address ${test_service_address} --wave-path ${test_wave} --interim-results" +phrase="serwis" +check_output "${cmd}" "${phrase}" + +echo +echo "Testing: --grpc-timeout" +cmd="${SCRIPTPATH}/../run.sh --service-address ${test_service_address} --wave-path ${test_wave} --grpc-timeout 50" +phrase="\"grpc_status\":4}" +check_output "${cmd}" "${phrase}" + +echo +echo "Testing: --time-offsets" +cmd="${SCRIPTPATH}/../run.sh --service-address ${test_service_address} --wave-path ${test_wave} --time-offsets" +phrase="testowy \[0.51 - 1.20\]" +check_output "${cmd}" "${phrase}" + +echo +echo "Testing: --recognition-timeout" +cmd="${SCRIPTPATH}/../run.sh --service-address ${test_service_address} --wave-path ${test_wave} --recognition-timeout 10" +phrase="serwis" +check_output "${cmd}" "${phrase}" + +echo +echo "Testing: --context-phrase" +cmd="${SCRIPTPATH}/../run.sh --service-address ${test_service_address} --wave-path ${test_context_wave} --context-phrase context" +phrase="przedsięwzięcie" +check_output "${cmd}" "${phrase}" + + +test_result="success"