Search in sources :

Example 11 with ConnectionName

use of com.google.cloud.bigquery.connection.v1.ConnectionName in project java-bigqueryconnection by googleapis.

the class ConnectionServiceClient method deleteConnection.

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
 * Deletes connection and associated credential.
 *
 * <p>Sample code:
 *
 * <pre>{@code
 * // This snippet has been automatically generated for illustrative purposes only.
 * // It may require modifications to work in your environment.
 * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
 *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
 *   connectionServiceClient.deleteConnection(name);
 * }
 * }</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);
}
Also used : DeleteConnectionRequest(com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest)

Aggregations

ConnectionName (com.google.cloud.bigquery.connection.v1.ConnectionName)10 Connection (com.google.cloud.bigquery.connection.v1.Connection)6 Test (org.junit.Test)6 ConnectionServiceClient (com.google.cloud.bigqueryconnection.v1.ConnectionServiceClient)4 InvalidArgumentException (com.google.api.gax.rpc.InvalidArgumentException)3 DeleteConnectionRequest (com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest)3 GetConnectionRequest (com.google.cloud.bigquery.connection.v1.GetConnectionRequest)3 AbstractMessage (com.google.protobuf.AbstractMessage)3 FieldMask (com.google.protobuf.FieldMask)3 StatusRuntimeException (io.grpc.StatusRuntimeException)3 UpdateConnectionRequest (com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest)2 Empty (com.google.protobuf.Empty)1