Skip to content
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.

fix: migrate to grpc_service_config #228

Merged
merged 3 commits into from Jun 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -17,7 +17,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>7.0.0</version>
<version>7.0.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
Expand Up @@ -173,133 +173,6 @@ public final OperationsClient getOperationsClient() {
return operationsClient;
}

// 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.
*
* <p>Sample code:
*
* <pre><code>
* try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
* GlossaryName name = GlossaryName.of("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
* DeleteGlossaryResponse response = translationServiceClient.deleteGlossaryAsync(name).get();
* }
* </code></pre>
*
* @param name Required. The name of the glossary to delete.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFuture<DeleteGlossaryResponse, DeleteGlossaryMetadata> deleteGlossaryAsync(
GlossaryName name) {
DeleteGlossaryRequest request =
DeleteGlossaryRequest.newBuilder().setName(name == null ? null : name.toString()).build();
return deleteGlossaryAsync(request);
}

// 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.
*
* <p>Sample code:
*
* <pre><code>
* try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
* GlossaryName name = GlossaryName.of("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
* DeleteGlossaryResponse response = translationServiceClient.deleteGlossaryAsync(name.toString()).get();
* }
* </code></pre>
*
* @param name Required. The name of the glossary to delete.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFuture<DeleteGlossaryResponse, DeleteGlossaryMetadata> deleteGlossaryAsync(
String name) {
DeleteGlossaryRequest request = DeleteGlossaryRequest.newBuilder().setName(name).build();
return deleteGlossaryAsync(request);
}

// 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.
*
* <p>Sample code:
*
* <pre><code>
* try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
* GlossaryName name = GlossaryName.of("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
* DeleteGlossaryRequest request = DeleteGlossaryRequest.newBuilder()
* .setName(name.toString())
* .build();
* DeleteGlossaryResponse response = translationServiceClient.deleteGlossaryAsync(request).get();
* }
* </code></pre>
*
* @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
*/
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFuture<DeleteGlossaryResponse, DeleteGlossaryMetadata> deleteGlossaryAsync(
DeleteGlossaryRequest request) {
return deleteGlossaryOperationCallable().futureCall(request);
}

// 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.
*
* <p>Sample code:
*
* <pre><code>
* try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
* GlossaryName name = GlossaryName.of("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
* DeleteGlossaryRequest request = DeleteGlossaryRequest.newBuilder()
* .setName(name.toString())
* .build();
* OperationFuture&lt;DeleteGlossaryResponse, DeleteGlossaryMetadata&gt; future = translationServiceClient.deleteGlossaryOperationCallable().futureCall(request);
* // Do something
* DeleteGlossaryResponse response = future.get();
* }
* </code></pre>
*/
@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
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.
*
* <p>Sample code:
*
* <pre><code>
* try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
* GlossaryName name = GlossaryName.of("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
* DeleteGlossaryRequest request = DeleteGlossaryRequest.newBuilder()
* .setName(name.toString())
* .build();
* ApiFuture&lt;Operation&gt; future = translationServiceClient.deleteGlossaryCallable().futureCall(request);
* // Do something
* Operation response = future.get();
* }
* </code></pre>
*/
public final UnaryCallable<DeleteGlossaryRequest, Operation> deleteGlossaryCallable() {
return stub.deleteGlossaryCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Translates input text and returns translated text.
Expand Down Expand Up @@ -1318,6 +1191,133 @@ public final UnaryCallable<GetGlossaryRequest, Glossary> getGlossaryCallable() {
return stub.getGlossaryCallable();
}

// 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.
*
* <p>Sample code:
*
* <pre><code>
* try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
* GlossaryName name = GlossaryName.of("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
* DeleteGlossaryResponse response = translationServiceClient.deleteGlossaryAsync(name).get();
* }
* </code></pre>
*
* @param name Required. The name of the glossary to delete.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFuture<DeleteGlossaryResponse, DeleteGlossaryMetadata> deleteGlossaryAsync(
GlossaryName name) {
DeleteGlossaryRequest request =
DeleteGlossaryRequest.newBuilder().setName(name == null ? null : name.toString()).build();
return deleteGlossaryAsync(request);
}

// 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.
*
* <p>Sample code:
*
* <pre><code>
* try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
* GlossaryName name = GlossaryName.of("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
* DeleteGlossaryResponse response = translationServiceClient.deleteGlossaryAsync(name.toString()).get();
* }
* </code></pre>
*
* @param name Required. The name of the glossary to delete.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFuture<DeleteGlossaryResponse, DeleteGlossaryMetadata> deleteGlossaryAsync(
String name) {
DeleteGlossaryRequest request = DeleteGlossaryRequest.newBuilder().setName(name).build();
return deleteGlossaryAsync(request);
}

// 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.
*
* <p>Sample code:
*
* <pre><code>
* try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
* GlossaryName name = GlossaryName.of("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
* DeleteGlossaryRequest request = DeleteGlossaryRequest.newBuilder()
* .setName(name.toString())
* .build();
* DeleteGlossaryResponse response = translationServiceClient.deleteGlossaryAsync(request).get();
* }
* </code></pre>
*
* @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
*/
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFuture<DeleteGlossaryResponse, DeleteGlossaryMetadata> deleteGlossaryAsync(
DeleteGlossaryRequest request) {
return deleteGlossaryOperationCallable().futureCall(request);
}

// 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.
*
* <p>Sample code:
*
* <pre><code>
* try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
* GlossaryName name = GlossaryName.of("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
* DeleteGlossaryRequest request = DeleteGlossaryRequest.newBuilder()
* .setName(name.toString())
* .build();
* OperationFuture&lt;DeleteGlossaryResponse, DeleteGlossaryMetadata&gt; future = translationServiceClient.deleteGlossaryOperationCallable().futureCall(request);
* // Do something
* DeleteGlossaryResponse response = future.get();
* }
* </code></pre>
*/
@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
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.
*
* <p>Sample code:
*
* <pre><code>
* try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
* GlossaryName name = GlossaryName.of("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
* DeleteGlossaryRequest request = DeleteGlossaryRequest.newBuilder()
* .setName(name.toString())
* .build();
* ApiFuture&lt;Operation&gt; future = translationServiceClient.deleteGlossaryCallable().futureCall(request);
* // Do something
* Operation response = future.get();
* }
* </code></pre>
*/
public final UnaryCallable<DeleteGlossaryRequest, Operation> deleteGlossaryCallable() {
return stub.deleteGlossaryCallable();
}

@Override
public final void close() {
stub.close();
Expand Down
Expand Up @@ -69,20 +69,6 @@
@Generated("by gapic-generator")
@BetaApi
public class TranslationServiceSettings extends ClientSettings<TranslationServiceSettings> {
/** Returns the object with the settings used for calls to deleteGlossary. */
public UnaryCallSettings<DeleteGlossaryRequest, Operation> deleteGlossarySettings() {
return ((TranslationServiceStubSettings) getStubSettings()).deleteGlossarySettings();
}

/** Returns the object with the settings used for calls to deleteGlossary. */
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public OperationCallSettings<
DeleteGlossaryRequest, DeleteGlossaryResponse, DeleteGlossaryMetadata>
deleteGlossaryOperationSettings() {
return ((TranslationServiceStubSettings) getStubSettings()).deleteGlossaryOperationSettings();
}

/** Returns the object with the settings used for calls to translateText. */
public UnaryCallSettings<TranslateTextRequest, TranslateTextResponse> translateTextSettings() {
return ((TranslationServiceStubSettings) getStubSettings()).translateTextSettings();
Expand Down Expand Up @@ -139,6 +125,20 @@ public UnaryCallSettings<GetGlossaryRequest, Glossary> getGlossarySettings() {
return ((TranslationServiceStubSettings) getStubSettings()).getGlossarySettings();
}

/** Returns the object with the settings used for calls to deleteGlossary. */
public UnaryCallSettings<DeleteGlossaryRequest, Operation> deleteGlossarySettings() {
return ((TranslationServiceStubSettings) getStubSettings()).deleteGlossarySettings();
}

/** Returns the object with the settings used for calls to deleteGlossary. */
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public OperationCallSettings<
DeleteGlossaryRequest, DeleteGlossaryResponse, DeleteGlossaryMetadata>
deleteGlossaryOperationSettings() {
return ((TranslationServiceStubSettings) getStubSettings()).deleteGlossaryOperationSettings();
}

public static final TranslationServiceSettings create(TranslationServiceStubSettings stub)
throws IOException {
return new TranslationServiceSettings.Builder(stub.toBuilder()).build();
Expand Down Expand Up @@ -236,20 +236,6 @@ public Builder applyToAllUnaryMethods(
return this;
}

/** Returns the builder for the settings used for calls to deleteGlossary. */
public UnaryCallSettings.Builder<DeleteGlossaryRequest, Operation> deleteGlossarySettings() {
return getStubSettingsBuilder().deleteGlossarySettings();
}

/** Returns the builder for the settings used for calls to deleteGlossary. */
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public OperationCallSettings.Builder<
DeleteGlossaryRequest, DeleteGlossaryResponse, DeleteGlossaryMetadata>
deleteGlossaryOperationSettings() {
return getStubSettingsBuilder().deleteGlossaryOperationSettings();
}

/** Returns the builder for the settings used for calls to translateText. */
public UnaryCallSettings.Builder<TranslateTextRequest, TranslateTextResponse>
translateTextSettings() {
Expand Down Expand Up @@ -308,6 +294,20 @@ public UnaryCallSettings.Builder<GetGlossaryRequest, Glossary> getGlossarySettin
return getStubSettingsBuilder().getGlossarySettings();
}

/** Returns the builder for the settings used for calls to deleteGlossary. */
public UnaryCallSettings.Builder<DeleteGlossaryRequest, Operation> deleteGlossarySettings() {
return getStubSettingsBuilder().deleteGlossarySettings();
}

/** Returns the builder for the settings used for calls to deleteGlossary. */
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public OperationCallSettings.Builder<
DeleteGlossaryRequest, DeleteGlossaryResponse, DeleteGlossaryMetadata>
deleteGlossaryOperationSettings() {
return getStubSettingsBuilder().deleteGlossaryOperationSettings();
}

@Override
public TranslationServiceSettings build() throws IOException {
return new TranslationServiceSettings(this);
Expand Down