Search in sources :

Example 6 with DeleteConnectionRequest

use of com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest 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

DeleteConnectionRequest (com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest)6 ConnectionName (com.google.cloud.bigquery.connection.v1.ConnectionName)2 AbstractMessage (com.google.protobuf.AbstractMessage)2 Empty (com.google.protobuf.Empty)2 Test (org.junit.Test)2 ConnectionServiceClient (com.google.cloud.bigqueryconnection.v1.ConnectionServiceClient)1 ByteString (com.google.protobuf.ByteString)1 After (org.junit.After)1