diff --git a/grpc-google-cloud-translate-v3/src/main/java/com/google/cloud/location/LocationsGrpc.java b/grpc-google-cloud-translate-v3/src/main/java/com/google/cloud/location/LocationsGrpc.java deleted file mode 100644 index 16f28b5c..00000000 --- a/grpc-google-cloud-translate-v3/src/main/java/com/google/cloud/location/LocationsGrpc.java +++ /dev/null @@ -1,476 +0,0 @@ -/* - * 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.location; - -import static io.grpc.MethodDescriptor.generateFullMethodName; - -/** - * - * - *
- * An abstract interface that provides location-related information for - * a service. Service-specific metadata is provided through the - * [Location.metadata][google.cloud.location.Location.metadata] field. - *- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: google/cloud/location/locations.proto") -public final class LocationsGrpc { - - private LocationsGrpc() {} - - public static final String SERVICE_NAME = "google.cloud.location.Locations"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.location.ListLocationsRequest, - com.google.cloud.location.ListLocationsResponse> - getListLocationsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ListLocations", - requestType = com.google.cloud.location.ListLocationsRequest.class, - responseType = com.google.cloud.location.ListLocationsResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.location.ListLocationsRequest, - com.google.cloud.location.ListLocationsResponse> - getListLocationsMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.location.ListLocationsRequest, - com.google.cloud.location.ListLocationsResponse> - getListLocationsMethod; - if ((getListLocationsMethod = LocationsGrpc.getListLocationsMethod) == null) { - synchronized (LocationsGrpc.class) { - if ((getListLocationsMethod = LocationsGrpc.getListLocationsMethod) == null) { - LocationsGrpc.getListLocationsMethod = - getListLocationsMethod = - io.grpc.MethodDescriptor - .
- * An abstract interface that provides location-related information for - * a service. Service-specific metadata is provided through the - * [Location.metadata][google.cloud.location.Location.metadata] field. - *- */ - public abstract static class LocationsImplBase implements io.grpc.BindableService { - - /** - * - * - *
- * Lists information about the supported locations for this service. - *- */ - public void listLocations( - com.google.cloud.location.ListLocationsRequest request, - io.grpc.stub.StreamObserver
- * Gets information about a location. - *- */ - public void getLocation( - com.google.cloud.location.GetLocationRequest request, - io.grpc.stub.StreamObserver
- * An abstract interface that provides location-related information for - * a service. Service-specific metadata is provided through the - * [Location.metadata][google.cloud.location.Location.metadata] field. - *- */ - public static final class LocationsStub extends io.grpc.stub.AbstractAsyncStub
- * Lists information about the supported locations for this service. - *- */ - public void listLocations( - com.google.cloud.location.ListLocationsRequest request, - io.grpc.stub.StreamObserver
- * Gets information about a location. - *- */ - public void getLocation( - com.google.cloud.location.GetLocationRequest request, - io.grpc.stub.StreamObserver
- * An abstract interface that provides location-related information for - * a service. Service-specific metadata is provided through the - * [Location.metadata][google.cloud.location.Location.metadata] field. - *- */ - public static final class LocationsBlockingStub - extends io.grpc.stub.AbstractBlockingStub
- * Lists information about the supported locations for this service. - *- */ - public com.google.cloud.location.ListLocationsResponse listLocations( - com.google.cloud.location.ListLocationsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListLocationsMethod(), getCallOptions(), request); - } - - /** - * - * - *
- * Gets information about a location. - *- */ - public com.google.cloud.location.Location getLocation( - com.google.cloud.location.GetLocationRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetLocationMethod(), getCallOptions(), request); - } - } - - /** - * - * - *
- * An abstract interface that provides location-related information for - * a service. Service-specific metadata is provided through the - * [Location.metadata][google.cloud.location.Location.metadata] field. - *- */ - public static final class LocationsFutureStub - extends io.grpc.stub.AbstractFutureStub
- * Lists information about the supported locations for this service. - *- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.location.ListLocationsResponse> - listLocations(com.google.cloud.location.ListLocationsRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListLocationsMethod(), getCallOptions()), request); - } - - /** - * - * - *
- * Gets information about a location. - *- */ - public com.google.common.util.concurrent.ListenableFuture
- * Provides natural language translation operations. - *- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: google/cloud/translate/v3/translation_service.proto") -public final class TranslationServiceGrpc { - - private TranslationServiceGrpc() {} - - public static final String SERVICE_NAME = "google.cloud.translation.v3.TranslationService"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.translate.v3.TranslateTextRequest, - com.google.cloud.translate.v3.TranslateTextResponse> - getTranslateTextMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "TranslateText", - requestType = com.google.cloud.translate.v3.TranslateTextRequest.class, - responseType = com.google.cloud.translate.v3.TranslateTextResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.translate.v3.TranslateTextRequest, - com.google.cloud.translate.v3.TranslateTextResponse> - getTranslateTextMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.translate.v3.TranslateTextRequest, - com.google.cloud.translate.v3.TranslateTextResponse> - getTranslateTextMethod; - if ((getTranslateTextMethod = TranslationServiceGrpc.getTranslateTextMethod) == null) { - synchronized (TranslationServiceGrpc.class) { - if ((getTranslateTextMethod = TranslationServiceGrpc.getTranslateTextMethod) == null) { - TranslationServiceGrpc.getTranslateTextMethod = - getTranslateTextMethod = - io.grpc.MethodDescriptor - .
- * Provides natural language translation operations. - *- */ - public abstract static class TranslationServiceImplBase implements io.grpc.BindableService { - - /** - * - * - *
- * Translates input text and returns translated text. - *- */ - public void translateText( - com.google.cloud.translate.v3.TranslateTextRequest request, - io.grpc.stub.StreamObserver
- * Detects the language of text within a request. - *- */ - public void detectLanguage( - com.google.cloud.translate.v3.DetectLanguageRequest request, - io.grpc.stub.StreamObserver
- * Returns a list of supported languages for translation. - *- */ - public void getSupportedLanguages( - com.google.cloud.translate.v3.GetSupportedLanguagesRequest request, - io.grpc.stub.StreamObserver
- * Translates documents in synchronous mode. - *- */ - public void translateDocument( - com.google.cloud.translate.v3.TranslateDocumentRequest request, - io.grpc.stub.StreamObserver
- * Translates a large volume of text in asynchronous batch mode. - * This function provides real-time output as the inputs are being processed. - * If caller cancels a request, the partial results (for an input file, it's - * all or nothing) may still be available on the specified output location. - * This call returns immediately and you can - * use google.longrunning.Operation.name to poll the status of the call. - *- */ - public void batchTranslateText( - com.google.cloud.translate.v3.BatchTranslateTextRequest request, - io.grpc.stub.StreamObserver
- * Translates a large volume of document in asynchronous batch mode. - * This function provides real-time output as the inputs are being processed. - * If caller cancels a request, the partial results (for an input file, it's - * all or nothing) may still be available on the specified output location. - * This call returns immediately and you can use - * google.longrunning.Operation.name to poll the status of the call. - *- */ - public void batchTranslateDocument( - com.google.cloud.translate.v3.BatchTranslateDocumentRequest request, - io.grpc.stub.StreamObserver
- * Creates a glossary and returns the long-running operation. Returns - * NOT_FOUND, if the project doesn't exist. - *- */ - public void createGlossary( - com.google.cloud.translate.v3.CreateGlossaryRequest request, - io.grpc.stub.StreamObserver
- * Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't - * exist. - *- */ - public void listGlossaries( - com.google.cloud.translate.v3.ListGlossariesRequest request, - io.grpc.stub.StreamObserver
- * Gets a glossary. Returns NOT_FOUND, if the glossary doesn't - * exist. - *- */ - public void getGlossary( - com.google.cloud.translate.v3.GetGlossaryRequest request, - io.grpc.stub.StreamObserver
- * Deletes a glossary, or cancels glossary construction - * if the glossary isn't created yet. - * Returns NOT_FOUND, if the glossary doesn't exist. - *- */ - public void deleteGlossary( - com.google.cloud.translate.v3.DeleteGlossaryRequest request, - io.grpc.stub.StreamObserver
- * Provides natural language translation operations. - *- */ - public static final class TranslationServiceStub - extends io.grpc.stub.AbstractAsyncStub
- * Translates input text and returns translated text. - *- */ - public void translateText( - com.google.cloud.translate.v3.TranslateTextRequest request, - io.grpc.stub.StreamObserver
- * Detects the language of text within a request. - *- */ - public void detectLanguage( - com.google.cloud.translate.v3.DetectLanguageRequest request, - io.grpc.stub.StreamObserver
- * Returns a list of supported languages for translation. - *- */ - public void getSupportedLanguages( - com.google.cloud.translate.v3.GetSupportedLanguagesRequest request, - io.grpc.stub.StreamObserver
- * Translates documents in synchronous mode. - *- */ - public void translateDocument( - com.google.cloud.translate.v3.TranslateDocumentRequest request, - io.grpc.stub.StreamObserver
- * Translates a large volume of text in asynchronous batch mode. - * This function provides real-time output as the inputs are being processed. - * If caller cancels a request, the partial results (for an input file, it's - * all or nothing) may still be available on the specified output location. - * This call returns immediately and you can - * use google.longrunning.Operation.name to poll the status of the call. - *- */ - public void batchTranslateText( - com.google.cloud.translate.v3.BatchTranslateTextRequest request, - io.grpc.stub.StreamObserver
- * Translates a large volume of document in asynchronous batch mode. - * This function provides real-time output as the inputs are being processed. - * If caller cancels a request, the partial results (for an input file, it's - * all or nothing) may still be available on the specified output location. - * This call returns immediately and you can use - * google.longrunning.Operation.name to poll the status of the call. - *- */ - public void batchTranslateDocument( - com.google.cloud.translate.v3.BatchTranslateDocumentRequest request, - io.grpc.stub.StreamObserver
- * Creates a glossary and returns the long-running operation. Returns - * NOT_FOUND, if the project doesn't exist. - *- */ - public void createGlossary( - com.google.cloud.translate.v3.CreateGlossaryRequest request, - io.grpc.stub.StreamObserver
- * Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't - * exist. - *- */ - public void listGlossaries( - com.google.cloud.translate.v3.ListGlossariesRequest request, - io.grpc.stub.StreamObserver
- * Gets a glossary. Returns NOT_FOUND, if the glossary doesn't - * exist. - *- */ - public void getGlossary( - com.google.cloud.translate.v3.GetGlossaryRequest request, - io.grpc.stub.StreamObserver
- * Deletes a glossary, or cancels glossary construction - * if the glossary isn't created yet. - * Returns NOT_FOUND, if the glossary doesn't exist. - *- */ - public void deleteGlossary( - com.google.cloud.translate.v3.DeleteGlossaryRequest request, - io.grpc.stub.StreamObserver
- * Provides natural language translation operations. - *- */ - public static final class TranslationServiceBlockingStub - extends io.grpc.stub.AbstractBlockingStub
- * Translates input text and returns translated text. - *- */ - public com.google.cloud.translate.v3.TranslateTextResponse translateText( - com.google.cloud.translate.v3.TranslateTextRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getTranslateTextMethod(), getCallOptions(), request); - } - - /** - * - * - *
- * Detects the language of text within a request. - *- */ - public com.google.cloud.translate.v3.DetectLanguageResponse detectLanguage( - com.google.cloud.translate.v3.DetectLanguageRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDetectLanguageMethod(), getCallOptions(), request); - } - - /** - * - * - *
- * Returns a list of supported languages for translation. - *- */ - public com.google.cloud.translate.v3.SupportedLanguages getSupportedLanguages( - com.google.cloud.translate.v3.GetSupportedLanguagesRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetSupportedLanguagesMethod(), getCallOptions(), request); - } - - /** - * - * - *
- * Translates documents in synchronous mode. - *- */ - public com.google.cloud.translate.v3.TranslateDocumentResponse translateDocument( - com.google.cloud.translate.v3.TranslateDocumentRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getTranslateDocumentMethod(), getCallOptions(), request); - } - - /** - * - * - *
- * Translates a large volume of text in asynchronous batch mode. - * This function provides real-time output as the inputs are being processed. - * If caller cancels a request, the partial results (for an input file, it's - * all or nothing) may still be available on the specified output location. - * This call returns immediately and you can - * use google.longrunning.Operation.name to poll the status of the call. - *- */ - public com.google.longrunning.Operation batchTranslateText( - com.google.cloud.translate.v3.BatchTranslateTextRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getBatchTranslateTextMethod(), getCallOptions(), request); - } - - /** - * - * - *
- * Translates a large volume of document in asynchronous batch mode. - * This function provides real-time output as the inputs are being processed. - * If caller cancels a request, the partial results (for an input file, it's - * all or nothing) may still be available on the specified output location. - * This call returns immediately and you can use - * google.longrunning.Operation.name to poll the status of the call. - *- */ - public com.google.longrunning.Operation batchTranslateDocument( - com.google.cloud.translate.v3.BatchTranslateDocumentRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getBatchTranslateDocumentMethod(), getCallOptions(), request); - } - - /** - * - * - *
- * Creates a glossary and returns the long-running operation. Returns - * NOT_FOUND, if the project doesn't exist. - *- */ - public com.google.longrunning.Operation createGlossary( - com.google.cloud.translate.v3.CreateGlossaryRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getCreateGlossaryMethod(), getCallOptions(), request); - } - - /** - * - * - *
- * Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't - * exist. - *- */ - public com.google.cloud.translate.v3.ListGlossariesResponse listGlossaries( - com.google.cloud.translate.v3.ListGlossariesRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListGlossariesMethod(), getCallOptions(), request); - } - - /** - * - * - *
- * Gets a glossary. Returns NOT_FOUND, if the glossary doesn't - * exist. - *- */ - public com.google.cloud.translate.v3.Glossary getGlossary( - com.google.cloud.translate.v3.GetGlossaryRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetGlossaryMethod(), getCallOptions(), request); - } - - /** - * - * - *
- * Deletes a glossary, or cancels glossary construction - * if the glossary isn't created yet. - * Returns NOT_FOUND, if the glossary doesn't exist. - *- */ - public com.google.longrunning.Operation deleteGlossary( - com.google.cloud.translate.v3.DeleteGlossaryRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDeleteGlossaryMethod(), getCallOptions(), request); - } - } - - /** - * - * - *
- * Provides natural language translation operations. - *- */ - public static final class TranslationServiceFutureStub - extends io.grpc.stub.AbstractFutureStub
- * Translates input text and returns translated text. - *- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.translate.v3.TranslateTextResponse> - translateText(com.google.cloud.translate.v3.TranslateTextRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getTranslateTextMethod(), getCallOptions()), request); - } - - /** - * - * - *
- * Detects the language of text within a request. - *- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.translate.v3.DetectLanguageResponse> - detectLanguage(com.google.cloud.translate.v3.DetectLanguageRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDetectLanguageMethod(), getCallOptions()), request); - } - - /** - * - * - *
- * Returns a list of supported languages for translation. - *- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.translate.v3.SupportedLanguages> - getSupportedLanguages(com.google.cloud.translate.v3.GetSupportedLanguagesRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetSupportedLanguagesMethod(), getCallOptions()), request); - } - - /** - * - * - *
- * Translates documents in synchronous mode. - *- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.translate.v3.TranslateDocumentResponse> - translateDocument(com.google.cloud.translate.v3.TranslateDocumentRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getTranslateDocumentMethod(), getCallOptions()), request); - } - - /** - * - * - *
- * Translates a large volume of text in asynchronous batch mode. - * This function provides real-time output as the inputs are being processed. - * If caller cancels a request, the partial results (for an input file, it's - * all or nothing) may still be available on the specified output location. - * This call returns immediately and you can - * use google.longrunning.Operation.name to poll the status of the call. - *- */ - public com.google.common.util.concurrent.ListenableFuture
- * Translates a large volume of document in asynchronous batch mode. - * This function provides real-time output as the inputs are being processed. - * If caller cancels a request, the partial results (for an input file, it's - * all or nothing) may still be available on the specified output location. - * This call returns immediately and you can use - * google.longrunning.Operation.name to poll the status of the call. - *- */ - public com.google.common.util.concurrent.ListenableFuture
- * Creates a glossary and returns the long-running operation. Returns - * NOT_FOUND, if the project doesn't exist. - *- */ - public com.google.common.util.concurrent.ListenableFuture
- * Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't - * exist. - *- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.translate.v3.ListGlossariesResponse> - listGlossaries(com.google.cloud.translate.v3.ListGlossariesRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListGlossariesMethod(), getCallOptions()), request); - } - - /** - * - * - *
- * Gets a glossary. Returns NOT_FOUND, if the glossary doesn't - * exist. - *- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.translate.v3.Glossary> - getGlossary(com.google.cloud.translate.v3.GetGlossaryRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetGlossaryMethod(), getCallOptions()), request); - } - - /** - * - * - *
- * Deletes a glossary, or cancels glossary construction - * if the glossary isn't created yet. - * Returns NOT_FOUND, if the glossary doesn't exist. - *- */ - public com.google.common.util.concurrent.ListenableFuture
- * An abstract interface that provides location-related information for - * a service. Service-specific metadata is provided through the - * [Location.metadata][google.cloud.location.Location.metadata] field. - *- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: google/cloud/location/locations.proto") -public final class LocationsGrpc { - - private LocationsGrpc() {} - - public static final String SERVICE_NAME = "google.cloud.location.Locations"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.location.ListLocationsRequest, - com.google.cloud.location.ListLocationsResponse> - getListLocationsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ListLocations", - requestType = com.google.cloud.location.ListLocationsRequest.class, - responseType = com.google.cloud.location.ListLocationsResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.location.ListLocationsRequest, - com.google.cloud.location.ListLocationsResponse> - getListLocationsMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.location.ListLocationsRequest, - com.google.cloud.location.ListLocationsResponse> - getListLocationsMethod; - if ((getListLocationsMethod = LocationsGrpc.getListLocationsMethod) == null) { - synchronized (LocationsGrpc.class) { - if ((getListLocationsMethod = LocationsGrpc.getListLocationsMethod) == null) { - LocationsGrpc.getListLocationsMethod = - getListLocationsMethod = - io.grpc.MethodDescriptor - .
- * An abstract interface that provides location-related information for - * a service. Service-specific metadata is provided through the - * [Location.metadata][google.cloud.location.Location.metadata] field. - *- */ - public abstract static class LocationsImplBase implements io.grpc.BindableService { - - /** - * - * - *
- * Lists information about the supported locations for this service. - *- */ - public void listLocations( - com.google.cloud.location.ListLocationsRequest request, - io.grpc.stub.StreamObserver
- * Gets information about a location. - *- */ - public void getLocation( - com.google.cloud.location.GetLocationRequest request, - io.grpc.stub.StreamObserver
- * An abstract interface that provides location-related information for - * a service. Service-specific metadata is provided through the - * [Location.metadata][google.cloud.location.Location.metadata] field. - *- */ - public static final class LocationsStub extends io.grpc.stub.AbstractAsyncStub
- * Lists information about the supported locations for this service. - *- */ - public void listLocations( - com.google.cloud.location.ListLocationsRequest request, - io.grpc.stub.StreamObserver
- * Gets information about a location. - *- */ - public void getLocation( - com.google.cloud.location.GetLocationRequest request, - io.grpc.stub.StreamObserver
- * An abstract interface that provides location-related information for - * a service. Service-specific metadata is provided through the - * [Location.metadata][google.cloud.location.Location.metadata] field. - *- */ - public static final class LocationsBlockingStub - extends io.grpc.stub.AbstractBlockingStub
- * Lists information about the supported locations for this service. - *- */ - public com.google.cloud.location.ListLocationsResponse listLocations( - com.google.cloud.location.ListLocationsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListLocationsMethod(), getCallOptions(), request); - } - - /** - * - * - *
- * Gets information about a location. - *- */ - public com.google.cloud.location.Location getLocation( - com.google.cloud.location.GetLocationRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetLocationMethod(), getCallOptions(), request); - } - } - - /** - * - * - *
- * An abstract interface that provides location-related information for - * a service. Service-specific metadata is provided through the - * [Location.metadata][google.cloud.location.Location.metadata] field. - *- */ - public static final class LocationsFutureStub - extends io.grpc.stub.AbstractFutureStub
- * Lists information about the supported locations for this service. - *- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.location.ListLocationsResponse> - listLocations(com.google.cloud.location.ListLocationsRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListLocationsMethod(), getCallOptions()), request); - } - - /** - * - * - *
- * Gets information about a location. - *- */ - public com.google.common.util.concurrent.ListenableFuture
- * Provides natural language translation operations. - *- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: google/cloud/translate/v3beta1/translation_service.proto") -public final class TranslationServiceGrpc { - - private TranslationServiceGrpc() {} - - public static final String SERVICE_NAME = "google.cloud.translation.v3beta1.TranslationService"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.translate.v3beta1.TranslateTextRequest, - com.google.cloud.translate.v3beta1.TranslateTextResponse> - getTranslateTextMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "TranslateText", - requestType = com.google.cloud.translate.v3beta1.TranslateTextRequest.class, - responseType = com.google.cloud.translate.v3beta1.TranslateTextResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.translate.v3beta1.TranslateTextRequest, - com.google.cloud.translate.v3beta1.TranslateTextResponse> - getTranslateTextMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.translate.v3beta1.TranslateTextRequest, - com.google.cloud.translate.v3beta1.TranslateTextResponse> - getTranslateTextMethod; - if ((getTranslateTextMethod = TranslationServiceGrpc.getTranslateTextMethod) == null) { - synchronized (TranslationServiceGrpc.class) { - if ((getTranslateTextMethod = TranslationServiceGrpc.getTranslateTextMethod) == null) { - TranslationServiceGrpc.getTranslateTextMethod = - getTranslateTextMethod = - io.grpc.MethodDescriptor - .
- * Provides natural language translation operations. - *- */ - public abstract static class TranslationServiceImplBase implements io.grpc.BindableService { - - /** - * - * - *
- * Translates input text and returns translated text. - *- */ - public void translateText( - com.google.cloud.translate.v3beta1.TranslateTextRequest request, - io.grpc.stub.StreamObserver
- * Detects the language of text within a request. - *- */ - public void detectLanguage( - com.google.cloud.translate.v3beta1.DetectLanguageRequest request, - io.grpc.stub.StreamObserver
- * Returns a list of supported languages for translation. - *- */ - public void getSupportedLanguages( - com.google.cloud.translate.v3beta1.GetSupportedLanguagesRequest request, - io.grpc.stub.StreamObserver
- * Translates documents in synchronous mode. - *- */ - public void translateDocument( - com.google.cloud.translate.v3beta1.TranslateDocumentRequest request, - io.grpc.stub.StreamObserver
- * Translates a large volume of text in asynchronous batch mode. - * This function provides real-time output as the inputs are being processed. - * If caller cancels a request, the partial results (for an input file, it's - * all or nothing) may still be available on the specified output location. - * This call returns immediately and you can - * use google.longrunning.Operation.name to poll the status of the call. - *- */ - public void batchTranslateText( - com.google.cloud.translate.v3beta1.BatchTranslateTextRequest request, - io.grpc.stub.StreamObserver
- * Translates a large volume of documents in asynchronous batch mode. - * This function provides real-time output as the inputs are being processed. - * If caller cancels a request, the partial results (for an input file, it's - * all or nothing) may still be available on the specified output location. - * This call returns immediately and you can use - * google.longrunning.Operation.name to poll the status of the call. - *- */ - public void batchTranslateDocument( - com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest request, - io.grpc.stub.StreamObserver
- * Creates a glossary and returns the long-running operation. Returns - * NOT_FOUND, if the project doesn't exist. - *- */ - public void createGlossary( - com.google.cloud.translate.v3beta1.CreateGlossaryRequest request, - io.grpc.stub.StreamObserver
- * Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't - * exist. - *- */ - public void listGlossaries( - com.google.cloud.translate.v3beta1.ListGlossariesRequest request, - io.grpc.stub.StreamObserver
- * Gets a glossary. Returns NOT_FOUND, if the glossary doesn't - * exist. - *- */ - public void getGlossary( - com.google.cloud.translate.v3beta1.GetGlossaryRequest request, - io.grpc.stub.StreamObserver
- * Deletes a glossary, or cancels glossary construction - * if the glossary isn't created yet. - * Returns NOT_FOUND, if the glossary doesn't exist. - *- */ - public void deleteGlossary( - com.google.cloud.translate.v3beta1.DeleteGlossaryRequest request, - io.grpc.stub.StreamObserver
- * Provides natural language translation operations. - *- */ - public static final class TranslationServiceStub - extends io.grpc.stub.AbstractAsyncStub
- * Translates input text and returns translated text. - *- */ - public void translateText( - com.google.cloud.translate.v3beta1.TranslateTextRequest request, - io.grpc.stub.StreamObserver
- * Detects the language of text within a request. - *- */ - public void detectLanguage( - com.google.cloud.translate.v3beta1.DetectLanguageRequest request, - io.grpc.stub.StreamObserver
- * Returns a list of supported languages for translation. - *- */ - public void getSupportedLanguages( - com.google.cloud.translate.v3beta1.GetSupportedLanguagesRequest request, - io.grpc.stub.StreamObserver
- * Translates documents in synchronous mode. - *- */ - public void translateDocument( - com.google.cloud.translate.v3beta1.TranslateDocumentRequest request, - io.grpc.stub.StreamObserver
- * Translates a large volume of text in asynchronous batch mode. - * This function provides real-time output as the inputs are being processed. - * If caller cancels a request, the partial results (for an input file, it's - * all or nothing) may still be available on the specified output location. - * This call returns immediately and you can - * use google.longrunning.Operation.name to poll the status of the call. - *- */ - public void batchTranslateText( - com.google.cloud.translate.v3beta1.BatchTranslateTextRequest request, - io.grpc.stub.StreamObserver
- * Translates a large volume of documents in asynchronous batch mode. - * This function provides real-time output as the inputs are being processed. - * If caller cancels a request, the partial results (for an input file, it's - * all or nothing) may still be available on the specified output location. - * This call returns immediately and you can use - * google.longrunning.Operation.name to poll the status of the call. - *- */ - public void batchTranslateDocument( - com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest request, - io.grpc.stub.StreamObserver
- * Creates a glossary and returns the long-running operation. Returns - * NOT_FOUND, if the project doesn't exist. - *- */ - public void createGlossary( - com.google.cloud.translate.v3beta1.CreateGlossaryRequest request, - io.grpc.stub.StreamObserver
- * Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't - * exist. - *- */ - public void listGlossaries( - com.google.cloud.translate.v3beta1.ListGlossariesRequest request, - io.grpc.stub.StreamObserver
- * Gets a glossary. Returns NOT_FOUND, if the glossary doesn't - * exist. - *- */ - public void getGlossary( - com.google.cloud.translate.v3beta1.GetGlossaryRequest request, - io.grpc.stub.StreamObserver
- * Deletes a glossary, or cancels glossary construction - * if the glossary isn't created yet. - * Returns NOT_FOUND, if the glossary doesn't exist. - *- */ - public void deleteGlossary( - com.google.cloud.translate.v3beta1.DeleteGlossaryRequest request, - io.grpc.stub.StreamObserver
- * Provides natural language translation operations. - *- */ - public static final class TranslationServiceBlockingStub - extends io.grpc.stub.AbstractBlockingStub
- * Translates input text and returns translated text. - *- */ - public com.google.cloud.translate.v3beta1.TranslateTextResponse translateText( - com.google.cloud.translate.v3beta1.TranslateTextRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getTranslateTextMethod(), getCallOptions(), request); - } - - /** - * - * - *
- * Detects the language of text within a request. - *- */ - public com.google.cloud.translate.v3beta1.DetectLanguageResponse detectLanguage( - com.google.cloud.translate.v3beta1.DetectLanguageRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDetectLanguageMethod(), getCallOptions(), request); - } - - /** - * - * - *
- * Returns a list of supported languages for translation. - *- */ - public com.google.cloud.translate.v3beta1.SupportedLanguages getSupportedLanguages( - com.google.cloud.translate.v3beta1.GetSupportedLanguagesRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetSupportedLanguagesMethod(), getCallOptions(), request); - } - - /** - * - * - *
- * Translates documents in synchronous mode. - *- */ - public com.google.cloud.translate.v3beta1.TranslateDocumentResponse translateDocument( - com.google.cloud.translate.v3beta1.TranslateDocumentRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getTranslateDocumentMethod(), getCallOptions(), request); - } - - /** - * - * - *
- * Translates a large volume of text in asynchronous batch mode. - * This function provides real-time output as the inputs are being processed. - * If caller cancels a request, the partial results (for an input file, it's - * all or nothing) may still be available on the specified output location. - * This call returns immediately and you can - * use google.longrunning.Operation.name to poll the status of the call. - *- */ - public com.google.longrunning.Operation batchTranslateText( - com.google.cloud.translate.v3beta1.BatchTranslateTextRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getBatchTranslateTextMethod(), getCallOptions(), request); - } - - /** - * - * - *
- * Translates a large volume of documents in asynchronous batch mode. - * This function provides real-time output as the inputs are being processed. - * If caller cancels a request, the partial results (for an input file, it's - * all or nothing) may still be available on the specified output location. - * This call returns immediately and you can use - * google.longrunning.Operation.name to poll the status of the call. - *- */ - public com.google.longrunning.Operation batchTranslateDocument( - com.google.cloud.translate.v3beta1.BatchTranslateDocumentRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getBatchTranslateDocumentMethod(), getCallOptions(), request); - } - - /** - * - * - *
- * Creates a glossary and returns the long-running operation. Returns - * NOT_FOUND, if the project doesn't exist. - *- */ - public com.google.longrunning.Operation createGlossary( - com.google.cloud.translate.v3beta1.CreateGlossaryRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getCreateGlossaryMethod(), getCallOptions(), request); - } - - /** - * - * - *
- * Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't - * exist. - *- */ - public com.google.cloud.translate.v3beta1.ListGlossariesResponse listGlossaries( - com.google.cloud.translate.v3beta1.ListGlossariesRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListGlossariesMethod(), getCallOptions(), request); - } - - /** - * - * - *
- * Gets a glossary. Returns NOT_FOUND, if the glossary doesn't - * exist. - *- */ - public com.google.cloud.translate.v3beta1.Glossary getGlossary( - com.google.cloud.translate.v3beta1.GetGlossaryRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetGlossaryMethod(), getCallOptions(), request); - } - - /** - * - * - *
- * Deletes a glossary, or cancels glossary construction - * if the glossary isn't created yet. - * Returns NOT_FOUND, if the glossary doesn't exist. - *- */ - public com.google.longrunning.Operation deleteGlossary( - com.google.cloud.translate.v3beta1.DeleteGlossaryRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDeleteGlossaryMethod(), getCallOptions(), request); - } - } - - /** - * - * - *
- * Provides natural language translation operations. - *- */ - public static final class TranslationServiceFutureStub - extends io.grpc.stub.AbstractFutureStub
- * Translates input text and returns translated text. - *- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.translate.v3beta1.TranslateTextResponse> - translateText(com.google.cloud.translate.v3beta1.TranslateTextRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getTranslateTextMethod(), getCallOptions()), request); - } - - /** - * - * - *
- * Detects the language of text within a request. - *- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.translate.v3beta1.DetectLanguageResponse> - detectLanguage(com.google.cloud.translate.v3beta1.DetectLanguageRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDetectLanguageMethod(), getCallOptions()), request); - } - - /** - * - * - *
- * Returns a list of supported languages for translation. - *- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.translate.v3beta1.SupportedLanguages> - getSupportedLanguages( - com.google.cloud.translate.v3beta1.GetSupportedLanguagesRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetSupportedLanguagesMethod(), getCallOptions()), request); - } - - /** - * - * - *
- * Translates documents in synchronous mode. - *- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.translate.v3beta1.TranslateDocumentResponse> - translateDocument(com.google.cloud.translate.v3beta1.TranslateDocumentRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getTranslateDocumentMethod(), getCallOptions()), request); - } - - /** - * - * - *
- * Translates a large volume of text in asynchronous batch mode. - * This function provides real-time output as the inputs are being processed. - * If caller cancels a request, the partial results (for an input file, it's - * all or nothing) may still be available on the specified output location. - * This call returns immediately and you can - * use google.longrunning.Operation.name to poll the status of the call. - *- */ - public com.google.common.util.concurrent.ListenableFuture
- * Translates a large volume of documents in asynchronous batch mode. - * This function provides real-time output as the inputs are being processed. - * If caller cancels a request, the partial results (for an input file, it's - * all or nothing) may still be available on the specified output location. - * This call returns immediately and you can use - * google.longrunning.Operation.name to poll the status of the call. - *- */ - public com.google.common.util.concurrent.ListenableFuture
- * Creates a glossary and returns the long-running operation. Returns - * NOT_FOUND, if the project doesn't exist. - *- */ - public com.google.common.util.concurrent.ListenableFuture
- * Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't - * exist. - *- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.translate.v3beta1.ListGlossariesResponse> - listGlossaries(com.google.cloud.translate.v3beta1.ListGlossariesRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListGlossariesMethod(), getCallOptions()), request); - } - - /** - * - * - *
- * Gets a glossary. Returns NOT_FOUND, if the glossary doesn't - * exist. - *- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.translate.v3beta1.Glossary> - getGlossary(com.google.cloud.translate.v3beta1.GetGlossaryRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetGlossaryMethod(), getCallOptions()), request); - } - - /** - * - * - *
- * Deletes a glossary, or cancels glossary construction - * if the glossary isn't created yet. - * Returns NOT_FOUND, if the glossary doesn't exist. - *- */ - public com.google.common.util.concurrent.ListenableFuture
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 (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * String targetLanguageCode = "targetLanguageCode-106414698"; + * List+ * + *contents = new ArrayList<>(); + * TranslateTextResponse response = + * translationServiceClient.translateText(parent, targetLanguageCode, contents); + * } + * }
Note: close() needs to be called on the TranslationServiceClient 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: + * + *
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 TranslationServiceSettings to + * create(). For example: + * + *
To customize credentials: + * + *
{@code + * TranslationServiceSettings translationServiceSettings = + * TranslationServiceSettings.newBuilder() + * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + * .build(); + * TranslationServiceClient translationServiceClient = + * TranslationServiceClient.create(translationServiceSettings); + * }+ * + *
To customize the endpoint: + * + *
{@code + * TranslationServiceSettings translationServiceSettings = + * TranslationServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + * TranslationServiceClient translationServiceClient = + * TranslationServiceClient.create(translationServiceSettings); + * }+ * + *
Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class TranslationServiceClient implements BackgroundResource { + private final TranslationServiceSettings settings; + private final TranslationServiceStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of TranslationServiceClient with default settings. */ + public static final TranslationServiceClient create() throws IOException { + return create(TranslationServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of TranslationServiceClient, 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 TranslationServiceClient create(TranslationServiceSettings settings) + throws IOException { + return new TranslationServiceClient(settings); + } + + /** + * Constructs an instance of TranslationServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(TranslationServiceSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final TranslationServiceClient create(TranslationServiceStub stub) { + return new TranslationServiceClient(stub); + } + + /** + * Constructs an instance of TranslationServiceClient, 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 TranslationServiceClient(TranslationServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((TranslationServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected TranslationServiceClient(TranslationServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final TranslationServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public TranslationServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Translates input text and returns translated text. + * + *
Sample code: + * + *
{@code + * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * String targetLanguageCode = "targetLanguageCode-106414698"; + * List+ * + * @param parent Required. Project or location to make a call. Must refer to a caller's project. + *contents = new ArrayList<>(); + * TranslateTextResponse response = + * translationServiceClient.translateText(parent, targetLanguageCode, contents); + * } + * }
Format: `projects/{project-number-or-id}` or + * `projects/{project-number-or-id}/locations/{location-id}`. + *
For global calls, use `projects/{project-number-or-id}/locations/global` or + * `projects/{project-number-or-id}`. + *
Non-global location is required for requests using AutoML models or custom glossaries. + *
Models and glossaries must be within the same region (have same location-id), otherwise
+ * an INVALID_ARGUMENT (400) error is returned.
+ * @param targetLanguageCode Required. The BCP-47 language code to use for translation of the
+ * input text, set to one of the language codes listed in Language Support.
+ * @param contents Required. The content of the input in string format. We recommend the total
+ * content be less than 30k codepoints. The max length of this field is 1024. Use
+ * BatchTranslateText for larger text.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final TranslateTextResponse translateText(
+ LocationName parent, String targetLanguageCode, List Sample code:
+ *
+ * Format: `projects/{project-number-or-id}` or
+ * `projects/{project-number-or-id}/locations/{location-id}`.
+ * For global calls, use `projects/{project-number-or-id}/locations/global` or
+ * `projects/{project-number-or-id}`.
+ * Non-global location is required for requests using AutoML models or custom glossaries.
+ * Models and glossaries must be within the same region (have same location-id), otherwise
+ * an INVALID_ARGUMENT (400) error is returned.
+ * @param targetLanguageCode Required. The BCP-47 language code to use for translation of the
+ * input text, set to one of the language codes listed in Language Support.
+ * @param contents Required. The content of the input in string format. We recommend the total
+ * content be less than 30k codepoints. The max length of this field is 1024. Use
+ * BatchTranslateText for larger text.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final TranslateTextResponse translateText(
+ String parent, String targetLanguageCode, List Sample code:
+ *
+ * Format: `projects/{project-number-or-id}` or
+ * `projects/{project-number-or-id}/locations/{location-id}`.
+ * For global calls, use `projects/{project-number-or-id}/locations/global` or
+ * `projects/{project-number-or-id}`.
+ * Non-global location is required for requests using AutoML models or custom glossaries.
+ * Models and glossaries must be within the same region (have same location-id), otherwise
+ * an INVALID_ARGUMENT (400) error is returned.
+ * @param model Optional. The `model` type requested for this translation.
+ * The format depends on model type:
+ * - AutoML Translation models:
+ * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
+ * - General (built-in) models:
+ * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
+ * For global (non-regionalized) requests, use `location-id` `global`. For example,
+ * `projects/{project-number-or-id}/locations/global/models/general/nmt`.
+ * If not provided, the default Google model (NMT) will be used.
+ * @param mimeType Optional. The format of the source text, for example, "text/html",
+ * "text/plain". If left blank, the MIME type defaults to "text/html".
+ * @param sourceLanguageCode Optional. The BCP-47 language code of the input text if known, for
+ * example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If
+ * the source language isn't specified, the API attempts to identify the source language
+ * automatically and returns the source language within the response.
+ * @param targetLanguageCode Required. The BCP-47 language code to use for translation of the
+ * input text, set to one of the language codes listed in Language Support.
+ * @param contents Required. The content of the input in string format. We recommend the total
+ * content be less than 30k codepoints. The max length of this field is 1024. Use
+ * BatchTranslateText for larger text.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final TranslateTextResponse translateText(
+ LocationName parent,
+ String model,
+ String mimeType,
+ String sourceLanguageCode,
+ String targetLanguageCode,
+ List Sample code:
+ *
+ * Format: `projects/{project-number-or-id}` or
+ * `projects/{project-number-or-id}/locations/{location-id}`.
+ * For global calls, use `projects/{project-number-or-id}/locations/global` or
+ * `projects/{project-number-or-id}`.
+ * Non-global location is required for requests using AutoML models or custom glossaries.
+ * Models and glossaries must be within the same region (have same location-id), otherwise
+ * an INVALID_ARGUMENT (400) error is returned.
+ * @param model Optional. The `model` type requested for this translation.
+ * The format depends on model type:
+ * - AutoML Translation models:
+ * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
+ * - General (built-in) models:
+ * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
+ * For global (non-regionalized) requests, use `location-id` `global`. For example,
+ * `projects/{project-number-or-id}/locations/global/models/general/nmt`.
+ * If not provided, the default Google model (NMT) will be used.
+ * @param mimeType Optional. The format of the source text, for example, "text/html",
+ * "text/plain". If left blank, the MIME type defaults to "text/html".
+ * @param sourceLanguageCode Optional. The BCP-47 language code of the input text if known, for
+ * example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If
+ * the source language isn't specified, the API attempts to identify the source language
+ * automatically and returns the source language within the response.
+ * @param targetLanguageCode Required. The BCP-47 language code to use for translation of the
+ * input text, set to one of the language codes listed in Language Support.
+ * @param contents Required. The content of the input in string format. We recommend the total
+ * content be less than 30k codepoints. The max length of this field is 1024. Use
+ * BatchTranslateText for larger text.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final TranslateTextResponse translateText(
+ String parent,
+ String model,
+ String mimeType,
+ String sourceLanguageCode,
+ String targetLanguageCode,
+ List Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Format: `projects/{project-number-or-id}/locations/{location-id}` or
+ * `projects/{project-number-or-id}`.
+ * For global calls, use `projects/{project-number-or-id}/locations/global` or
+ * `projects/{project-number-or-id}`.
+ * Only models within the same region (has same location-id) can be used. Otherwise an
+ * INVALID_ARGUMENT (400) error is returned.
+ * @param model Optional. The language detection model to be used.
+ * Format:
+ * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}`
+ * Only one language detection model is currently supported:
+ * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`.
+ * If not specified, the default model is used.
+ * @param mimeType Optional. The format of the source text, for example, "text/html",
+ * "text/plain". If left blank, the MIME type defaults to "text/html".
+ * @param content The content of the input stored as a string.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DetectLanguageResponse detectLanguage(
+ LocationName parent, String model, String mimeType, String content) {
+ DetectLanguageRequest request =
+ DetectLanguageRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setModel(model)
+ .setMimeType(mimeType)
+ .setContent(content)
+ .build();
+ return detectLanguage(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Detects the language of text within a request.
+ *
+ * Sample code:
+ *
+ * Format: `projects/{project-number-or-id}/locations/{location-id}` or
+ * `projects/{project-number-or-id}`.
+ * For global calls, use `projects/{project-number-or-id}/locations/global` or
+ * `projects/{project-number-or-id}`.
+ * Only models within the same region (has same location-id) can be used. Otherwise an
+ * INVALID_ARGUMENT (400) error is returned.
+ * @param model Optional. The language detection model to be used.
+ * Format:
+ * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}`
+ * Only one language detection model is currently supported:
+ * `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`.
+ * If not specified, the default model is used.
+ * @param mimeType Optional. The format of the source text, for example, "text/html",
+ * "text/plain". If left blank, the MIME type defaults to "text/html".
+ * @param content The content of the input stored as a string.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DetectLanguageResponse detectLanguage(
+ String parent, String model, String mimeType, String content) {
+ DetectLanguageRequest request =
+ DetectLanguageRequest.newBuilder()
+ .setParent(parent)
+ .setModel(model)
+ .setMimeType(mimeType)
+ .setContent(content)
+ .build();
+ return detectLanguage(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Detects the language of text within a request.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Format: `projects/{project-number-or-id}` or
+ * `projects/{project-number-or-id}/locations/{location-id}`.
+ * For global calls, use `projects/{project-number-or-id}/locations/global` or
+ * `projects/{project-number-or-id}`.
+ * Non-global location is required for AutoML models.
+ * Only models within the same region (have same location-id) can be used, otherwise an
+ * INVALID_ARGUMENT (400) error is returned.
+ * @param model Optional. Get supported languages of this model.
+ * The format depends on model type:
+ * - AutoML Translation models:
+ * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
+ * - General (built-in) models:
+ * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
+ * Returns languages supported by the specified model. If missing, we get supported
+ * languages of Google general NMT model.
+ * @param displayLanguageCode Optional. The language to use to return localized, human readable
+ * names of supported languages. If missing, then display names are not returned in a
+ * response.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final SupportedLanguages getSupportedLanguages(
+ LocationName parent, String model, String displayLanguageCode) {
+ GetSupportedLanguagesRequest request =
+ GetSupportedLanguagesRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setModel(model)
+ .setDisplayLanguageCode(displayLanguageCode)
+ .build();
+ return getSupportedLanguages(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns a list of supported languages for translation.
+ *
+ * Sample code:
+ *
+ * Format: `projects/{project-number-or-id}` or
+ * `projects/{project-number-or-id}/locations/{location-id}`.
+ * For global calls, use `projects/{project-number-or-id}/locations/global` or
+ * `projects/{project-number-or-id}`.
+ * Non-global location is required for AutoML models.
+ * Only models within the same region (have same location-id) can be used, otherwise an
+ * INVALID_ARGUMENT (400) error is returned.
+ * @param model Optional. Get supported languages of this model.
+ * The format depends on model type:
+ * - AutoML Translation models:
+ * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
+ * - General (built-in) models:
+ * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
+ * Returns languages supported by the specified model. If missing, we get supported
+ * languages of Google general NMT model.
+ * @param displayLanguageCode Optional. The language to use to return localized, human readable
+ * names of supported languages. If missing, then display names are not returned in a
+ * response.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final SupportedLanguages getSupportedLanguages(
+ String parent, String model, String displayLanguageCode) {
+ GetSupportedLanguagesRequest request =
+ GetSupportedLanguagesRequest.newBuilder()
+ .setParent(parent)
+ .setModel(model)
+ .setDisplayLanguageCode(displayLanguageCode)
+ .build();
+ return getSupportedLanguages(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns a list of supported languages for translation.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * This call returns immediately and you can use google.longrunning.Operation.name to poll the
+ * status of the call.
+ *
+ * Sample code:
+ *
+ * This call returns immediately and you can use google.longrunning.Operation.name to poll the
+ * status of the call.
+ *
+ * Sample code:
+ *
+ * This call returns immediately and you can use google.longrunning.Operation.name to poll the
+ * status of the call.
+ *
+ * Sample code:
+ *
+ * This call returns immediately and you can use google.longrunning.Operation.name to poll the
+ * status of the call.
+ *
+ * Sample code:
+ *
+ * Format: `projects/{project-number-or-id}/locations/{location-id}`.
+ * The `global` location is not supported for batch translation.
+ * Only AutoML Translation models or glossaries within the same region (have the same
+ * location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.
+ * @param sourceLanguageCode Required. The BCP-47 language code of the input document if known,
+ * for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support
+ * (https://cloud.google.com/translate/docs/languages).
+ * @param targetLanguageCodes Required. The BCP-47 language code to use for translation of the
+ * input document. Specify up to 10 language codes here.
+ * @param inputConfigs Required. Input configurations. The total number of files matched should be
+ * <= 100. The total content size to translate should be <= 100M Unicode codepoints. The
+ * files must use UTF-8 encoding.
+ * @param outputConfig Required. Output configuration. If 2 input configs match to the same file
+ * (that is, same input path), we don't generate output for duplicate inputs.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture This call returns immediately and you can use google.longrunning.Operation.name to poll the
+ * status of the call.
+ *
+ * Sample code:
+ *
+ * Format: `projects/{project-number-or-id}/locations/{location-id}`.
+ * The `global` location is not supported for batch translation.
+ * Only AutoML Translation models or glossaries within the same region (have the same
+ * location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.
+ * @param sourceLanguageCode Required. The BCP-47 language code of the input document if known,
+ * for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support
+ * (https://cloud.google.com/translate/docs/languages).
+ * @param targetLanguageCodes Required. The BCP-47 language code to use for translation of the
+ * input document. Specify up to 10 language codes here.
+ * @param inputConfigs Required. Input configurations. The total number of files matched should be
+ * <= 100. The total content size to translate should be <= 100M Unicode codepoints. The
+ * files must use UTF-8 encoding.
+ * @param outputConfig Required. Output configuration. If 2 input configs match to the same file
+ * (that is, same input path), we don't generate output for duplicate inputs.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture This call returns immediately and you can use google.longrunning.Operation.name to poll the
+ * status of the call.
+ *
+ * Sample code:
+ *
+ * This call returns immediately and you can use google.longrunning.Operation.name to poll the
+ * status of the call.
+ *
+ * Sample code:
+ *
+ * This call returns immediately and you can use google.longrunning.Operation.name to poll the
+ * status of the call.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ * 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 translateText to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction The interfaces provided are listed below, along with usage samples.
+ *
+ * ======================= TranslationServiceClient =======================
+ *
+ * Service Description: Provides natural language translation operations.
+ *
+ * Sample for TranslationServiceClient:
+ *
+ * This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcTranslationServiceCallableFactory implements GrpcStubCallableFactory {
+
+ @Override
+ public {@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * String targetLanguageCode = "targetLanguageCode-106414698";
+ * List
+ *
+ * @param parent Required. Project or location to make a call. Must refer to a caller's project.
+ * {@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * String model = "model104069929";
+ * String mimeType = "mimeType-1392120434";
+ * String sourceLanguageCode = "sourceLanguageCode1645917472";
+ * String targetLanguageCode = "targetLanguageCode-106414698";
+ * List
+ *
+ * @param parent Required. Project or location to make a call. Must refer to a caller's project.
+ * {@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * String model = "model104069929";
+ * String mimeType = "mimeType-1392120434";
+ * String sourceLanguageCode = "sourceLanguageCode1645917472";
+ * String targetLanguageCode = "targetLanguageCode-106414698";
+ * List
+ *
+ * @param parent Required. Project or location to make a call. Must refer to a caller's project.
+ * {@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * TranslateTextRequest request =
+ * TranslateTextRequest.newBuilder()
+ * .addAllContents(new ArrayList
+ *
+ * @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 TranslateTextResponse translateText(TranslateTextRequest request) {
+ return translateTextCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Translates input text and returns translated text.
+ *
+ * {@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * TranslateTextRequest request =
+ * TranslateTextRequest.newBuilder()
+ * .addAllContents(new ArrayList
+ */
+ public final UnaryCallable{@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * String model = "model104069929";
+ * String mimeType = "mimeType-1392120434";
+ * String content = "content951530617";
+ * DetectLanguageResponse response =
+ * translationServiceClient.detectLanguage(parent, model, mimeType, content);
+ * }
+ * }
+ *
+ * @param parent Required. Project or location to make a call. Must refer to a caller's project.
+ * {@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * String model = "model104069929";
+ * String mimeType = "mimeType-1392120434";
+ * String content = "content951530617";
+ * DetectLanguageResponse response =
+ * translationServiceClient.detectLanguage(parent, model, mimeType, content);
+ * }
+ * }
+ *
+ * @param parent Required. Project or location to make a call. Must refer to a caller's project.
+ * {@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * DetectLanguageRequest request =
+ * DetectLanguageRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setModel("model104069929")
+ * .setMimeType("mimeType-1392120434")
+ * .putAllLabels(new HashMap
+ *
+ * @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 DetectLanguageResponse detectLanguage(DetectLanguageRequest request) {
+ return detectLanguageCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Detects the language of text within a request.
+ *
+ * {@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * DetectLanguageRequest request =
+ * DetectLanguageRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setModel("model104069929")
+ * .setMimeType("mimeType-1392120434")
+ * .putAllLabels(new HashMap
+ */
+ public final UnaryCallable{@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * String model = "model104069929";
+ * String displayLanguageCode = "displayLanguageCode-1457478841";
+ * SupportedLanguages response =
+ * translationServiceClient.getSupportedLanguages(parent, model, displayLanguageCode);
+ * }
+ * }
+ *
+ * @param parent Required. Project or location to make a call. Must refer to a caller's project.
+ * {@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * String model = "model104069929";
+ * String displayLanguageCode = "displayLanguageCode-1457478841";
+ * SupportedLanguages response =
+ * translationServiceClient.getSupportedLanguages(parent, model, displayLanguageCode);
+ * }
+ * }
+ *
+ * @param parent Required. Project or location to make a call. Must refer to a caller's project.
+ * {@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * GetSupportedLanguagesRequest request =
+ * GetSupportedLanguagesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setDisplayLanguageCode("displayLanguageCode-1457478841")
+ * .setModel("model104069929")
+ * .build();
+ * SupportedLanguages response = translationServiceClient.getSupportedLanguages(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 SupportedLanguages getSupportedLanguages(GetSupportedLanguagesRequest request) {
+ return getSupportedLanguagesCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns a list of supported languages for translation.
+ *
+ * {@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * GetSupportedLanguagesRequest request =
+ * GetSupportedLanguagesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setDisplayLanguageCode("displayLanguageCode-1457478841")
+ * .setModel("model104069929")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * TranslateDocumentRequest request =
+ * TranslateDocumentRequest.newBuilder()
+ * .setParent("parent-995424086")
+ * .setSourceLanguageCode("sourceLanguageCode1645917472")
+ * .setTargetLanguageCode("targetLanguageCode-106414698")
+ * .setDocumentInputConfig(DocumentInputConfig.newBuilder().build())
+ * .setDocumentOutputConfig(DocumentOutputConfig.newBuilder().build())
+ * .setModel("model104069929")
+ * .setGlossaryConfig(TranslateTextGlossaryConfig.newBuilder().build())
+ * .putAllLabels(new HashMap
+ *
+ * @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 TranslateDocumentResponse translateDocument(TranslateDocumentRequest request) {
+ return translateDocumentCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Translates documents in synchronous mode.
+ *
+ * {@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * TranslateDocumentRequest request =
+ * TranslateDocumentRequest.newBuilder()
+ * .setParent("parent-995424086")
+ * .setSourceLanguageCode("sourceLanguageCode1645917472")
+ * .setTargetLanguageCode("targetLanguageCode-106414698")
+ * .setDocumentInputConfig(DocumentInputConfig.newBuilder().build())
+ * .setDocumentOutputConfig(DocumentOutputConfig.newBuilder().build())
+ * .setModel("model104069929")
+ * .setGlossaryConfig(TranslateTextGlossaryConfig.newBuilder().build())
+ * .putAllLabels(new HashMap
+ */
+ public final UnaryCallable{@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * BatchTranslateTextRequest request =
+ * BatchTranslateTextRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setSourceLanguageCode("sourceLanguageCode1645917472")
+ * .addAllTargetLanguageCodes(new ArrayList
+ *
+ * @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 OperationFuture{@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * BatchTranslateTextRequest request =
+ * BatchTranslateTextRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setSourceLanguageCode("sourceLanguageCode1645917472")
+ * .addAllTargetLanguageCodes(new ArrayList
+ */
+ public final OperationCallable<
+ BatchTranslateTextRequest, BatchTranslateResponse, BatchTranslateMetadata>
+ batchTranslateTextOperationCallable() {
+ return stub.batchTranslateTextOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Translates a large volume of text in asynchronous batch mode. This function provides real-time
+ * output as the inputs are being processed. If caller cancels a request, the partial results (for
+ * an input file, it's all or nothing) may still be available on the specified output location.
+ *
+ * {@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * BatchTranslateTextRequest request =
+ * BatchTranslateTextRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setSourceLanguageCode("sourceLanguageCode1645917472")
+ * .addAllTargetLanguageCodes(new ArrayList
+ */
+ public final UnaryCallable{@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * String sourceLanguageCode = "sourceLanguageCode1645917472";
+ * List
+ *
+ * @param parent Required. Location to make a regional call.
+ * {@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * String sourceLanguageCode = "sourceLanguageCode1645917472";
+ * List
+ *
+ * @param parent Required. Location to make a regional call.
+ * {@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * BatchTranslateDocumentRequest request =
+ * BatchTranslateDocumentRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setSourceLanguageCode("sourceLanguageCode1645917472")
+ * .addAllTargetLanguageCodes(new ArrayList
+ *
+ * @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 OperationFuture{@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * BatchTranslateDocumentRequest request =
+ * BatchTranslateDocumentRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setSourceLanguageCode("sourceLanguageCode1645917472")
+ * .addAllTargetLanguageCodes(new ArrayList
+ */
+ public final OperationCallable<
+ BatchTranslateDocumentRequest, BatchTranslateDocumentResponse,
+ BatchTranslateDocumentMetadata>
+ batchTranslateDocumentOperationCallable() {
+ return stub.batchTranslateDocumentOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Translates a large volume of document in asynchronous batch mode. This function provides
+ * real-time output as the inputs are being processed. If caller cancels a request, the partial
+ * results (for an input file, it's all or nothing) may still be available on the specified output
+ * location.
+ *
+ * {@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * BatchTranslateDocumentRequest request =
+ * BatchTranslateDocumentRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setSourceLanguageCode("sourceLanguageCode1645917472")
+ * .addAllTargetLanguageCodes(new ArrayList
+ */
+ public final UnaryCallable{@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * Glossary glossary = Glossary.newBuilder().build();
+ * Glossary response = translationServiceClient.createGlossaryAsync(parent, glossary).get();
+ * }
+ * }
+ *
+ * @param parent Required. The project name.
+ * @param glossary Required. The glossary to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * Glossary glossary = Glossary.newBuilder().build();
+ * Glossary response = translationServiceClient.createGlossaryAsync(parent, glossary).get();
+ * }
+ * }
+ *
+ * @param parent Required. The project name.
+ * @param glossary Required. The glossary to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * CreateGlossaryRequest request =
+ * CreateGlossaryRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setGlossary(Glossary.newBuilder().build())
+ * .build();
+ * Glossary response = translationServiceClient.createGlossaryAsync(request).get();
+ * }
+ * }
+ *
+ * @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 OperationFuture{@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * CreateGlossaryRequest request =
+ * CreateGlossaryRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setGlossary(Glossary.newBuilder().build())
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable{@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * CreateGlossaryRequest request =
+ * CreateGlossaryRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setGlossary(Glossary.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (Glossary element : translationServiceClient.listGlossaries(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The name of the project from which to list all of the glossaries.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListGlossariesPagedResponse listGlossaries(LocationName parent) {
+ ListGlossariesRequest request =
+ ListGlossariesRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listGlossaries(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.
+ *
+ * {@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (Glossary element : translationServiceClient.listGlossaries(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The name of the project from which to list all of the glossaries.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListGlossariesPagedResponse listGlossaries(String parent) {
+ ListGlossariesRequest request = ListGlossariesRequest.newBuilder().setParent(parent).build();
+ return listGlossaries(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.
+ *
+ * {@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * ListGlossariesRequest request =
+ * ListGlossariesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .build();
+ * for (Glossary element : translationServiceClient.listGlossaries(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 ListGlossariesPagedResponse listGlossaries(ListGlossariesRequest request) {
+ return listGlossariesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.
+ *
+ * {@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * ListGlossariesRequest request =
+ * ListGlossariesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * ListGlossariesRequest request =
+ * ListGlossariesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .build();
+ * while (true) {
+ * ListGlossariesResponse response =
+ * translationServiceClient.listGlossariesCallable().call(request);
+ * for (Glossary element : response.getResponsesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable{@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * GlossaryName name = GlossaryName.of("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
+ * Glossary response = translationServiceClient.getGlossary(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the glossary to retrieve.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Glossary getGlossary(GlossaryName name) {
+ GetGlossaryRequest request =
+ GetGlossaryRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getGlossary(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.
+ *
+ * {@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * String name = GlossaryName.of("[PROJECT]", "[LOCATION]", "[GLOSSARY]").toString();
+ * Glossary response = translationServiceClient.getGlossary(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the glossary to retrieve.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Glossary getGlossary(String name) {
+ GetGlossaryRequest request = GetGlossaryRequest.newBuilder().setName(name).build();
+ return getGlossary(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.
+ *
+ * {@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * GetGlossaryRequest request =
+ * GetGlossaryRequest.newBuilder()
+ * .setName(GlossaryName.of("[PROJECT]", "[LOCATION]", "[GLOSSARY]").toString())
+ * .build();
+ * Glossary response = translationServiceClient.getGlossary(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 Glossary getGlossary(GetGlossaryRequest request) {
+ return getGlossaryCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.
+ *
+ * {@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * GetGlossaryRequest request =
+ * GetGlossaryRequest.newBuilder()
+ * .setName(GlossaryName.of("[PROJECT]", "[LOCATION]", "[GLOSSARY]").toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * GlossaryName name = GlossaryName.of("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
+ * DeleteGlossaryResponse response = translationServiceClient.deleteGlossaryAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the glossary to delete.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * String name = GlossaryName.of("[PROJECT]", "[LOCATION]", "[GLOSSARY]").toString();
+ * DeleteGlossaryResponse response = translationServiceClient.deleteGlossaryAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the glossary to delete.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * DeleteGlossaryRequest request =
+ * DeleteGlossaryRequest.newBuilder()
+ * .setName(GlossaryName.of("[PROJECT]", "[LOCATION]", "[GLOSSARY]").toString())
+ * .build();
+ * DeleteGlossaryResponse response = translationServiceClient.deleteGlossaryAsync(request).get();
+ * }
+ * }
+ *
+ * @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 OperationFuture{@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * DeleteGlossaryRequest request =
+ * DeleteGlossaryRequest.newBuilder()
+ * .setName(GlossaryName.of("[PROJECT]", "[LOCATION]", "[GLOSSARY]").toString())
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable<
+ DeleteGlossaryRequest, DeleteGlossaryResponse, DeleteGlossaryMetadata>
+ deleteGlossaryOperationCallable() {
+ return stub.deleteGlossaryOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns
+ * NOT_FOUND, if the glossary doesn't exist.
+ *
+ * {@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * DeleteGlossaryRequest request =
+ * DeleteGlossaryRequest.newBuilder()
+ * .setName(GlossaryName.of("[PROJECT]", "[LOCATION]", "[GLOSSARY]").toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable
+ *
+ *
+ * {@code
+ * TranslationServiceSettings.Builder translationServiceSettingsBuilder =
+ * TranslationServiceSettings.newBuilder();
+ * translationServiceSettingsBuilder
+ * .translateTextSettings()
+ * .setRetrySettings(
+ * translationServiceSettingsBuilder
+ * .translateTextSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * TranslationServiceSettings translationServiceSettings =
+ * translationServiceSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class TranslationServiceSettings extends ClientSettings{@code
+ * try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * String targetLanguageCode = "targetLanguageCode-106414698";
+ * List
+ */
+@Generated("by gapic-generator-java")
+package com.google.cloud.translate.v3;
+
+import javax.annotation.Generated;
diff --git a/owl-bot-staging/v3/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/stub/GrpcTranslationServiceCallableFactory.java b/owl-bot-staging/v3/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/stub/GrpcTranslationServiceCallableFactory.java
new file mode 100644
index 00000000..af90b661
--- /dev/null
+++ b/owl-bot-staging/v3/google-cloud-translate/src/main/java/com/google/cloud/translate/v3/stub/GrpcTranslationServiceCallableFactory.java
@@ -0,0 +1,113 @@
+/*
+ * 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
+ *
+ * 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.translate.v3.stub;
+
+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 TranslationService service API.
+ *
+ *