From 0fd2554392560c34cc753f26bcbaf4e923b499d9 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 22 Feb 2021 12:22:04 -0800 Subject: [PATCH] feat(v1p1beta1): add support for Model Adaptation (#433) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/8440e2da-528d-412a-bf89-385b5618d6dd/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 358182033 Source-Link: https://github.com/googleapis/googleapis/commit/56c65edc8b946c95fa7ea0e4458412d3a8219c83 --- .../speech/v1p1beta1/AdaptationClient.java | 1312 +++++++++++++++ .../speech/v1p1beta1/AdaptationSettings.java | 285 ++++ .../cloud/speech/v1p1beta1/package-info.java | 15 + .../speech/v1p1beta1/stub/AdaptationStub.java | 105 ++ .../stub/AdaptationStubSettings.java | 614 +++++++ .../stub/GrpcAdaptationCallableFactory.java | 115 ++ .../v1p1beta1/stub/GrpcAdaptationStub.java | 502 ++++++ .../v1p1beta1/AdaptationClientTest.java | 838 ++++++++++ .../speech/v1p1beta1/MockAdaptation.java | 59 + .../speech/v1p1beta1/MockAdaptationImpl.java | 272 ++++ .../speech/v1p1beta1/AdaptationGrpc.java | 1412 +++++++++++++++++ .../v1p1beta1/CreateCustomClassRequest.java | 1167 ++++++++++++++ .../CreateCustomClassRequestOrBuilder.java | 130 ++ .../v1p1beta1/CreatePhraseSetRequest.java | 1167 ++++++++++++++ .../CreatePhraseSetRequestOrBuilder.java | 130 ++ .../cloud/speech/v1p1beta1/CustomClass.java | 14 +- .../v1p1beta1/CustomClassOrBuilder.java | 4 +- .../v1p1beta1/DeleteCustomClassRequest.java | 665 ++++++++ .../DeleteCustomClassRequestOrBuilder.java | 58 + .../v1p1beta1/DeletePhraseSetRequest.java | 665 ++++++++ .../DeletePhraseSetRequestOrBuilder.java | 58 + .../v1p1beta1/GetCustomClassRequest.java | 665 ++++++++ .../GetCustomClassRequestOrBuilder.java | 58 + .../speech/v1p1beta1/GetPhraseSetRequest.java | 665 ++++++++ .../GetPhraseSetRequestOrBuilder.java | 58 + .../v1p1beta1/ListCustomClassesRequest.java | 967 +++++++++++ .../ListCustomClassesRequestOrBuilder.java | 105 ++ .../v1p1beta1/ListCustomClassesResponse.java | 1148 ++++++++++++++ .../ListCustomClassesResponseOrBuilder.java | 104 ++ .../v1p1beta1/ListPhraseSetRequest.java | 967 +++++++++++ .../ListPhraseSetRequestOrBuilder.java | 105 ++ .../v1p1beta1/ListPhraseSetResponse.java | 1139 +++++++++++++ .../ListPhraseSetResponseOrBuilder.java | 104 ++ .../cloud/speech/v1p1beta1/LocationName.java | 192 +++ .../LongRunningRecognizeMetadata.java | 28 +- ...LongRunningRecognizeMetadataOrBuilder.java | 8 +- .../speech/v1p1beta1/RecognitionConfig.java | 6 +- .../speech/v1p1beta1/SpeechAdaptation.java | 348 +++- .../v1p1beta1/SpeechAdaptationOrBuilder.java | 61 +- .../v1p1beta1/SpeechAdaptationProto.java | 317 ++++ .../speech/v1p1beta1/SpeechResourceProto.java | 27 +- .../v1p1beta1/StreamingRecognitionConfig.java | 32 + .../StreamingRecognitionConfigOrBuilder.java | 8 + .../v1p1beta1/UpdateCustomClassRequest.java | 1067 +++++++++++++ .../UpdateCustomClassRequestOrBuilder.java | 110 ++ .../v1p1beta1/UpdatePhraseSetRequest.java | 1067 +++++++++++++ .../UpdatePhraseSetRequestOrBuilder.java | 110 ++ .../cloud/speech/v1p1beta1/cloud_speech.proto | 19 +- .../v1p1beta1/cloud_speech_adaptation.proto | 318 ++++ .../cloud/speech/v1p1beta1/resource.proto | 11 +- synth.metadata | 45 +- 51 files changed, 19351 insertions(+), 95 deletions(-) create mode 100644 google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationClient.java create mode 100644 google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationSettings.java create mode 100644 google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/AdaptationStub.java create mode 100644 google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/AdaptationStubSettings.java create mode 100644 google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcAdaptationCallableFactory.java create mode 100644 google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcAdaptationStub.java create mode 100644 google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/AdaptationClientTest.java create mode 100644 google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptation.java create mode 100644 google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptationImpl.java create mode 100644 grpc-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationGrpc.java create mode 100644 proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreateCustomClassRequest.java create mode 100644 proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreateCustomClassRequestOrBuilder.java create mode 100644 proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreatePhraseSetRequest.java create mode 100644 proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreatePhraseSetRequestOrBuilder.java create mode 100644 proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeleteCustomClassRequest.java create mode 100644 proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeleteCustomClassRequestOrBuilder.java create mode 100644 proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeletePhraseSetRequest.java create mode 100644 proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeletePhraseSetRequestOrBuilder.java create mode 100644 proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetCustomClassRequest.java create mode 100644 proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetCustomClassRequestOrBuilder.java create mode 100644 proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetPhraseSetRequest.java create mode 100644 proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetPhraseSetRequestOrBuilder.java create mode 100644 proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesRequest.java create mode 100644 proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesRequestOrBuilder.java create mode 100644 proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesResponse.java create mode 100644 proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesResponseOrBuilder.java create mode 100644 proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetRequest.java create mode 100644 proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetRequestOrBuilder.java create mode 100644 proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetResponse.java create mode 100644 proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetResponseOrBuilder.java create mode 100644 proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LocationName.java create mode 100644 proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationProto.java create mode 100644 proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdateCustomClassRequest.java create mode 100644 proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdateCustomClassRequestOrBuilder.java create mode 100644 proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdatePhraseSetRequest.java create mode 100644 proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdatePhraseSetRequestOrBuilder.java create mode 100644 proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationClient.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationClient.java new file mode 100644 index 000000000..023f3f31e --- /dev/null +++ b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationClient.java @@ -0,0 +1,1312 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.speech.v1p1beta1.stub.AdaptationStub; +import com.google.cloud.speech.v1p1beta1.stub.AdaptationStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service that implements Google Cloud Speech Adaptation API. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   PhraseSet phraseSet = PhraseSet.newBuilder().build();
+ *   String phraseSetId = "phraseSetId959902180";
+ *   PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the AdaptationClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of AdaptationSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * AdaptationSettings adaptationSettings =
+ *     AdaptationSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * AdaptationSettings adaptationSettings =
+ *     AdaptationSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class AdaptationClient implements BackgroundResource { + private final AdaptationSettings settings; + private final AdaptationStub stub; + + /** Constructs an instance of AdaptationClient with default settings. */ + public static final AdaptationClient create() throws IOException { + return create(AdaptationSettings.newBuilder().build()); + } + + /** + * Constructs an instance of AdaptationClient, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. + */ + public static final AdaptationClient create(AdaptationSettings settings) throws IOException { + return new AdaptationClient(settings); + } + + /** + * Constructs an instance of AdaptationClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(AdaptationSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final AdaptationClient create(AdaptationStub stub) { + return new AdaptationClient(stub); + } + + /** + * Constructs an instance of AdaptationClient, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected AdaptationClient(AdaptationSettings settings) throws IOException { + this.settings = settings; + this.stub = ((AdaptationStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected AdaptationClient(AdaptationStub stub) { + this.settings = null; + this.stub = stub; + } + + public final AdaptationSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public AdaptationStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. + * The items in the PhraseSet are favored by the recognition model when you send a call that + * includes the PhraseSet. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   PhraseSet phraseSet = PhraseSet.newBuilder().build();
+   *   String phraseSetId = "phraseSetId959902180";
+   *   PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource where this phrase set will be created. Format: + * {api_version}/projects/{project}/locations/{location}/phraseSets + * @param phraseSet Required. The phrase set to create. + * @param phraseSetId The ID to use for the phrase set, which will become the final component of + * the phrase set's resource name. + *

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PhraseSet createPhraseSet( + LocationName parent, PhraseSet phraseSet, String phraseSetId) { + CreatePhraseSetRequest request = + CreatePhraseSetRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setPhraseSet(phraseSet) + .setPhraseSetId(phraseSetId) + .build(); + return createPhraseSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. + * The items in the PhraseSet are favored by the recognition model when you send a call that + * includes the PhraseSet. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   String parent = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString();
+   *   PhraseSet phraseSet = PhraseSet.newBuilder().build();
+   *   String phraseSetId = "phraseSetId959902180";
+   *   PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource where this phrase set will be created. Format: + * {api_version}/projects/{project}/locations/{location}/phraseSets + * @param phraseSet Required. The phrase set to create. + * @param phraseSetId The ID to use for the phrase set, which will become the final component of + * the phrase set's resource name. + *

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PhraseSet createPhraseSet(String parent, PhraseSet phraseSet, String phraseSetId) { + CreatePhraseSetRequest request = + CreatePhraseSetRequest.newBuilder() + .setParent(parent) + .setPhraseSet(phraseSet) + .setPhraseSetId(phraseSetId) + .build(); + return createPhraseSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. + * The items in the PhraseSet are favored by the recognition model when you send a call that + * includes the PhraseSet. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   CreatePhraseSetRequest request =
+   *       CreatePhraseSetRequest.newBuilder()
+   *           .setParent(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
+   *           .setPhraseSetId("phraseSetId959902180")
+   *           .setPhraseSet(PhraseSet.newBuilder().build())
+   *           .build();
+   *   PhraseSet response = adaptationClient.createPhraseSet(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PhraseSet createPhraseSet(CreatePhraseSetRequest request) { + return createPhraseSetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. + * The items in the PhraseSet are favored by the recognition model when you send a call that + * includes the PhraseSet. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   CreatePhraseSetRequest request =
+   *       CreatePhraseSetRequest.newBuilder()
+   *           .setParent(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
+   *           .setPhraseSetId("phraseSetId959902180")
+   *           .setPhraseSet(PhraseSet.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = adaptationClient.createPhraseSetCallable().futureCall(request);
+   *   // Do something.
+   *   PhraseSet response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createPhraseSetCallable() { + return stub.createPhraseSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a phrase set. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]");
+   *   PhraseSet response = adaptationClient.getPhraseSet(name);
+   * }
+   * }
+ * + * @param name Required. The name of the phrase set to retrieve. Format: + * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PhraseSet getPhraseSet(PhraseSetName name) { + GetPhraseSetRequest request = + GetPhraseSetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getPhraseSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a phrase set. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   String name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString();
+   *   PhraseSet response = adaptationClient.getPhraseSet(name);
+   * }
+   * }
+ * + * @param name Required. The name of the phrase set to retrieve. Format: + * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PhraseSet getPhraseSet(String name) { + GetPhraseSetRequest request = GetPhraseSetRequest.newBuilder().setName(name).build(); + return getPhraseSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a phrase set. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   GetPhraseSetRequest request =
+   *       GetPhraseSetRequest.newBuilder()
+   *           .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
+   *           .build();
+   *   PhraseSet response = adaptationClient.getPhraseSet(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PhraseSet getPhraseSet(GetPhraseSetRequest request) { + return getPhraseSetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a phrase set. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   GetPhraseSetRequest request =
+   *       GetPhraseSetRequest.newBuilder()
+   *           .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
+   *           .build();
+   *   ApiFuture future = adaptationClient.getPhraseSetCallable().futureCall(request);
+   *   // Do something.
+   *   PhraseSet response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getPhraseSetCallable() { + return stub.getPhraseSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List phrase sets. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (PhraseSet element : adaptationClient.listPhraseSet(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of phrase set. Format: + * projects/{project}/locations/{location} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPhraseSetPagedResponse listPhraseSet(LocationName parent) { + ListPhraseSetRequest request = + ListPhraseSetRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listPhraseSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List phrase sets. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   String parent = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString();
+   *   for (PhraseSet element : adaptationClient.listPhraseSet(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of phrase set. Format: + * projects/{project}/locations/{location} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPhraseSetPagedResponse listPhraseSet(String parent) { + ListPhraseSetRequest request = ListPhraseSetRequest.newBuilder().setParent(parent).build(); + return listPhraseSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List phrase sets. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   ListPhraseSetRequest request =
+   *       ListPhraseSetRequest.newBuilder()
+   *           .setParent(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (PhraseSet element : adaptationClient.listPhraseSet(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPhraseSetPagedResponse listPhraseSet(ListPhraseSetRequest request) { + return listPhraseSetPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List phrase sets. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   ListPhraseSetRequest request =
+   *       ListPhraseSetRequest.newBuilder()
+   *           .setParent(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       adaptationClient.listPhraseSetPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (PhraseSet element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listPhraseSetPagedCallable() { + return stub.listPhraseSetPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List phrase sets. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   while (true) {
+   *     ListPhraseSetResponse response = adaptationClient.listPhraseSetCallable().call(request);
+   *     for (PhraseSet element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listPhraseSetCallable() { + return stub.listPhraseSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a phrase set. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   UpdatePhraseSetRequest request =
+   *       UpdatePhraseSetRequest.newBuilder()
+   *           .setPhraseSet(PhraseSet.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   PhraseSet response = adaptationClient.updatePhraseSet(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PhraseSet updatePhraseSet(UpdatePhraseSetRequest request) { + return updatePhraseSetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a phrase set. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   UpdatePhraseSetRequest request =
+   *       UpdatePhraseSetRequest.newBuilder()
+   *           .setPhraseSet(PhraseSet.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = adaptationClient.updatePhraseSetCallable().futureCall(request);
+   *   // Do something.
+   *   PhraseSet response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updatePhraseSetCallable() { + return stub.updatePhraseSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a phrase set. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]");
+   *   adaptationClient.deletePhraseSet(name);
+   * }
+   * }
+ * + * @param name Required. The name of the phrase set to delete. Format: + * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deletePhraseSet(PhraseSetName name) { + DeletePhraseSetRequest request = + DeletePhraseSetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deletePhraseSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a phrase set. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   String name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString();
+   *   adaptationClient.deletePhraseSet(name);
+   * }
+   * }
+ * + * @param name Required. The name of the phrase set to delete. Format: + * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deletePhraseSet(String name) { + DeletePhraseSetRequest request = DeletePhraseSetRequest.newBuilder().setName(name).build(); + deletePhraseSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a phrase set. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   DeletePhraseSetRequest request =
+   *       DeletePhraseSetRequest.newBuilder()
+   *           .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
+   *           .build();
+   *   adaptationClient.deletePhraseSet(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deletePhraseSet(DeletePhraseSetRequest request) { + deletePhraseSetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a phrase set. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   DeletePhraseSetRequest request =
+   *       DeletePhraseSetRequest.newBuilder()
+   *           .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
+   *           .build();
+   *   ApiFuture future = adaptationClient.deletePhraseSetCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deletePhraseSetCallable() { + return stub.deletePhraseSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a custom class. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   CustomClass customClass = CustomClass.newBuilder().build();
+   *   String customClassId = "customClassId1871032322";
+   *   CustomClass response = adaptationClient.createCustomClass(parent, customClass, customClassId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource where this custom class will be created. Format: + * {api_version}/projects/{project}/locations/{location}/customClasses + * @param customClass Required. The custom class to create. + * @param customClassId The ID to use for the custom class, which will become the final component + * of the custom class' resource name. + *

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CustomClass createCustomClass( + LocationName parent, CustomClass customClass, String customClassId) { + CreateCustomClassRequest request = + CreateCustomClassRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setCustomClass(customClass) + .setCustomClassId(customClassId) + .build(); + return createCustomClass(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a custom class. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   String parent = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString();
+   *   CustomClass customClass = CustomClass.newBuilder().build();
+   *   String customClassId = "customClassId1871032322";
+   *   CustomClass response = adaptationClient.createCustomClass(parent, customClass, customClassId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource where this custom class will be created. Format: + * {api_version}/projects/{project}/locations/{location}/customClasses + * @param customClass Required. The custom class to create. + * @param customClassId The ID to use for the custom class, which will become the final component + * of the custom class' resource name. + *

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CustomClass createCustomClass( + String parent, CustomClass customClass, String customClassId) { + CreateCustomClassRequest request = + CreateCustomClassRequest.newBuilder() + .setParent(parent) + .setCustomClass(customClass) + .setCustomClassId(customClassId) + .build(); + return createCustomClass(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a custom class. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   CreateCustomClassRequest request =
+   *       CreateCustomClassRequest.newBuilder()
+   *           .setParent(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
+   *           .setCustomClassId("customClassId1871032322")
+   *           .setCustomClass(CustomClass.newBuilder().build())
+   *           .build();
+   *   CustomClass response = adaptationClient.createCustomClass(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CustomClass createCustomClass(CreateCustomClassRequest request) { + return createCustomClassCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a custom class. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   CreateCustomClassRequest request =
+   *       CreateCustomClassRequest.newBuilder()
+   *           .setParent(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
+   *           .setCustomClassId("customClassId1871032322")
+   *           .setCustomClass(CustomClass.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       adaptationClient.createCustomClassCallable().futureCall(request);
+   *   // Do something.
+   *   CustomClass response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createCustomClassCallable() { + return stub.createCustomClassCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a custom class. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]");
+   *   CustomClass response = adaptationClient.getCustomClass(name);
+   * }
+   * }
+ * + * @param name Required. The name of the custom class to retrieve. Format: + * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CustomClass getCustomClass(CustomClassName name) { + GetCustomClassRequest request = + GetCustomClassRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getCustomClass(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a custom class. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   String name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString();
+   *   CustomClass response = adaptationClient.getCustomClass(name);
+   * }
+   * }
+ * + * @param name Required. The name of the custom class to retrieve. Format: + * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CustomClass getCustomClass(String name) { + GetCustomClassRequest request = GetCustomClassRequest.newBuilder().setName(name).build(); + return getCustomClass(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a custom class. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   GetCustomClassRequest request =
+   *       GetCustomClassRequest.newBuilder()
+   *           .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
+   *           .build();
+   *   CustomClass response = adaptationClient.getCustomClass(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CustomClass getCustomClass(GetCustomClassRequest request) { + return getCustomClassCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a custom class. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   GetCustomClassRequest request =
+   *       GetCustomClassRequest.newBuilder()
+   *           .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
+   *           .build();
+   *   ApiFuture future = adaptationClient.getCustomClassCallable().futureCall(request);
+   *   // Do something.
+   *   CustomClass response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getCustomClassCallable() { + return stub.getCustomClassCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List custom classes. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (CustomClass element : adaptationClient.listCustomClasses(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of custom classes. Format: + * {api_version}/projects/{project}/locations/{location}/customClasses + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListCustomClassesPagedResponse listCustomClasses(LocationName parent) { + ListCustomClassesRequest request = + ListCustomClassesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listCustomClasses(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List custom classes. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   String parent = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString();
+   *   for (CustomClass element : adaptationClient.listCustomClasses(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of custom classes. Format: + * {api_version}/projects/{project}/locations/{location}/customClasses + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListCustomClassesPagedResponse listCustomClasses(String parent) { + ListCustomClassesRequest request = + ListCustomClassesRequest.newBuilder().setParent(parent).build(); + return listCustomClasses(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List custom classes. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   ListCustomClassesRequest request =
+   *       ListCustomClassesRequest.newBuilder()
+   *           .setParent(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (CustomClass element : adaptationClient.listCustomClasses(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListCustomClassesPagedResponse listCustomClasses(ListCustomClassesRequest request) { + return listCustomClassesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List custom classes. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   ListCustomClassesRequest request =
+   *       ListCustomClassesRequest.newBuilder()
+   *           .setParent(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       adaptationClient.listCustomClassesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (CustomClass element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listCustomClassesPagedCallable() { + return stub.listCustomClassesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List custom classes. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   while (true) {
+   *     ListCustomClassesResponse response =
+   *         adaptationClient.listCustomClassesCallable().call(request);
+   *     for (CustomClass element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listCustomClassesCallable() { + return stub.listCustomClassesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a custom class. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   UpdateCustomClassRequest request =
+   *       UpdateCustomClassRequest.newBuilder()
+   *           .setCustomClass(CustomClass.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   CustomClass response = adaptationClient.updateCustomClass(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CustomClass updateCustomClass(UpdateCustomClassRequest request) { + return updateCustomClassCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a custom class. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   UpdateCustomClassRequest request =
+   *       UpdateCustomClassRequest.newBuilder()
+   *           .setCustomClass(CustomClass.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       adaptationClient.updateCustomClassCallable().futureCall(request);
+   *   // Do something.
+   *   CustomClass response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateCustomClassCallable() { + return stub.updateCustomClassCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a custom class. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]");
+   *   adaptationClient.deleteCustomClass(name);
+   * }
+   * }
+ * + * @param name Required. The name of the custom class to delete. Format: + * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteCustomClass(CustomClassName name) { + DeleteCustomClassRequest request = + DeleteCustomClassRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteCustomClass(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a custom class. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   String name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString();
+   *   adaptationClient.deleteCustomClass(name);
+   * }
+   * }
+ * + * @param name Required. The name of the custom class to delete. Format: + * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteCustomClass(String name) { + DeleteCustomClassRequest request = DeleteCustomClassRequest.newBuilder().setName(name).build(); + deleteCustomClass(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a custom class. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   DeleteCustomClassRequest request =
+   *       DeleteCustomClassRequest.newBuilder()
+   *           .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
+   *           .build();
+   *   adaptationClient.deleteCustomClass(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteCustomClass(DeleteCustomClassRequest request) { + deleteCustomClassCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a custom class. + * + *

Sample code: + * + *

{@code
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   DeleteCustomClassRequest request =
+   *       DeleteCustomClassRequest.newBuilder()
+   *           .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
+   *           .build();
+   *   ApiFuture future = adaptationClient.deleteCustomClassCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteCustomClassCallable() { + return stub.deleteCustomClassCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListPhraseSetPagedResponse + extends AbstractPagedListResponse< + ListPhraseSetRequest, + ListPhraseSetResponse, + PhraseSet, + ListPhraseSetPage, + ListPhraseSetFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListPhraseSetPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListPhraseSetPagedResponse apply(ListPhraseSetPage input) { + return new ListPhraseSetPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListPhraseSetPagedResponse(ListPhraseSetPage page) { + super(page, ListPhraseSetFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListPhraseSetPage + extends AbstractPage< + ListPhraseSetRequest, ListPhraseSetResponse, PhraseSet, ListPhraseSetPage> { + + private ListPhraseSetPage( + PageContext context, + ListPhraseSetResponse response) { + super(context, response); + } + + private static ListPhraseSetPage createEmptyPage() { + return new ListPhraseSetPage(null, null); + } + + @Override + protected ListPhraseSetPage createPage( + PageContext context, + ListPhraseSetResponse response) { + return new ListPhraseSetPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListPhraseSetFixedSizeCollection + extends AbstractFixedSizeCollection< + ListPhraseSetRequest, + ListPhraseSetResponse, + PhraseSet, + ListPhraseSetPage, + ListPhraseSetFixedSizeCollection> { + + private ListPhraseSetFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListPhraseSetFixedSizeCollection createEmptyCollection() { + return new ListPhraseSetFixedSizeCollection(null, 0); + } + + @Override + protected ListPhraseSetFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListPhraseSetFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListCustomClassesPagedResponse + extends AbstractPagedListResponse< + ListCustomClassesRequest, + ListCustomClassesResponse, + CustomClass, + ListCustomClassesPage, + ListCustomClassesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListCustomClassesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListCustomClassesPagedResponse apply(ListCustomClassesPage input) { + return new ListCustomClassesPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListCustomClassesPagedResponse(ListCustomClassesPage page) { + super(page, ListCustomClassesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListCustomClassesPage + extends AbstractPage< + ListCustomClassesRequest, ListCustomClassesResponse, CustomClass, ListCustomClassesPage> { + + private ListCustomClassesPage( + PageContext context, + ListCustomClassesResponse response) { + super(context, response); + } + + private static ListCustomClassesPage createEmptyPage() { + return new ListCustomClassesPage(null, null); + } + + @Override + protected ListCustomClassesPage createPage( + PageContext context, + ListCustomClassesResponse response) { + return new ListCustomClassesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListCustomClassesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListCustomClassesRequest, + ListCustomClassesResponse, + CustomClass, + ListCustomClassesPage, + ListCustomClassesFixedSizeCollection> { + + private ListCustomClassesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListCustomClassesFixedSizeCollection createEmptyCollection() { + return new ListCustomClassesFixedSizeCollection(null, 0); + } + + @Override + protected ListCustomClassesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListCustomClassesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationSettings.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationSettings.java new file mode 100644 index 000000000..11fd5c5e2 --- /dev/null +++ b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationSettings.java @@ -0,0 +1,285 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1; + +import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListCustomClassesPagedResponse; +import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListPhraseSetPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.speech.v1p1beta1.stub.AdaptationStubSettings; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link AdaptationClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (speech.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of createPhraseSet to 30 seconds: + * + *

{@code
+ * AdaptationSettings.Builder adaptationSettingsBuilder = AdaptationSettings.newBuilder();
+ * adaptationSettingsBuilder
+ *     .createPhraseSetSettings()
+ *     .setRetrySettings(
+ *         adaptationSettingsBuilder
+ *             .createPhraseSetSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AdaptationSettings adaptationSettings = adaptationSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class AdaptationSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createPhraseSet. */ + public UnaryCallSettings createPhraseSetSettings() { + return ((AdaptationStubSettings) getStubSettings()).createPhraseSetSettings(); + } + + /** Returns the object with the settings used for calls to getPhraseSet. */ + public UnaryCallSettings getPhraseSetSettings() { + return ((AdaptationStubSettings) getStubSettings()).getPhraseSetSettings(); + } + + /** Returns the object with the settings used for calls to listPhraseSet. */ + public PagedCallSettings + listPhraseSetSettings() { + return ((AdaptationStubSettings) getStubSettings()).listPhraseSetSettings(); + } + + /** Returns the object with the settings used for calls to updatePhraseSet. */ + public UnaryCallSettings updatePhraseSetSettings() { + return ((AdaptationStubSettings) getStubSettings()).updatePhraseSetSettings(); + } + + /** Returns the object with the settings used for calls to deletePhraseSet. */ + public UnaryCallSettings deletePhraseSetSettings() { + return ((AdaptationStubSettings) getStubSettings()).deletePhraseSetSettings(); + } + + /** Returns the object with the settings used for calls to createCustomClass. */ + public UnaryCallSettings createCustomClassSettings() { + return ((AdaptationStubSettings) getStubSettings()).createCustomClassSettings(); + } + + /** Returns the object with the settings used for calls to getCustomClass. */ + public UnaryCallSettings getCustomClassSettings() { + return ((AdaptationStubSettings) getStubSettings()).getCustomClassSettings(); + } + + /** Returns the object with the settings used for calls to listCustomClasses. */ + public PagedCallSettings< + ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> + listCustomClassesSettings() { + return ((AdaptationStubSettings) getStubSettings()).listCustomClassesSettings(); + } + + /** Returns the object with the settings used for calls to updateCustomClass. */ + public UnaryCallSettings updateCustomClassSettings() { + return ((AdaptationStubSettings) getStubSettings()).updateCustomClassSettings(); + } + + /** Returns the object with the settings used for calls to deleteCustomClass. */ + public UnaryCallSettings deleteCustomClassSettings() { + return ((AdaptationStubSettings) getStubSettings()).deleteCustomClassSettings(); + } + + public static final AdaptationSettings create(AdaptationStubSettings stub) throws IOException { + return new AdaptationSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return AdaptationStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return AdaptationStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return AdaptationStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return AdaptationStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return AdaptationStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return AdaptationStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AdaptationStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected AdaptationSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for AdaptationSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(AdaptationStubSettings.newBuilder(clientContext)); + } + + protected Builder(AdaptationSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(AdaptationStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(AdaptationStubSettings.newBuilder()); + } + + public AdaptationStubSettings.Builder getStubSettingsBuilder() { + return ((AdaptationStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createPhraseSet. */ + public UnaryCallSettings.Builder createPhraseSetSettings() { + return getStubSettingsBuilder().createPhraseSetSettings(); + } + + /** Returns the builder for the settings used for calls to getPhraseSet. */ + public UnaryCallSettings.Builder getPhraseSetSettings() { + return getStubSettingsBuilder().getPhraseSetSettings(); + } + + /** Returns the builder for the settings used for calls to listPhraseSet. */ + public PagedCallSettings.Builder< + ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse> + listPhraseSetSettings() { + return getStubSettingsBuilder().listPhraseSetSettings(); + } + + /** Returns the builder for the settings used for calls to updatePhraseSet. */ + public UnaryCallSettings.Builder updatePhraseSetSettings() { + return getStubSettingsBuilder().updatePhraseSetSettings(); + } + + /** Returns the builder for the settings used for calls to deletePhraseSet. */ + public UnaryCallSettings.Builder deletePhraseSetSettings() { + return getStubSettingsBuilder().deletePhraseSetSettings(); + } + + /** Returns the builder for the settings used for calls to createCustomClass. */ + public UnaryCallSettings.Builder + createCustomClassSettings() { + return getStubSettingsBuilder().createCustomClassSettings(); + } + + /** Returns the builder for the settings used for calls to getCustomClass. */ + public UnaryCallSettings.Builder getCustomClassSettings() { + return getStubSettingsBuilder().getCustomClassSettings(); + } + + /** Returns the builder for the settings used for calls to listCustomClasses. */ + public PagedCallSettings.Builder< + ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> + listCustomClassesSettings() { + return getStubSettingsBuilder().listCustomClassesSettings(); + } + + /** Returns the builder for the settings used for calls to updateCustomClass. */ + public UnaryCallSettings.Builder + updateCustomClassSettings() { + return getStubSettingsBuilder().updateCustomClassSettings(); + } + + /** Returns the builder for the settings used for calls to deleteCustomClass. */ + public UnaryCallSettings.Builder deleteCustomClassSettings() { + return getStubSettingsBuilder().deleteCustomClassSettings(); + } + + @Override + public AdaptationSettings build() throws IOException { + return new AdaptationSettings(this); + } + } +} diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/package-info.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/package-info.java index dc873e742..a3680552c 100644 --- a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/package-info.java +++ b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/package-info.java @@ -30,6 +30,21 @@ * RecognizeResponse response = speechClient.recognize(config, audio); * } * } + * + *

======================= AdaptationClient ======================= + * + *

Service Description: Service that implements Google Cloud Speech Adaptation API. + * + *

Sample for AdaptationClient: + * + *

{@code
+ * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   PhraseSet phraseSet = PhraseSet.newBuilder().build();
+ *   String phraseSetId = "phraseSetId959902180";
+ *   PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId);
+ * }
+ * }
*/ @Generated("by gapic-generator-java") package com.google.cloud.speech.v1p1beta1; diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/AdaptationStub.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/AdaptationStub.java new file mode 100644 index 000000000..4ee410425 --- /dev/null +++ b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/AdaptationStub.java @@ -0,0 +1,105 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.stub; + +import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListCustomClassesPagedResponse; +import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListPhraseSetPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.CustomClass; +import com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.GetCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest; +import com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse; +import com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse; +import com.google.cloud.speech.v1p1beta1.PhraseSet; +import com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Adaptation service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class AdaptationStub implements BackgroundResource { + + public UnaryCallable createPhraseSetCallable() { + throw new UnsupportedOperationException("Not implemented: createPhraseSetCallable()"); + } + + public UnaryCallable getPhraseSetCallable() { + throw new UnsupportedOperationException("Not implemented: getPhraseSetCallable()"); + } + + public UnaryCallable + listPhraseSetPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listPhraseSetPagedCallable()"); + } + + public UnaryCallable listPhraseSetCallable() { + throw new UnsupportedOperationException("Not implemented: listPhraseSetCallable()"); + } + + public UnaryCallable updatePhraseSetCallable() { + throw new UnsupportedOperationException("Not implemented: updatePhraseSetCallable()"); + } + + public UnaryCallable deletePhraseSetCallable() { + throw new UnsupportedOperationException("Not implemented: deletePhraseSetCallable()"); + } + + public UnaryCallable createCustomClassCallable() { + throw new UnsupportedOperationException("Not implemented: createCustomClassCallable()"); + } + + public UnaryCallable getCustomClassCallable() { + throw new UnsupportedOperationException("Not implemented: getCustomClassCallable()"); + } + + public UnaryCallable + listCustomClassesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listCustomClassesPagedCallable()"); + } + + public UnaryCallable + listCustomClassesCallable() { + throw new UnsupportedOperationException("Not implemented: listCustomClassesCallable()"); + } + + public UnaryCallable updateCustomClassCallable() { + throw new UnsupportedOperationException("Not implemented: updateCustomClassCallable()"); + } + + public UnaryCallable deleteCustomClassCallable() { + throw new UnsupportedOperationException("Not implemented: deleteCustomClassCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/AdaptationStubSettings.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/AdaptationStubSettings.java new file mode 100644 index 000000000..bd2147218 --- /dev/null +++ b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/AdaptationStubSettings.java @@ -0,0 +1,614 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.stub; + +import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListCustomClassesPagedResponse; +import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListPhraseSetPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.CustomClass; +import com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.GetCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest; +import com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse; +import com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse; +import com.google.cloud.speech.v1p1beta1.PhraseSet; +import com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link AdaptationStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (speech.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of createPhraseSet to 30 seconds: + * + *

{@code
+ * AdaptationStubSettings.Builder adaptationSettingsBuilder = AdaptationStubSettings.newBuilder();
+ * adaptationSettingsBuilder
+ *     .createPhraseSetSettings()
+ *     .setRetrySettings(
+ *         adaptationSettingsBuilder
+ *             .createPhraseSetSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AdaptationStubSettings adaptationSettings = adaptationSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class AdaptationStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings createPhraseSetSettings; + private final UnaryCallSettings getPhraseSetSettings; + private final PagedCallSettings< + ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse> + listPhraseSetSettings; + private final UnaryCallSettings updatePhraseSetSettings; + private final UnaryCallSettings deletePhraseSetSettings; + private final UnaryCallSettings createCustomClassSettings; + private final UnaryCallSettings getCustomClassSettings; + private final PagedCallSettings< + ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> + listCustomClassesSettings; + private final UnaryCallSettings updateCustomClassSettings; + private final UnaryCallSettings deleteCustomClassSettings; + + private static final PagedListDescriptor + LIST_PHRASE_SET_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListPhraseSetRequest injectToken(ListPhraseSetRequest payload, String token) { + return ListPhraseSetRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListPhraseSetRequest injectPageSize(ListPhraseSetRequest payload, int pageSize) { + return ListPhraseSetRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListPhraseSetRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListPhraseSetResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListPhraseSetResponse payload) { + return payload.getPhraseSetsList() == null + ? ImmutableList.of() + : payload.getPhraseSetsList(); + } + }; + + private static final PagedListDescriptor< + ListCustomClassesRequest, ListCustomClassesResponse, CustomClass> + LIST_CUSTOM_CLASSES_PAGE_STR_DESC = + new PagedListDescriptor< + ListCustomClassesRequest, ListCustomClassesResponse, CustomClass>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListCustomClassesRequest injectToken( + ListCustomClassesRequest payload, String token) { + return ListCustomClassesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListCustomClassesRequest injectPageSize( + ListCustomClassesRequest payload, int pageSize) { + return ListCustomClassesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListCustomClassesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListCustomClassesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListCustomClassesResponse payload) { + return payload.getCustomClassesList() == null + ? ImmutableList.of() + : payload.getCustomClassesList(); + } + }; + + private static final PagedListResponseFactory< + ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse> + LIST_PHRASE_SET_PAGE_STR_FACT = + new PagedListResponseFactory< + ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListPhraseSetRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_PHRASE_SET_PAGE_STR_DESC, request, context); + return ListPhraseSetPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> + LIST_CUSTOM_CLASSES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListCustomClassesRequest, + ListCustomClassesResponse, + ListCustomClassesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListCustomClassesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_CUSTOM_CLASSES_PAGE_STR_DESC, request, context); + return ListCustomClassesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createPhraseSet. */ + public UnaryCallSettings createPhraseSetSettings() { + return createPhraseSetSettings; + } + + /** Returns the object with the settings used for calls to getPhraseSet. */ + public UnaryCallSettings getPhraseSetSettings() { + return getPhraseSetSettings; + } + + /** Returns the object with the settings used for calls to listPhraseSet. */ + public PagedCallSettings + listPhraseSetSettings() { + return listPhraseSetSettings; + } + + /** Returns the object with the settings used for calls to updatePhraseSet. */ + public UnaryCallSettings updatePhraseSetSettings() { + return updatePhraseSetSettings; + } + + /** Returns the object with the settings used for calls to deletePhraseSet. */ + public UnaryCallSettings deletePhraseSetSettings() { + return deletePhraseSetSettings; + } + + /** Returns the object with the settings used for calls to createCustomClass. */ + public UnaryCallSettings createCustomClassSettings() { + return createCustomClassSettings; + } + + /** Returns the object with the settings used for calls to getCustomClass. */ + public UnaryCallSettings getCustomClassSettings() { + return getCustomClassSettings; + } + + /** Returns the object with the settings used for calls to listCustomClasses. */ + public PagedCallSettings< + ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> + listCustomClassesSettings() { + return listCustomClassesSettings; + } + + /** Returns the object with the settings used for calls to updateCustomClass. */ + public UnaryCallSettings updateCustomClassSettings() { + return updateCustomClassSettings; + } + + /** Returns the object with the settings used for calls to deleteCustomClass. */ + public UnaryCallSettings deleteCustomClassSettings() { + return deleteCustomClassSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public AdaptationStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcAdaptationStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "speech.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(AdaptationStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected AdaptationStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createPhraseSetSettings = settingsBuilder.createPhraseSetSettings().build(); + getPhraseSetSettings = settingsBuilder.getPhraseSetSettings().build(); + listPhraseSetSettings = settingsBuilder.listPhraseSetSettings().build(); + updatePhraseSetSettings = settingsBuilder.updatePhraseSetSettings().build(); + deletePhraseSetSettings = settingsBuilder.deletePhraseSetSettings().build(); + createCustomClassSettings = settingsBuilder.createCustomClassSettings().build(); + getCustomClassSettings = settingsBuilder.getCustomClassSettings().build(); + listCustomClassesSettings = settingsBuilder.listCustomClassesSettings().build(); + updateCustomClassSettings = settingsBuilder.updateCustomClassSettings().build(); + deleteCustomClassSettings = settingsBuilder.deleteCustomClassSettings().build(); + } + + /** Builder for AdaptationStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + createPhraseSetSettings; + private final UnaryCallSettings.Builder getPhraseSetSettings; + private final PagedCallSettings.Builder< + ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse> + listPhraseSetSettings; + private final UnaryCallSettings.Builder + updatePhraseSetSettings; + private final UnaryCallSettings.Builder deletePhraseSetSettings; + private final UnaryCallSettings.Builder + createCustomClassSettings; + private final UnaryCallSettings.Builder + getCustomClassSettings; + private final PagedCallSettings.Builder< + ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> + listCustomClassesSettings; + private final UnaryCallSettings.Builder + updateCustomClassSettings; + private final UnaryCallSettings.Builder + deleteCustomClassSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createPhraseSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getPhraseSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listPhraseSetSettings = PagedCallSettings.newBuilder(LIST_PHRASE_SET_PAGE_STR_FACT); + updatePhraseSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deletePhraseSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createCustomClassSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getCustomClassSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listCustomClassesSettings = PagedCallSettings.newBuilder(LIST_CUSTOM_CLASSES_PAGE_STR_FACT); + updateCustomClassSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteCustomClassSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createPhraseSetSettings, + getPhraseSetSettings, + listPhraseSetSettings, + updatePhraseSetSettings, + deletePhraseSetSettings, + createCustomClassSettings, + getCustomClassSettings, + listCustomClassesSettings, + updateCustomClassSettings, + deleteCustomClassSettings); + initDefaults(this); + } + + protected Builder(AdaptationStubSettings settings) { + super(settings); + + createPhraseSetSettings = settings.createPhraseSetSettings.toBuilder(); + getPhraseSetSettings = settings.getPhraseSetSettings.toBuilder(); + listPhraseSetSettings = settings.listPhraseSetSettings.toBuilder(); + updatePhraseSetSettings = settings.updatePhraseSetSettings.toBuilder(); + deletePhraseSetSettings = settings.deletePhraseSetSettings.toBuilder(); + createCustomClassSettings = settings.createCustomClassSettings.toBuilder(); + getCustomClassSettings = settings.getCustomClassSettings.toBuilder(); + listCustomClassesSettings = settings.listCustomClassesSettings.toBuilder(); + updateCustomClassSettings = settings.updateCustomClassSettings.toBuilder(); + deleteCustomClassSettings = settings.deleteCustomClassSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createPhraseSetSettings, + getPhraseSetSettings, + listPhraseSetSettings, + updatePhraseSetSettings, + deletePhraseSetSettings, + createCustomClassSettings, + getCustomClassSettings, + listCustomClassesSettings, + updateCustomClassSettings, + deleteCustomClassSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createPhraseSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getPhraseSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listPhraseSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updatePhraseSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deletePhraseSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createCustomClassSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getCustomClassSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listCustomClassesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateCustomClassSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteCustomClassSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + return builder; + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createPhraseSet. */ + public UnaryCallSettings.Builder createPhraseSetSettings() { + return createPhraseSetSettings; + } + + /** Returns the builder for the settings used for calls to getPhraseSet. */ + public UnaryCallSettings.Builder getPhraseSetSettings() { + return getPhraseSetSettings; + } + + /** Returns the builder for the settings used for calls to listPhraseSet. */ + public PagedCallSettings.Builder< + ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse> + listPhraseSetSettings() { + return listPhraseSetSettings; + } + + /** Returns the builder for the settings used for calls to updatePhraseSet. */ + public UnaryCallSettings.Builder updatePhraseSetSettings() { + return updatePhraseSetSettings; + } + + /** Returns the builder for the settings used for calls to deletePhraseSet. */ + public UnaryCallSettings.Builder deletePhraseSetSettings() { + return deletePhraseSetSettings; + } + + /** Returns the builder for the settings used for calls to createCustomClass. */ + public UnaryCallSettings.Builder + createCustomClassSettings() { + return createCustomClassSettings; + } + + /** Returns the builder for the settings used for calls to getCustomClass. */ + public UnaryCallSettings.Builder getCustomClassSettings() { + return getCustomClassSettings; + } + + /** Returns the builder for the settings used for calls to listCustomClasses. */ + public PagedCallSettings.Builder< + ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> + listCustomClassesSettings() { + return listCustomClassesSettings; + } + + /** Returns the builder for the settings used for calls to updateCustomClass. */ + public UnaryCallSettings.Builder + updateCustomClassSettings() { + return updateCustomClassSettings; + } + + /** Returns the builder for the settings used for calls to deleteCustomClass. */ + public UnaryCallSettings.Builder deleteCustomClassSettings() { + return deleteCustomClassSettings; + } + + @Override + public AdaptationStubSettings build() throws IOException { + return new AdaptationStubSettings(this); + } + } +} diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcAdaptationCallableFactory.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcAdaptationCallableFactory.java new file mode 100644 index 000000000..a450d540d --- /dev/null +++ b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcAdaptationCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Adaptation service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcAdaptationCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcAdaptationStub.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcAdaptationStub.java new file mode 100644 index 000000000..f42848743 --- /dev/null +++ b/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcAdaptationStub.java @@ -0,0 +1,502 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.stub; + +import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListCustomClassesPagedResponse; +import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListPhraseSetPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.CustomClass; +import com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.GetCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest; +import com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse; +import com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse; +import com.google.cloud.speech.v1p1beta1.PhraseSet; +import com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the Adaptation service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcAdaptationStub extends AdaptationStub { + private static final MethodDescriptor + createPhraseSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/CreatePhraseSet") + .setRequestMarshaller( + ProtoUtils.marshaller(CreatePhraseSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(PhraseSet.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getPhraseSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/GetPhraseSet") + .setRequestMarshaller(ProtoUtils.marshaller(GetPhraseSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(PhraseSet.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listPhraseSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/ListPhraseSet") + .setRequestMarshaller( + ProtoUtils.marshaller(ListPhraseSetRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListPhraseSetResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updatePhraseSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/UpdatePhraseSet") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdatePhraseSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(PhraseSet.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deletePhraseSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/DeletePhraseSet") + .setRequestMarshaller( + ProtoUtils.marshaller(DeletePhraseSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createCustomClassMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/CreateCustomClass") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateCustomClassRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(CustomClass.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getCustomClassMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/GetCustomClass") + .setRequestMarshaller( + ProtoUtils.marshaller(GetCustomClassRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(CustomClass.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listCustomClassesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/ListCustomClasses") + .setRequestMarshaller( + ProtoUtils.marshaller(ListCustomClassesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListCustomClassesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateCustomClassMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/UpdateCustomClass") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateCustomClassRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(CustomClass.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteCustomClassMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/DeleteCustomClass") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteCustomClassRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private final UnaryCallable createPhraseSetCallable; + private final UnaryCallable getPhraseSetCallable; + private final UnaryCallable listPhraseSetCallable; + private final UnaryCallable + listPhraseSetPagedCallable; + private final UnaryCallable updatePhraseSetCallable; + private final UnaryCallable deletePhraseSetCallable; + private final UnaryCallable createCustomClassCallable; + private final UnaryCallable getCustomClassCallable; + private final UnaryCallable + listCustomClassesCallable; + private final UnaryCallable + listCustomClassesPagedCallable; + private final UnaryCallable updateCustomClassCallable; + private final UnaryCallable deleteCustomClassCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcAdaptationStub create(AdaptationStubSettings settings) + throws IOException { + return new GrpcAdaptationStub(settings, ClientContext.create(settings)); + } + + public static final GrpcAdaptationStub create(ClientContext clientContext) throws IOException { + return new GrpcAdaptationStub(AdaptationStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcAdaptationStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcAdaptationStub( + AdaptationStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcAdaptationStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcAdaptationStub(AdaptationStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcAdaptationCallableFactory()); + } + + /** + * Constructs an instance of GrpcAdaptationStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcAdaptationStub( + AdaptationStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createPhraseSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createPhraseSetMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreatePhraseSetRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getPhraseSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getPhraseSetMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetPhraseSetRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings listPhraseSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listPhraseSetMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListPhraseSetRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updatePhraseSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updatePhraseSetMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdatePhraseSetRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("phrase_set.name", String.valueOf(request.getPhraseSet().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deletePhraseSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deletePhraseSetMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeletePhraseSetRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createCustomClassTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createCustomClassMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateCustomClassRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getCustomClassTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getCustomClassMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetCustomClassRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + listCustomClassesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listCustomClassesMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListCustomClassesRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateCustomClassTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateCustomClassMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateCustomClassRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "custom_class.name", String.valueOf(request.getCustomClass().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteCustomClassTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteCustomClassMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteCustomClassRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + + this.createPhraseSetCallable = + callableFactory.createUnaryCallable( + createPhraseSetTransportSettings, settings.createPhraseSetSettings(), clientContext); + this.getPhraseSetCallable = + callableFactory.createUnaryCallable( + getPhraseSetTransportSettings, settings.getPhraseSetSettings(), clientContext); + this.listPhraseSetCallable = + callableFactory.createUnaryCallable( + listPhraseSetTransportSettings, settings.listPhraseSetSettings(), clientContext); + this.listPhraseSetPagedCallable = + callableFactory.createPagedCallable( + listPhraseSetTransportSettings, settings.listPhraseSetSettings(), clientContext); + this.updatePhraseSetCallable = + callableFactory.createUnaryCallable( + updatePhraseSetTransportSettings, settings.updatePhraseSetSettings(), clientContext); + this.deletePhraseSetCallable = + callableFactory.createUnaryCallable( + deletePhraseSetTransportSettings, settings.deletePhraseSetSettings(), clientContext); + this.createCustomClassCallable = + callableFactory.createUnaryCallable( + createCustomClassTransportSettings, + settings.createCustomClassSettings(), + clientContext); + this.getCustomClassCallable = + callableFactory.createUnaryCallable( + getCustomClassTransportSettings, settings.getCustomClassSettings(), clientContext); + this.listCustomClassesCallable = + callableFactory.createUnaryCallable( + listCustomClassesTransportSettings, + settings.listCustomClassesSettings(), + clientContext); + this.listCustomClassesPagedCallable = + callableFactory.createPagedCallable( + listCustomClassesTransportSettings, + settings.listCustomClassesSettings(), + clientContext); + this.updateCustomClassCallable = + callableFactory.createUnaryCallable( + updateCustomClassTransportSettings, + settings.updateCustomClassSettings(), + clientContext); + this.deleteCustomClassCallable = + callableFactory.createUnaryCallable( + deleteCustomClassTransportSettings, + settings.deleteCustomClassSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createPhraseSetCallable() { + return createPhraseSetCallable; + } + + @Override + public UnaryCallable getPhraseSetCallable() { + return getPhraseSetCallable; + } + + @Override + public UnaryCallable listPhraseSetCallable() { + return listPhraseSetCallable; + } + + @Override + public UnaryCallable + listPhraseSetPagedCallable() { + return listPhraseSetPagedCallable; + } + + @Override + public UnaryCallable updatePhraseSetCallable() { + return updatePhraseSetCallable; + } + + @Override + public UnaryCallable deletePhraseSetCallable() { + return deletePhraseSetCallable; + } + + @Override + public UnaryCallable createCustomClassCallable() { + return createCustomClassCallable; + } + + @Override + public UnaryCallable getCustomClassCallable() { + return getCustomClassCallable; + } + + @Override + public UnaryCallable + listCustomClassesCallable() { + return listCustomClassesCallable; + } + + @Override + public UnaryCallable + listCustomClassesPagedCallable() { + return listCustomClassesPagedCallable; + } + + @Override + public UnaryCallable updateCustomClassCallable() { + return updateCustomClassCallable; + } + + @Override + public UnaryCallable deleteCustomClassCallable() { + return deleteCustomClassCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/AdaptationClientTest.java b/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/AdaptationClientTest.java new file mode 100644 index 000000000..1865a26ed --- /dev/null +++ b/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/AdaptationClientTest.java @@ -0,0 +1,838 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1; + +import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListCustomClassesPagedResponse; +import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListPhraseSetPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class AdaptationClientTest { + private static MockServiceHelper mockServiceHelper; + private static MockAdaptation mockAdaptation; + private AdaptationClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockAdaptation = new MockAdaptation(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockAdaptation)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + AdaptationSettings settings = + AdaptationSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AdaptationClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createPhraseSetTest() throws Exception { + PhraseSet expectedResponse = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + mockAdaptation.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + String phraseSetId = "phraseSetId959902180"; + + PhraseSet actualResponse = client.createPhraseSet(parent, phraseSet, phraseSetId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreatePhraseSetRequest actualRequest = ((CreatePhraseSetRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(phraseSet, actualRequest.getPhraseSet()); + Assert.assertEquals(phraseSetId, actualRequest.getPhraseSetId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createPhraseSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + String phraseSetId = "phraseSetId959902180"; + client.createPhraseSet(parent, phraseSet, phraseSetId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createPhraseSetTest2() throws Exception { + PhraseSet expectedResponse = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + mockAdaptation.addResponse(expectedResponse); + + String parent = "parent-995424086"; + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + String phraseSetId = "phraseSetId959902180"; + + PhraseSet actualResponse = client.createPhraseSet(parent, phraseSet, phraseSetId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreatePhraseSetRequest actualRequest = ((CreatePhraseSetRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(phraseSet, actualRequest.getPhraseSet()); + Assert.assertEquals(phraseSetId, actualRequest.getPhraseSetId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createPhraseSetExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + String parent = "parent-995424086"; + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + String phraseSetId = "phraseSetId959902180"; + client.createPhraseSet(parent, phraseSet, phraseSetId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPhraseSetTest() throws Exception { + PhraseSet expectedResponse = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + mockAdaptation.addResponse(expectedResponse); + + PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); + + PhraseSet actualResponse = client.getPhraseSet(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetPhraseSetRequest actualRequest = ((GetPhraseSetRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getPhraseSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); + client.getPhraseSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPhraseSetTest2() throws Exception { + PhraseSet expectedResponse = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + mockAdaptation.addResponse(expectedResponse); + + String name = "name3373707"; + + PhraseSet actualResponse = client.getPhraseSet(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetPhraseSetRequest actualRequest = ((GetPhraseSetRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getPhraseSetExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + String name = "name3373707"; + client.getPhraseSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listPhraseSetTest() throws Exception { + PhraseSet responsesElement = PhraseSet.newBuilder().build(); + ListPhraseSetResponse expectedResponse = + ListPhraseSetResponse.newBuilder() + .setNextPageToken("") + .addAllPhraseSets(Arrays.asList(responsesElement)) + .build(); + mockAdaptation.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListPhraseSetPagedResponse pagedListResponse = client.listPhraseSet(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPhraseSetsList().get(0), resources.get(0)); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListPhraseSetRequest actualRequest = ((ListPhraseSetRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listPhraseSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listPhraseSet(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listPhraseSetTest2() throws Exception { + PhraseSet responsesElement = PhraseSet.newBuilder().build(); + ListPhraseSetResponse expectedResponse = + ListPhraseSetResponse.newBuilder() + .setNextPageToken("") + .addAllPhraseSets(Arrays.asList(responsesElement)) + .build(); + mockAdaptation.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListPhraseSetPagedResponse pagedListResponse = client.listPhraseSet(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPhraseSetsList().get(0), resources.get(0)); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListPhraseSetRequest actualRequest = ((ListPhraseSetRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listPhraseSetExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + String parent = "parent-995424086"; + client.listPhraseSet(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updatePhraseSetTest() throws Exception { + PhraseSet expectedResponse = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + mockAdaptation.addResponse(expectedResponse); + + UpdatePhraseSetRequest request = + UpdatePhraseSetRequest.newBuilder() + .setPhraseSet(PhraseSet.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + PhraseSet actualResponse = client.updatePhraseSet(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdatePhraseSetRequest actualRequest = ((UpdatePhraseSetRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getPhraseSet(), actualRequest.getPhraseSet()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updatePhraseSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + UpdatePhraseSetRequest request = + UpdatePhraseSetRequest.newBuilder() + .setPhraseSet(PhraseSet.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updatePhraseSet(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deletePhraseSetTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAdaptation.addResponse(expectedResponse); + + PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); + + client.deletePhraseSet(name); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeletePhraseSetRequest actualRequest = ((DeletePhraseSetRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deletePhraseSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); + client.deletePhraseSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deletePhraseSetTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAdaptation.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deletePhraseSet(name); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeletePhraseSetRequest actualRequest = ((DeletePhraseSetRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deletePhraseSetExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + String name = "name3373707"; + client.deletePhraseSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createCustomClassTest() throws Exception { + CustomClass expectedResponse = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + mockAdaptation.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + CustomClass customClass = CustomClass.newBuilder().build(); + String customClassId = "customClassId1871032322"; + + CustomClass actualResponse = client.createCustomClass(parent, customClass, customClassId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateCustomClassRequest actualRequest = ((CreateCustomClassRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(customClass, actualRequest.getCustomClass()); + Assert.assertEquals(customClassId, actualRequest.getCustomClassId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createCustomClassExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + CustomClass customClass = CustomClass.newBuilder().build(); + String customClassId = "customClassId1871032322"; + client.createCustomClass(parent, customClass, customClassId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createCustomClassTest2() throws Exception { + CustomClass expectedResponse = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + mockAdaptation.addResponse(expectedResponse); + + String parent = "parent-995424086"; + CustomClass customClass = CustomClass.newBuilder().build(); + String customClassId = "customClassId1871032322"; + + CustomClass actualResponse = client.createCustomClass(parent, customClass, customClassId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateCustomClassRequest actualRequest = ((CreateCustomClassRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(customClass, actualRequest.getCustomClass()); + Assert.assertEquals(customClassId, actualRequest.getCustomClassId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createCustomClassExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + String parent = "parent-995424086"; + CustomClass customClass = CustomClass.newBuilder().build(); + String customClassId = "customClassId1871032322"; + client.createCustomClass(parent, customClass, customClassId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCustomClassTest() throws Exception { + CustomClass expectedResponse = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + mockAdaptation.addResponse(expectedResponse); + + CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); + + CustomClass actualResponse = client.getCustomClass(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetCustomClassRequest actualRequest = ((GetCustomClassRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getCustomClassExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); + client.getCustomClass(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCustomClassTest2() throws Exception { + CustomClass expectedResponse = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + mockAdaptation.addResponse(expectedResponse); + + String name = "name3373707"; + + CustomClass actualResponse = client.getCustomClass(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetCustomClassRequest actualRequest = ((GetCustomClassRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getCustomClassExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + String name = "name3373707"; + client.getCustomClass(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listCustomClassesTest() throws Exception { + CustomClass responsesElement = CustomClass.newBuilder().build(); + ListCustomClassesResponse expectedResponse = + ListCustomClassesResponse.newBuilder() + .setNextPageToken("") + .addAllCustomClasses(Arrays.asList(responsesElement)) + .build(); + mockAdaptation.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListCustomClassesPagedResponse pagedListResponse = client.listCustomClasses(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCustomClassesList().get(0), resources.get(0)); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListCustomClassesRequest actualRequest = ((ListCustomClassesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listCustomClassesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listCustomClasses(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listCustomClassesTest2() throws Exception { + CustomClass responsesElement = CustomClass.newBuilder().build(); + ListCustomClassesResponse expectedResponse = + ListCustomClassesResponse.newBuilder() + .setNextPageToken("") + .addAllCustomClasses(Arrays.asList(responsesElement)) + .build(); + mockAdaptation.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListCustomClassesPagedResponse pagedListResponse = client.listCustomClasses(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCustomClassesList().get(0), resources.get(0)); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListCustomClassesRequest actualRequest = ((ListCustomClassesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listCustomClassesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + String parent = "parent-995424086"; + client.listCustomClasses(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateCustomClassTest() throws Exception { + CustomClass expectedResponse = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + mockAdaptation.addResponse(expectedResponse); + + UpdateCustomClassRequest request = + UpdateCustomClassRequest.newBuilder() + .setCustomClass(CustomClass.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + CustomClass actualResponse = client.updateCustomClass(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateCustomClassRequest actualRequest = ((UpdateCustomClassRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getCustomClass(), actualRequest.getCustomClass()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateCustomClassExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + UpdateCustomClassRequest request = + UpdateCustomClassRequest.newBuilder() + .setCustomClass(CustomClass.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateCustomClass(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteCustomClassTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAdaptation.addResponse(expectedResponse); + + CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); + + client.deleteCustomClass(name); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteCustomClassRequest actualRequest = ((DeleteCustomClassRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteCustomClassExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); + client.deleteCustomClass(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteCustomClassTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAdaptation.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteCustomClass(name); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteCustomClassRequest actualRequest = ((DeleteCustomClassRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteCustomClassExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + String name = "name3373707"; + client.deleteCustomClass(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptation.java b/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptation.java new file mode 100644 index 000000000..da8b125ec --- /dev/null +++ b/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptation.java @@ -0,0 +1,59 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockAdaptation implements MockGrpcService { + private final MockAdaptationImpl serviceImpl; + + public MockAdaptation() { + serviceImpl = new MockAdaptationImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptationImpl.java b/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptationImpl.java new file mode 100644 index 000000000..9f736471e --- /dev/null +++ b/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptationImpl.java @@ -0,0 +1,272 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.speech.v1p1beta1.AdaptationGrpc.AdaptationImplBase; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockAdaptationImpl extends AdaptationImplBase { + private List requests; + private Queue responses; + + public MockAdaptationImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void createPhraseSet( + CreatePhraseSetRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof PhraseSet) { + requests.add(request); + responseObserver.onNext(((PhraseSet) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreatePhraseSet, expected %s or %s", + response.getClass().getName(), + PhraseSet.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getPhraseSet( + GetPhraseSetRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof PhraseSet) { + requests.add(request); + responseObserver.onNext(((PhraseSet) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetPhraseSet, expected %s or %s", + response.getClass().getName(), + PhraseSet.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listPhraseSet( + ListPhraseSetRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListPhraseSetResponse) { + requests.add(request); + responseObserver.onNext(((ListPhraseSetResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListPhraseSet, expected %s or %s", + response.getClass().getName(), + ListPhraseSetResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updatePhraseSet( + UpdatePhraseSetRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof PhraseSet) { + requests.add(request); + responseObserver.onNext(((PhraseSet) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdatePhraseSet, expected %s or %s", + response.getClass().getName(), + PhraseSet.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deletePhraseSet( + DeletePhraseSetRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeletePhraseSet, expected %s or %s", + response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createCustomClass( + CreateCustomClassRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof CustomClass) { + requests.add(request); + responseObserver.onNext(((CustomClass) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateCustomClass, expected %s or %s", + response.getClass().getName(), + CustomClass.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getCustomClass( + GetCustomClassRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof CustomClass) { + requests.add(request); + responseObserver.onNext(((CustomClass) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetCustomClass, expected %s or %s", + response.getClass().getName(), + CustomClass.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listCustomClasses( + ListCustomClassesRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListCustomClassesResponse) { + requests.add(request); + responseObserver.onNext(((ListCustomClassesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListCustomClasses, expected %s or %s", + response.getClass().getName(), + ListCustomClassesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateCustomClass( + UpdateCustomClassRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof CustomClass) { + requests.add(request); + responseObserver.onNext(((CustomClass) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateCustomClass, expected %s or %s", + response.getClass().getName(), + CustomClass.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteCustomClass( + DeleteCustomClassRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteCustomClass, expected %s or %s", + response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/grpc-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationGrpc.java b/grpc-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationGrpc.java new file mode 100644 index 000000000..afb4e1801 --- /dev/null +++ b/grpc-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationGrpc.java @@ -0,0 +1,1412 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ +package com.google.cloud.speech.v1p1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * Service that implements Google Cloud Speech Adaptation API.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto") +public final class AdaptationGrpc { + + private AdaptationGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.speech.v1p1beta1.Adaptation"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest, + com.google.cloud.speech.v1p1beta1.PhraseSet> + getCreatePhraseSetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreatePhraseSet", + requestType = com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.class, + responseType = com.google.cloud.speech.v1p1beta1.PhraseSet.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest, + com.google.cloud.speech.v1p1beta1.PhraseSet> + getCreatePhraseSetMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest, + com.google.cloud.speech.v1p1beta1.PhraseSet> + getCreatePhraseSetMethod; + if ((getCreatePhraseSetMethod = AdaptationGrpc.getCreatePhraseSetMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getCreatePhraseSetMethod = AdaptationGrpc.getCreatePhraseSetMethod) == null) { + AdaptationGrpc.getCreatePhraseSetMethod = + getCreatePhraseSetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreatePhraseSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance())) + .setSchemaDescriptor( + new AdaptationMethodDescriptorSupplier("CreatePhraseSet")) + .build(); + } + } + } + return getCreatePhraseSetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest, + com.google.cloud.speech.v1p1beta1.PhraseSet> + getGetPhraseSetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetPhraseSet", + requestType = com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest.class, + responseType = com.google.cloud.speech.v1p1beta1.PhraseSet.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest, + com.google.cloud.speech.v1p1beta1.PhraseSet> + getGetPhraseSetMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest, + com.google.cloud.speech.v1p1beta1.PhraseSet> + getGetPhraseSetMethod; + if ((getGetPhraseSetMethod = AdaptationGrpc.getGetPhraseSetMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getGetPhraseSetMethod = AdaptationGrpc.getGetPhraseSetMethod) == null) { + AdaptationGrpc.getGetPhraseSetMethod = + getGetPhraseSetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetPhraseSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance())) + .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("GetPhraseSet")) + .build(); + } + } + } + return getGetPhraseSetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest, + com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse> + getListPhraseSetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListPhraseSet", + requestType = com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest.class, + responseType = com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest, + com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse> + getListPhraseSetMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest, + com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse> + getListPhraseSetMethod; + if ((getListPhraseSetMethod = AdaptationGrpc.getListPhraseSetMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getListPhraseSetMethod = AdaptationGrpc.getListPhraseSetMethod) == null) { + AdaptationGrpc.getListPhraseSetMethod = + getListPhraseSetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListPhraseSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse + .getDefaultInstance())) + .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("ListPhraseSet")) + .build(); + } + } + } + return getListPhraseSetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest, + com.google.cloud.speech.v1p1beta1.PhraseSet> + getUpdatePhraseSetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdatePhraseSet", + requestType = com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.class, + responseType = com.google.cloud.speech.v1p1beta1.PhraseSet.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest, + com.google.cloud.speech.v1p1beta1.PhraseSet> + getUpdatePhraseSetMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest, + com.google.cloud.speech.v1p1beta1.PhraseSet> + getUpdatePhraseSetMethod; + if ((getUpdatePhraseSetMethod = AdaptationGrpc.getUpdatePhraseSetMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getUpdatePhraseSetMethod = AdaptationGrpc.getUpdatePhraseSetMethod) == null) { + AdaptationGrpc.getUpdatePhraseSetMethod = + getUpdatePhraseSetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdatePhraseSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance())) + .setSchemaDescriptor( + new AdaptationMethodDescriptorSupplier("UpdatePhraseSet")) + .build(); + } + } + } + return getUpdatePhraseSetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest, com.google.protobuf.Empty> + getDeletePhraseSetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeletePhraseSet", + requestType = com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest, com.google.protobuf.Empty> + getDeletePhraseSetMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest, com.google.protobuf.Empty> + getDeletePhraseSetMethod; + if ((getDeletePhraseSetMethod = AdaptationGrpc.getDeletePhraseSetMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getDeletePhraseSetMethod = AdaptationGrpc.getDeletePhraseSetMethod) == null) { + AdaptationGrpc.getDeletePhraseSetMethod = + getDeletePhraseSetMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeletePhraseSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new AdaptationMethodDescriptorSupplier("DeletePhraseSet")) + .build(); + } + } + } + return getDeletePhraseSetMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest, + com.google.cloud.speech.v1p1beta1.CustomClass> + getCreateCustomClassMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateCustomClass", + requestType = com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest.class, + responseType = com.google.cloud.speech.v1p1beta1.CustomClass.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest, + com.google.cloud.speech.v1p1beta1.CustomClass> + getCreateCustomClassMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest, + com.google.cloud.speech.v1p1beta1.CustomClass> + getCreateCustomClassMethod; + if ((getCreateCustomClassMethod = AdaptationGrpc.getCreateCustomClassMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getCreateCustomClassMethod = AdaptationGrpc.getCreateCustomClassMethod) == null) { + AdaptationGrpc.getCreateCustomClassMethod = + getCreateCustomClassMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateCustomClass")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance())) + .setSchemaDescriptor( + new AdaptationMethodDescriptorSupplier("CreateCustomClass")) + .build(); + } + } + } + return getCreateCustomClassMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.GetCustomClassRequest, + com.google.cloud.speech.v1p1beta1.CustomClass> + getGetCustomClassMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetCustomClass", + requestType = com.google.cloud.speech.v1p1beta1.GetCustomClassRequest.class, + responseType = com.google.cloud.speech.v1p1beta1.CustomClass.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.GetCustomClassRequest, + com.google.cloud.speech.v1p1beta1.CustomClass> + getGetCustomClassMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.GetCustomClassRequest, + com.google.cloud.speech.v1p1beta1.CustomClass> + getGetCustomClassMethod; + if ((getGetCustomClassMethod = AdaptationGrpc.getGetCustomClassMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getGetCustomClassMethod = AdaptationGrpc.getGetCustomClassMethod) == null) { + AdaptationGrpc.getGetCustomClassMethod = + getGetCustomClassMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetCustomClass")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.GetCustomClassRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance())) + .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("GetCustomClass")) + .build(); + } + } + } + return getGetCustomClassMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest, + com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse> + getListCustomClassesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListCustomClasses", + requestType = com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest.class, + responseType = com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest, + com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse> + getListCustomClassesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest, + com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse> + getListCustomClassesMethod; + if ((getListCustomClassesMethod = AdaptationGrpc.getListCustomClassesMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getListCustomClassesMethod = AdaptationGrpc.getListCustomClassesMethod) == null) { + AdaptationGrpc.getListCustomClassesMethod = + getListCustomClassesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListCustomClasses")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new AdaptationMethodDescriptorSupplier("ListCustomClasses")) + .build(); + } + } + } + return getListCustomClassesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest, + com.google.cloud.speech.v1p1beta1.CustomClass> + getUpdateCustomClassMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateCustomClass", + requestType = com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.class, + responseType = com.google.cloud.speech.v1p1beta1.CustomClass.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest, + com.google.cloud.speech.v1p1beta1.CustomClass> + getUpdateCustomClassMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest, + com.google.cloud.speech.v1p1beta1.CustomClass> + getUpdateCustomClassMethod; + if ((getUpdateCustomClassMethod = AdaptationGrpc.getUpdateCustomClassMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getUpdateCustomClassMethod = AdaptationGrpc.getUpdateCustomClassMethod) == null) { + AdaptationGrpc.getUpdateCustomClassMethod = + getUpdateCustomClassMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateCustomClass")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance())) + .setSchemaDescriptor( + new AdaptationMethodDescriptorSupplier("UpdateCustomClass")) + .build(); + } + } + } + return getUpdateCustomClassMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest, com.google.protobuf.Empty> + getDeleteCustomClassMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteCustomClass", + requestType = com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest, com.google.protobuf.Empty> + getDeleteCustomClassMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest, com.google.protobuf.Empty> + getDeleteCustomClassMethod; + if ((getDeleteCustomClassMethod = AdaptationGrpc.getDeleteCustomClassMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getDeleteCustomClassMethod = AdaptationGrpc.getDeleteCustomClassMethod) == null) { + AdaptationGrpc.getDeleteCustomClassMethod = + getDeleteCustomClassMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteCustomClass")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new AdaptationMethodDescriptorSupplier("DeleteCustomClass")) + .build(); + } + } + } + return getDeleteCustomClassMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static AdaptationStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AdaptationStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AdaptationStub(channel, callOptions); + } + }; + return AdaptationStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static AdaptationBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AdaptationBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AdaptationBlockingStub(channel, callOptions); + } + }; + return AdaptationBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static AdaptationFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AdaptationFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AdaptationFutureStub(channel, callOptions); + } + }; + return AdaptationFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service that implements Google Cloud Speech Adaptation API.
+   * 
+ */ + public abstract static class AdaptationImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Create a set of phrase hints. Each item in the set can be a single word or
+     * a multi-word phrase. The items in the PhraseSet are favored by the
+     * recognition model when you send a call that includes the PhraseSet.
+     * 
+ */ + public void createPhraseSet( + com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreatePhraseSetMethod(), responseObserver); + } + + /** + * + * + *
+     * Get a phrase set.
+     * 
+ */ + public void getPhraseSet( + com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetPhraseSetMethod(), responseObserver); + } + + /** + * + * + *
+     * List phrase sets.
+     * 
+ */ + public void listPhraseSet( + com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListPhraseSetMethod(), responseObserver); + } + + /** + * + * + *
+     * Update a phrase set.
+     * 
+ */ + public void updatePhraseSet( + com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdatePhraseSetMethod(), responseObserver); + } + + /** + * + * + *
+     * Delete a phrase set.
+     * 
+ */ + public void deletePhraseSet( + com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeletePhraseSetMethod(), responseObserver); + } + + /** + * + * + *
+     * Create a custom class.
+     * 
+ */ + public void createCustomClass( + com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getCreateCustomClassMethod(), responseObserver); + } + + /** + * + * + *
+     * Get a custom class.
+     * 
+ */ + public void getCustomClass( + com.google.cloud.speech.v1p1beta1.GetCustomClassRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetCustomClassMethod(), responseObserver); + } + + /** + * + * + *
+     * List custom classes.
+     * 
+ */ + public void listCustomClasses( + com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListCustomClassesMethod(), responseObserver); + } + + /** + * + * + *
+     * Update a custom class.
+     * 
+ */ + public void updateCustomClass( + com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateCustomClassMethod(), responseObserver); + } + + /** + * + * + *
+     * Delete a custom class.
+     * 
+ */ + public void deleteCustomClass( + com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteCustomClassMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreatePhraseSetMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest, + com.google.cloud.speech.v1p1beta1.PhraseSet>( + this, METHODID_CREATE_PHRASE_SET))) + .addMethod( + getGetPhraseSetMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest, + com.google.cloud.speech.v1p1beta1.PhraseSet>(this, METHODID_GET_PHRASE_SET))) + .addMethod( + getListPhraseSetMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest, + com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse>( + this, METHODID_LIST_PHRASE_SET))) + .addMethod( + getUpdatePhraseSetMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest, + com.google.cloud.speech.v1p1beta1.PhraseSet>( + this, METHODID_UPDATE_PHRASE_SET))) + .addMethod( + getDeletePhraseSetMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_PHRASE_SET))) + .addMethod( + getCreateCustomClassMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest, + com.google.cloud.speech.v1p1beta1.CustomClass>( + this, METHODID_CREATE_CUSTOM_CLASS))) + .addMethod( + getGetCustomClassMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1p1beta1.GetCustomClassRequest, + com.google.cloud.speech.v1p1beta1.CustomClass>( + this, METHODID_GET_CUSTOM_CLASS))) + .addMethod( + getListCustomClassesMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest, + com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse>( + this, METHODID_LIST_CUSTOM_CLASSES))) + .addMethod( + getUpdateCustomClassMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest, + com.google.cloud.speech.v1p1beta1.CustomClass>( + this, METHODID_UPDATE_CUSTOM_CLASS))) + .addMethod( + getDeleteCustomClassMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_CUSTOM_CLASS))) + .build(); + } + } + + /** + * + * + *
+   * Service that implements Google Cloud Speech Adaptation API.
+   * 
+ */ + public static final class AdaptationStub extends io.grpc.stub.AbstractAsyncStub { + private AdaptationStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AdaptationStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AdaptationStub(channel, callOptions); + } + + /** + * + * + *
+     * Create a set of phrase hints. Each item in the set can be a single word or
+     * a multi-word phrase. The items in the PhraseSet are favored by the
+     * recognition model when you send a call that includes the PhraseSet.
+     * 
+ */ + public void createPhraseSet( + com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreatePhraseSetMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Get a phrase set.
+     * 
+ */ + public void getPhraseSet( + com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetPhraseSetMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * List phrase sets.
+     * 
+ */ + public void listPhraseSet( + com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListPhraseSetMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Update a phrase set.
+     * 
+ */ + public void updatePhraseSet( + com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdatePhraseSetMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Delete a phrase set.
+     * 
+ */ + public void deletePhraseSet( + com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeletePhraseSetMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Create a custom class.
+     * 
+ */ + public void createCustomClass( + com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateCustomClassMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Get a custom class.
+     * 
+ */ + public void getCustomClass( + com.google.cloud.speech.v1p1beta1.GetCustomClassRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetCustomClassMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * List custom classes.
+     * 
+ */ + public void listCustomClasses( + com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListCustomClassesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Update a custom class.
+     * 
+ */ + public void updateCustomClass( + com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateCustomClassMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Delete a custom class.
+     * 
+ */ + public void deleteCustomClass( + com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteCustomClassMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service that implements Google Cloud Speech Adaptation API.
+   * 
+ */ + public static final class AdaptationBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private AdaptationBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AdaptationBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AdaptationBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Create a set of phrase hints. Each item in the set can be a single word or
+     * a multi-word phrase. The items in the PhraseSet are favored by the
+     * recognition model when you send a call that includes the PhraseSet.
+     * 
+ */ + public com.google.cloud.speech.v1p1beta1.PhraseSet createPhraseSet( + com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest request) { + return blockingUnaryCall(getChannel(), getCreatePhraseSetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get a phrase set.
+     * 
+ */ + public com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSet( + com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest request) { + return blockingUnaryCall(getChannel(), getGetPhraseSetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * List phrase sets.
+     * 
+ */ + public com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse listPhraseSet( + com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest request) { + return blockingUnaryCall(getChannel(), getListPhraseSetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Update a phrase set.
+     * 
+ */ + public com.google.cloud.speech.v1p1beta1.PhraseSet updatePhraseSet( + com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest request) { + return blockingUnaryCall(getChannel(), getUpdatePhraseSetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Delete a phrase set.
+     * 
+ */ + public com.google.protobuf.Empty deletePhraseSet( + com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest request) { + return blockingUnaryCall(getChannel(), getDeletePhraseSetMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Create a custom class.
+     * 
+ */ + public com.google.cloud.speech.v1p1beta1.CustomClass createCustomClass( + com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest request) { + return blockingUnaryCall( + getChannel(), getCreateCustomClassMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get a custom class.
+     * 
+ */ + public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClass( + com.google.cloud.speech.v1p1beta1.GetCustomClassRequest request) { + return blockingUnaryCall(getChannel(), getGetCustomClassMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * List custom classes.
+     * 
+ */ + public com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse listCustomClasses( + com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest request) { + return blockingUnaryCall( + getChannel(), getListCustomClassesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Update a custom class.
+     * 
+ */ + public com.google.cloud.speech.v1p1beta1.CustomClass updateCustomClass( + com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateCustomClassMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Delete a custom class.
+     * 
+ */ + public com.google.protobuf.Empty deleteCustomClass( + com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteCustomClassMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service that implements Google Cloud Speech Adaptation API.
+   * 
+ */ + public static final class AdaptationFutureStub + extends io.grpc.stub.AbstractFutureStub { + private AdaptationFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AdaptationFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AdaptationFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Create a set of phrase hints. Each item in the set can be a single word or
+     * a multi-word phrase. The items in the PhraseSet are favored by the
+     * recognition model when you send a call that includes the PhraseSet.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.speech.v1p1beta1.PhraseSet> + createPhraseSet(com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreatePhraseSetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Get a phrase set.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.speech.v1p1beta1.PhraseSet> + getPhraseSet(com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetPhraseSetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * List phrase sets.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse> + listPhraseSet(com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest request) { + return futureUnaryCall( + getChannel().newCall(getListPhraseSetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Update a phrase set.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.speech.v1p1beta1.PhraseSet> + updatePhraseSet(com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdatePhraseSetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Delete a phrase set.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deletePhraseSet(com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeletePhraseSetMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Create a custom class.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.speech.v1p1beta1.CustomClass> + createCustomClass(com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateCustomClassMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Get a custom class.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.speech.v1p1beta1.CustomClass> + getCustomClass(com.google.cloud.speech.v1p1beta1.GetCustomClassRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetCustomClassMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * List custom classes.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse> + listCustomClasses(com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest request) { + return futureUnaryCall( + getChannel().newCall(getListCustomClassesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Update a custom class.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.speech.v1p1beta1.CustomClass> + updateCustomClass(com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateCustomClassMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Delete a custom class.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteCustomClass(com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteCustomClassMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_PHRASE_SET = 0; + private static final int METHODID_GET_PHRASE_SET = 1; + private static final int METHODID_LIST_PHRASE_SET = 2; + private static final int METHODID_UPDATE_PHRASE_SET = 3; + private static final int METHODID_DELETE_PHRASE_SET = 4; + private static final int METHODID_CREATE_CUSTOM_CLASS = 5; + private static final int METHODID_GET_CUSTOM_CLASS = 6; + private static final int METHODID_LIST_CUSTOM_CLASSES = 7; + private static final int METHODID_UPDATE_CUSTOM_CLASS = 8; + private static final int METHODID_DELETE_CUSTOM_CLASS = 9; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AdaptationImplBase serviceImpl; + private final int methodId; + + MethodHandlers(AdaptationImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_PHRASE_SET: + serviceImpl.createPhraseSet( + (com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_PHRASE_SET: + serviceImpl.getPhraseSet( + (com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_PHRASE_SET: + serviceImpl.listPhraseSet( + (com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_PHRASE_SET: + serviceImpl.updatePhraseSet( + (com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_PHRASE_SET: + serviceImpl.deletePhraseSet( + (com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_CUSTOM_CLASS: + serviceImpl.createCustomClass( + (com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_CUSTOM_CLASS: + serviceImpl.getCustomClass( + (com.google.cloud.speech.v1p1beta1.GetCustomClassRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_CUSTOM_CLASSES: + serviceImpl.listCustomClasses( + (com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse>) + responseObserver); + break; + case METHODID_UPDATE_CUSTOM_CLASS: + serviceImpl.updateCustomClass( + (com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_CUSTOM_CLASS: + serviceImpl.deleteCustomClass( + (com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class AdaptationBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + AdaptationBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Adaptation"); + } + } + + private static final class AdaptationFileDescriptorSupplier + extends AdaptationBaseDescriptorSupplier { + AdaptationFileDescriptorSupplier() {} + } + + private static final class AdaptationMethodDescriptorSupplier + extends AdaptationBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + AdaptationMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (AdaptationGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new AdaptationFileDescriptorSupplier()) + .addMethod(getCreatePhraseSetMethod()) + .addMethod(getGetPhraseSetMethod()) + .addMethod(getListPhraseSetMethod()) + .addMethod(getUpdatePhraseSetMethod()) + .addMethod(getDeletePhraseSetMethod()) + .addMethod(getCreateCustomClassMethod()) + .addMethod(getGetCustomClassMethod()) + .addMethod(getListCustomClassesMethod()) + .addMethod(getUpdateCustomClassMethod()) + .addMethod(getDeleteCustomClassMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreateCustomClassRequest.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreateCustomClassRequest.java new file mode 100644 index 000000000..a41229a95 --- /dev/null +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreateCustomClassRequest.java @@ -0,0 +1,1167 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + * + * + *
+ * Message sent by the client for the `CreateCustomClass` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.CreateCustomClassRequest} + */ +public final class CreateCustomClassRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.CreateCustomClassRequest) + CreateCustomClassRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateCustomClassRequest.newBuilder() to construct. + private CreateCustomClassRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateCustomClassRequest() { + parent_ = ""; + customClassId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateCustomClassRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateCustomClassRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + customClassId_ = s; + break; + } + case 26: + { + com.google.cloud.speech.v1p1beta1.CustomClass.Builder subBuilder = null; + if (customClass_ != null) { + subBuilder = customClass_.toBuilder(); + } + customClass_ = + input.readMessage( + com.google.cloud.speech.v1p1beta1.CustomClass.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(customClass_); + customClass_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest.class, + com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource where this custom class will be created.
+   * Format:
+   * {api_version}/projects/{project}/locations/{location}/customClasses
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource where this custom class will be created.
+   * Format:
+   * {api_version}/projects/{project}/locations/{location}/customClasses
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CUSTOM_CLASS_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object customClassId_; + /** + * + * + *
+   * The ID to use for the custom class, which will become the final
+   * component of the custom class' resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-/.
+   * 
+ * + * string custom_class_id = 2; + * + * @return The customClassId. + */ + @java.lang.Override + public java.lang.String getCustomClassId() { + java.lang.Object ref = customClassId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + customClassId_ = s; + return s; + } + } + /** + * + * + *
+   * The ID to use for the custom class, which will become the final
+   * component of the custom class' resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-/.
+   * 
+ * + * string custom_class_id = 2; + * + * @return The bytes for customClassId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCustomClassIdBytes() { + java.lang.Object ref = customClassId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + customClassId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CUSTOM_CLASS_FIELD_NUMBER = 3; + private com.google.cloud.speech.v1p1beta1.CustomClass customClass_; + /** + * + * + *
+   * Required. The custom class to create.
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the customClass field is set. + */ + @java.lang.Override + public boolean hasCustomClass() { + return customClass_ != null; + } + /** + * + * + *
+   * Required. The custom class to create.
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The customClass. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClass() { + return customClass_ == null + ? com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance() + : customClass_; + } + /** + * + * + *
+   * Required. The custom class to create.
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassOrBuilder() { + return getCustomClass(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getCustomClassIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, customClassId_); + } + if (customClass_ != null) { + output.writeMessage(3, getCustomClass()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getCustomClassIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, customClassId_); + } + if (customClass_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCustomClass()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest other = + (com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getCustomClassId().equals(other.getCustomClassId())) return false; + if (hasCustomClass() != other.hasCustomClass()) return false; + if (hasCustomClass()) { + if (!getCustomClass().equals(other.getCustomClass())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + CUSTOM_CLASS_ID_FIELD_NUMBER; + hash = (53 * hash) + getCustomClassId().hashCode(); + if (hasCustomClass()) { + hash = (37 * hash) + CUSTOM_CLASS_FIELD_NUMBER; + hash = (53 * hash) + getCustomClass().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message sent by the client for the `CreateCustomClass` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.CreateCustomClassRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.CreateCustomClassRequest) + com.google.cloud.speech.v1p1beta1.CreateCustomClassRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest.class, + com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + customClassId_ = ""; + + if (customClassBuilder_ == null) { + customClass_ = null; + } else { + customClass_ = null; + customClassBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest build() { + com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest buildPartial() { + com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest result = + new com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest(this); + result.parent_ = parent_; + result.customClassId_ = customClassId_; + if (customClassBuilder_ == null) { + result.customClass_ = customClass_; + } else { + result.customClass_ = customClassBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest other) { + if (other == com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getCustomClassId().isEmpty()) { + customClassId_ = other.customClassId_; + onChanged(); + } + if (other.hasCustomClass()) { + mergeCustomClass(other.getCustomClass()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource where this custom class will be created.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource where this custom class will be created.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource where this custom class will be created.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource where this custom class will be created.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource where this custom class will be created.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object customClassId_ = ""; + /** + * + * + *
+     * The ID to use for the custom class, which will become the final
+     * component of the custom class' resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string custom_class_id = 2; + * + * @return The customClassId. + */ + public java.lang.String getCustomClassId() { + java.lang.Object ref = customClassId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + customClassId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The ID to use for the custom class, which will become the final
+     * component of the custom class' resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string custom_class_id = 2; + * + * @return The bytes for customClassId. + */ + public com.google.protobuf.ByteString getCustomClassIdBytes() { + java.lang.Object ref = customClassId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + customClassId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The ID to use for the custom class, which will become the final
+     * component of the custom class' resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string custom_class_id = 2; + * + * @param value The customClassId to set. + * @return This builder for chaining. + */ + public Builder setCustomClassId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + customClassId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID to use for the custom class, which will become the final
+     * component of the custom class' resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string custom_class_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearCustomClassId() { + + customClassId_ = getDefaultInstance().getCustomClassId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The ID to use for the custom class, which will become the final
+     * component of the custom class' resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string custom_class_id = 2; + * + * @param value The bytes for customClassId to set. + * @return This builder for chaining. + */ + public Builder setCustomClassIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + customClassId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.speech.v1p1beta1.CustomClass customClass_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.CustomClass, + com.google.cloud.speech.v1p1beta1.CustomClass.Builder, + com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder> + customClassBuilder_; + /** + * + * + *
+     * Required. The custom class to create.
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the customClass field is set. + */ + public boolean hasCustomClass() { + return customClassBuilder_ != null || customClass_ != null; + } + /** + * + * + *
+     * Required. The custom class to create.
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The customClass. + */ + public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClass() { + if (customClassBuilder_ == null) { + return customClass_ == null + ? com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance() + : customClass_; + } else { + return customClassBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The custom class to create.
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCustomClass(com.google.cloud.speech.v1p1beta1.CustomClass value) { + if (customClassBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + customClass_ = value; + onChanged(); + } else { + customClassBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The custom class to create.
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCustomClass( + com.google.cloud.speech.v1p1beta1.CustomClass.Builder builderForValue) { + if (customClassBuilder_ == null) { + customClass_ = builderForValue.build(); + onChanged(); + } else { + customClassBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The custom class to create.
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCustomClass(com.google.cloud.speech.v1p1beta1.CustomClass value) { + if (customClassBuilder_ == null) { + if (customClass_ != null) { + customClass_ = + com.google.cloud.speech.v1p1beta1.CustomClass.newBuilder(customClass_) + .mergeFrom(value) + .buildPartial(); + } else { + customClass_ = value; + } + onChanged(); + } else { + customClassBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The custom class to create.
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCustomClass() { + if (customClassBuilder_ == null) { + customClass_ = null; + onChanged(); + } else { + customClass_ = null; + customClassBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The custom class to create.
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.speech.v1p1beta1.CustomClass.Builder getCustomClassBuilder() { + + onChanged(); + return getCustomClassFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The custom class to create.
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassOrBuilder() { + if (customClassBuilder_ != null) { + return customClassBuilder_.getMessageOrBuilder(); + } else { + return customClass_ == null + ? com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance() + : customClass_; + } + } + /** + * + * + *
+     * Required. The custom class to create.
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.CustomClass, + com.google.cloud.speech.v1p1beta1.CustomClass.Builder, + com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder> + getCustomClassFieldBuilder() { + if (customClassBuilder_ == null) { + customClassBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.CustomClass, + com.google.cloud.speech.v1p1beta1.CustomClass.Builder, + com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder>( + getCustomClass(), getParentForChildren(), isClean()); + customClass_ = null; + } + return customClassBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.CreateCustomClassRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.CreateCustomClassRequest) + private static final com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest(); + } + + public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateCustomClassRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateCustomClassRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreateCustomClassRequestOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreateCustomClassRequestOrBuilder.java new file mode 100644 index 000000000..8ba488d63 --- /dev/null +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreateCustomClassRequestOrBuilder.java @@ -0,0 +1,130 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface CreateCustomClassRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.CreateCustomClassRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource where this custom class will be created.
+   * Format:
+   * {api_version}/projects/{project}/locations/{location}/customClasses
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource where this custom class will be created.
+   * Format:
+   * {api_version}/projects/{project}/locations/{location}/customClasses
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The ID to use for the custom class, which will become the final
+   * component of the custom class' resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-/.
+   * 
+ * + * string custom_class_id = 2; + * + * @return The customClassId. + */ + java.lang.String getCustomClassId(); + /** + * + * + *
+   * The ID to use for the custom class, which will become the final
+   * component of the custom class' resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-/.
+   * 
+ * + * string custom_class_id = 2; + * + * @return The bytes for customClassId. + */ + com.google.protobuf.ByteString getCustomClassIdBytes(); + + /** + * + * + *
+   * Required. The custom class to create.
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the customClass field is set. + */ + boolean hasCustomClass(); + /** + * + * + *
+   * Required. The custom class to create.
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The customClass. + */ + com.google.cloud.speech.v1p1beta1.CustomClass getCustomClass(); + /** + * + * + *
+   * Required. The custom class to create.
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassOrBuilder(); +} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreatePhraseSetRequest.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreatePhraseSetRequest.java new file mode 100644 index 000000000..344f3b1bc --- /dev/null +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreatePhraseSetRequest.java @@ -0,0 +1,1167 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + * + * + *
+ * Message sent by the client for the `CreatePhraseSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.CreatePhraseSetRequest} + */ +public final class CreatePhraseSetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) + CreatePhraseSetRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreatePhraseSetRequest.newBuilder() to construct. + private CreatePhraseSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreatePhraseSetRequest() { + parent_ = ""; + phraseSetId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreatePhraseSetRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreatePhraseSetRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + phraseSetId_ = s; + break; + } + case 26: + { + com.google.cloud.speech.v1p1beta1.PhraseSet.Builder subBuilder = null; + if (phraseSet_ != null) { + subBuilder = phraseSet_.toBuilder(); + } + phraseSet_ = + input.readMessage( + com.google.cloud.speech.v1p1beta1.PhraseSet.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(phraseSet_); + phraseSet_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.class, + com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource where this phrase set will be created.
+   * Format:
+   * {api_version}/projects/{project}/locations/{location}/phraseSets
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource where this phrase set will be created.
+   * Format:
+   * {api_version}/projects/{project}/locations/{location}/phraseSets
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PHRASE_SET_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object phraseSetId_; + /** + * + * + *
+   * The ID to use for the phrase set, which will become the final
+   * component of the phrase set's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-/.
+   * 
+ * + * string phrase_set_id = 2; + * + * @return The phraseSetId. + */ + @java.lang.Override + public java.lang.String getPhraseSetId() { + java.lang.Object ref = phraseSetId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + phraseSetId_ = s; + return s; + } + } + /** + * + * + *
+   * The ID to use for the phrase set, which will become the final
+   * component of the phrase set's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-/.
+   * 
+ * + * string phrase_set_id = 2; + * + * @return The bytes for phraseSetId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPhraseSetIdBytes() { + java.lang.Object ref = phraseSetId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + phraseSetId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PHRASE_SET_FIELD_NUMBER = 3; + private com.google.cloud.speech.v1p1beta1.PhraseSet phraseSet_; + /** + * + * + *
+   * Required. The phrase set to create.
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the phraseSet field is set. + */ + @java.lang.Override + public boolean hasPhraseSet() { + return phraseSet_ != null; + } + /** + * + * + *
+   * Required. The phrase set to create.
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The phraseSet. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSet() { + return phraseSet_ == null + ? com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance() + : phraseSet_; + } + /** + * + * + *
+   * Required. The phrase set to create.
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetOrBuilder() { + return getPhraseSet(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getPhraseSetIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, phraseSetId_); + } + if (phraseSet_ != null) { + output.writeMessage(3, getPhraseSet()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getPhraseSetIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, phraseSetId_); + } + if (phraseSet_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getPhraseSet()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest other = + (com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getPhraseSetId().equals(other.getPhraseSetId())) return false; + if (hasPhraseSet() != other.hasPhraseSet()) return false; + if (hasPhraseSet()) { + if (!getPhraseSet().equals(other.getPhraseSet())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PHRASE_SET_ID_FIELD_NUMBER; + hash = (53 * hash) + getPhraseSetId().hashCode(); + if (hasPhraseSet()) { + hash = (37 * hash) + PHRASE_SET_FIELD_NUMBER; + hash = (53 * hash) + getPhraseSet().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message sent by the client for the `CreatePhraseSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.CreatePhraseSetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) + com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.class, + com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + phraseSetId_ = ""; + + if (phraseSetBuilder_ == null) { + phraseSet_ = null; + } else { + phraseSet_ = null; + phraseSetBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest build() { + com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest buildPartial() { + com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest result = + new com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest(this); + result.parent_ = parent_; + result.phraseSetId_ = phraseSetId_; + if (phraseSetBuilder_ == null) { + result.phraseSet_ = phraseSet_; + } else { + result.phraseSet_ = phraseSetBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest other) { + if (other == com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getPhraseSetId().isEmpty()) { + phraseSetId_ = other.phraseSetId_; + onChanged(); + } + if (other.hasPhraseSet()) { + mergePhraseSet(other.getPhraseSet()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource where this phrase set will be created.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/phraseSets
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource where this phrase set will be created.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/phraseSets
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource where this phrase set will be created.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/phraseSets
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource where this phrase set will be created.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/phraseSets
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource where this phrase set will be created.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/phraseSets
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object phraseSetId_ = ""; + /** + * + * + *
+     * The ID to use for the phrase set, which will become the final
+     * component of the phrase set's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string phrase_set_id = 2; + * + * @return The phraseSetId. + */ + public java.lang.String getPhraseSetId() { + java.lang.Object ref = phraseSetId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + phraseSetId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The ID to use for the phrase set, which will become the final
+     * component of the phrase set's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string phrase_set_id = 2; + * + * @return The bytes for phraseSetId. + */ + public com.google.protobuf.ByteString getPhraseSetIdBytes() { + java.lang.Object ref = phraseSetId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + phraseSetId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The ID to use for the phrase set, which will become the final
+     * component of the phrase set's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string phrase_set_id = 2; + * + * @param value The phraseSetId to set. + * @return This builder for chaining. + */ + public Builder setPhraseSetId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + phraseSetId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID to use for the phrase set, which will become the final
+     * component of the phrase set's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string phrase_set_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearPhraseSetId() { + + phraseSetId_ = getDefaultInstance().getPhraseSetId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The ID to use for the phrase set, which will become the final
+     * component of the phrase set's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string phrase_set_id = 2; + * + * @param value The bytes for phraseSetId to set. + * @return This builder for chaining. + */ + public Builder setPhraseSetIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + phraseSetId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.speech.v1p1beta1.PhraseSet phraseSet_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.PhraseSet, + com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, + com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder> + phraseSetBuilder_; + /** + * + * + *
+     * Required. The phrase set to create.
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the phraseSet field is set. + */ + public boolean hasPhraseSet() { + return phraseSetBuilder_ != null || phraseSet_ != null; + } + /** + * + * + *
+     * Required. The phrase set to create.
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The phraseSet. + */ + public com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSet() { + if (phraseSetBuilder_ == null) { + return phraseSet_ == null + ? com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance() + : phraseSet_; + } else { + return phraseSetBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The phrase set to create.
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPhraseSet(com.google.cloud.speech.v1p1beta1.PhraseSet value) { + if (phraseSetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + phraseSet_ = value; + onChanged(); + } else { + phraseSetBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The phrase set to create.
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPhraseSet( + com.google.cloud.speech.v1p1beta1.PhraseSet.Builder builderForValue) { + if (phraseSetBuilder_ == null) { + phraseSet_ = builderForValue.build(); + onChanged(); + } else { + phraseSetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The phrase set to create.
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergePhraseSet(com.google.cloud.speech.v1p1beta1.PhraseSet value) { + if (phraseSetBuilder_ == null) { + if (phraseSet_ != null) { + phraseSet_ = + com.google.cloud.speech.v1p1beta1.PhraseSet.newBuilder(phraseSet_) + .mergeFrom(value) + .buildPartial(); + } else { + phraseSet_ = value; + } + onChanged(); + } else { + phraseSetBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The phrase set to create.
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPhraseSet() { + if (phraseSetBuilder_ == null) { + phraseSet_ = null; + onChanged(); + } else { + phraseSet_ = null; + phraseSetBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The phrase set to create.
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.speech.v1p1beta1.PhraseSet.Builder getPhraseSetBuilder() { + + onChanged(); + return getPhraseSetFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The phrase set to create.
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetOrBuilder() { + if (phraseSetBuilder_ != null) { + return phraseSetBuilder_.getMessageOrBuilder(); + } else { + return phraseSet_ == null + ? com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance() + : phraseSet_; + } + } + /** + * + * + *
+     * Required. The phrase set to create.
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.PhraseSet, + com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, + com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder> + getPhraseSetFieldBuilder() { + if (phraseSetBuilder_ == null) { + phraseSetBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.PhraseSet, + com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, + com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder>( + getPhraseSet(), getParentForChildren(), isClean()); + phraseSet_ = null; + } + return phraseSetBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) + private static final com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest(); + } + + public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreatePhraseSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreatePhraseSetRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreatePhraseSetRequestOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreatePhraseSetRequestOrBuilder.java new file mode 100644 index 000000000..21a36bdc1 --- /dev/null +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreatePhraseSetRequestOrBuilder.java @@ -0,0 +1,130 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface CreatePhraseSetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource where this phrase set will be created.
+   * Format:
+   * {api_version}/projects/{project}/locations/{location}/phraseSets
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource where this phrase set will be created.
+   * Format:
+   * {api_version}/projects/{project}/locations/{location}/phraseSets
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The ID to use for the phrase set, which will become the final
+   * component of the phrase set's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-/.
+   * 
+ * + * string phrase_set_id = 2; + * + * @return The phraseSetId. + */ + java.lang.String getPhraseSetId(); + /** + * + * + *
+   * The ID to use for the phrase set, which will become the final
+   * component of the phrase set's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-/.
+   * 
+ * + * string phrase_set_id = 2; + * + * @return The bytes for phraseSetId. + */ + com.google.protobuf.ByteString getPhraseSetIdBytes(); + + /** + * + * + *
+   * Required. The phrase set to create.
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the phraseSet field is set. + */ + boolean hasPhraseSet(); + /** + * + * + *
+   * Required. The phrase set to create.
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The phraseSet. + */ + com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSet(); + /** + * + * + *
+   * Required. The phrase set to create.
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetOrBuilder(); +} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClass.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClass.java index 4583de87f..d680977ab 100644 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClass.java +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClass.java @@ -849,7 +849,7 @@ public com.google.protobuf.ByteString getNameBytes() { * *
    * If this custom class is a resource, the custom_class_id is the resource id
-   * of the CustomClass.
+   * of the CustomClass. Case sensitive.
    * 
* * string custom_class_id = 2; @@ -873,7 +873,7 @@ public java.lang.String getCustomClassId() { * *
    * If this custom class is a resource, the custom_class_id is the resource id
-   * of the CustomClass.
+   * of the CustomClass. Case sensitive.
    * 
* * string custom_class_id = 2; @@ -1467,7 +1467,7 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * *
      * If this custom class is a resource, the custom_class_id is the resource id
-     * of the CustomClass.
+     * of the CustomClass. Case sensitive.
      * 
* * string custom_class_id = 2; @@ -1490,7 +1490,7 @@ public java.lang.String getCustomClassId() { * *
      * If this custom class is a resource, the custom_class_id is the resource id
-     * of the CustomClass.
+     * of the CustomClass. Case sensitive.
      * 
* * string custom_class_id = 2; @@ -1513,7 +1513,7 @@ public com.google.protobuf.ByteString getCustomClassIdBytes() { * *
      * If this custom class is a resource, the custom_class_id is the resource id
-     * of the CustomClass.
+     * of the CustomClass. Case sensitive.
      * 
* * string custom_class_id = 2; @@ -1535,7 +1535,7 @@ public Builder setCustomClassId(java.lang.String value) { * *
      * If this custom class is a resource, the custom_class_id is the resource id
-     * of the CustomClass.
+     * of the CustomClass. Case sensitive.
      * 
* * string custom_class_id = 2; @@ -1553,7 +1553,7 @@ public Builder clearCustomClassId() { * *
      * If this custom class is a resource, the custom_class_id is the resource id
-     * of the CustomClass.
+     * of the CustomClass. Case sensitive.
      * 
* * string custom_class_id = 2; diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassOrBuilder.java index b6f23c994..494362336 100644 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassOrBuilder.java +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassOrBuilder.java @@ -53,7 +53,7 @@ public interface CustomClassOrBuilder * *
    * If this custom class is a resource, the custom_class_id is the resource id
-   * of the CustomClass.
+   * of the CustomClass. Case sensitive.
    * 
* * string custom_class_id = 2; @@ -66,7 +66,7 @@ public interface CustomClassOrBuilder * *
    * If this custom class is a resource, the custom_class_id is the resource id
-   * of the CustomClass.
+   * of the CustomClass. Case sensitive.
    * 
* * string custom_class_id = 2; diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeleteCustomClassRequest.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeleteCustomClassRequest.java new file mode 100644 index 000000000..4726ca65d --- /dev/null +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeleteCustomClassRequest.java @@ -0,0 +1,665 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + * + * + *
+ * Message sent by the client for the `DeleteCustomClass` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.DeleteCustomClassRequest} + */ +public final class DeleteCustomClassRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) + DeleteCustomClassRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteCustomClassRequest.newBuilder() to construct. + private DeleteCustomClassRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteCustomClassRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteCustomClassRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteCustomClassRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.class, + com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the custom class to delete.
+   * Format:
+   * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the custom class to delete.
+   * Format:
+   * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest other = + (com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message sent by the client for the `DeleteCustomClass` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.DeleteCustomClassRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) + com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.class, + com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest build() { + com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest buildPartial() { + com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest result = + new com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest other) { + if (other == com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the custom class to delete.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the custom class to delete.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the custom class to delete.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the custom class to delete.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the custom class to delete.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) + private static final com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest(); + } + + public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteCustomClassRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteCustomClassRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeleteCustomClassRequestOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeleteCustomClassRequestOrBuilder.java new file mode 100644 index 000000000..198fc72fc --- /dev/null +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeleteCustomClassRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface DeleteCustomClassRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the custom class to delete.
+   * Format:
+   * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the custom class to delete.
+   * Format:
+   * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeletePhraseSetRequest.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeletePhraseSetRequest.java new file mode 100644 index 000000000..4f8760a03 --- /dev/null +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeletePhraseSetRequest.java @@ -0,0 +1,665 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + * + * + *
+ * Message sent by the client for the `DeletePhraseSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.DeletePhraseSetRequest} + */ +public final class DeletePhraseSetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) + DeletePhraseSetRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeletePhraseSetRequest.newBuilder() to construct. + private DeletePhraseSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeletePhraseSetRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeletePhraseSetRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeletePhraseSetRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.class, + com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the phrase set to delete.
+   * Format:
+   * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the phrase set to delete.
+   * Format:
+   * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest other = + (com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message sent by the client for the `DeletePhraseSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.DeletePhraseSetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) + com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.class, + com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest build() { + com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest buildPartial() { + com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest result = + new com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest other) { + if (other == com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the phrase set to delete.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the phrase set to delete.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the phrase set to delete.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the phrase set to delete.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the phrase set to delete.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) + private static final com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest(); + } + + public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeletePhraseSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeletePhraseSetRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeletePhraseSetRequestOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeletePhraseSetRequestOrBuilder.java new file mode 100644 index 000000000..7a6a2edba --- /dev/null +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeletePhraseSetRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface DeletePhraseSetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the phrase set to delete.
+   * Format:
+   * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the phrase set to delete.
+   * Format:
+   * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetCustomClassRequest.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetCustomClassRequest.java new file mode 100644 index 000000000..5eae14583 --- /dev/null +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetCustomClassRequest.java @@ -0,0 +1,665 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + * + * + *
+ * Message sent by the client for the `GetCustomClass` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.GetCustomClassRequest} + */ +public final class GetCustomClassRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.GetCustomClassRequest) + GetCustomClassRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetCustomClassRequest.newBuilder() to construct. + private GetCustomClassRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetCustomClassRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetCustomClassRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetCustomClassRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.GetCustomClassRequest.class, + com.google.cloud.speech.v1p1beta1.GetCustomClassRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the custom class to retrieve.
+   * Format:
+   * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the custom class to retrieve.
+   * Format:
+   * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.GetCustomClassRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.GetCustomClassRequest other = + (com.google.cloud.speech.v1p1beta1.GetCustomClassRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.speech.v1p1beta1.GetCustomClassRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message sent by the client for the `GetCustomClass` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.GetCustomClassRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.GetCustomClassRequest) + com.google.cloud.speech.v1p1beta1.GetCustomClassRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.GetCustomClassRequest.class, + com.google.cloud.speech.v1p1beta1.GetCustomClassRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.GetCustomClassRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.GetCustomClassRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.GetCustomClassRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.GetCustomClassRequest build() { + com.google.cloud.speech.v1p1beta1.GetCustomClassRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.GetCustomClassRequest buildPartial() { + com.google.cloud.speech.v1p1beta1.GetCustomClassRequest result = + new com.google.cloud.speech.v1p1beta1.GetCustomClassRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.GetCustomClassRequest) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.GetCustomClassRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.GetCustomClassRequest other) { + if (other == com.google.cloud.speech.v1p1beta1.GetCustomClassRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.speech.v1p1beta1.GetCustomClassRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the custom class to retrieve.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the custom class to retrieve.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the custom class to retrieve.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the custom class to retrieve.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the custom class to retrieve.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.GetCustomClassRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.GetCustomClassRequest) + private static final com.google.cloud.speech.v1p1beta1.GetCustomClassRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.GetCustomClassRequest(); + } + + public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetCustomClassRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetCustomClassRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.GetCustomClassRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetCustomClassRequestOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetCustomClassRequestOrBuilder.java new file mode 100644 index 000000000..6bd4958e0 --- /dev/null +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetCustomClassRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface GetCustomClassRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.GetCustomClassRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the custom class to retrieve.
+   * Format:
+   * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the custom class to retrieve.
+   * Format:
+   * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetPhraseSetRequest.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetPhraseSetRequest.java new file mode 100644 index 000000000..523fc87c9 --- /dev/null +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetPhraseSetRequest.java @@ -0,0 +1,665 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + * + * + *
+ * Message sent by the client for the `GetPhraseSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.GetPhraseSetRequest} + */ +public final class GetPhraseSetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.GetPhraseSetRequest) + GetPhraseSetRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetPhraseSetRequest.newBuilder() to construct. + private GetPhraseSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetPhraseSetRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetPhraseSetRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetPhraseSetRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest.class, + com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the phrase set to retrieve.
+   * Format:
+   * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the phrase set to retrieve.
+   * Format:
+   * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest other = + (com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message sent by the client for the `GetPhraseSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.GetPhraseSetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.GetPhraseSetRequest) + com.google.cloud.speech.v1p1beta1.GetPhraseSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest.class, + com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest build() { + com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest buildPartial() { + com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest result = + new com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest other) { + if (other == com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the phrase set to retrieve.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the phrase set to retrieve.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the phrase set to retrieve.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the phrase set to retrieve.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the phrase set to retrieve.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.GetPhraseSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.GetPhraseSetRequest) + private static final com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest(); + } + + public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetPhraseSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetPhraseSetRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetPhraseSetRequestOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetPhraseSetRequestOrBuilder.java new file mode 100644 index 000000000..40d0f81c6 --- /dev/null +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetPhraseSetRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface GetPhraseSetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.GetPhraseSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the phrase set to retrieve.
+   * Format:
+   * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the phrase set to retrieve.
+   * Format:
+   * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesRequest.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesRequest.java new file mode 100644 index 000000000..05d5db22c --- /dev/null +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesRequest.java @@ -0,0 +1,967 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + * + * + *
+ * Message sent by the client for the `ListCustomClasses` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.ListCustomClassesRequest} + */ +public final class ListCustomClassesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.ListCustomClassesRequest) + ListCustomClassesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListCustomClassesRequest.newBuilder() to construct. + private ListCustomClassesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListCustomClassesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListCustomClassesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListCustomClassesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest.class, + com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent, which owns this collection of custom classes.
+   * Format:
+   * {api_version}/projects/{project}/locations/{location}/customClasses
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent, which owns this collection of custom classes.
+   * Format:
+   * {api_version}/projects/{project}/locations/{location}/customClasses
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of custom classes to return. The service may return
+   * fewer than this value. If unspecified, at most 50 custom classes will be
+   * returned. The maximum value is 1000; values above 1000 will be coerced to
+   * 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * A page token, received from a previous `ListCustomClass` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListCustomClass` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token, received from a previous `ListCustomClass` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListCustomClass` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest other = + (com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message sent by the client for the `ListCustomClasses` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.ListCustomClassesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.ListCustomClassesRequest) + com.google.cloud.speech.v1p1beta1.ListCustomClassesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest.class, + com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest build() { + com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest buildPartial() { + com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest result = + new com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest other) { + if (other == com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent, which owns this collection of custom classes.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent, which owns this collection of custom classes.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent, which owns this collection of custom classes.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent, which owns this collection of custom classes.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent, which owns this collection of custom classes.
+     * Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of custom classes to return. The service may return
+     * fewer than this value. If unspecified, at most 50 custom classes will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of custom classes to return. The service may return
+     * fewer than this value. If unspecified, at most 50 custom classes will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of custom classes to return. The service may return
+     * fewer than this value. If unspecified, at most 50 custom classes will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token, received from a previous `ListCustomClass` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListCustomClass` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListCustomClass` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListCustomClass` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListCustomClass` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListCustomClass` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListCustomClass` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListCustomClass` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListCustomClass` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListCustomClass` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.ListCustomClassesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.ListCustomClassesRequest) + private static final com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest(); + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListCustomClassesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListCustomClassesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesRequestOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesRequestOrBuilder.java new file mode 100644 index 000000000..fe040690a --- /dev/null +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesRequestOrBuilder.java @@ -0,0 +1,105 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface ListCustomClassesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.ListCustomClassesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent, which owns this collection of custom classes.
+   * Format:
+   * {api_version}/projects/{project}/locations/{location}/customClasses
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent, which owns this collection of custom classes.
+   * Format:
+   * {api_version}/projects/{project}/locations/{location}/customClasses
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of custom classes to return. The service may return
+   * fewer than this value. If unspecified, at most 50 custom classes will be
+   * returned. The maximum value is 1000; values above 1000 will be coerced to
+   * 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token, received from a previous `ListCustomClass` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListCustomClass` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token, received from a previous `ListCustomClass` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListCustomClass` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesResponse.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesResponse.java new file mode 100644 index 000000000..0f1f09017 --- /dev/null +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesResponse.java @@ -0,0 +1,1148 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + * + * + *
+ * Message returned to the client by the `ListCustomClasses` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.ListCustomClassesResponse} + */ +public final class ListCustomClassesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.ListCustomClassesResponse) + ListCustomClassesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListCustomClassesResponse.newBuilder() to construct. + private ListCustomClassesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListCustomClassesResponse() { + customClasses_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListCustomClassesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListCustomClassesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + customClasses_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + customClasses_.add( + input.readMessage( + com.google.cloud.speech.v1p1beta1.CustomClass.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + customClasses_ = java.util.Collections.unmodifiableList(customClasses_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse.class, + com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse.Builder.class); + } + + public static final int CUSTOM_CLASSES_FIELD_NUMBER = 1; + private java.util.List customClasses_; + /** + * + * + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + @java.lang.Override + public java.util.List getCustomClassesList() { + return customClasses_; + } + /** + * + * + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + @java.lang.Override + public java.util.List + getCustomClassesOrBuilderList() { + return customClasses_; + } + /** + * + * + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + @java.lang.Override + public int getCustomClassesCount() { + return customClasses_.size(); + } + /** + * + * + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClasses(int index) { + return customClasses_.get(index); + } + /** + * + * + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassesOrBuilder( + int index) { + return customClasses_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < customClasses_.size(); i++) { + output.writeMessage(1, customClasses_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < customClasses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, customClasses_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse other = + (com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse) obj; + + if (!getCustomClassesList().equals(other.getCustomClassesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getCustomClassesCount() > 0) { + hash = (37 * hash) + CUSTOM_CLASSES_FIELD_NUMBER; + hash = (53 * hash) + getCustomClassesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message returned to the client by the `ListCustomClasses` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.ListCustomClassesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.ListCustomClassesResponse) + com.google.cloud.speech.v1p1beta1.ListCustomClassesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse.class, + com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCustomClassesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (customClassesBuilder_ == null) { + customClasses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + customClassesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse build() { + com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse buildPartial() { + com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse result = + new com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse(this); + int from_bitField0_ = bitField0_; + if (customClassesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + customClasses_ = java.util.Collections.unmodifiableList(customClasses_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.customClasses_ = customClasses_; + } else { + result.customClasses_ = customClassesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse other) { + if (other == com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse.getDefaultInstance()) + return this; + if (customClassesBuilder_ == null) { + if (!other.customClasses_.isEmpty()) { + if (customClasses_.isEmpty()) { + customClasses_ = other.customClasses_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCustomClassesIsMutable(); + customClasses_.addAll(other.customClasses_); + } + onChanged(); + } + } else { + if (!other.customClasses_.isEmpty()) { + if (customClassesBuilder_.isEmpty()) { + customClassesBuilder_.dispose(); + customClassesBuilder_ = null; + customClasses_ = other.customClasses_; + bitField0_ = (bitField0_ & ~0x00000001); + customClassesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCustomClassesFieldBuilder() + : null; + } else { + customClassesBuilder_.addAllMessages(other.customClasses_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List customClasses_ = + java.util.Collections.emptyList(); + + private void ensureCustomClassesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + customClasses_ = + new java.util.ArrayList(customClasses_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.CustomClass, + com.google.cloud.speech.v1p1beta1.CustomClass.Builder, + com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder> + customClassesBuilder_; + + /** + * + * + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public java.util.List getCustomClassesList() { + if (customClassesBuilder_ == null) { + return java.util.Collections.unmodifiableList(customClasses_); + } else { + return customClassesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public int getCustomClassesCount() { + if (customClassesBuilder_ == null) { + return customClasses_.size(); + } else { + return customClassesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClasses(int index) { + if (customClassesBuilder_ == null) { + return customClasses_.get(index); + } else { + return customClassesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public Builder setCustomClasses( + int index, com.google.cloud.speech.v1p1beta1.CustomClass value) { + if (customClassesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomClassesIsMutable(); + customClasses_.set(index, value); + onChanged(); + } else { + customClassesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public Builder setCustomClasses( + int index, com.google.cloud.speech.v1p1beta1.CustomClass.Builder builderForValue) { + if (customClassesBuilder_ == null) { + ensureCustomClassesIsMutable(); + customClasses_.set(index, builderForValue.build()); + onChanged(); + } else { + customClassesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public Builder addCustomClasses(com.google.cloud.speech.v1p1beta1.CustomClass value) { + if (customClassesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomClassesIsMutable(); + customClasses_.add(value); + onChanged(); + } else { + customClassesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public Builder addCustomClasses( + int index, com.google.cloud.speech.v1p1beta1.CustomClass value) { + if (customClassesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomClassesIsMutable(); + customClasses_.add(index, value); + onChanged(); + } else { + customClassesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public Builder addCustomClasses( + com.google.cloud.speech.v1p1beta1.CustomClass.Builder builderForValue) { + if (customClassesBuilder_ == null) { + ensureCustomClassesIsMutable(); + customClasses_.add(builderForValue.build()); + onChanged(); + } else { + customClassesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public Builder addCustomClasses( + int index, com.google.cloud.speech.v1p1beta1.CustomClass.Builder builderForValue) { + if (customClassesBuilder_ == null) { + ensureCustomClassesIsMutable(); + customClasses_.add(index, builderForValue.build()); + onChanged(); + } else { + customClassesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public Builder addAllCustomClasses( + java.lang.Iterable values) { + if (customClassesBuilder_ == null) { + ensureCustomClassesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, customClasses_); + onChanged(); + } else { + customClassesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public Builder clearCustomClasses() { + if (customClassesBuilder_ == null) { + customClasses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + customClassesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public Builder removeCustomClasses(int index) { + if (customClassesBuilder_ == null) { + ensureCustomClassesIsMutable(); + customClasses_.remove(index); + onChanged(); + } else { + customClassesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public com.google.cloud.speech.v1p1beta1.CustomClass.Builder getCustomClassesBuilder( + int index) { + return getCustomClassesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassesOrBuilder( + int index) { + if (customClassesBuilder_ == null) { + return customClasses_.get(index); + } else { + return customClassesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public java.util.List + getCustomClassesOrBuilderList() { + if (customClassesBuilder_ != null) { + return customClassesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(customClasses_); + } + } + /** + * + * + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public com.google.cloud.speech.v1p1beta1.CustomClass.Builder addCustomClassesBuilder() { + return getCustomClassesFieldBuilder() + .addBuilder(com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance()); + } + /** + * + * + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public com.google.cloud.speech.v1p1beta1.CustomClass.Builder addCustomClassesBuilder( + int index) { + return getCustomClassesFieldBuilder() + .addBuilder(index, com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance()); + } + /** + * + * + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public java.util.List + getCustomClassesBuilderList() { + return getCustomClassesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.CustomClass, + com.google.cloud.speech.v1p1beta1.CustomClass.Builder, + com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder> + getCustomClassesFieldBuilder() { + if (customClassesBuilder_ == null) { + customClassesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.CustomClass, + com.google.cloud.speech.v1p1beta1.CustomClass.Builder, + com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder>( + customClasses_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + customClasses_ = null; + } + return customClassesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.ListCustomClassesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.ListCustomClassesResponse) + private static final com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse(); + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListCustomClassesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListCustomClassesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesResponseOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesResponseOrBuilder.java new file mode 100644 index 000000000..ba426471d --- /dev/null +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface ListCustomClassesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.ListCustomClassesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + java.util.List getCustomClassesList(); + /** + * + * + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + com.google.cloud.speech.v1p1beta1.CustomClass getCustomClasses(int index); + /** + * + * + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + int getCustomClassesCount(); + /** + * + * + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + java.util.List + getCustomClassesOrBuilderList(); + /** + * + * + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassesOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetRequest.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetRequest.java new file mode 100644 index 000000000..f31c2b8d5 --- /dev/null +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetRequest.java @@ -0,0 +1,967 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + * + * + *
+ * Message sent by the client for the `ListPhraseSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.ListPhraseSetRequest} + */ +public final class ListPhraseSetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.ListPhraseSetRequest) + ListPhraseSetRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListPhraseSetRequest.newBuilder() to construct. + private ListPhraseSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListPhraseSetRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListPhraseSetRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListPhraseSetRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest.class, + com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent, which owns this collection of phrase set.
+   * Format:
+   * projects/{project}/locations/{location}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent, which owns this collection of phrase set.
+   * Format:
+   * projects/{project}/locations/{location}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of phrase sets to return. The service may return
+   * fewer than this value. If unspecified, at most 50 phrase sets will be
+   * returned. The maximum value is 1000; values above 1000 will be coerced to
+   * 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * A page token, received from a previous `ListPhraseSet` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListPhraseSet` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token, received from a previous `ListPhraseSet` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListPhraseSet` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest other = + (com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message sent by the client for the `ListPhraseSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.ListPhraseSetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.ListPhraseSetRequest) + com.google.cloud.speech.v1p1beta1.ListPhraseSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest.class, + com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest build() { + com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest buildPartial() { + com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest result = + new com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest other) { + if (other == com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent, which owns this collection of phrase set.
+     * Format:
+     * projects/{project}/locations/{location}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent, which owns this collection of phrase set.
+     * Format:
+     * projects/{project}/locations/{location}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent, which owns this collection of phrase set.
+     * Format:
+     * projects/{project}/locations/{location}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent, which owns this collection of phrase set.
+     * Format:
+     * projects/{project}/locations/{location}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent, which owns this collection of phrase set.
+     * Format:
+     * projects/{project}/locations/{location}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of phrase sets to return. The service may return
+     * fewer than this value. If unspecified, at most 50 phrase sets will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of phrase sets to return. The service may return
+     * fewer than this value. If unspecified, at most 50 phrase sets will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of phrase sets to return. The service may return
+     * fewer than this value. If unspecified, at most 50 phrase sets will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token, received from a previous `ListPhraseSet` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListPhraseSet` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListPhraseSet` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListPhraseSet` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListPhraseSet` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListPhraseSet` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListPhraseSet` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListPhraseSet` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListPhraseSet` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListPhraseSet` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.ListPhraseSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.ListPhraseSetRequest) + private static final com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest(); + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListPhraseSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListPhraseSetRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetRequestOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetRequestOrBuilder.java new file mode 100644 index 000000000..b514303ec --- /dev/null +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetRequestOrBuilder.java @@ -0,0 +1,105 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface ListPhraseSetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.ListPhraseSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent, which owns this collection of phrase set.
+   * Format:
+   * projects/{project}/locations/{location}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent, which owns this collection of phrase set.
+   * Format:
+   * projects/{project}/locations/{location}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of phrase sets to return. The service may return
+   * fewer than this value. If unspecified, at most 50 phrase sets will be
+   * returned. The maximum value is 1000; values above 1000 will be coerced to
+   * 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token, received from a previous `ListPhraseSet` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListPhraseSet` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token, received from a previous `ListPhraseSet` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListPhraseSet` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetResponse.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetResponse.java new file mode 100644 index 000000000..0ae5ad215 --- /dev/null +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetResponse.java @@ -0,0 +1,1139 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + * + * + *
+ * Message returned to the client by the `ListPhraseSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.ListPhraseSetResponse} + */ +public final class ListPhraseSetResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.ListPhraseSetResponse) + ListPhraseSetResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListPhraseSetResponse.newBuilder() to construct. + private ListPhraseSetResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListPhraseSetResponse() { + phraseSets_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListPhraseSetResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListPhraseSetResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + phraseSets_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + phraseSets_.add( + input.readMessage( + com.google.cloud.speech.v1p1beta1.PhraseSet.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + phraseSets_ = java.util.Collections.unmodifiableList(phraseSets_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse.class, + com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse.Builder.class); + } + + public static final int PHRASE_SETS_FIELD_NUMBER = 1; + private java.util.List phraseSets_; + /** + * + * + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + @java.lang.Override + public java.util.List getPhraseSetsList() { + return phraseSets_; + } + /** + * + * + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + @java.lang.Override + public java.util.List + getPhraseSetsOrBuilderList() { + return phraseSets_; + } + /** + * + * + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + @java.lang.Override + public int getPhraseSetsCount() { + return phraseSets_.size(); + } + /** + * + * + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSets(int index) { + return phraseSets_.get(index); + } + /** + * + * + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetsOrBuilder(int index) { + return phraseSets_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < phraseSets_.size(); i++) { + output.writeMessage(1, phraseSets_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < phraseSets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, phraseSets_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse other = + (com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse) obj; + + if (!getPhraseSetsList().equals(other.getPhraseSetsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getPhraseSetsCount() > 0) { + hash = (37 * hash) + PHRASE_SETS_FIELD_NUMBER; + hash = (53 * hash) + getPhraseSetsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message returned to the client by the `ListPhraseSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.ListPhraseSetResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.ListPhraseSetResponse) + com.google.cloud.speech.v1p1beta1.ListPhraseSetResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse.class, + com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPhraseSetsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (phraseSetsBuilder_ == null) { + phraseSets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + phraseSetsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse build() { + com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse buildPartial() { + com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse result = + new com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse(this); + int from_bitField0_ = bitField0_; + if (phraseSetsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + phraseSets_ = java.util.Collections.unmodifiableList(phraseSets_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.phraseSets_ = phraseSets_; + } else { + result.phraseSets_ = phraseSetsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse other) { + if (other == com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse.getDefaultInstance()) + return this; + if (phraseSetsBuilder_ == null) { + if (!other.phraseSets_.isEmpty()) { + if (phraseSets_.isEmpty()) { + phraseSets_ = other.phraseSets_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePhraseSetsIsMutable(); + phraseSets_.addAll(other.phraseSets_); + } + onChanged(); + } + } else { + if (!other.phraseSets_.isEmpty()) { + if (phraseSetsBuilder_.isEmpty()) { + phraseSetsBuilder_.dispose(); + phraseSetsBuilder_ = null; + phraseSets_ = other.phraseSets_; + bitField0_ = (bitField0_ & ~0x00000001); + phraseSetsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPhraseSetsFieldBuilder() + : null; + } else { + phraseSetsBuilder_.addAllMessages(other.phraseSets_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List phraseSets_ = + java.util.Collections.emptyList(); + + private void ensurePhraseSetsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + phraseSets_ = + new java.util.ArrayList(phraseSets_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.PhraseSet, + com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, + com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder> + phraseSetsBuilder_; + + /** + * + * + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public java.util.List getPhraseSetsList() { + if (phraseSetsBuilder_ == null) { + return java.util.Collections.unmodifiableList(phraseSets_); + } else { + return phraseSetsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public int getPhraseSetsCount() { + if (phraseSetsBuilder_ == null) { + return phraseSets_.size(); + } else { + return phraseSetsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSets(int index) { + if (phraseSetsBuilder_ == null) { + return phraseSets_.get(index); + } else { + return phraseSetsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public Builder setPhraseSets(int index, com.google.cloud.speech.v1p1beta1.PhraseSet value) { + if (phraseSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhraseSetsIsMutable(); + phraseSets_.set(index, value); + onChanged(); + } else { + phraseSetsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public Builder setPhraseSets( + int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder builderForValue) { + if (phraseSetsBuilder_ == null) { + ensurePhraseSetsIsMutable(); + phraseSets_.set(index, builderForValue.build()); + onChanged(); + } else { + phraseSetsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public Builder addPhraseSets(com.google.cloud.speech.v1p1beta1.PhraseSet value) { + if (phraseSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhraseSetsIsMutable(); + phraseSets_.add(value); + onChanged(); + } else { + phraseSetsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public Builder addPhraseSets(int index, com.google.cloud.speech.v1p1beta1.PhraseSet value) { + if (phraseSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhraseSetsIsMutable(); + phraseSets_.add(index, value); + onChanged(); + } else { + phraseSetsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public Builder addPhraseSets( + com.google.cloud.speech.v1p1beta1.PhraseSet.Builder builderForValue) { + if (phraseSetsBuilder_ == null) { + ensurePhraseSetsIsMutable(); + phraseSets_.add(builderForValue.build()); + onChanged(); + } else { + phraseSetsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public Builder addPhraseSets( + int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder builderForValue) { + if (phraseSetsBuilder_ == null) { + ensurePhraseSetsIsMutable(); + phraseSets_.add(index, builderForValue.build()); + onChanged(); + } else { + phraseSetsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public Builder addAllPhraseSets( + java.lang.Iterable values) { + if (phraseSetsBuilder_ == null) { + ensurePhraseSetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, phraseSets_); + onChanged(); + } else { + phraseSetsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public Builder clearPhraseSets() { + if (phraseSetsBuilder_ == null) { + phraseSets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + phraseSetsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public Builder removePhraseSets(int index) { + if (phraseSetsBuilder_ == null) { + ensurePhraseSetsIsMutable(); + phraseSets_.remove(index); + onChanged(); + } else { + phraseSetsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public com.google.cloud.speech.v1p1beta1.PhraseSet.Builder getPhraseSetsBuilder(int index) { + return getPhraseSetsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetsOrBuilder(int index) { + if (phraseSetsBuilder_ == null) { + return phraseSets_.get(index); + } else { + return phraseSetsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public java.util.List + getPhraseSetsOrBuilderList() { + if (phraseSetsBuilder_ != null) { + return phraseSetsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(phraseSets_); + } + } + /** + * + * + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public com.google.cloud.speech.v1p1beta1.PhraseSet.Builder addPhraseSetsBuilder() { + return getPhraseSetsFieldBuilder() + .addBuilder(com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance()); + } + /** + * + * + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public com.google.cloud.speech.v1p1beta1.PhraseSet.Builder addPhraseSetsBuilder(int index) { + return getPhraseSetsFieldBuilder() + .addBuilder(index, com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance()); + } + /** + * + * + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public java.util.List + getPhraseSetsBuilderList() { + return getPhraseSetsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.PhraseSet, + com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, + com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder> + getPhraseSetsFieldBuilder() { + if (phraseSetsBuilder_ == null) { + phraseSetsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.PhraseSet, + com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, + com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder>( + phraseSets_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + phraseSets_ = null; + } + return phraseSetsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.ListPhraseSetResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.ListPhraseSetResponse) + private static final com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse(); + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListPhraseSetResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListPhraseSetResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetResponseOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetResponseOrBuilder.java new file mode 100644 index 000000000..319d29f4f --- /dev/null +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface ListPhraseSetResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.ListPhraseSetResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + java.util.List getPhraseSetsList(); + /** + * + * + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSets(int index); + /** + * + * + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + int getPhraseSetsCount(); + /** + * + * + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + java.util.List + getPhraseSetsOrBuilderList(); + /** + * + * + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetsOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LocationName.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LocationName.java new file mode 100644 index 000000000..e6cb512c6 --- /dev/null +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + project = locationName.project; + location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadata.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadata.java index a54d7fac9..538b5a4ec 100644 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadata.java +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadata.java @@ -267,8 +267,8 @@ public com.google.protobuf.TimestampOrBuilder getLastUpdateTimeOrBuilder() { * * *
-   * The URI of the audio file being transcribed. Empty if the audio was sent
-   * as byte content.
+   * Output only. The URI of the audio file being transcribed. Empty if the
+   * audio was sent as byte content.
    * 
* * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -291,8 +291,8 @@ public java.lang.String getUri() { * * *
-   * The URI of the audio file being transcribed. Empty if the audio was sent
-   * as byte content.
+   * Output only. The URI of the audio file being transcribed. Empty if the
+   * audio was sent as byte content.
    * 
* * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1131,8 +1131,8 @@ public com.google.protobuf.TimestampOrBuilder getLastUpdateTimeOrBuilder() { * * *
-     * The URI of the audio file being transcribed. Empty if the audio was sent
-     * as byte content.
+     * Output only. The URI of the audio file being transcribed. Empty if the
+     * audio was sent as byte content.
      * 
* * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1154,8 +1154,8 @@ public java.lang.String getUri() { * * *
-     * The URI of the audio file being transcribed. Empty if the audio was sent
-     * as byte content.
+     * Output only. The URI of the audio file being transcribed. Empty if the
+     * audio was sent as byte content.
      * 
* * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1177,8 +1177,8 @@ public com.google.protobuf.ByteString getUriBytes() { * * *
-     * The URI of the audio file being transcribed. Empty if the audio was sent
-     * as byte content.
+     * Output only. The URI of the audio file being transcribed. Empty if the
+     * audio was sent as byte content.
      * 
* * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1199,8 +1199,8 @@ public Builder setUri(java.lang.String value) { * * *
-     * The URI of the audio file being transcribed. Empty if the audio was sent
-     * as byte content.
+     * Output only. The URI of the audio file being transcribed. Empty if the
+     * audio was sent as byte content.
      * 
* * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1217,8 +1217,8 @@ public Builder clearUri() { * * *
-     * The URI of the audio file being transcribed. Empty if the audio was sent
-     * as byte content.
+     * Output only. The URI of the audio file being transcribed. Empty if the
+     * audio was sent as byte content.
      * 
* * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadataOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadataOrBuilder.java index 072c108ae..50fc6216f 100644 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadataOrBuilder.java +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadataOrBuilder.java @@ -111,8 +111,8 @@ public interface LongRunningRecognizeMetadataOrBuilder * * *
-   * The URI of the audio file being transcribed. Empty if the audio was sent
-   * as byte content.
+   * Output only. The URI of the audio file being transcribed. Empty if the
+   * audio was sent as byte content.
    * 
* * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -124,8 +124,8 @@ public interface LongRunningRecognizeMetadataOrBuilder * * *
-   * The URI of the audio file being transcribed. Empty if the audio was sent
-   * as byte content.
+   * Output only. The URI of the audio file being transcribed. Empty if the
+   * audio was sent as byte content.
    * 
* * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfig.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfig.java index ff4ebf3a1..cecc942a1 100644 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfig.java +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfig.java @@ -397,7 +397,8 @@ public enum AudioEncoding implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * MP3 audio. Support all standard MP3 bitrates (which range from 32-320
+     * MP3 audio. MP3 encoding is a Beta feature and only available in
+     * v1p1beta1. Support all standard MP3 bitrates (which range from 32-320
      * kbps). When using this encoding, `sample_rate_hertz` has to match the
      * sample rate of the file being used.
      * 
@@ -511,7 +512,8 @@ public enum AudioEncoding implements com.google.protobuf.ProtocolMessageEnum { * * *
-     * MP3 audio. Support all standard MP3 bitrates (which range from 32-320
+     * MP3 audio. MP3 encoding is a Beta feature and only available in
+     * v1p1beta1. Support all standard MP3 bitrates (which range from 32-320
      * kbps). When using this encoding, `sample_rate_hertz` has to match the
      * sample rate of the file being used.
      * 
diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptation.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptation.java index fd05b15f0..a71df1aab 100644 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptation.java +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptation.java @@ -39,6 +39,7 @@ private SpeechAdaptation(com.google.protobuf.GeneratedMessageV3.Builder build private SpeechAdaptation() { phraseSets_ = java.util.Collections.emptyList(); + phraseSetReferences_ = com.google.protobuf.LazyStringArrayList.EMPTY; customClasses_ = java.util.Collections.emptyList(); } @@ -86,10 +87,20 @@ private SpeechAdaptation( } case 18: { + java.lang.String s = input.readStringRequireUtf8(); if (!((mutable_bitField0_ & 0x00000002) != 0)) { + phraseSetReferences_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + phraseSetReferences_.add(s); + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { customClasses_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; + mutable_bitField0_ |= 0x00000004; } customClasses_.add( input.readMessage( @@ -114,6 +125,9 @@ private SpeechAdaptation( phraseSets_ = java.util.Collections.unmodifiableList(phraseSets_); } if (((mutable_bitField0_ & 0x00000002) != 0)) { + phraseSetReferences_ = phraseSetReferences_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { customClasses_ = java.util.Collections.unmodifiableList(customClasses_); } this.unknownFields = unknownFields.build(); @@ -215,7 +229,68 @@ public com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetsOrBuild return phraseSets_.get(index); } - public static final int CUSTOM_CLASSES_FIELD_NUMBER = 2; + public static final int PHRASE_SET_REFERENCES_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList phraseSetReferences_; + /** + * + * + *
+   * A collection of phrase set resource names to use.
+   * 
+ * + * repeated string phrase_set_references = 2; + * + * @return A list containing the phraseSetReferences. + */ + public com.google.protobuf.ProtocolStringList getPhraseSetReferencesList() { + return phraseSetReferences_; + } + /** + * + * + *
+   * A collection of phrase set resource names to use.
+   * 
+ * + * repeated string phrase_set_references = 2; + * + * @return The count of phraseSetReferences. + */ + public int getPhraseSetReferencesCount() { + return phraseSetReferences_.size(); + } + /** + * + * + *
+   * A collection of phrase set resource names to use.
+   * 
+ * + * repeated string phrase_set_references = 2; + * + * @param index The index of the element to return. + * @return The phraseSetReferences at the given index. + */ + public java.lang.String getPhraseSetReferences(int index) { + return phraseSetReferences_.get(index); + } + /** + * + * + *
+   * A collection of phrase set resource names to use.
+   * 
+ * + * repeated string phrase_set_references = 2; + * + * @param index The index of the value to return. + * @return The bytes of the phraseSetReferences at the given index. + */ + public com.google.protobuf.ByteString getPhraseSetReferencesBytes(int index) { + return phraseSetReferences_.getByteString(index); + } + + public static final int CUSTOM_CLASSES_FIELD_NUMBER = 3; private java.util.List customClasses_; /** * @@ -227,7 +302,7 @@ public com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetsOrBuild * `custom_class_id`. * * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; */ @java.lang.Override public java.util.List getCustomClassesList() { @@ -243,7 +318,7 @@ public java.util.List getCustomCl * `custom_class_id`. * * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; */ @java.lang.Override public java.util.List @@ -260,7 +335,7 @@ public java.util.List getCustomCl * `custom_class_id`. * * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; */ @java.lang.Override public int getCustomClassesCount() { @@ -276,7 +351,7 @@ public int getCustomClassesCount() { * `custom_class_id`. * * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; */ @java.lang.Override public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClasses(int index) { @@ -292,7 +367,7 @@ public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClasses(int index) * `custom_class_id`. * * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; */ @java.lang.Override public com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassesOrBuilder( @@ -317,8 +392,11 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < phraseSets_.size(); i++) { output.writeMessage(1, phraseSets_.get(i)); } + for (int i = 0; i < phraseSetReferences_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, phraseSetReferences_.getRaw(i)); + } for (int i = 0; i < customClasses_.size(); i++) { - output.writeMessage(2, customClasses_.get(i)); + output.writeMessage(3, customClasses_.get(i)); } unknownFields.writeTo(output); } @@ -332,8 +410,16 @@ public int getSerializedSize() { for (int i = 0; i < phraseSets_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, phraseSets_.get(i)); } + { + int dataSize = 0; + for (int i = 0; i < phraseSetReferences_.size(); i++) { + dataSize += computeStringSizeNoTag(phraseSetReferences_.getRaw(i)); + } + size += dataSize; + size += 1 * getPhraseSetReferencesList().size(); + } for (int i = 0; i < customClasses_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, customClasses_.get(i)); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, customClasses_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -352,6 +438,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.speech.v1p1beta1.SpeechAdaptation) obj; if (!getPhraseSetsList().equals(other.getPhraseSetsList())) return false; + if (!getPhraseSetReferencesList().equals(other.getPhraseSetReferencesList())) return false; if (!getCustomClassesList().equals(other.getCustomClassesList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; @@ -368,6 +455,10 @@ public int hashCode() { hash = (37 * hash) + PHRASE_SETS_FIELD_NUMBER; hash = (53 * hash) + getPhraseSetsList().hashCode(); } + if (getPhraseSetReferencesCount() > 0) { + hash = (37 * hash) + PHRASE_SET_REFERENCES_FIELD_NUMBER; + hash = (53 * hash) + getPhraseSetReferencesList().hashCode(); + } if (getCustomClassesCount() > 0) { hash = (37 * hash) + CUSTOM_CLASSES_FIELD_NUMBER; hash = (53 * hash) + getCustomClassesList().hashCode(); @@ -526,9 +617,11 @@ public Builder clear() { } else { phraseSetsBuilder_.clear(); } + phraseSetReferences_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); if (customClassesBuilder_ == null) { customClasses_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000004); } else { customClassesBuilder_.clear(); } @@ -569,10 +662,15 @@ public com.google.cloud.speech.v1p1beta1.SpeechAdaptation buildPartial() { } else { result.phraseSets_ = phraseSetsBuilder_.build(); } + if (((bitField0_ & 0x00000002) != 0)) { + phraseSetReferences_ = phraseSetReferences_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.phraseSetReferences_ = phraseSetReferences_; if (customClassesBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { + if (((bitField0_ & 0x00000004) != 0)) { customClasses_ = java.util.Collections.unmodifiableList(customClasses_); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000004); } result.customClasses_ = customClasses_; } else { @@ -655,11 +753,21 @@ public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.SpeechAdaptation othe } } } + if (!other.phraseSetReferences_.isEmpty()) { + if (phraseSetReferences_.isEmpty()) { + phraseSetReferences_ = other.phraseSetReferences_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensurePhraseSetReferencesIsMutable(); + phraseSetReferences_.addAll(other.phraseSetReferences_); + } + onChanged(); + } if (customClassesBuilder_ == null) { if (!other.customClasses_.isEmpty()) { if (customClasses_.isEmpty()) { customClasses_ = other.customClasses_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000004); } else { ensureCustomClassesIsMutable(); customClasses_.addAll(other.customClasses_); @@ -672,7 +780,7 @@ public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.SpeechAdaptation othe customClassesBuilder_.dispose(); customClassesBuilder_ = null; customClasses_ = other.customClasses_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000004); customClassesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getCustomClassesFieldBuilder() @@ -1101,14 +1209,182 @@ public com.google.cloud.speech.v1p1beta1.PhraseSet.Builder addPhraseSetsBuilder( return phraseSetsBuilder_; } + private com.google.protobuf.LazyStringList phraseSetReferences_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePhraseSetReferencesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + phraseSetReferences_ = new com.google.protobuf.LazyStringArrayList(phraseSetReferences_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * A collection of phrase set resource names to use.
+     * 
+ * + * repeated string phrase_set_references = 2; + * + * @return A list containing the phraseSetReferences. + */ + public com.google.protobuf.ProtocolStringList getPhraseSetReferencesList() { + return phraseSetReferences_.getUnmodifiableView(); + } + /** + * + * + *
+     * A collection of phrase set resource names to use.
+     * 
+ * + * repeated string phrase_set_references = 2; + * + * @return The count of phraseSetReferences. + */ + public int getPhraseSetReferencesCount() { + return phraseSetReferences_.size(); + } + /** + * + * + *
+     * A collection of phrase set resource names to use.
+     * 
+ * + * repeated string phrase_set_references = 2; + * + * @param index The index of the element to return. + * @return The phraseSetReferences at the given index. + */ + public java.lang.String getPhraseSetReferences(int index) { + return phraseSetReferences_.get(index); + } + /** + * + * + *
+     * A collection of phrase set resource names to use.
+     * 
+ * + * repeated string phrase_set_references = 2; + * + * @param index The index of the value to return. + * @return The bytes of the phraseSetReferences at the given index. + */ + public com.google.protobuf.ByteString getPhraseSetReferencesBytes(int index) { + return phraseSetReferences_.getByteString(index); + } + /** + * + * + *
+     * A collection of phrase set resource names to use.
+     * 
+ * + * repeated string phrase_set_references = 2; + * + * @param index The index to set the value at. + * @param value The phraseSetReferences to set. + * @return This builder for chaining. + */ + public Builder setPhraseSetReferences(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhraseSetReferencesIsMutable(); + phraseSetReferences_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * A collection of phrase set resource names to use.
+     * 
+ * + * repeated string phrase_set_references = 2; + * + * @param value The phraseSetReferences to add. + * @return This builder for chaining. + */ + public Builder addPhraseSetReferences(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhraseSetReferencesIsMutable(); + phraseSetReferences_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * A collection of phrase set resource names to use.
+     * 
+ * + * repeated string phrase_set_references = 2; + * + * @param values The phraseSetReferences to add. + * @return This builder for chaining. + */ + public Builder addAllPhraseSetReferences(java.lang.Iterable values) { + ensurePhraseSetReferencesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, phraseSetReferences_); + onChanged(); + return this; + } + /** + * + * + *
+     * A collection of phrase set resource names to use.
+     * 
+ * + * repeated string phrase_set_references = 2; + * + * @return This builder for chaining. + */ + public Builder clearPhraseSetReferences() { + phraseSetReferences_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A collection of phrase set resource names to use.
+     * 
+ * + * repeated string phrase_set_references = 2; + * + * @param value The bytes of the phraseSetReferences to add. + * @return This builder for chaining. + */ + public Builder addPhraseSetReferencesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePhraseSetReferencesIsMutable(); + phraseSetReferences_.add(value); + onChanged(); + return this; + } + private java.util.List customClasses_ = java.util.Collections.emptyList(); private void ensureCustomClassesIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!((bitField0_ & 0x00000004) != 0)) { customClasses_ = new java.util.ArrayList(customClasses_); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000004; } } @@ -1128,7 +1404,7 @@ private void ensureCustomClassesIsMutable() { * `custom_class_id`. * * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; */ public java.util.List getCustomClassesList() { if (customClassesBuilder_ == null) { @@ -1147,7 +1423,7 @@ public java.util.List getCustomCl * `custom_class_id`. * * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; */ public int getCustomClassesCount() { if (customClassesBuilder_ == null) { @@ -1166,7 +1442,7 @@ public int getCustomClassesCount() { * `custom_class_id`. * * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; */ public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClasses(int index) { if (customClassesBuilder_ == null) { @@ -1185,7 +1461,7 @@ public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClasses(int index) * `custom_class_id`. * * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; */ public Builder setCustomClasses( int index, com.google.cloud.speech.v1p1beta1.CustomClass value) { @@ -1211,7 +1487,7 @@ public Builder setCustomClasses( * `custom_class_id`. * * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; */ public Builder setCustomClasses( int index, com.google.cloud.speech.v1p1beta1.CustomClass.Builder builderForValue) { @@ -1234,7 +1510,7 @@ public Builder setCustomClasses( * `custom_class_id`. * * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; */ public Builder addCustomClasses(com.google.cloud.speech.v1p1beta1.CustomClass value) { if (customClassesBuilder_ == null) { @@ -1259,7 +1535,7 @@ public Builder addCustomClasses(com.google.cloud.speech.v1p1beta1.CustomClass va * `custom_class_id`. * * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; */ public Builder addCustomClasses( int index, com.google.cloud.speech.v1p1beta1.CustomClass value) { @@ -1285,7 +1561,7 @@ public Builder addCustomClasses( * `custom_class_id`. * * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; */ public Builder addCustomClasses( com.google.cloud.speech.v1p1beta1.CustomClass.Builder builderForValue) { @@ -1308,7 +1584,7 @@ public Builder addCustomClasses( * `custom_class_id`. * * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; */ public Builder addCustomClasses( int index, com.google.cloud.speech.v1p1beta1.CustomClass.Builder builderForValue) { @@ -1331,7 +1607,7 @@ public Builder addCustomClasses( * `custom_class_id`. * * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; */ public Builder addAllCustomClasses( java.lang.Iterable values) { @@ -1354,12 +1630,12 @@ public Builder addAllCustomClasses( * `custom_class_id`. * * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; */ public Builder clearCustomClasses() { if (customClassesBuilder_ == null) { customClasses_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); } else { customClassesBuilder_.clear(); @@ -1376,7 +1652,7 @@ public Builder clearCustomClasses() { * `custom_class_id`. * * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; */ public Builder removeCustomClasses(int index) { if (customClassesBuilder_ == null) { @@ -1398,7 +1674,7 @@ public Builder removeCustomClasses(int index) { * `custom_class_id`. * * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; */ public com.google.cloud.speech.v1p1beta1.CustomClass.Builder getCustomClassesBuilder( int index) { @@ -1414,7 +1690,7 @@ public com.google.cloud.speech.v1p1beta1.CustomClass.Builder getCustomClassesBui * `custom_class_id`. * * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; */ public com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassesOrBuilder( int index) { @@ -1434,7 +1710,7 @@ public com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassesOr * `custom_class_id`. * * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; */ public java.util.List getCustomClassesOrBuilderList() { @@ -1454,7 +1730,7 @@ public com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassesOr * `custom_class_id`. * * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; */ public com.google.cloud.speech.v1p1beta1.CustomClass.Builder addCustomClassesBuilder() { return getCustomClassesFieldBuilder() @@ -1470,7 +1746,7 @@ public com.google.cloud.speech.v1p1beta1.CustomClass.Builder addCustomClassesBui * `custom_class_id`. * * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; */ public com.google.cloud.speech.v1p1beta1.CustomClass.Builder addCustomClassesBuilder( int index) { @@ -1487,7 +1763,7 @@ public com.google.cloud.speech.v1p1beta1.CustomClass.Builder addCustomClassesBui * `custom_class_id`. * * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; */ public java.util.List getCustomClassesBuilderList() { @@ -1506,7 +1782,7 @@ public com.google.cloud.speech.v1p1beta1.CustomClass.Builder addCustomClassesBui com.google.cloud.speech.v1p1beta1.CustomClass.Builder, com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder>( customClasses_, - ((bitField0_ & 0x00000002) != 0), + ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); customClasses_ = null; diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationOrBuilder.java index 1549bd430..d735f0bf2 100644 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationOrBuilder.java +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationOrBuilder.java @@ -85,6 +85,57 @@ public interface SpeechAdaptationOrBuilder */ com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetsOrBuilder(int index); + /** + * + * + *
+   * A collection of phrase set resource names to use.
+   * 
+ * + * repeated string phrase_set_references = 2; + * + * @return A list containing the phraseSetReferences. + */ + java.util.List getPhraseSetReferencesList(); + /** + * + * + *
+   * A collection of phrase set resource names to use.
+   * 
+ * + * repeated string phrase_set_references = 2; + * + * @return The count of phraseSetReferences. + */ + int getPhraseSetReferencesCount(); + /** + * + * + *
+   * A collection of phrase set resource names to use.
+   * 
+ * + * repeated string phrase_set_references = 2; + * + * @param index The index of the element to return. + * @return The phraseSetReferences at the given index. + */ + java.lang.String getPhraseSetReferences(int index); + /** + * + * + *
+   * A collection of phrase set resource names to use.
+   * 
+ * + * repeated string phrase_set_references = 2; + * + * @param index The index of the value to return. + * @return The bytes of the phraseSetReferences at the given index. + */ + com.google.protobuf.ByteString getPhraseSetReferencesBytes(int index); + /** * * @@ -95,7 +146,7 @@ public interface SpeechAdaptationOrBuilder * `custom_class_id`. * * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; */ java.util.List getCustomClassesList(); /** @@ -108,7 +159,7 @@ public interface SpeechAdaptationOrBuilder * `custom_class_id`. * * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; */ com.google.cloud.speech.v1p1beta1.CustomClass getCustomClasses(int index); /** @@ -121,7 +172,7 @@ public interface SpeechAdaptationOrBuilder * `custom_class_id`. * * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; */ int getCustomClassesCount(); /** @@ -134,7 +185,7 @@ public interface SpeechAdaptationOrBuilder * `custom_class_id`. * * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; */ java.util.List getCustomClassesOrBuilderList(); @@ -148,7 +199,7 @@ public interface SpeechAdaptationOrBuilder * `custom_class_id`. * * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 2; + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; */ com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassesOrBuilder(int index); } diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationProto.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationProto.java new file mode 100644 index 000000000..a528a7cde --- /dev/null +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationProto.java @@ -0,0 +1,317 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +public final class SpeechAdaptationProto { + private SpeechAdaptationProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n;google/cloud/speech/v1p1beta1/cloud_sp" + + "eech_adaptation.proto\022\035google.cloud.spee" + + "ch.v1p1beta1\032\034google/api/annotations.pro" + + "to\032\027google/api/client.proto\032\037google/api/" + + "field_behavior.proto\032\031google/api/resourc" + + "e.proto\032,google/cloud/speech/v1p1beta1/r" + + "esource.proto\032\033google/protobuf/empty.pro" + + "to\032 google/protobuf/field_mask.proto\"\253\001\n" + + "\026CreatePhraseSetRequest\0227\n\006parent\030\001 \001(\tB" + + "\'\340A\002\372A!\022\037speech.googleapis.com/PhraseSet" + + "\022\025\n\rphrase_set_id\030\002 \001(\t\022A\n\nphrase_set\030\003 " + + "\001(\0132(.google.cloud.speech.v1p1beta1.Phra" + + "seSetB\003\340A\002\"\214\001\n\026UpdatePhraseSetRequest\022A\n" + + "\nphrase_set\030\001 \001(\0132(.google.cloud.speech." + + "v1p1beta1.PhraseSetB\003\340A\002\022/\n\013update_mask\030" + + "\002 \001(\0132\032.google.protobuf.FieldMask\"L\n\023Get" + + "PhraseSetRequest\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037" + + "speech.googleapis.com/PhraseSet\"v\n\024ListP" + + "hraseSetRequest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\022" + + "\037speech.googleapis.com/PhraseSet\022\021\n\tpage" + + "_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"o\n\025ListP" + + "hraseSetResponse\022=\n\013phrase_sets\030\001 \003(\0132(." + + "google.cloud.speech.v1p1beta1.PhraseSet\022" + + "\027\n\017next_page_token\030\002 \001(\t\"O\n\026DeletePhrase" + + "SetRequest\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037speech" + + ".googleapis.com/PhraseSet\"\265\001\n\030CreateCust" + + "omClassRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\022!" + + "speech.googleapis.com/CustomClass\022\027\n\017cus" + + "tom_class_id\030\002 \001(\t\022E\n\014custom_class\030\003 \001(\013" + + "2*.google.cloud.speech.v1p1beta1.CustomC" + + "lassB\003\340A\002\"\222\001\n\030UpdateCustomClassRequest\022E" + + "\n\014custom_class\030\001 \001(\0132*.google.cloud.spee" + + "ch.v1p1beta1.CustomClassB\003\340A\002\022/\n\013update_" + + "mask\030\002 \001(\0132\032.google.protobuf.FieldMask\"P" + + "\n\025GetCustomClassRequest\0227\n\004name\030\001 \001(\tB)\340" + + "A\002\372A#\n!speech.googleapis.com/CustomClass" + + "\"|\n\030ListCustomClassesRequest\0229\n\006parent\030\001" + + " \001(\tB)\340A\002\372A#\022!speech.googleapis.com/Cust" + + "omClass\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token" + + "\030\003 \001(\t\"x\n\031ListCustomClassesResponse\022B\n\016c" + + "ustom_classes\030\001 \003(\0132*.google.cloud.speec" + + "h.v1p1beta1.CustomClass\022\027\n\017next_page_tok" + + "en\030\002 \001(\t\"S\n\030DeleteCustomClassRequest\0227\n\004" + + "name\030\001 \001(\tB)\340A\002\372A#\n!speech.googleapis.co" + + "m/CustomClass2\236\020\n\nAdaptation\022\326\001\n\017CreateP" + + "hraseSet\0225.google.cloud.speech.v1p1beta1" + + ".CreatePhraseSetRequest\032(.google.cloud.s" + + "peech.v1p1beta1.PhraseSet\"b\202\323\344\223\002:\"5/v1p1" + + "beta1/{parent=projects/*/locations/*}/ph" + + "raseSets:\001*\332A\037parent,phrase_set,phrase_s" + + "et_id\022\262\001\n\014GetPhraseSet\0222.google.cloud.sp" + + "eech.v1p1beta1.GetPhraseSetRequest\032(.goo" + + "gle.cloud.speech.v1p1beta1.PhraseSet\"D\202\323" + + "\344\223\0027\0225/v1p1beta1/{name=projects/*/locati" + + "ons/*/phraseSets/*}\332A\004name\022\302\001\n\rListPhras" + + "eSet\0223.google.cloud.speech.v1p1beta1.Lis" + + "tPhraseSetRequest\0324.google.cloud.speech." + + "v1p1beta1.ListPhraseSetResponse\"F\202\323\344\223\0027\022" + + "5/v1p1beta1/{parent=projects/*/locations" + + "/*}/phraseSets\332A\006parent\022\310\001\n\017UpdatePhrase" + + "Set\0225.google.cloud.speech.v1p1beta1.Upda" + + "tePhraseSetRequest\032(.google.cloud.speech" + + ".v1p1beta1.PhraseSet\"T\202\323\344\223\002N2@/v1p1beta1" + + "/{phrase_set.name=projects/*/locations/*" + + "/phraseSets/*}:\nphrase_set\022\246\001\n\017DeletePhr" + + "aseSet\0225.google.cloud.speech.v1p1beta1.D" + + "eletePhraseSetRequest\032\026.google.protobuf." + + "Empty\"D\202\323\344\223\0027*5/v1p1beta1/{name=projects" + + "/*/locations/*/phraseSets/*}\332A\004name\022\343\001\n\021" + + "CreateCustomClass\0227.google.cloud.speech." + + "v1p1beta1.CreateCustomClassRequest\032*.goo" + + "gle.cloud.speech.v1p1beta1.CustomClass\"i" + + "\202\323\344\223\002=\"8/v1p1beta1/{parent=projects/*/lo" + + "cations/*}/customClasses:\001*\332A#parent,cus" + + "tom_class,custom_class_id\022\273\001\n\016GetCustomC" + + "lass\0224.google.cloud.speech.v1p1beta1.Get" + + "CustomClassRequest\032*.google.cloud.speech" + + ".v1p1beta1.CustomClass\"G\202\323\344\223\002:\0228/v1p1bet" + + "a1/{name=projects/*/locations/*/customCl" + + "asses/*}\332A\004name\022\321\001\n\021ListCustomClasses\0227." + + "google.cloud.speech.v1p1beta1.ListCustom" + + "ClassesRequest\0328.google.cloud.speech.v1p" + + "1beta1.ListCustomClassesResponse\"I\202\323\344\223\002:" + + "\0228/v1p1beta1/{parent=projects/*/location" + + "s/*}/customClasses\332A\006parent\022\325\001\n\021UpdateCu" + + "stomClass\0227.google.cloud.speech.v1p1beta" + + "1.UpdateCustomClassRequest\032*.google.clou" + + "d.speech.v1p1beta1.CustomClass\"[\202\323\344\223\002U2E" + + "/v1p1beta1/{custom_class.name=projects/*" + + "/locations/*/customClasses/*}:\014custom_cl" + + "ass\022\255\001\n\021DeleteCustomClass\0227.google.cloud" + + ".speech.v1p1beta1.DeleteCustomClassReque" + + "st\032\026.google.protobuf.Empty\"G\202\323\344\223\002:*8/v1p" + + "1beta1/{name=projects/*/locations/*/cust" + + "omClasses/*}\332A\004name\032I\312A\025speech.googleapi" + + "s.com\322A.https://www.googleapis.com/auth/" + + "cloud-platformB\212\001\n!com.google.cloud.spee" + + "ch.v1p1beta1B\025SpeechAdaptationProtoP\001ZCg" + + "oogle.golang.org/genproto/googleapis/clo" + + "ud/speech/v1p1beta1;speech\370\001\001\242\002\003GCSb\006pro" + + "to3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.speech.v1p1beta1.SpeechResourceProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }); + internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_descriptor, + new java.lang.String[] { + "Parent", "PhraseSetId", "PhraseSet", + }); + internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_descriptor, + new java.lang.String[] { + "PhraseSet", "UpdateMask", + }); + internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_descriptor, + new java.lang.String[] { + "PhraseSets", "NextPageToken", + }); + internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_descriptor, + new java.lang.String[] { + "Parent", "CustomClassId", "CustomClass", + }); + internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_descriptor, + new java.lang.String[] { + "CustomClass", "UpdateMask", + }); + internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_descriptor, + new java.lang.String[] { + "CustomClasses", "NextPageToken", + }); + internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_descriptor, + new java.lang.String[] { + "Name", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.speech.v1p1beta1.SpeechResourceProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechResourceProto.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechResourceProto.java index c10c54239..0178a9891 100644 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechResourceProto.java +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechResourceProto.java @@ -57,9 +57,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { "\n,google/cloud/speech/v1p1beta1/resource" - + ".proto\022\035google.cloud.speech.v1p1beta1\032\034g" - + "oogle/api/annotations.proto\032\031google/api/" - + "resource.proto\"\203\002\n\013CustomClass\022\014\n\004name\030\001" + + ".proto\022\035google.cloud.speech.v1p1beta1\032\031g" + + "oogle/api/resource.proto\032\034google/api/ann" + + "otations.proto\"\203\002\n\013CustomClass\022\014\n\004name\030\001" + " \001(\t\022\027\n\017custom_class_id\030\002 \001(\t\022C\n\005items\030\003" + " \003(\01324.google.cloud.speech.v1p1beta1.Cus" + "tomClass.ClassItem\032\032\n\tClassItem\022\r\n\005value" @@ -72,21 +72,22 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "alue\030\001 \001(\t\022\r\n\005boost\030\002 \001(\002:e\352Ab\n\037speech.g" + "oogleapis.com/PhraseSet\022?projects/{proje" + "ct}/locations/{location}/phraseSets/{phr" - + "ase_set}\"\225\001\n\020SpeechAdaptation\022=\n\013phrase_" + + "ase_set}\"\264\001\n\020SpeechAdaptation\022=\n\013phrase_" + "sets\030\001 \003(\0132(.google.cloud.speech.v1p1bet" - + "a1.PhraseSet\022B\n\016custom_classes\030\002 \003(\0132*.g" - + "oogle.cloud.speech.v1p1beta1.CustomClass" - + "B\210\001\n!com.google.cloud.speech.v1p1beta1B\023" - + "SpeechResourceProtoP\001ZCgoogle.golang.org" - + "/genproto/googleapis/cloud/speech/v1p1be" - + "ta1;speech\370\001\001\242\002\003GCSb\006proto3" + + "a1.PhraseSet\022\035\n\025phrase_set_references\030\002 " + + "\003(\t\022B\n\016custom_classes\030\003 \003(\0132*.google.clo" + + "ud.speech.v1p1beta1.CustomClassB\210\001\n!com." + + "google.cloud.speech.v1p1beta1B\023SpeechRes" + + "ourceProtoP\001ZCgoogle.golang.org/genproto" + + "/googleapis/cloud/speech/v1p1beta1;speec" + + "h\370\001\001\242\002\003GCSb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.api.AnnotationsProto.getDescriptor(), com.google.api.ResourceProto.getDescriptor(), + com.google.api.AnnotationsProto.getDescriptor(), }); internal_static_google_cloud_speech_v1p1beta1_CustomClass_descriptor = getDescriptor().getMessageTypes().get(0); @@ -128,15 +129,15 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_descriptor, new java.lang.String[] { - "PhraseSets", "CustomClasses", + "PhraseSets", "PhraseSetReferences", "CustomClasses", }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.ResourceProto.resource); com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); - com.google.api.AnnotationsProto.getDescriptor(); com.google.api.ResourceProto.getDescriptor(); + com.google.api.AnnotationsProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfig.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfig.java index 844ab39bd..2665d0f08 100644 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfig.java +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfig.java @@ -203,6 +203,14 @@ public com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrB * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no * more than one `StreamingRecognitionResult` with the `is_final` flag set to * `true`. + * The `single_utterance` field can only be used with specified models, + * otherwise an error is thrown. The `model` field in [`RecognitionConfig`][] + * must be set to: + * * `command_and_search` + * * `phone_call` AND additional field `useEnhanced`=`true` + * * The `model` field is left undefined. In this case the API auto-selects + * a model based on any other parameters that you set in + * `RecognitionConfig`. * * * bool single_utterance = 2; @@ -827,6 +835,14 @@ public com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrB * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no * more than one `StreamingRecognitionResult` with the `is_final` flag set to * `true`. + * The `single_utterance` field can only be used with specified models, + * otherwise an error is thrown. The `model` field in [`RecognitionConfig`][] + * must be set to: + * * `command_and_search` + * * `phone_call` AND additional field `useEnhanced`=`true` + * * The `model` field is left undefined. In this case the API auto-selects + * a model based on any other parameters that you set in + * `RecognitionConfig`. * * * bool single_utterance = 2; @@ -851,6 +867,14 @@ public boolean getSingleUtterance() { * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no * more than one `StreamingRecognitionResult` with the `is_final` flag set to * `true`. + * The `single_utterance` field can only be used with specified models, + * otherwise an error is thrown. The `model` field in [`RecognitionConfig`][] + * must be set to: + * * `command_and_search` + * * `phone_call` AND additional field `useEnhanced`=`true` + * * The `model` field is left undefined. In this case the API auto-selects + * a model based on any other parameters that you set in + * `RecognitionConfig`. * * * bool single_utterance = 2; @@ -878,6 +902,14 @@ public Builder setSingleUtterance(boolean value) { * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no * more than one `StreamingRecognitionResult` with the `is_final` flag set to * `true`. + * The `single_utterance` field can only be used with specified models, + * otherwise an error is thrown. The `model` field in [`RecognitionConfig`][] + * must be set to: + * * `command_and_search` + * * `phone_call` AND additional field `useEnhanced`=`true` + * * The `model` field is left undefined. In this case the API auto-selects + * a model based on any other parameters that you set in + * `RecognitionConfig`. * * * bool single_utterance = 2; diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfigOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfigOrBuilder.java index 157a5dccc..40aa63db7 100644 --- a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfigOrBuilder.java +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfigOrBuilder.java @@ -81,6 +81,14 @@ public interface StreamingRecognitionConfigOrBuilder * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no * more than one `StreamingRecognitionResult` with the `is_final` flag set to * `true`. + * The `single_utterance` field can only be used with specified models, + * otherwise an error is thrown. The `model` field in [`RecognitionConfig`][] + * must be set to: + * * `command_and_search` + * * `phone_call` AND additional field `useEnhanced`=`true` + * * The `model` field is left undefined. In this case the API auto-selects + * a model based on any other parameters that you set in + * `RecognitionConfig`. * * * bool single_utterance = 2; diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdateCustomClassRequest.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdateCustomClassRequest.java new file mode 100644 index 000000000..2a17b16ab --- /dev/null +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdateCustomClassRequest.java @@ -0,0 +1,1067 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + * + * + *
+ * Message sent by the client for the `UpdateCustomClass` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.UpdateCustomClassRequest} + */ +public final class UpdateCustomClassRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) + UpdateCustomClassRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateCustomClassRequest.newBuilder() to construct. + private UpdateCustomClassRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateCustomClassRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateCustomClassRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateCustomClassRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.speech.v1p1beta1.CustomClass.Builder subBuilder = null; + if (customClass_ != null) { + subBuilder = customClass_.toBuilder(); + } + customClass_ = + input.readMessage( + com.google.cloud.speech.v1p1beta1.CustomClass.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(customClass_); + customClass_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.class, + com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.Builder.class); + } + + public static final int CUSTOM_CLASS_FIELD_NUMBER = 1; + private com.google.cloud.speech.v1p1beta1.CustomClass customClass_; + /** + * + * + *
+   * Required. The custom class to update.
+   * The custom class's `name` field is used to identify the custom class to be
+   * updated. Format:
+   * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the customClass field is set. + */ + @java.lang.Override + public boolean hasCustomClass() { + return customClass_ != null; + } + /** + * + * + *
+   * Required. The custom class to update.
+   * The custom class's `name` field is used to identify the custom class to be
+   * updated. Format:
+   * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The customClass. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClass() { + return customClass_ == null + ? com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance() + : customClass_; + } + /** + * + * + *
+   * Required. The custom class to update.
+   * The custom class's `name` field is used to identify the custom class to be
+   * updated. Format:
+   * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassOrBuilder() { + return getCustomClass(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (customClass_ != null) { + output.writeMessage(1, getCustomClass()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (customClass_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCustomClass()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest other = + (com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) obj; + + if (hasCustomClass() != other.hasCustomClass()) return false; + if (hasCustomClass()) { + if (!getCustomClass().equals(other.getCustomClass())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCustomClass()) { + hash = (37 * hash) + CUSTOM_CLASS_FIELD_NUMBER; + hash = (53 * hash) + getCustomClass().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message sent by the client for the `UpdateCustomClass` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.UpdateCustomClassRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) + com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.class, + com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (customClassBuilder_ == null) { + customClass_ = null; + } else { + customClass_ = null; + customClassBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest build() { + com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest buildPartial() { + com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest result = + new com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest(this); + if (customClassBuilder_ == null) { + result.customClass_ = customClass_; + } else { + result.customClass_ = customClassBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest other) { + if (other == com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.getDefaultInstance()) + return this; + if (other.hasCustomClass()) { + mergeCustomClass(other.getCustomClass()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.speech.v1p1beta1.CustomClass customClass_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.CustomClass, + com.google.cloud.speech.v1p1beta1.CustomClass.Builder, + com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder> + customClassBuilder_; + /** + * + * + *
+     * Required. The custom class to update.
+     * The custom class's `name` field is used to identify the custom class to be
+     * updated. Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the customClass field is set. + */ + public boolean hasCustomClass() { + return customClassBuilder_ != null || customClass_ != null; + } + /** + * + * + *
+     * Required. The custom class to update.
+     * The custom class's `name` field is used to identify the custom class to be
+     * updated. Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The customClass. + */ + public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClass() { + if (customClassBuilder_ == null) { + return customClass_ == null + ? com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance() + : customClass_; + } else { + return customClassBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The custom class to update.
+     * The custom class's `name` field is used to identify the custom class to be
+     * updated. Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCustomClass(com.google.cloud.speech.v1p1beta1.CustomClass value) { + if (customClassBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + customClass_ = value; + onChanged(); + } else { + customClassBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The custom class to update.
+     * The custom class's `name` field is used to identify the custom class to be
+     * updated. Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCustomClass( + com.google.cloud.speech.v1p1beta1.CustomClass.Builder builderForValue) { + if (customClassBuilder_ == null) { + customClass_ = builderForValue.build(); + onChanged(); + } else { + customClassBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The custom class to update.
+     * The custom class's `name` field is used to identify the custom class to be
+     * updated. Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCustomClass(com.google.cloud.speech.v1p1beta1.CustomClass value) { + if (customClassBuilder_ == null) { + if (customClass_ != null) { + customClass_ = + com.google.cloud.speech.v1p1beta1.CustomClass.newBuilder(customClass_) + .mergeFrom(value) + .buildPartial(); + } else { + customClass_ = value; + } + onChanged(); + } else { + customClassBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The custom class to update.
+     * The custom class's `name` field is used to identify the custom class to be
+     * updated. Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCustomClass() { + if (customClassBuilder_ == null) { + customClass_ = null; + onChanged(); + } else { + customClass_ = null; + customClassBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The custom class to update.
+     * The custom class's `name` field is used to identify the custom class to be
+     * updated. Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.speech.v1p1beta1.CustomClass.Builder getCustomClassBuilder() { + + onChanged(); + return getCustomClassFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The custom class to update.
+     * The custom class's `name` field is used to identify the custom class to be
+     * updated. Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassOrBuilder() { + if (customClassBuilder_ != null) { + return customClassBuilder_.getMessageOrBuilder(); + } else { + return customClass_ == null + ? com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance() + : customClass_; + } + } + /** + * + * + *
+     * Required. The custom class to update.
+     * The custom class's `name` field is used to identify the custom class to be
+     * updated. Format:
+     * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.CustomClass, + com.google.cloud.speech.v1p1beta1.CustomClass.Builder, + com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder> + getCustomClassFieldBuilder() { + if (customClassBuilder_ == null) { + customClassBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.CustomClass, + com.google.cloud.speech.v1p1beta1.CustomClass.Builder, + com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder>( + getCustomClass(), getParentForChildren(), isClean()); + customClass_ = null; + } + return customClassBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) + private static final com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest(); + } + + public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateCustomClassRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateCustomClassRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdateCustomClassRequestOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdateCustomClassRequestOrBuilder.java new file mode 100644 index 000000000..c57f6e028 --- /dev/null +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdateCustomClassRequestOrBuilder.java @@ -0,0 +1,110 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface UpdateCustomClassRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The custom class to update.
+   * The custom class's `name` field is used to identify the custom class to be
+   * updated. Format:
+   * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the customClass field is set. + */ + boolean hasCustomClass(); + /** + * + * + *
+   * Required. The custom class to update.
+   * The custom class's `name` field is used to identify the custom class to be
+   * updated. Format:
+   * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The customClass. + */ + com.google.cloud.speech.v1p1beta1.CustomClass getCustomClass(); + /** + * + * + *
+   * Required. The custom class to update.
+   * The custom class's `name` field is used to identify the custom class to be
+   * updated. Format:
+   * {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassOrBuilder(); + + /** + * + * + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdatePhraseSetRequest.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdatePhraseSetRequest.java new file mode 100644 index 000000000..8165d2765 --- /dev/null +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdatePhraseSetRequest.java @@ -0,0 +1,1067 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + * + * + *
+ * Message sent by the client for the `UpdatePhraseSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest} + */ +public final class UpdatePhraseSetRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) + UpdatePhraseSetRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdatePhraseSetRequest.newBuilder() to construct. + private UpdatePhraseSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdatePhraseSetRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdatePhraseSetRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdatePhraseSetRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.speech.v1p1beta1.PhraseSet.Builder subBuilder = null; + if (phraseSet_ != null) { + subBuilder = phraseSet_.toBuilder(); + } + phraseSet_ = + input.readMessage( + com.google.cloud.speech.v1p1beta1.PhraseSet.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(phraseSet_); + phraseSet_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.class, + com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.Builder.class); + } + + public static final int PHRASE_SET_FIELD_NUMBER = 1; + private com.google.cloud.speech.v1p1beta1.PhraseSet phraseSet_; + /** + * + * + *
+   * Required. The phrase set to update.
+   * The phrase set's `name` field is used to identify the set to be
+   * updated. Format:
+   * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the phraseSet field is set. + */ + @java.lang.Override + public boolean hasPhraseSet() { + return phraseSet_ != null; + } + /** + * + * + *
+   * Required. The phrase set to update.
+   * The phrase set's `name` field is used to identify the set to be
+   * updated. Format:
+   * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The phraseSet. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSet() { + return phraseSet_ == null + ? com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance() + : phraseSet_; + } + /** + * + * + *
+   * Required. The phrase set to update.
+   * The phrase set's `name` field is used to identify the set to be
+   * updated. Format:
+   * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetOrBuilder() { + return getPhraseSet(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (phraseSet_ != null) { + output.writeMessage(1, getPhraseSet()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (phraseSet_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPhraseSet()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest other = + (com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) obj; + + if (hasPhraseSet() != other.hasPhraseSet()) return false; + if (hasPhraseSet()) { + if (!getPhraseSet().equals(other.getPhraseSet())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasPhraseSet()) { + hash = (37 * hash) + PHRASE_SET_FIELD_NUMBER; + hash = (53 * hash) + getPhraseSet().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message sent by the client for the `UpdatePhraseSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) + com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.class, + com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (phraseSetBuilder_ == null) { + phraseSet_ = null; + } else { + phraseSet_ = null; + phraseSetBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto + .internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest build() { + com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest buildPartial() { + com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest result = + new com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest(this); + if (phraseSetBuilder_ == null) { + result.phraseSet_ = phraseSet_; + } else { + result.phraseSet_ = phraseSetBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest other) { + if (other == com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.getDefaultInstance()) + return this; + if (other.hasPhraseSet()) { + mergePhraseSet(other.getPhraseSet()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.speech.v1p1beta1.PhraseSet phraseSet_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.PhraseSet, + com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, + com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder> + phraseSetBuilder_; + /** + * + * + *
+     * Required. The phrase set to update.
+     * The phrase set's `name` field is used to identify the set to be
+     * updated. Format:
+     * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the phraseSet field is set. + */ + public boolean hasPhraseSet() { + return phraseSetBuilder_ != null || phraseSet_ != null; + } + /** + * + * + *
+     * Required. The phrase set to update.
+     * The phrase set's `name` field is used to identify the set to be
+     * updated. Format:
+     * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The phraseSet. + */ + public com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSet() { + if (phraseSetBuilder_ == null) { + return phraseSet_ == null + ? com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance() + : phraseSet_; + } else { + return phraseSetBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The phrase set to update.
+     * The phrase set's `name` field is used to identify the set to be
+     * updated. Format:
+     * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPhraseSet(com.google.cloud.speech.v1p1beta1.PhraseSet value) { + if (phraseSetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + phraseSet_ = value; + onChanged(); + } else { + phraseSetBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The phrase set to update.
+     * The phrase set's `name` field is used to identify the set to be
+     * updated. Format:
+     * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPhraseSet( + com.google.cloud.speech.v1p1beta1.PhraseSet.Builder builderForValue) { + if (phraseSetBuilder_ == null) { + phraseSet_ = builderForValue.build(); + onChanged(); + } else { + phraseSetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The phrase set to update.
+     * The phrase set's `name` field is used to identify the set to be
+     * updated. Format:
+     * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergePhraseSet(com.google.cloud.speech.v1p1beta1.PhraseSet value) { + if (phraseSetBuilder_ == null) { + if (phraseSet_ != null) { + phraseSet_ = + com.google.cloud.speech.v1p1beta1.PhraseSet.newBuilder(phraseSet_) + .mergeFrom(value) + .buildPartial(); + } else { + phraseSet_ = value; + } + onChanged(); + } else { + phraseSetBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The phrase set to update.
+     * The phrase set's `name` field is used to identify the set to be
+     * updated. Format:
+     * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPhraseSet() { + if (phraseSetBuilder_ == null) { + phraseSet_ = null; + onChanged(); + } else { + phraseSet_ = null; + phraseSetBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The phrase set to update.
+     * The phrase set's `name` field is used to identify the set to be
+     * updated. Format:
+     * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.speech.v1p1beta1.PhraseSet.Builder getPhraseSetBuilder() { + + onChanged(); + return getPhraseSetFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The phrase set to update.
+     * The phrase set's `name` field is used to identify the set to be
+     * updated. Format:
+     * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetOrBuilder() { + if (phraseSetBuilder_ != null) { + return phraseSetBuilder_.getMessageOrBuilder(); + } else { + return phraseSet_ == null + ? com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance() + : phraseSet_; + } + } + /** + * + * + *
+     * Required. The phrase set to update.
+     * The phrase set's `name` field is used to identify the set to be
+     * updated. Format:
+     * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+     * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.PhraseSet, + com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, + com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder> + getPhraseSetFieldBuilder() { + if (phraseSetBuilder_ == null) { + phraseSetBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.PhraseSet, + com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, + com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder>( + getPhraseSet(), getParentForChildren(), isClean()); + phraseSet_ = null; + } + return phraseSetBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) + private static final com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest(); + } + + public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdatePhraseSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdatePhraseSetRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdatePhraseSetRequestOrBuilder.java b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdatePhraseSetRequestOrBuilder.java new file mode 100644 index 000000000..939c27f2f --- /dev/null +++ b/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdatePhraseSetRequestOrBuilder.java @@ -0,0 +1,110 @@ +/* + * Copyright 2020 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 + * + * https://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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface UpdatePhraseSetRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The phrase set to update.
+   * The phrase set's `name` field is used to identify the set to be
+   * updated. Format:
+   * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the phraseSet field is set. + */ + boolean hasPhraseSet(); + /** + * + * + *
+   * Required. The phrase set to update.
+   * The phrase set's `name` field is used to identify the set to be
+   * updated. Format:
+   * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The phraseSet. + */ + com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSet(); + /** + * + * + *
+   * Required. The phrase set to update.
+   * The phrase set's `name` field is used to identify the set to be
+   * updated. Format:
+   * {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
+   * 
+ * + * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetOrBuilder(); + + /** + * + * + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech.proto b/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech.proto index 7bb12866b..3eccfb661 100644 --- a/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech.proto +++ b/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -139,6 +139,16 @@ message StreamingRecognitionConfig { // `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no // more than one `StreamingRecognitionResult` with the `is_final` flag set to // `true`. + // + // The `single_utterance` field can only be used with specified models, + // otherwise an error is thrown. The `model` field in [`RecognitionConfig`][] + // must be set to: + // + // * `command_and_search` + // * `phone_call` AND additional field `useEnhanced`=`true` + // * The `model` field is left undefined. In this case the API auto-selects + // a model based on any other parameters that you set in + // `RecognitionConfig`. bool single_utterance = 2; // If `true`, interim results (tentative hypotheses) may be @@ -218,7 +228,8 @@ message RecognitionConfig { // wideband is supported. `sample_rate_hertz` must be 16000. SPEEX_WITH_HEADER_BYTE = 7; - // MP3 audio. Support all standard MP3 bitrates (which range from 32-320 + // MP3 audio. MP3 encoding is a Beta feature and only available in + // v1p1beta1. Support all standard MP3 bitrates (which range from 32-320 // kbps). When using this encoding, `sample_rate_hertz` has to match the // sample rate of the file being used. MP3 = 8; @@ -635,8 +646,8 @@ message LongRunningRecognizeMetadata { // Time of the most recent processing update. google.protobuf.Timestamp last_update_time = 3; - // The URI of the audio file being transcribed. Empty if the audio was sent - // as byte content. + // Output only. The URI of the audio file being transcribed. Empty if the + // audio was sent as byte content. string uri = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; } diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto b/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto new file mode 100644 index 000000000..4e4377c9c --- /dev/null +++ b/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto @@ -0,0 +1,318 @@ +// Copyright 2021 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. + +syntax = "proto3"; + +package google.cloud.speech.v1p1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/speech/v1p1beta1/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/cloud/speech/v1p1beta1;speech"; +option java_multiple_files = true; +option java_outer_classname = "SpeechAdaptationProto"; +option java_package = "com.google.cloud.speech.v1p1beta1"; +option objc_class_prefix = "GCS"; + +// Service that implements Google Cloud Speech Adaptation API. +service Adaptation { + option (google.api.default_host) = "speech.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Create a set of phrase hints. Each item in the set can be a single word or + // a multi-word phrase. The items in the PhraseSet are favored by the + // recognition model when you send a call that includes the PhraseSet. + rpc CreatePhraseSet(CreatePhraseSetRequest) returns (PhraseSet) { + option (google.api.http) = { + post: "/v1p1beta1/{parent=projects/*/locations/*}/phraseSets" + body: "*" + }; + option (google.api.method_signature) = "parent,phrase_set,phrase_set_id"; + } + + // Get a phrase set. + rpc GetPhraseSet(GetPhraseSetRequest) returns (PhraseSet) { + option (google.api.http) = { + get: "/v1p1beta1/{name=projects/*/locations/*/phraseSets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List phrase sets. + rpc ListPhraseSet(ListPhraseSetRequest) returns (ListPhraseSetResponse) { + option (google.api.http) = { + get: "/v1p1beta1/{parent=projects/*/locations/*}/phraseSets" + }; + option (google.api.method_signature) = "parent"; + } + + // Update a phrase set. + rpc UpdatePhraseSet(UpdatePhraseSetRequest) returns (PhraseSet) { + option (google.api.http) = { + patch: "/v1p1beta1/{phrase_set.name=projects/*/locations/*/phraseSets/*}" + body: "phrase_set" + }; + } + + // Delete a phrase set. + rpc DeletePhraseSet(DeletePhraseSetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1p1beta1/{name=projects/*/locations/*/phraseSets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Create a custom class. + rpc CreateCustomClass(CreateCustomClassRequest) returns (CustomClass) { + option (google.api.http) = { + post: "/v1p1beta1/{parent=projects/*/locations/*}/customClasses" + body: "*" + }; + option (google.api.method_signature) = "parent,custom_class,custom_class_id"; + } + + // Get a custom class. + rpc GetCustomClass(GetCustomClassRequest) returns (CustomClass) { + option (google.api.http) = { + get: "/v1p1beta1/{name=projects/*/locations/*/customClasses/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List custom classes. + rpc ListCustomClasses(ListCustomClassesRequest) returns (ListCustomClassesResponse) { + option (google.api.http) = { + get: "/v1p1beta1/{parent=projects/*/locations/*}/customClasses" + }; + option (google.api.method_signature) = "parent"; + } + + // Update a custom class. + rpc UpdateCustomClass(UpdateCustomClassRequest) returns (CustomClass) { + option (google.api.http) = { + patch: "/v1p1beta1/{custom_class.name=projects/*/locations/*/customClasses/*}" + body: "custom_class" + }; + } + + // Delete a custom class. + rpc DeleteCustomClass(DeleteCustomClassRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1p1beta1/{name=projects/*/locations/*/customClasses/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Message sent by the client for the `CreatePhraseSet` method. +message CreatePhraseSetRequest { + // Required. The parent resource where this phrase set will be created. + // Format: + // {api_version}/projects/{project}/locations/{location}/phraseSets + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/PhraseSet" + } + ]; + + // The ID to use for the phrase set, which will become the final + // component of the phrase set's resource name. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-/. + string phrase_set_id = 2; + + // Required. The phrase set to create. + PhraseSet phrase_set = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Message sent by the client for the `UpdatePhraseSet` method. +message UpdatePhraseSetRequest { + // Required. The phrase set to update. + // + // The phrase set's `name` field is used to identify the set to be + // updated. Format: + // {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set} + PhraseSet phrase_set = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Message sent by the client for the `GetPhraseSet` method. +message GetPhraseSetRequest { + // Required. The name of the phrase set to retrieve. + // Format: + // {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + } + ]; +} + +// Message sent by the client for the `ListPhraseSet` method. +message ListPhraseSetRequest { + // Required. The parent, which owns this collection of phrase set. + // Format: + // projects/{project}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/PhraseSet" + } + ]; + + // The maximum number of phrase sets to return. The service may return + // fewer than this value. If unspecified, at most 50 phrase sets will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListPhraseSet` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListPhraseSet` must + // match the call that provided the page token. + string page_token = 3; +} + +// Message returned to the client by the `ListPhraseSet` method. +message ListPhraseSetResponse { + // The phrase set. + repeated PhraseSet phrase_sets = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Message sent by the client for the `DeletePhraseSet` method. +message DeletePhraseSetRequest { + // Required. The name of the phrase set to delete. + // Format: + // {api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + } + ]; +} + +// Message sent by the client for the `CreateCustomClass` method. +message CreateCustomClassRequest { + // Required. The parent resource where this custom class will be created. + // Format: + // {api_version}/projects/{project}/locations/{location}/customClasses + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/CustomClass" + } + ]; + + // The ID to use for the custom class, which will become the final + // component of the custom class' resource name. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-/. + string custom_class_id = 2; + + // Required. The custom class to create. + CustomClass custom_class = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Message sent by the client for the `UpdateCustomClass` method. +message UpdateCustomClassRequest { + // Required. The custom class to update. + // + // The custom class's `name` field is used to identify the custom class to be + // updated. Format: + // {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class} + CustomClass custom_class = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Message sent by the client for the `GetCustomClass` method. +message GetCustomClassRequest { + // Required. The name of the custom class to retrieve. + // Format: + // {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/CustomClass" + } + ]; +} + +// Message sent by the client for the `ListCustomClasses` method. +message ListCustomClassesRequest { + // Required. The parent, which owns this collection of custom classes. + // Format: + // {api_version}/projects/{project}/locations/{location}/customClasses + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/CustomClass" + } + ]; + + // The maximum number of custom classes to return. The service may return + // fewer than this value. If unspecified, at most 50 custom classes will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListCustomClass` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListCustomClass` must + // match the call that provided the page token. + string page_token = 3; +} + +// Message returned to the client by the `ListCustomClasses` method. +message ListCustomClassesResponse { + // The custom classes. + repeated CustomClass custom_classes = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Message sent by the client for the `DeleteCustomClass` method. +message DeleteCustomClassRequest { + // Required. The name of the custom class to delete. + // Format: + // {api_version}/projects/{project}/locations/{location}/customClasses/{custom_class} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/CustomClass" + } + ]; +} diff --git a/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/resource.proto b/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/resource.proto index 5bb379ff1..74cee0647 100644 --- a/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/resource.proto +++ b/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/resource.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,8 +16,8 @@ syntax = "proto3"; package google.cloud.speech.v1p1beta1; -import "google/api/annotations.proto"; import "google/api/resource.proto"; +import "google/api/annotations.proto"; option cc_enable_arenas = true; option go_package = "google.golang.org/genproto/googleapis/cloud/speech/v1p1beta1;speech"; @@ -45,7 +45,7 @@ message CustomClass { string name = 1; // If this custom class is a resource, the custom_class_id is the resource id - // of the CustomClass. + // of the CustomClass. Case sensitive. string custom_class_id = 2; // A collection of class items. @@ -121,9 +121,12 @@ message SpeechAdaptation { // phrase set can use any custom class. repeated PhraseSet phrase_sets = 1; + // A collection of phrase set resource names to use. + repeated string phrase_set_references = 2; + // A collection of custom classes. To specify the classes inline, leave the // class' `name` blank and fill in the rest of its fields, giving it a unique // `custom_class_id`. Refer to the inline defined class in phrase hints by its // `custom_class_id`. - repeated CustomClass custom_classes = 2; + repeated CustomClass custom_classes = 3; } diff --git a/synth.metadata b/synth.metadata index 9d3fea214..aae8c5829 100644 --- a/synth.metadata +++ b/synth.metadata @@ -11,16 +11,16 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e8bc4471a88ac5f60defe3ed436f517174e59ba0", - "internalRef": "357800868" + "sha": "56c65edc8b946c95fa7ea0e4458412d3a8219c83", + "internalRef": "358182033" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e8bc4471a88ac5f60defe3ed436f517174e59ba0", - "internalRef": "357800868" + "sha": "56c65edc8b946c95fa7ea0e4458412d3a8219c83", + "internalRef": "358182033" } }, { @@ -125,9 +125,15 @@ "google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcSpeechStub.java", "google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/SpeechStub.java", "google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/SpeechStubSettings.java", + "google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationClient.java", + "google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationSettings.java", "google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechClient.java", "google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechSettings.java", "google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/package-info.java", + "google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/AdaptationStub.java", + "google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/AdaptationStubSettings.java", + "google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcAdaptationCallableFactory.java", + "google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcAdaptationStub.java", "google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcSpeechCallableFactory.java", "google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcSpeechStub.java", "google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/SpeechStub.java", @@ -135,10 +141,14 @@ "google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeech.java", "google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeechImpl.java", "google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientTest.java", + "google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/AdaptationClientTest.java", + "google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptation.java", + "google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptationImpl.java", "google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeech.java", "google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeechImpl.java", "google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientTest.java", "grpc-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechGrpc.java", + "grpc-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationGrpc.java", "grpc-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechGrpc.java", "java.header", "license-checks.xml", @@ -178,9 +188,30 @@ "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfo.java", "proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfoOrBuilder.java", "proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech.proto", + "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreateCustomClassRequest.java", + "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreateCustomClassRequestOrBuilder.java", + "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreatePhraseSetRequest.java", + "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreatePhraseSetRequestOrBuilder.java", "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClass.java", "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassName.java", "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassOrBuilder.java", + "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeleteCustomClassRequest.java", + "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeleteCustomClassRequestOrBuilder.java", + "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeletePhraseSetRequest.java", + "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeletePhraseSetRequestOrBuilder.java", + "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetCustomClassRequest.java", + "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetCustomClassRequestOrBuilder.java", + "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetPhraseSetRequest.java", + "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetPhraseSetRequestOrBuilder.java", + "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesRequest.java", + "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesRequestOrBuilder.java", + "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesResponse.java", + "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesResponseOrBuilder.java", + "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetRequest.java", + "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetRequestOrBuilder.java", + "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetResponse.java", + "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetResponseOrBuilder.java", + "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LocationName.java", "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadata.java", "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadataOrBuilder.java", "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeRequest.java", @@ -204,6 +235,7 @@ "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfigOrBuilder.java", "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptation.java", "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationOrBuilder.java", + "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationProto.java", "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechContext.java", "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechContextOrBuilder.java", "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechProto.java", @@ -220,9 +252,14 @@ "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeRequestOrBuilder.java", "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponse.java", "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponseOrBuilder.java", + "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdateCustomClassRequest.java", + "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdateCustomClassRequestOrBuilder.java", + "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdatePhraseSetRequest.java", + "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdatePhraseSetRequestOrBuilder.java", "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/WordInfo.java", "proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/WordInfoOrBuilder.java", "proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech.proto", + "proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto", "proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/resource.proto", "renovate.json", "samples/install-without-bom/pom.xml",