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

Commit

Permalink
fix: restore GAPIC v2 retry configs (#19)
Browse files Browse the repository at this point in the history
Restores GAPIC v2 retry config overrides that were
mistakenly removed during migration.

PiperOrigin-RevId: 312088359

Source-Author: Google APIs <noreply@google.com>
Source-Date: Mon May 18 08:57:12 2020 -0700
Source-Repo: googleapis/googleapis
Source-Sha: 5a90d467aa65e7f038f87585e8fbb45d74475e7c
Source-Link: googleapis/googleapis@5a90d46
  • Loading branch information
yoshi-automation committed May 18, 2020
1 parent 7bb7a4b commit 38e43da
Show file tree
Hide file tree
Showing 8 changed files with 209 additions and 213 deletions.
Expand Up @@ -54,10 +54,8 @@
* <pre>
* <code>
* try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
* LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
* Connection connection = Connection.newBuilder().build();
* String connectionId = "";
* Connection response = connectionServiceClient.createConnection(parent, connection, connectionId);
* ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
* connectionServiceClient.deleteConnection(name);
* }
* </code>
* </pre>
Expand Down Expand Up @@ -167,6 +165,96 @@ public ConnectionServiceStub getStub() {
return stub;
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes connection and associated credential.
*
* <p>Sample code:
*
* <pre><code>
* try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
* ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
* connectionServiceClient.deleteConnection(name);
* }
* </code></pre>
*
* @param name Required. Name of the deleted connection, for example:
* `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void deleteConnection(ConnectionName name) {
DeleteConnectionRequest request =
DeleteConnectionRequest.newBuilder().setName(name == null ? null : name.toString()).build();
deleteConnection(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes connection and associated credential.
*
* <p>Sample code:
*
* <pre><code>
* try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
* ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
* connectionServiceClient.deleteConnection(name.toString());
* }
* </code></pre>
*
* @param name Required. Name of the deleted connection, for example:
* `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void deleteConnection(String name) {
DeleteConnectionRequest request = DeleteConnectionRequest.newBuilder().setName(name).build();
deleteConnection(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes connection and associated credential.
*
* <p>Sample code:
*
* <pre><code>
* try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
* ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
* DeleteConnectionRequest request = DeleteConnectionRequest.newBuilder()
* .setName(name.toString())
* .build();
* connectionServiceClient.deleteConnection(request);
* }
* </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
*/
public final void deleteConnection(DeleteConnectionRequest request) {
deleteConnectionCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes connection and associated credential.
*
* <p>Sample code:
*
* <pre><code>
* try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
* ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
* DeleteConnectionRequest request = DeleteConnectionRequest.newBuilder()
* .setName(name.toString())
* .build();
* ApiFuture&lt;Void&gt; future = connectionServiceClient.deleteConnectionCallable().futureCall(request);
* // Do something
* future.get();
* }
* </code></pre>
*/
public final UnaryCallable<DeleteConnectionRequest, Empty> deleteConnectionCallable() {
return stub.deleteConnectionCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Creates a new connection.
Expand Down Expand Up @@ -673,96 +761,6 @@ public final void updateConnectionCredential(UpdateConnectionCredentialRequest r
return stub.updateConnectionCredentialCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes connection and associated credential.
*
* <p>Sample code:
*
* <pre><code>
* try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
* ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
* connectionServiceClient.deleteConnection(name);
* }
* </code></pre>
*
* @param name Required. Name of the deleted connection, for example:
* `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void deleteConnection(ConnectionName name) {
DeleteConnectionRequest request =
DeleteConnectionRequest.newBuilder().setName(name == null ? null : name.toString()).build();
deleteConnection(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes connection and associated credential.
*
* <p>Sample code:
*
* <pre><code>
* try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
* ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
* connectionServiceClient.deleteConnection(name.toString());
* }
* </code></pre>
*
* @param name Required. Name of the deleted connection, for example:
* `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void deleteConnection(String name) {
DeleteConnectionRequest request = DeleteConnectionRequest.newBuilder().setName(name).build();
deleteConnection(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes connection and associated credential.
*
* <p>Sample code:
*
* <pre><code>
* try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
* ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
* DeleteConnectionRequest request = DeleteConnectionRequest.newBuilder()
* .setName(name.toString())
* .build();
* connectionServiceClient.deleteConnection(request);
* }
* </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
*/
public final void deleteConnection(DeleteConnectionRequest request) {
deleteConnectionCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes connection and associated credential.
*
* <p>Sample code:
*
* <pre><code>
* try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
* ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
* DeleteConnectionRequest request = DeleteConnectionRequest.newBuilder()
* .setName(name.toString())
* .build();
* ApiFuture&lt;Void&gt; future = connectionServiceClient.deleteConnectionCallable().futureCall(request);
* // Do something
* future.get();
* }
* </code></pre>
*/
public final UnaryCallable<DeleteConnectionRequest, Empty> deleteConnectionCallable() {
return stub.deleteConnectionCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Gets the access control policy for a resource. Returns an empty policy if the resource exists
Expand Down
Expand Up @@ -60,16 +60,16 @@
* <p>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.
*
* <p>For example, to set the total timeout of createConnection to 30 seconds:
* <p>For example, to set the total timeout of deleteConnection to 30 seconds:
*
* <pre>
* <code>
* ConnectionServiceSettings.Builder connectionServiceSettingsBuilder =
* ConnectionServiceSettings.newBuilder();
* connectionServiceSettingsBuilder
* .createConnectionSettings()
* .deleteConnectionSettings()
* .setRetrySettings(
* connectionServiceSettingsBuilder.createConnectionSettings().getRetrySettings().toBuilder()
* connectionServiceSettingsBuilder.deleteConnectionSettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* ConnectionServiceSettings connectionServiceSettings = connectionServiceSettingsBuilder.build();
Expand All @@ -79,6 +79,11 @@
@Generated("by gapic-generator")
@BetaApi
public class ConnectionServiceSettings extends ClientSettings<ConnectionServiceSettings> {
/** Returns the object with the settings used for calls to deleteConnection. */
public UnaryCallSettings<DeleteConnectionRequest, Empty> deleteConnectionSettings() {
return ((ConnectionServiceStubSettings) getStubSettings()).deleteConnectionSettings();
}

/** Returns the object with the settings used for calls to createConnection. */
public UnaryCallSettings<CreateConnectionRequest, Connection> createConnectionSettings() {
return ((ConnectionServiceStubSettings) getStubSettings()).createConnectionSettings();
Expand Down Expand Up @@ -106,11 +111,6 @@ public UnaryCallSettings<UpdateConnectionRequest, Connection> updateConnectionSe
return ((ConnectionServiceStubSettings) getStubSettings()).updateConnectionCredentialSettings();
}

/** Returns the object with the settings used for calls to deleteConnection. */
public UnaryCallSettings<DeleteConnectionRequest, Empty> deleteConnectionSettings() {
return ((ConnectionServiceStubSettings) getStubSettings()).deleteConnectionSettings();
}

/** Returns the object with the settings used for calls to getIamPolicy. */
public UnaryCallSettings<GetIamPolicyRequest, Policy> getIamPolicySettings() {
return ((ConnectionServiceStubSettings) getStubSettings()).getIamPolicySettings();
Expand Down Expand Up @@ -224,6 +224,11 @@ public Builder applyToAllUnaryMethods(
return this;
}

/** Returns the builder for the settings used for calls to deleteConnection. */
public UnaryCallSettings.Builder<DeleteConnectionRequest, Empty> deleteConnectionSettings() {
return getStubSettingsBuilder().deleteConnectionSettings();
}

/** Returns the builder for the settings used for calls to createConnection. */
public UnaryCallSettings.Builder<CreateConnectionRequest, Connection>
createConnectionSettings() {
Expand Down Expand Up @@ -253,11 +258,6 @@ public UnaryCallSettings.Builder<GetConnectionRequest, Connection> getConnection
return getStubSettingsBuilder().updateConnectionCredentialSettings();
}

/** Returns the builder for the settings used for calls to deleteConnection. */
public UnaryCallSettings.Builder<DeleteConnectionRequest, Empty> deleteConnectionSettings() {
return getStubSettingsBuilder().deleteConnectionSettings();
}

/** Returns the builder for the settings used for calls to getIamPolicy. */
public UnaryCallSettings.Builder<GetIamPolicyRequest, Policy> getIamPolicySettings() {
return getStubSettingsBuilder().getIamPolicySettings();
Expand Down
Expand Up @@ -28,10 +28,8 @@
* <pre>
* <code>
* try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
* LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
* Connection connection = Connection.newBuilder().build();
* String connectionId = "";
* Connection response = connectionServiceClient.createConnection(parent, connection, connectionId);
* ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
* connectionServiceClient.deleteConnection(name);
* }
* </code>
* </pre>
Expand Down
Expand Up @@ -44,6 +44,10 @@
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public abstract class ConnectionServiceStub implements BackgroundResource {

public UnaryCallable<DeleteConnectionRequest, Empty> deleteConnectionCallable() {
throw new UnsupportedOperationException("Not implemented: deleteConnectionCallable()");
}

public UnaryCallable<CreateConnectionRequest, Connection> createConnectionCallable() {
throw new UnsupportedOperationException("Not implemented: createConnectionCallable()");
}
Expand All @@ -66,10 +70,6 @@ public UnaryCallable<UpdateConnectionRequest, Connection> updateConnectionCallab
"Not implemented: updateConnectionCredentialCallable()");
}

public UnaryCallable<DeleteConnectionRequest, Empty> deleteConnectionCallable() {
throw new UnsupportedOperationException("Not implemented: deleteConnectionCallable()");
}

public UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() {
throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()");
}
Expand Down

0 comments on commit 38e43da

Please sign in to comment.