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

Commit

Permalink
feat: proto updates (#78)
Browse files Browse the repository at this point in the history
* fix: migrate bq/connection/v1beta1 to grpc_service_config

PiperOrigin-RevId: 320216738

Source-Author: Google APIs <noreply@google.com>
Source-Date: Wed Jul 8 10:33:41 2020 -0700
Source-Repo: googleapis/googleapis
Source-Sha: f0919d48d5fcbfd2d2e30ad3fe6ad7ea2685efc5
Source-Link: googleapis/googleapis@f0919d4

* fix: migrate bq/connection/v1 to grpc_service_config

PiperOrigin-RevId: 320217000

Source-Author: Google APIs <noreply@google.com>
Source-Date: Wed Jul 8 10:34:46 2020 -0700
Source-Repo: googleapis/googleapis
Source-Sha: c4ed5e8114b75a84929aa146a72e9e75a4027c8d
Source-Link: googleapis/googleapis@c4ed5e8
  • Loading branch information
yoshi-automation committed Jul 9, 2020
1 parent 8ce50d0 commit 2d47c35
Show file tree
Hide file tree
Showing 9 changed files with 283 additions and 255 deletions.
Expand Up @@ -54,8 +54,10 @@
* <pre>
* <code>
* try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
* ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
* connectionServiceClient.deleteConnection(name);
* LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
* Connection connection = Connection.newBuilder().build();
* String connectionId = "";
* Connection response = connectionServiceClient.createConnection(parent, connection, connectionId);
* }
* </code>
* </pre>
Expand Down Expand Up @@ -165,96 +167,6 @@ 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 @@ -761,6 +673,96 @@ 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 deleteConnection to 30 seconds:
* <p>For example, to set the total timeout of createConnection to 30 seconds:
*
* <pre>
* <code>
* ConnectionServiceSettings.Builder connectionServiceSettingsBuilder =
* ConnectionServiceSettings.newBuilder();
* connectionServiceSettingsBuilder
* .deleteConnectionSettings()
* .createConnectionSettings()
* .setRetrySettings(
* connectionServiceSettingsBuilder.deleteConnectionSettings().getRetrySettings().toBuilder()
* connectionServiceSettingsBuilder.createConnectionSettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* ConnectionServiceSettings connectionServiceSettings = connectionServiceSettingsBuilder.build();
Expand All @@ -79,11 +79,6 @@
@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 @@ -111,6 +106,11 @@ 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,11 +224,6 @@ 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 @@ -258,6 +253,11 @@ 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,8 +28,10 @@
* <pre>
* <code>
* try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
* ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
* connectionServiceClient.deleteConnection(name);
* LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
* Connection connection = Connection.newBuilder().build();
* String connectionId = "";
* Connection response = connectionServiceClient.createConnection(parent, connection, connectionId);
* }
* </code>
* </pre>
Expand Down
Expand Up @@ -44,10 +44,6 @@
@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 @@ -70,6 +66,10 @@ 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 2d47c35

Please sign in to comment.