Skip to content
Permalink
Browse files
fix: restore GAPIC v2 retry configs (#19)
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 38e43da23d2d9884728ff5d81df2259af7535d95
@@ -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>
@@ -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.
@@ -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
@@ -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();
@@ -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();
@@ -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();
@@ -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() {
@@ -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();
@@ -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>
@@ -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()");
}
@@ -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()");
}

0 comments on commit 38e43da

Please sign in to comment.