diff --git a/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigqueryconnection/v1/ConnectionServiceClient.java b/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigqueryconnection/v1/ConnectionServiceClient.java new file mode 100644 index 00000000..a27004c1 --- /dev/null +++ b/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigqueryconnection/v1/ConnectionServiceClient.java @@ -0,0 +1,1140 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigqueryconnection.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.resourcenames.ResourceName; +import com.google.cloud.bigquery.connection.v1.Connection; +import com.google.cloud.bigquery.connection.v1.ConnectionName; +import com.google.cloud.bigquery.connection.v1.CreateConnectionRequest; +import com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest; +import com.google.cloud.bigquery.connection.v1.GetConnectionRequest; +import com.google.cloud.bigquery.connection.v1.ListConnectionsRequest; +import com.google.cloud.bigquery.connection.v1.ListConnectionsResponse; +import com.google.cloud.bigquery.connection.v1.LocationName; +import com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest; +import com.google.cloud.bigqueryconnection.v1.stub.ConnectionServiceStub; +import com.google.cloud.bigqueryconnection.v1.stub.ConnectionServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Manages external data source connections and credentials. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * 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);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the connectionServiceClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of ConnectionServiceSettings to + * create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * ConnectionServiceSettings connectionServiceSettings =
+ *     ConnectionServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ConnectionServiceClient connectionServiceClient =
+ *     ConnectionServiceClient.create(connectionServiceSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * ConnectionServiceSettings connectionServiceSettings =
+ *     ConnectionServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ConnectionServiceClient connectionServiceClient =
+ *     ConnectionServiceClient.create(connectionServiceSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ConnectionServiceClient implements BackgroundResource { + private final ConnectionServiceSettings settings; + private final ConnectionServiceStub stub; + + /** Constructs an instance of ConnectionServiceClient with default settings. */ + public static final ConnectionServiceClient create() throws IOException { + return create(ConnectionServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ConnectionServiceClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final ConnectionServiceClient create(ConnectionServiceSettings settings) + throws IOException { + return new ConnectionServiceClient(settings); + } + + /** + * Constructs an instance of ConnectionServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer to use ConnectionServiceSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final ConnectionServiceClient create(ConnectionServiceStub stub) { + return new ConnectionServiceClient(stub); + } + + /** + * Constructs an instance of ConnectionServiceClient, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected ConnectionServiceClient(ConnectionServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ConnectionServiceStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected ConnectionServiceClient(ConnectionServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ConnectionServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ConnectionServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new connection. + * + *

Sample 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);
+   * }
+   * 
+ * + * @param parent Required. Parent resource name. Must be in the format + * `projects/{project_id}/locations/{location_id}` + * @param connection Required. Connection to create. + * @param connectionId Optional. Connection id that should be assigned to the created connection. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Connection createConnection( + LocationName parent, Connection connection, String connectionId) { + CreateConnectionRequest request = + CreateConnectionRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setConnection(connection) + .setConnectionId(connectionId) + .build(); + return createConnection(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new connection. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Connection connection = Connection.newBuilder().build();
+   *   String connectionId = "";
+   *   Connection response = connectionServiceClient.createConnection(parent.toString(), connection, connectionId);
+   * }
+   * 
+ * + * @param parent Required. Parent resource name. Must be in the format + * `projects/{project_id}/locations/{location_id}` + * @param connection Required. Connection to create. + * @param connectionId Optional. Connection id that should be assigned to the created connection. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Connection createConnection( + String parent, Connection connection, String connectionId) { + CreateConnectionRequest request = + CreateConnectionRequest.newBuilder() + .setParent(parent) + .setConnection(connection) + .setConnectionId(connectionId) + .build(); + return createConnection(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new connection. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Connection connection = Connection.newBuilder().build();
+   *   CreateConnectionRequest request = CreateConnectionRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setConnection(connection)
+   *     .build();
+   *   Connection response = connectionServiceClient.createConnection(request);
+   * }
+   * 
+ * + * @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 Connection createConnection(CreateConnectionRequest request) { + return createConnectionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new connection. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Connection connection = Connection.newBuilder().build();
+   *   CreateConnectionRequest request = CreateConnectionRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setConnection(connection)
+   *     .build();
+   *   ApiFuture<Connection> future = connectionServiceClient.createConnectionCallable().futureCall(request);
+   *   // Do something
+   *   Connection response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createConnectionCallable() { + return stub.createConnectionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns specified connection. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Connection response = connectionServiceClient.getConnection(name);
+   * }
+   * 
+ * + * @param name Required. Name of the requested 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 Connection getConnection(ConnectionName name) { + GetConnectionRequest request = + GetConnectionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getConnection(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns specified connection. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Connection response = connectionServiceClient.getConnection(name.toString());
+   * }
+   * 
+ * + * @param name Required. Name of the requested 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 Connection getConnection(String name) { + GetConnectionRequest request = GetConnectionRequest.newBuilder().setName(name).build(); + return getConnection(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns specified connection. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   GetConnectionRequest request = GetConnectionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Connection response = connectionServiceClient.getConnection(request);
+   * }
+   * 
+ * + * @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 Connection getConnection(GetConnectionRequest request) { + return getConnectionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns specified connection. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   GetConnectionRequest request = GetConnectionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Connection> future = connectionServiceClient.getConnectionCallable().futureCall(request);
+   *   // Do something
+   *   Connection response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getConnectionCallable() { + return stub.getConnectionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a list of connections in the given project. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   int pageSize = 0;
+   *   ListConnectionsRequest request = ListConnectionsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setPageSize(pageSize)
+   *     .build();
+   *   for (Connection element : connectionServiceClient.listConnections(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @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 ListConnectionsPagedResponse listConnections(ListConnectionsRequest request) { + return listConnectionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a list of connections in the given project. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   int pageSize = 0;
+   *   ListConnectionsRequest request = ListConnectionsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setPageSize(pageSize)
+   *     .build();
+   *   ApiFuture<ListConnectionsPagedResponse> future = connectionServiceClient.listConnectionsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Connection element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listConnectionsPagedCallable() { + return stub.listConnectionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a list of connections in the given project. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   int pageSize = 0;
+   *   ListConnectionsRequest request = ListConnectionsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setPageSize(pageSize)
+   *     .build();
+   *   while (true) {
+   *     ListConnectionsResponse response = connectionServiceClient.listConnectionsCallable().call(request);
+   *     for (Connection element : response.getConnectionsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listConnectionsCallable() { + return stub.listConnectionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified connection. For security reasons, also resets credential if connection + * properties are in the update field mask. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Connection connection = Connection.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Connection response = connectionServiceClient.updateConnection(name, connection, updateMask);
+   * }
+   * 
+ * + * @param name Required. Name of the connection to update, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * @param connection Required. Connection containing the updated fields. + * @param updateMask Required. Update mask for the connection fields to be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Connection updateConnection( + ConnectionName name, Connection connection, FieldMask updateMask) { + UpdateConnectionRequest request = + UpdateConnectionRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setConnection(connection) + .setUpdateMask(updateMask) + .build(); + return updateConnection(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified connection. For security reasons, also resets credential if connection + * properties are in the update field mask. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Connection connection = Connection.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Connection response = connectionServiceClient.updateConnection(name.toString(), connection, updateMask);
+   * }
+   * 
+ * + * @param name Required. Name of the connection to update, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * @param connection Required. Connection containing the updated fields. + * @param updateMask Required. Update mask for the connection fields to be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Connection updateConnection( + String name, Connection connection, FieldMask updateMask) { + UpdateConnectionRequest request = + UpdateConnectionRequest.newBuilder() + .setName(name) + .setConnection(connection) + .setUpdateMask(updateMask) + .build(); + return updateConnection(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified connection. For security reasons, also resets credential if connection + * properties are in the update field mask. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Connection connection = Connection.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateConnectionRequest request = UpdateConnectionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setConnection(connection)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   Connection response = connectionServiceClient.updateConnection(request);
+   * }
+   * 
+ * + * @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 Connection updateConnection(UpdateConnectionRequest request) { + return updateConnectionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified connection. For security reasons, also resets credential if connection + * properties are in the update field mask. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Connection connection = Connection.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateConnectionRequest request = UpdateConnectionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setConnection(connection)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   ApiFuture<Connection> future = connectionServiceClient.updateConnectionCallable().futureCall(request);
+   *   // Do something
+   *   Connection response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateConnectionCallable() { + return stub.updateConnectionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes connection and associated credential. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   connectionServiceClient.deleteConnection(name);
+   * }
+   * 
+ * + * @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. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   connectionServiceClient.deleteConnection(name.toString());
+   * }
+   * 
+ * + * @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. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   DeleteConnectionRequest request = DeleteConnectionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   connectionServiceClient.deleteConnection(request);
+   * }
+   * 
+ * + * @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. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   DeleteConnectionRequest request = DeleteConnectionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = connectionServiceClient.deleteConnectionCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable 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 + * and does not have a policy set. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   GetPolicyOptions options = GetPolicyOptions.newBuilder().build();
+   *   Policy response = connectionServiceClient.getIamPolicy(resource, options);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @param options OPTIONAL: A `GetPolicyOptions` object for specifying options to `GetIamPolicy`. + * This field is only used by Cloud IAM. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(ResourceName resource, GetPolicyOptions options) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setOptions(options) + .build(); + return getIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   GetPolicyOptions options = GetPolicyOptions.newBuilder().build();
+   *   Policy response = connectionServiceClient.getIamPolicy(resource.toString(), options);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @param options OPTIONAL: A `GetPolicyOptions` object for specifying options to `GetIamPolicy`. + * This field is only used by Cloud IAM. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(String resource, GetPolicyOptions options) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder().setResource(resource).setOptions(options).build(); + return getIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   Policy response = connectionServiceClient.getIamPolicy(request);
+   * }
+   * 
+ * + * @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 Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   ApiFuture<Policy> future = connectionServiceClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   Policy response = connectionServiceClient.setIamPolicy(resource, policy);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the + * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud + * Platform services (such as Projects) might reject them. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(ResourceName resource, Policy policy) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setPolicy(policy) + .build(); + return setIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   Policy response = connectionServiceClient.setIamPolicy(resource.toString(), policy);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the + * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud + * Platform services (such as Projects) might reject them. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(String resource, Policy policy) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); + return setIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setPolicy(policy)
+   *     .build();
+   *   Policy response = connectionServiceClient.setIamPolicy(request);
+   * }
+   * 
+ * + * @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 Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setPolicy(policy)
+   *     .build();
+   *   ApiFuture<Policy> future = connectionServiceClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a NOT_FOUND error. + * + *

Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response = connectionServiceClient.testIamPermissions(resource, permissions);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions( + ResourceName resource, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a NOT_FOUND error. + * + *

Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response = connectionServiceClient.testIamPermissions(resource.toString(), permissions);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions( + String resource, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a NOT_FOUND error. + * + *

Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .addAllPermissions(permissions)
+   *     .build();
+   *   TestIamPermissionsResponse response = connectionServiceClient.testIamPermissions(request);
+   * }
+   * 
+ * + * @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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a NOT_FOUND error. + * + *

Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .addAllPermissions(permissions)
+   *     .build();
+   *   ApiFuture<TestIamPermissionsResponse> future = connectionServiceClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListConnectionsPagedResponse + extends AbstractPagedListResponse< + ListConnectionsRequest, + ListConnectionsResponse, + Connection, + ListConnectionsPage, + ListConnectionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListConnectionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListConnectionsPagedResponse apply(ListConnectionsPage input) { + return new ListConnectionsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListConnectionsPagedResponse(ListConnectionsPage page) { + super(page, ListConnectionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListConnectionsPage + extends AbstractPage< + ListConnectionsRequest, ListConnectionsResponse, Connection, ListConnectionsPage> { + + private ListConnectionsPage( + PageContext context, + ListConnectionsResponse response) { + super(context, response); + } + + private static ListConnectionsPage createEmptyPage() { + return new ListConnectionsPage(null, null); + } + + @Override + protected ListConnectionsPage createPage( + PageContext context, + ListConnectionsResponse response) { + return new ListConnectionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListConnectionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListConnectionsRequest, + ListConnectionsResponse, + Connection, + ListConnectionsPage, + ListConnectionsFixedSizeCollection> { + + private ListConnectionsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListConnectionsFixedSizeCollection createEmptyCollection() { + return new ListConnectionsFixedSizeCollection(null, 0); + } + + @Override + protected ListConnectionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListConnectionsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigqueryconnection/v1/ConnectionServiceSettings.java b/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigqueryconnection/v1/ConnectionServiceSettings.java new file mode 100644 index 00000000..5938f308 --- /dev/null +++ b/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigqueryconnection/v1/ConnectionServiceSettings.java @@ -0,0 +1,274 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigqueryconnection.v1; + +import static com.google.cloud.bigqueryconnection.v1.ConnectionServiceClient.ListConnectionsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.bigquery.connection.v1.Connection; +import com.google.cloud.bigquery.connection.v1.CreateConnectionRequest; +import com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest; +import com.google.cloud.bigquery.connection.v1.GetConnectionRequest; +import com.google.cloud.bigquery.connection.v1.ListConnectionsRequest; +import com.google.cloud.bigquery.connection.v1.ListConnectionsResponse; +import com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest; +import com.google.cloud.bigqueryconnection.v1.stub.ConnectionServiceStubSettings; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link ConnectionServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (bigqueryconnection.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

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. + * + *

For example, to set the total timeout of createConnection to 30 seconds: + * + *

+ * 
+ * ConnectionServiceSettings.Builder connectionServiceSettingsBuilder =
+ *     ConnectionServiceSettings.newBuilder();
+ * connectionServiceSettingsBuilder
+ *     .createConnectionSettings()
+ *     .setRetrySettings(
+ *         connectionServiceSettingsBuilder.createConnectionSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ConnectionServiceSettings connectionServiceSettings = connectionServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ConnectionServiceSettings extends ClientSettings { + /** Returns the object with the settings used for calls to createConnection. */ + public UnaryCallSettings createConnectionSettings() { + return ((ConnectionServiceStubSettings) getStubSettings()).createConnectionSettings(); + } + + /** Returns the object with the settings used for calls to getConnection. */ + public UnaryCallSettings getConnectionSettings() { + return ((ConnectionServiceStubSettings) getStubSettings()).getConnectionSettings(); + } + + /** Returns the object with the settings used for calls to listConnections. */ + public PagedCallSettings< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse> + listConnectionsSettings() { + return ((ConnectionServiceStubSettings) getStubSettings()).listConnectionsSettings(); + } + + /** Returns the object with the settings used for calls to updateConnection. */ + public UnaryCallSettings updateConnectionSettings() { + return ((ConnectionServiceStubSettings) getStubSettings()).updateConnectionSettings(); + } + + /** Returns the object with the settings used for calls to deleteConnection. */ + public UnaryCallSettings deleteConnectionSettings() { + return ((ConnectionServiceStubSettings) getStubSettings()).deleteConnectionSettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((ConnectionServiceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((ConnectionServiceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((ConnectionServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final ConnectionServiceSettings create(ConnectionServiceStubSettings stub) + throws IOException { + return new ConnectionServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ConnectionServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ConnectionServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ConnectionServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ConnectionServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ConnectionServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ConnectionServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ConnectionServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ConnectionServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ConnectionServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(ConnectionServiceStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(ConnectionServiceStubSettings.newBuilder()); + } + + protected Builder(ConnectionServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ConnectionServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public ConnectionServiceStubSettings.Builder getStubSettingsBuilder() { + return ((ConnectionServiceStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createConnection. */ + public UnaryCallSettings.Builder + createConnectionSettings() { + return getStubSettingsBuilder().createConnectionSettings(); + } + + /** Returns the builder for the settings used for calls to getConnection. */ + public UnaryCallSettings.Builder getConnectionSettings() { + return getStubSettingsBuilder().getConnectionSettings(); + } + + /** Returns the builder for the settings used for calls to listConnections. */ + public PagedCallSettings.Builder< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse> + listConnectionsSettings() { + return getStubSettingsBuilder().listConnectionsSettings(); + } + + /** Returns the builder for the settings used for calls to updateConnection. */ + public UnaryCallSettings.Builder + updateConnectionSettings() { + return getStubSettingsBuilder().updateConnectionSettings(); + } + + /** Returns the builder for the settings used for calls to deleteConnection. */ + public UnaryCallSettings.Builder deleteConnectionSettings() { + return getStubSettingsBuilder().deleteConnectionSettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public ConnectionServiceSettings build() throws IOException { + return new ConnectionServiceSettings(this); + } + } +} diff --git a/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigqueryconnection/v1/package-info.java b/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigqueryconnection/v1/package-info.java new file mode 100644 index 00000000..254d8027 --- /dev/null +++ b/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigqueryconnection/v1/package-info.java @@ -0,0 +1,42 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to BigQuery Connection API. + * + *

The interfaces provided are listed below, along with usage samples. + * + *

======================= ConnectionServiceClient ======================= + * + *

Service Description: Manages external data source connections and credentials. + * + *

Sample for ConnectionServiceClient: + * + *

+ * 
+ * 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);
+ * }
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +package com.google.cloud.bigqueryconnection.v1; + +import javax.annotation.Generated; diff --git a/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/ConnectionServiceStub.java b/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/ConnectionServiceStub.java new file mode 100644 index 00000000..94190eff --- /dev/null +++ b/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/ConnectionServiceStub.java @@ -0,0 +1,88 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigqueryconnection.v1.stub; + +import static com.google.cloud.bigqueryconnection.v1.ConnectionServiceClient.ListConnectionsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigquery.connection.v1.Connection; +import com.google.cloud.bigquery.connection.v1.CreateConnectionRequest; +import com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest; +import com.google.cloud.bigquery.connection.v1.GetConnectionRequest; +import com.google.cloud.bigquery.connection.v1.ListConnectionsRequest; +import com.google.cloud.bigquery.connection.v1.ListConnectionsResponse; +import com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for BigQuery Connection API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class ConnectionServiceStub implements BackgroundResource { + + public UnaryCallable createConnectionCallable() { + throw new UnsupportedOperationException("Not implemented: createConnectionCallable()"); + } + + public UnaryCallable getConnectionCallable() { + throw new UnsupportedOperationException("Not implemented: getConnectionCallable()"); + } + + public UnaryCallable + listConnectionsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listConnectionsPagedCallable()"); + } + + public UnaryCallable listConnectionsCallable() { + throw new UnsupportedOperationException("Not implemented: listConnectionsCallable()"); + } + + public UnaryCallable updateConnectionCallable() { + throw new UnsupportedOperationException("Not implemented: updateConnectionCallable()"); + } + + public UnaryCallable deleteConnectionCallable() { + throw new UnsupportedOperationException("Not implemented: deleteConnectionCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/ConnectionServiceStubSettings.java b/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/ConnectionServiceStubSettings.java new file mode 100644 index 00000000..89ceaa72 --- /dev/null +++ b/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/ConnectionServiceStubSettings.java @@ -0,0 +1,530 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigqueryconnection.v1.stub; + +import static com.google.cloud.bigqueryconnection.v1.ConnectionServiceClient.ListConnectionsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigquery.connection.v1.Connection; +import com.google.cloud.bigquery.connection.v1.CreateConnectionRequest; +import com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest; +import com.google.cloud.bigquery.connection.v1.GetConnectionRequest; +import com.google.cloud.bigquery.connection.v1.ListConnectionsRequest; +import com.google.cloud.bigquery.connection.v1.ListConnectionsResponse; +import com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link ConnectionServiceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (bigqueryconnection.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

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. + * + *

For example, to set the total timeout of createConnection to 30 seconds: + * + *

+ * 
+ * ConnectionServiceStubSettings.Builder connectionServiceSettingsBuilder =
+ *     ConnectionServiceStubSettings.newBuilder();
+ * connectionServiceSettingsBuilder
+ *     .createConnectionSettings()
+ *     .setRetrySettings(
+ *         connectionServiceSettingsBuilder.createConnectionSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ConnectionServiceStubSettings connectionServiceSettings = connectionServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ConnectionServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/bigquery") + .add("https://www.googleapis.com/auth/cloud-platform") + .build(); + + private final UnaryCallSettings createConnectionSettings; + private final UnaryCallSettings getConnectionSettings; + private final PagedCallSettings< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse> + listConnectionsSettings; + private final UnaryCallSettings updateConnectionSettings; + private final UnaryCallSettings deleteConnectionSettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + /** Returns the object with the settings used for calls to createConnection. */ + public UnaryCallSettings createConnectionSettings() { + return createConnectionSettings; + } + + /** Returns the object with the settings used for calls to getConnection. */ + public UnaryCallSettings getConnectionSettings() { + return getConnectionSettings; + } + + /** Returns the object with the settings used for calls to listConnections. */ + public PagedCallSettings< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse> + listConnectionsSettings() { + return listConnectionsSettings; + } + + /** Returns the object with the settings used for calls to updateConnection. */ + public UnaryCallSettings updateConnectionSettings() { + return updateConnectionSettings; + } + + /** Returns the object with the settings used for calls to deleteConnection. */ + public UnaryCallSettings deleteConnectionSettings() { + return deleteConnectionSettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ConnectionServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcConnectionServiceStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "bigqueryconnection.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ConnectionServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ConnectionServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createConnectionSettings = settingsBuilder.createConnectionSettings().build(); + getConnectionSettings = settingsBuilder.getConnectionSettings().build(); + listConnectionsSettings = settingsBuilder.listConnectionsSettings().build(); + updateConnectionSettings = settingsBuilder.updateConnectionSettings().build(); + deleteConnectionSettings = settingsBuilder.deleteConnectionSettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + private static final PagedListDescriptor< + ListConnectionsRequest, ListConnectionsResponse, Connection> + LIST_CONNECTIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListConnectionsRequest injectToken( + ListConnectionsRequest payload, String token) { + return ListConnectionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListConnectionsRequest injectPageSize( + ListConnectionsRequest payload, int pageSize) { + return ListConnectionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListConnectionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListConnectionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListConnectionsResponse payload) { + return payload.getConnectionsList() != null + ? payload.getConnectionsList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse> + LIST_CONNECTIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListConnectionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_CONNECTIONS_PAGE_STR_DESC, request, context); + return ListConnectionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for ConnectionServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder + createConnectionSettings; + private final UnaryCallSettings.Builder getConnectionSettings; + private final PagedCallSettings.Builder< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse> + listConnectionsSettings; + private final UnaryCallSettings.Builder + updateConnectionSettings; + private final UnaryCallSettings.Builder + deleteConnectionSettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listConnectionsSettings = PagedCallSettings.newBuilder(LIST_CONNECTIONS_PAGE_STR_FACT); + + updateConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createConnectionSettings, + getConnectionSettings, + listConnectionsSettings, + updateConnectionSettings, + deleteConnectionSettings, + getIamPolicySettings, + setIamPolicySettings, + testIamPermissionsSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .createConnectionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getConnectionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listConnectionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateConnectionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteConnectionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(ConnectionServiceStubSettings settings) { + super(settings); + + createConnectionSettings = settings.createConnectionSettings.toBuilder(); + getConnectionSettings = settings.getConnectionSettings.toBuilder(); + listConnectionsSettings = settings.listConnectionsSettings.toBuilder(); + updateConnectionSettings = settings.updateConnectionSettings.toBuilder(); + deleteConnectionSettings = settings.deleteConnectionSettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createConnectionSettings, + getConnectionSettings, + listConnectionsSettings, + updateConnectionSettings, + deleteConnectionSettings, + getIamPolicySettings, + setIamPolicySettings, + testIamPermissionsSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createConnection. */ + public UnaryCallSettings.Builder + createConnectionSettings() { + return createConnectionSettings; + } + + /** Returns the builder for the settings used for calls to getConnection. */ + public UnaryCallSettings.Builder getConnectionSettings() { + return getConnectionSettings; + } + + /** Returns the builder for the settings used for calls to listConnections. */ + public PagedCallSettings.Builder< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse> + listConnectionsSettings() { + return listConnectionsSettings; + } + + /** Returns the builder for the settings used for calls to updateConnection. */ + public UnaryCallSettings.Builder + updateConnectionSettings() { + return updateConnectionSettings; + } + + /** Returns the builder for the settings used for calls to deleteConnection. */ + public UnaryCallSettings.Builder deleteConnectionSettings() { + return deleteConnectionSettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public ConnectionServiceStubSettings build() throws IOException { + return new ConnectionServiceStubSettings(this); + } + } +} diff --git a/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/GrpcConnectionServiceCallableFactory.java b/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/GrpcConnectionServiceCallableFactory.java new file mode 100644 index 00000000..361af2a7 --- /dev/null +++ b/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/GrpcConnectionServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigqueryconnection.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for BigQuery Connection API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcConnectionServiceCallableFactory implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/GrpcConnectionServiceStub.java b/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/GrpcConnectionServiceStub.java new file mode 100644 index 00000000..f29e9d55 --- /dev/null +++ b/google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/GrpcConnectionServiceStub.java @@ -0,0 +1,399 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigqueryconnection.v1.stub; + +import static com.google.cloud.bigqueryconnection.v1.ConnectionServiceClient.ListConnectionsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigquery.connection.v1.Connection; +import com.google.cloud.bigquery.connection.v1.CreateConnectionRequest; +import com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest; +import com.google.cloud.bigquery.connection.v1.GetConnectionRequest; +import com.google.cloud.bigquery.connection.v1.ListConnectionsRequest; +import com.google.cloud.bigquery.connection.v1.ListConnectionsResponse; +import com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest; +import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for BigQuery Connection API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcConnectionServiceStub extends ConnectionServiceStub { + + private static final MethodDescriptor + createConnectionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.connection.v1.ConnectionService/CreateConnection") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateConnectionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Connection.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getConnectionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.connection.v1.ConnectionService/GetConnection") + .setRequestMarshaller( + ProtoUtils.marshaller(GetConnectionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Connection.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listConnectionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.connection.v1.ConnectionService/ListConnections") + .setRequestMarshaller( + ProtoUtils.marshaller(ListConnectionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListConnectionsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateConnectionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.connection.v1.ConnectionService/UpdateConnection") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateConnectionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Connection.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteConnectionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.connection.v1.ConnectionService/DeleteConnection") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteConnectionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.bigquery.connection.v1.ConnectionService/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.bigquery.connection.v1.ConnectionService/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.connection.v1.ConnectionService/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable createConnectionCallable; + private final UnaryCallable getConnectionCallable; + private final UnaryCallable + listConnectionsCallable; + private final UnaryCallable + listConnectionsPagedCallable; + private final UnaryCallable updateConnectionCallable; + private final UnaryCallable deleteConnectionCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcConnectionServiceStub create(ConnectionServiceStubSettings settings) + throws IOException { + return new GrpcConnectionServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcConnectionServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcConnectionServiceStub( + ConnectionServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcConnectionServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcConnectionServiceStub( + ConnectionServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcConnectionServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcConnectionServiceStub( + ConnectionServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcConnectionServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcConnectionServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcConnectionServiceStub( + ConnectionServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings createConnectionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createConnectionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateConnectionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getConnectionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getConnectionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetConnectionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + listConnectionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listConnectionsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListConnectionsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateConnectionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateConnectionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateConnectionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteConnectionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteConnectionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteConnectionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetIamPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(SetIamPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(TestIamPermissionsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + + this.createConnectionCallable = + callableFactory.createUnaryCallable( + createConnectionTransportSettings, settings.createConnectionSettings(), clientContext); + this.getConnectionCallable = + callableFactory.createUnaryCallable( + getConnectionTransportSettings, settings.getConnectionSettings(), clientContext); + this.listConnectionsCallable = + callableFactory.createUnaryCallable( + listConnectionsTransportSettings, settings.listConnectionsSettings(), clientContext); + this.listConnectionsPagedCallable = + callableFactory.createPagedCallable( + listConnectionsTransportSettings, settings.listConnectionsSettings(), clientContext); + this.updateConnectionCallable = + callableFactory.createUnaryCallable( + updateConnectionTransportSettings, settings.updateConnectionSettings(), clientContext); + this.deleteConnectionCallable = + callableFactory.createUnaryCallable( + deleteConnectionTransportSettings, settings.deleteConnectionSettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable createConnectionCallable() { + return createConnectionCallable; + } + + public UnaryCallable getConnectionCallable() { + return getConnectionCallable; + } + + public UnaryCallable + listConnectionsPagedCallable() { + return listConnectionsPagedCallable; + } + + public UnaryCallable listConnectionsCallable() { + return listConnectionsCallable; + } + + public UnaryCallable updateConnectionCallable() { + return updateConnectionCallable; + } + + public UnaryCallable deleteConnectionCallable() { + return deleteConnectionCallable; + } + + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-bigquery-connection/src/test/java/com/google/cloud/bigqueryconnection/v1/ConnectionServiceClientTest.java b/google-cloud-bigquery-connection/src/test/java/com/google/cloud/bigqueryconnection/v1/ConnectionServiceClientTest.java new file mode 100644 index 00000000..66657fd2 --- /dev/null +++ b/google-cloud-bigquery-connection/src/test/java/com/google/cloud/bigqueryconnection/v1/ConnectionServiceClientTest.java @@ -0,0 +1,493 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigqueryconnection.v1; + +import static com.google.cloud.bigqueryconnection.v1.ConnectionServiceClient.ListConnectionsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.resourcenames.ResourceName; +import com.google.cloud.bigquery.connection.v1.Connection; +import com.google.cloud.bigquery.connection.v1.ConnectionName; +import com.google.cloud.bigquery.connection.v1.CreateConnectionRequest; +import com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest; +import com.google.cloud.bigquery.connection.v1.GetConnectionRequest; +import com.google.cloud.bigquery.connection.v1.ListConnectionsRequest; +import com.google.cloud.bigquery.connection.v1.ListConnectionsResponse; +import com.google.cloud.bigquery.connection.v1.LocationName; +import com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +import java.util.UUID; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class ConnectionServiceClientTest { + private static MockConnectionService mockConnectionService; + private static MockServiceHelper serviceHelper; + private ConnectionServiceClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockConnectionService = new MockConnectionService(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockConnectionService)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + ConnectionServiceSettings settings = + ConnectionServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ConnectionServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void createConnectionTest() { + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + String friendlyName = "friendlyName1451097503"; + String description = "description-1724546052"; + long creationTime = 1932333101L; + long lastModifiedTime = 671513446L; + boolean hasCredential = true; + Connection expectedResponse = + Connection.newBuilder() + .setName(name.toString()) + .setFriendlyName(friendlyName) + .setDescription(description) + .setCreationTime(creationTime) + .setLastModifiedTime(lastModifiedTime) + .setHasCredential(hasCredential) + .build(); + mockConnectionService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Connection connection = Connection.newBuilder().build(); + String connectionId = "connectionId-513204708"; + + Connection actualResponse = client.createConnection(parent, connection, connectionId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConnectionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateConnectionRequest actualRequest = (CreateConnectionRequest) actualRequests.get(0); + + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(connection, actualRequest.getConnection()); + Assert.assertEquals(connectionId, actualRequest.getConnectionId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createConnectionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConnectionService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Connection connection = Connection.newBuilder().build(); + String connectionId = "connectionId-513204708"; + + client.createConnection(parent, connection, connectionId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getConnectionTest() { + ConnectionName name2 = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + String friendlyName = "friendlyName1451097503"; + String description = "description-1724546052"; + long creationTime = 1932333101L; + long lastModifiedTime = 671513446L; + boolean hasCredential = true; + Connection expectedResponse = + Connection.newBuilder() + .setName(name2.toString()) + .setFriendlyName(friendlyName) + .setDescription(description) + .setCreationTime(creationTime) + .setLastModifiedTime(lastModifiedTime) + .setHasCredential(hasCredential) + .build(); + mockConnectionService.addResponse(expectedResponse); + + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + + Connection actualResponse = client.getConnection(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConnectionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetConnectionRequest actualRequest = (GetConnectionRequest) actualRequests.get(0); + + Assert.assertEquals(name, ConnectionName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getConnectionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConnectionService.addException(exception); + + try { + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + + client.getConnection(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listConnectionsTest() { + String nextPageToken = ""; + Connection connectionsElement = Connection.newBuilder().build(); + List connections = Arrays.asList(connectionsElement); + ListConnectionsResponse expectedResponse = + ListConnectionsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllConnections(connections) + .build(); + mockConnectionService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + int pageSize = 883849137; + ListConnectionsRequest request = + ListConnectionsRequest.newBuilder() + .setParent(parent.toString()) + .setPageSize(pageSize) + .build(); + + ListConnectionsPagedResponse pagedListResponse = client.listConnections(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getConnectionsList().get(0), resources.get(0)); + + List actualRequests = mockConnectionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListConnectionsRequest actualRequest = (ListConnectionsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(pageSize, actualRequest.getPageSize()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listConnectionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConnectionService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + int pageSize = 883849137; + ListConnectionsRequest request = + ListConnectionsRequest.newBuilder() + .setParent(parent.toString()) + .setPageSize(pageSize) + .build(); + + client.listConnections(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateConnectionTest() { + ConnectionName name2 = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + String friendlyName = "friendlyName1451097503"; + String description = "description-1724546052"; + long creationTime = 1932333101L; + long lastModifiedTime = 671513446L; + boolean hasCredential = true; + Connection expectedResponse = + Connection.newBuilder() + .setName(name2.toString()) + .setFriendlyName(friendlyName) + .setDescription(description) + .setCreationTime(creationTime) + .setLastModifiedTime(lastModifiedTime) + .setHasCredential(hasCredential) + .build(); + mockConnectionService.addResponse(expectedResponse); + + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + Connection connection = Connection.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Connection actualResponse = client.updateConnection(name, connection, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConnectionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateConnectionRequest actualRequest = (UpdateConnectionRequest) actualRequests.get(0); + + Assert.assertEquals(name, ConnectionName.parse(actualRequest.getName())); + Assert.assertEquals(connection, actualRequest.getConnection()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateConnectionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConnectionService.addException(exception); + + try { + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + Connection connection = Connection.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateConnection(name, connection, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteConnectionTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockConnectionService.addResponse(expectedResponse); + + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + + client.deleteConnection(name); + + List actualRequests = mockConnectionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteConnectionRequest actualRequest = (DeleteConnectionRequest) actualRequests.get(0); + + Assert.assertEquals(name, ConnectionName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteConnectionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConnectionService.addException(exception); + + try { + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + + client.deleteConnection(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getIamPolicyTest() { + int version = 351608024; + ByteString etag = ByteString.copyFromUtf8("21"); + Policy expectedResponse = Policy.newBuilder().setVersion(version).setEtag(etag).build(); + mockConnectionService.addResponse(expectedResponse); + + ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + GetPolicyOptions options = GetPolicyOptions.newBuilder().build(); + + Policy actualResponse = client.getIamPolicy(resource, options); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConnectionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = (GetIamPolicyRequest) actualRequests.get(0); + + Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource())); + Assert.assertEquals(options, actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConnectionService.addException(exception); + + try { + ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + GetPolicyOptions options = GetPolicyOptions.newBuilder().build(); + + client.getIamPolicy(resource, options); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setIamPolicyTest() { + int version = 351608024; + ByteString etag = ByteString.copyFromUtf8("21"); + Policy expectedResponse = Policy.newBuilder().setVersion(version).setEtag(etag).build(); + mockConnectionService.addResponse(expectedResponse); + + ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + Policy policy = Policy.newBuilder().build(); + + Policy actualResponse = client.setIamPolicy(resource, policy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConnectionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = (SetIamPolicyRequest) actualRequests.get(0); + + Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource())); + Assert.assertEquals(policy, actualRequest.getPolicy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConnectionService.addException(exception); + + try { + ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + Policy policy = Policy.newBuilder().build(); + + client.setIamPolicy(resource, policy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsTest() { + TestIamPermissionsResponse expectedResponse = TestIamPermissionsResponse.newBuilder().build(); + mockConnectionService.addResponse(expectedResponse); + + ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + List permissions = new ArrayList<>(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConnectionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = (TestIamPermissionsRequest) actualRequests.get(0); + + Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource())); + Assert.assertEquals(permissions, actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConnectionService.addException(exception); + + try { + ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + List permissions = new ArrayList<>(); + + client.testIamPermissions(resource, permissions); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-bigquery-connection/src/test/java/com/google/cloud/bigqueryconnection/v1/MockConnectionService.java b/google-cloud-bigquery-connection/src/test/java/com/google/cloud/bigqueryconnection/v1/MockConnectionService.java new file mode 100644 index 00000000..3ef04b3e --- /dev/null +++ b/google-cloud-bigquery-connection/src/test/java/com/google/cloud/bigqueryconnection/v1/MockConnectionService.java @@ -0,0 +1,57 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigqueryconnection.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockConnectionService implements MockGrpcService { + private final MockConnectionServiceImpl serviceImpl; + + public MockConnectionService() { + serviceImpl = new MockConnectionServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-bigquery-connection/src/test/java/com/google/cloud/bigqueryconnection/v1/MockConnectionServiceImpl.java b/google-cloud-bigquery-connection/src/test/java/com/google/cloud/bigqueryconnection/v1/MockConnectionServiceImpl.java new file mode 100644 index 00000000..cc8f421e --- /dev/null +++ b/google-cloud-bigquery-connection/src/test/java/com/google/cloud/bigqueryconnection/v1/MockConnectionServiceImpl.java @@ -0,0 +1,190 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigqueryconnection.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.bigquery.connection.v1.Connection; +import com.google.cloud.bigquery.connection.v1.ConnectionServiceGrpc.ConnectionServiceImplBase; +import com.google.cloud.bigquery.connection.v1.CreateConnectionRequest; +import com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest; +import com.google.cloud.bigquery.connection.v1.GetConnectionRequest; +import com.google.cloud.bigquery.connection.v1.ListConnectionsRequest; +import com.google.cloud.bigquery.connection.v1.ListConnectionsResponse; +import com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockConnectionServiceImpl extends ConnectionServiceImplBase { + private List requests; + private Queue responses; + + public MockConnectionServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void createConnection( + CreateConnectionRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Connection) { + requests.add(request); + responseObserver.onNext((Connection) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getConnection( + GetConnectionRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Connection) { + requests.add(request); + responseObserver.onNext((Connection) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listConnections( + ListConnectionsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListConnectionsResponse) { + requests.add(request); + responseObserver.onNext((ListConnectionsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateConnection( + UpdateConnectionRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Connection) { + requests.add(request); + responseObserver.onNext((Connection) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteConnection( + DeleteConnectionRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext((Policy) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext((Policy) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext((TestIamPermissionsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/google-cloud-bigqueryconnection-bom/pom.xml b/google-cloud-bigqueryconnection-bom/pom.xml index c0d39cb1..93233934 100644 --- a/google-cloud-bigqueryconnection-bom/pom.xml +++ b/google-cloud-bigqueryconnection-bom/pom.xml @@ -66,6 +66,16 @@ google-cloud-bigqueryconnection 0.0.1-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-bigqueryconnection-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-bigqueryconnection-v1 + 0.0.1-SNAPSHOT + com.google.api.grpc proto-google-cloud-bigqueryconnection-v1beta1 diff --git a/google-cloud-bigqueryconnection/pom.xml b/google-cloud-bigqueryconnection/pom.xml index a616a669..596a2712 100644 --- a/google-cloud-bigqueryconnection/pom.xml +++ b/google-cloud-bigqueryconnection/pom.xml @@ -46,6 +46,10 @@ proto-google-iam-v1 + + com.google.api.grpc + proto-google-cloud-bigqueryconnection-v1 + com.google.api.grpc proto-google-cloud-bigqueryconnection-v1beta1 @@ -74,6 +78,11 @@ test + + com.google.api.grpc + grpc-google-cloud-bigqueryconnection-v1 + test + com.google.api.grpc grpc-google-cloud-bigqueryconnection-v1beta1 diff --git a/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceClient.java b/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceClient.java index 2dc04fff..2979c91f 100644 --- a/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceClient.java +++ b/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceClient.java @@ -54,10 +54,8 @@ *
  * 
  * 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);
  * }
  * 
  * 
@@ -167,6 +165,96 @@ public ConnectionServiceStub getStub() { return stub; } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes connection and associated credential. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   connectionServiceClient.deleteConnection(name);
+   * }
+   * 
+ * + * @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. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   connectionServiceClient.deleteConnection(name.toString());
+   * }
+   * 
+ * + * @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. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   DeleteConnectionRequest request = DeleteConnectionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   connectionServiceClient.deleteConnection(request);
+   * }
+   * 
+ * + * @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. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   DeleteConnectionRequest request = DeleteConnectionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = connectionServiceClient.deleteConnectionCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable 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. - * - *

Sample code: - * - *


-   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
-   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
-   *   connectionServiceClient.deleteConnection(name);
-   * }
-   * 
- * - * @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. - * - *

Sample code: - * - *


-   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
-   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
-   *   connectionServiceClient.deleteConnection(name.toString());
-   * }
-   * 
- * - * @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. - * - *

Sample code: - * - *


-   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
-   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
-   *   DeleteConnectionRequest request = DeleteConnectionRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   connectionServiceClient.deleteConnection(request);
-   * }
-   * 
- * - * @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. - * - *

Sample code: - * - *


-   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
-   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
-   *   DeleteConnectionRequest request = DeleteConnectionRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = connectionServiceClient.deleteConnectionCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
- */ - public final UnaryCallable 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 diff --git a/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceSettings.java b/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceSettings.java index 4a983a81..8b1f3731 100644 --- a/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceSettings.java +++ b/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceSettings.java @@ -60,16 +60,16 @@ *

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. * - *

For example, to set the total timeout of createConnection to 30 seconds: + *

For example, to set the total timeout of deleteConnection to 30 seconds: * *

  * 
  * 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 {
+  /** Returns the object with the settings used for calls to deleteConnection. */
+  public UnaryCallSettings deleteConnectionSettings() {
+    return ((ConnectionServiceStubSettings) getStubSettings()).deleteConnectionSettings();
+  }
+
   /** Returns the object with the settings used for calls to createConnection. */
   public UnaryCallSettings createConnectionSettings() {
     return ((ConnectionServiceStubSettings) getStubSettings()).createConnectionSettings();
@@ -106,11 +111,6 @@ public UnaryCallSettings updateConnectionSe
     return ((ConnectionServiceStubSettings) getStubSettings()).updateConnectionCredentialSettings();
   }
 
-  /** Returns the object with the settings used for calls to deleteConnection. */
-  public UnaryCallSettings deleteConnectionSettings() {
-    return ((ConnectionServiceStubSettings) getStubSettings()).deleteConnectionSettings();
-  }
-
   /** Returns the object with the settings used for calls to getIamPolicy. */
   public UnaryCallSettings 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 deleteConnectionSettings() {
+      return getStubSettingsBuilder().deleteConnectionSettings();
+    }
+
     /** Returns the builder for the settings used for calls to createConnection. */
     public UnaryCallSettings.Builder
         createConnectionSettings() {
@@ -253,11 +258,6 @@ public UnaryCallSettings.Builder getConnection
       return getStubSettingsBuilder().updateConnectionCredentialSettings();
     }
 
-    /** Returns the builder for the settings used for calls to deleteConnection. */
-    public UnaryCallSettings.Builder deleteConnectionSettings() {
-      return getStubSettingsBuilder().deleteConnectionSettings();
-    }
-
     /** Returns the builder for the settings used for calls to getIamPolicy. */
     public UnaryCallSettings.Builder getIamPolicySettings() {
       return getStubSettingsBuilder().getIamPolicySettings();
diff --git a/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/package-info.java b/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/package-info.java
index dfc46794..45bbab0a 100644
--- a/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/package-info.java
+++ b/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/package-info.java
@@ -28,10 +28,8 @@
  * 
  * 
  * 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);
  * }
  * 
  * 
diff --git a/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/stub/ConnectionServiceStub.java b/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/stub/ConnectionServiceStub.java index 3e46e264..2e5f4a0f 100644 --- a/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/stub/ConnectionServiceStub.java +++ b/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/stub/ConnectionServiceStub.java @@ -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 deleteConnectionCallable() { + throw new UnsupportedOperationException("Not implemented: deleteConnectionCallable()"); + } + public UnaryCallable createConnectionCallable() { throw new UnsupportedOperationException("Not implemented: createConnectionCallable()"); } @@ -66,10 +70,6 @@ public UnaryCallable updateConnectionCallab "Not implemented: updateConnectionCredentialCallable()"); } - public UnaryCallable deleteConnectionCallable() { - throw new UnsupportedOperationException("Not implemented: deleteConnectionCallable()"); - } - public UnaryCallable getIamPolicyCallable() { throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); } diff --git a/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/stub/ConnectionServiceStubSettings.java b/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/stub/ConnectionServiceStubSettings.java index f7bb470d..778ff4cd 100644 --- a/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/stub/ConnectionServiceStubSettings.java +++ b/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/stub/ConnectionServiceStubSettings.java @@ -69,16 +69,16 @@ *

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. * - *

For example, to set the total timeout of createConnection to 30 seconds: + *

For example, to set the total timeout of deleteConnection to 30 seconds: * *

  * 
  * ConnectionServiceStubSettings.Builder connectionServiceSettingsBuilder =
  *     ConnectionServiceStubSettings.newBuilder();
  * connectionServiceSettingsBuilder
- *     .createConnectionSettings()
+ *     .deleteConnectionSettings()
  *     .setRetrySettings(
- *         connectionServiceSettingsBuilder.createConnectionSettings().getRetrySettings().toBuilder()
+ *         connectionServiceSettingsBuilder.deleteConnectionSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * ConnectionServiceStubSettings connectionServiceSettings = connectionServiceSettingsBuilder.build();
@@ -95,6 +95,7 @@ public class ConnectionServiceStubSettings extends StubSettings deleteConnectionSettings;
   private final UnaryCallSettings createConnectionSettings;
   private final UnaryCallSettings getConnectionSettings;
   private final UnaryCallSettings
@@ -102,12 +103,16 @@ public class ConnectionServiceStubSettings extends StubSettings updateConnectionSettings;
   private final UnaryCallSettings
       updateConnectionCredentialSettings;
-  private final UnaryCallSettings deleteConnectionSettings;
   private final UnaryCallSettings getIamPolicySettings;
   private final UnaryCallSettings setIamPolicySettings;
   private final UnaryCallSettings
       testIamPermissionsSettings;
 
+  /** Returns the object with the settings used for calls to deleteConnection. */
+  public UnaryCallSettings deleteConnectionSettings() {
+    return deleteConnectionSettings;
+  }
+
   /** Returns the object with the settings used for calls to createConnection. */
   public UnaryCallSettings createConnectionSettings() {
     return createConnectionSettings;
@@ -135,11 +140,6 @@ public UnaryCallSettings updateConnectionSe
     return updateConnectionCredentialSettings;
   }
 
-  /** Returns the object with the settings used for calls to deleteConnection. */
-  public UnaryCallSettings deleteConnectionSettings() {
-    return deleteConnectionSettings;
-  }
-
   /** Returns the object with the settings used for calls to getIamPolicy. */
   public UnaryCallSettings getIamPolicySettings() {
     return getIamPolicySettings;
@@ -225,13 +225,13 @@ public Builder toBuilder() {
   protected ConnectionServiceStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
+    deleteConnectionSettings = settingsBuilder.deleteConnectionSettings().build();
     createConnectionSettings = settingsBuilder.createConnectionSettings().build();
     getConnectionSettings = settingsBuilder.getConnectionSettings().build();
     listConnectionsSettings = settingsBuilder.listConnectionsSettings().build();
     updateConnectionSettings = settingsBuilder.updateConnectionSettings().build();
     updateConnectionCredentialSettings =
         settingsBuilder.updateConnectionCredentialSettings().build();
-    deleteConnectionSettings = settingsBuilder.deleteConnectionSettings().build();
     getIamPolicySettings = settingsBuilder.getIamPolicySettings().build();
     setIamPolicySettings = settingsBuilder.setIamPolicySettings().build();
     testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build();
@@ -241,6 +241,8 @@ protected ConnectionServiceStubSettings(Builder settingsBuilder) throws IOExcept
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
+    private final UnaryCallSettings.Builder
+        deleteConnectionSettings;
     private final UnaryCallSettings.Builder
         createConnectionSettings;
     private final UnaryCallSettings.Builder getConnectionSettings;
@@ -250,8 +252,6 @@ public static class Builder extends StubSettings.Builder
         updateConnectionCredentialSettings;
-    private final UnaryCallSettings.Builder
-        deleteConnectionSettings;
     private final UnaryCallSettings.Builder getIamPolicySettings;
     private final UnaryCallSettings.Builder setIamPolicySettings;
     private final UnaryCallSettings.Builder
@@ -298,6 +298,8 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
+      deleteConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
       createConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       getConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
@@ -308,8 +310,6 @@ protected Builder(ClientContext clientContext) {
 
       updateConnectionCredentialSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      deleteConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
-
       getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
@@ -318,12 +318,12 @@ protected Builder(ClientContext clientContext) {
 
       unaryMethodSettingsBuilders =
           ImmutableList.>of(
+              deleteConnectionSettings,
               createConnectionSettings,
               getConnectionSettings,
               listConnectionsSettings,
               updateConnectionSettings,
               updateConnectionCredentialSettings,
-              deleteConnectionSettings,
               getIamPolicySettings,
               setIamPolicySettings,
               testIamPermissionsSettings);
@@ -342,6 +342,11 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
+      builder
+          .deleteConnectionSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
       builder
           .createConnectionSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
@@ -367,11 +372,6 @@ private static Builder initDefaults(Builder builder) {
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder
-          .deleteConnectionSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
-
       builder
           .getIamPolicySettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
@@ -393,24 +393,24 @@ private static Builder initDefaults(Builder builder) {
     protected Builder(ConnectionServiceStubSettings settings) {
       super(settings);
 
+      deleteConnectionSettings = settings.deleteConnectionSettings.toBuilder();
       createConnectionSettings = settings.createConnectionSettings.toBuilder();
       getConnectionSettings = settings.getConnectionSettings.toBuilder();
       listConnectionsSettings = settings.listConnectionsSettings.toBuilder();
       updateConnectionSettings = settings.updateConnectionSettings.toBuilder();
       updateConnectionCredentialSettings = settings.updateConnectionCredentialSettings.toBuilder();
-      deleteConnectionSettings = settings.deleteConnectionSettings.toBuilder();
       getIamPolicySettings = settings.getIamPolicySettings.toBuilder();
       setIamPolicySettings = settings.setIamPolicySettings.toBuilder();
       testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder();
 
       unaryMethodSettingsBuilders =
           ImmutableList.>of(
+              deleteConnectionSettings,
               createConnectionSettings,
               getConnectionSettings,
               listConnectionsSettings,
               updateConnectionSettings,
               updateConnectionCredentialSettings,
-              deleteConnectionSettings,
               getIamPolicySettings,
               setIamPolicySettings,
               testIamPermissionsSettings);
@@ -432,6 +432,11 @@ public Builder applyToAllUnaryMethods(
       return unaryMethodSettingsBuilders;
     }
 
+    /** Returns the builder for the settings used for calls to deleteConnection. */
+    public UnaryCallSettings.Builder deleteConnectionSettings() {
+      return deleteConnectionSettings;
+    }
+
     /** Returns the builder for the settings used for calls to createConnection. */
     public UnaryCallSettings.Builder
         createConnectionSettings() {
@@ -461,11 +466,6 @@ public UnaryCallSettings.Builder getConnection
       return updateConnectionCredentialSettings;
     }
 
-    /** Returns the builder for the settings used for calls to deleteConnection. */
-    public UnaryCallSettings.Builder deleteConnectionSettings() {
-      return deleteConnectionSettings;
-    }
-
     /** Returns the builder for the settings used for calls to getIamPolicy. */
     public UnaryCallSettings.Builder getIamPolicySettings() {
       return getIamPolicySettings;
diff --git a/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/stub/GrpcConnectionServiceStub.java b/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/stub/GrpcConnectionServiceStub.java
index 5f40e7c6..6f5bb611 100644
--- a/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/stub/GrpcConnectionServiceStub.java
+++ b/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/stub/GrpcConnectionServiceStub.java
@@ -55,6 +55,16 @@
 @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
 public class GrpcConnectionServiceStub extends ConnectionServiceStub {
 
+  private static final MethodDescriptor
+      deleteConnectionMethodDescriptor =
+          MethodDescriptor.newBuilder()
+              .setType(MethodDescriptor.MethodType.UNARY)
+              .setFullMethodName(
+                  "google.cloud.bigquery.connection.v1beta1.ConnectionService/DeleteConnection")
+              .setRequestMarshaller(
+                  ProtoUtils.marshaller(DeleteConnectionRequest.getDefaultInstance()))
+              .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
+              .build();
   private static final MethodDescriptor
       createConnectionMethodDescriptor =
           MethodDescriptor.newBuilder()
@@ -106,16 +116,6 @@ public class GrpcConnectionServiceStub extends ConnectionServiceStub {
                   ProtoUtils.marshaller(UpdateConnectionCredentialRequest.getDefaultInstance()))
               .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
               .build();
-  private static final MethodDescriptor
-      deleteConnectionMethodDescriptor =
-          MethodDescriptor.newBuilder()
-              .setType(MethodDescriptor.MethodType.UNARY)
-              .setFullMethodName(
-                  "google.cloud.bigquery.connection.v1beta1.ConnectionService/DeleteConnection")
-              .setRequestMarshaller(
-                  ProtoUtils.marshaller(DeleteConnectionRequest.getDefaultInstance()))
-              .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
-              .build();
   private static final MethodDescriptor getIamPolicyMethodDescriptor =
       MethodDescriptor.newBuilder()
           .setType(MethodDescriptor.MethodType.UNARY)
@@ -146,6 +146,7 @@ public class GrpcConnectionServiceStub extends ConnectionServiceStub {
 
   private final BackgroundResource backgroundResources;
 
+  private final UnaryCallable deleteConnectionCallable;
   private final UnaryCallable createConnectionCallable;
   private final UnaryCallable getConnectionCallable;
   private final UnaryCallable
@@ -153,7 +154,6 @@ public class GrpcConnectionServiceStub extends ConnectionServiceStub {
   private final UnaryCallable updateConnectionCallable;
   private final UnaryCallable
       updateConnectionCredentialCallable;
-  private final UnaryCallable deleteConnectionCallable;
   private final UnaryCallable getIamPolicyCallable;
   private final UnaryCallable setIamPolicyCallable;
   private final UnaryCallable
@@ -200,6 +200,19 @@ protected GrpcConnectionServiceStub(
       throws IOException {
     this.callableFactory = callableFactory;
 
+    GrpcCallSettings deleteConnectionTransportSettings =
+        GrpcCallSettings.newBuilder()
+            .setMethodDescriptor(deleteConnectionMethodDescriptor)
+            .setParamsExtractor(
+                new RequestParamsExtractor() {
+                  @Override
+                  public Map extract(DeleteConnectionRequest request) {
+                    ImmutableMap.Builder params = ImmutableMap.builder();
+                    params.put("name", String.valueOf(request.getName()));
+                    return params.build();
+                  }
+                })
+            .build();
     GrpcCallSettings createConnectionTransportSettings =
         GrpcCallSettings.newBuilder()
             .setMethodDescriptor(createConnectionMethodDescriptor)
@@ -268,19 +281,6 @@ public Map extract(
                       }
                     })
                 .build();
-    GrpcCallSettings deleteConnectionTransportSettings =
-        GrpcCallSettings.newBuilder()
-            .setMethodDescriptor(deleteConnectionMethodDescriptor)
-            .setParamsExtractor(
-                new RequestParamsExtractor() {
-                  @Override
-                  public Map extract(DeleteConnectionRequest request) {
-                    ImmutableMap.Builder params = ImmutableMap.builder();
-                    params.put("name", String.valueOf(request.getName()));
-                    return params.build();
-                  }
-                })
-            .build();
     GrpcCallSettings getIamPolicyTransportSettings =
         GrpcCallSettings.newBuilder()
             .setMethodDescriptor(getIamPolicyMethodDescriptor)
@@ -322,6 +322,9 @@ public Map extract(TestIamPermissionsRequest request) {
                     })
                 .build();
 
+    this.deleteConnectionCallable =
+        callableFactory.createUnaryCallable(
+            deleteConnectionTransportSettings, settings.deleteConnectionSettings(), clientContext);
     this.createConnectionCallable =
         callableFactory.createUnaryCallable(
             createConnectionTransportSettings, settings.createConnectionSettings(), clientContext);
@@ -339,9 +342,6 @@ public Map extract(TestIamPermissionsRequest request) {
             updateConnectionCredentialTransportSettings,
             settings.updateConnectionCredentialSettings(),
             clientContext);
-    this.deleteConnectionCallable =
-        callableFactory.createUnaryCallable(
-            deleteConnectionTransportSettings, settings.deleteConnectionSettings(), clientContext);
     this.getIamPolicyCallable =
         callableFactory.createUnaryCallable(
             getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext);
@@ -357,6 +357,10 @@ public Map extract(TestIamPermissionsRequest request) {
     backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources());
   }
 
+  public UnaryCallable deleteConnectionCallable() {
+    return deleteConnectionCallable;
+  }
+
   public UnaryCallable createConnectionCallable() {
     return createConnectionCallable;
   }
@@ -378,10 +382,6 @@ public UnaryCallable updateConnectionCallab
     return updateConnectionCredentialCallable;
   }
 
-  public UnaryCallable deleteConnectionCallable() {
-    return deleteConnectionCallable;
-  }
-
   public UnaryCallable getIamPolicyCallable() {
     return getIamPolicyCallable;
   }
diff --git a/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigqueryconnection/v1/ConnectionServiceClient.java b/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigqueryconnection/v1/ConnectionServiceClient.java
new file mode 100644
index 00000000..a27004c1
--- /dev/null
+++ b/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigqueryconnection/v1/ConnectionServiceClient.java
@@ -0,0 +1,1140 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.bigqueryconnection.v1;
+
+import com.google.api.core.ApiFunction;
+import com.google.api.core.ApiFuture;
+import com.google.api.core.ApiFutures;
+import com.google.api.core.BetaApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.paging.AbstractFixedSizeCollection;
+import com.google.api.gax.paging.AbstractPage;
+import com.google.api.gax.paging.AbstractPagedListResponse;
+import com.google.api.gax.rpc.PageContext;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.api.resourcenames.ResourceName;
+import com.google.cloud.bigquery.connection.v1.Connection;
+import com.google.cloud.bigquery.connection.v1.ConnectionName;
+import com.google.cloud.bigquery.connection.v1.CreateConnectionRequest;
+import com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest;
+import com.google.cloud.bigquery.connection.v1.GetConnectionRequest;
+import com.google.cloud.bigquery.connection.v1.ListConnectionsRequest;
+import com.google.cloud.bigquery.connection.v1.ListConnectionsResponse;
+import com.google.cloud.bigquery.connection.v1.LocationName;
+import com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest;
+import com.google.cloud.bigqueryconnection.v1.stub.ConnectionServiceStub;
+import com.google.cloud.bigqueryconnection.v1.stub.ConnectionServiceStubSettings;
+import com.google.common.util.concurrent.MoreExecutors;
+import com.google.iam.v1.GetIamPolicyRequest;
+import com.google.iam.v1.GetPolicyOptions;
+import com.google.iam.v1.Policy;
+import com.google.iam.v1.SetIamPolicyRequest;
+import com.google.iam.v1.TestIamPermissionsRequest;
+import com.google.iam.v1.TestIamPermissionsResponse;
+import com.google.protobuf.Empty;
+import com.google.protobuf.FieldMask;
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND SERVICE
+/**
+ * Service Description: Manages external data source connections and credentials.
+ *
+ * 

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * 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);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the connectionServiceClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of ConnectionServiceSettings to + * create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * ConnectionServiceSettings connectionServiceSettings =
+ *     ConnectionServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ConnectionServiceClient connectionServiceClient =
+ *     ConnectionServiceClient.create(connectionServiceSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * ConnectionServiceSettings connectionServiceSettings =
+ *     ConnectionServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ConnectionServiceClient connectionServiceClient =
+ *     ConnectionServiceClient.create(connectionServiceSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ConnectionServiceClient implements BackgroundResource { + private final ConnectionServiceSettings settings; + private final ConnectionServiceStub stub; + + /** Constructs an instance of ConnectionServiceClient with default settings. */ + public static final ConnectionServiceClient create() throws IOException { + return create(ConnectionServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ConnectionServiceClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final ConnectionServiceClient create(ConnectionServiceSettings settings) + throws IOException { + return new ConnectionServiceClient(settings); + } + + /** + * Constructs an instance of ConnectionServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer to use ConnectionServiceSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final ConnectionServiceClient create(ConnectionServiceStub stub) { + return new ConnectionServiceClient(stub); + } + + /** + * Constructs an instance of ConnectionServiceClient, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected ConnectionServiceClient(ConnectionServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ConnectionServiceStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected ConnectionServiceClient(ConnectionServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ConnectionServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ConnectionServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new connection. + * + *

Sample 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);
+   * }
+   * 
+ * + * @param parent Required. Parent resource name. Must be in the format + * `projects/{project_id}/locations/{location_id}` + * @param connection Required. Connection to create. + * @param connectionId Optional. Connection id that should be assigned to the created connection. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Connection createConnection( + LocationName parent, Connection connection, String connectionId) { + CreateConnectionRequest request = + CreateConnectionRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setConnection(connection) + .setConnectionId(connectionId) + .build(); + return createConnection(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new connection. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Connection connection = Connection.newBuilder().build();
+   *   String connectionId = "";
+   *   Connection response = connectionServiceClient.createConnection(parent.toString(), connection, connectionId);
+   * }
+   * 
+ * + * @param parent Required. Parent resource name. Must be in the format + * `projects/{project_id}/locations/{location_id}` + * @param connection Required. Connection to create. + * @param connectionId Optional. Connection id that should be assigned to the created connection. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Connection createConnection( + String parent, Connection connection, String connectionId) { + CreateConnectionRequest request = + CreateConnectionRequest.newBuilder() + .setParent(parent) + .setConnection(connection) + .setConnectionId(connectionId) + .build(); + return createConnection(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new connection. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Connection connection = Connection.newBuilder().build();
+   *   CreateConnectionRequest request = CreateConnectionRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setConnection(connection)
+   *     .build();
+   *   Connection response = connectionServiceClient.createConnection(request);
+   * }
+   * 
+ * + * @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 Connection createConnection(CreateConnectionRequest request) { + return createConnectionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new connection. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Connection connection = Connection.newBuilder().build();
+   *   CreateConnectionRequest request = CreateConnectionRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setConnection(connection)
+   *     .build();
+   *   ApiFuture<Connection> future = connectionServiceClient.createConnectionCallable().futureCall(request);
+   *   // Do something
+   *   Connection response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createConnectionCallable() { + return stub.createConnectionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns specified connection. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Connection response = connectionServiceClient.getConnection(name);
+   * }
+   * 
+ * + * @param name Required. Name of the requested 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 Connection getConnection(ConnectionName name) { + GetConnectionRequest request = + GetConnectionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getConnection(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns specified connection. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Connection response = connectionServiceClient.getConnection(name.toString());
+   * }
+   * 
+ * + * @param name Required. Name of the requested 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 Connection getConnection(String name) { + GetConnectionRequest request = GetConnectionRequest.newBuilder().setName(name).build(); + return getConnection(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns specified connection. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   GetConnectionRequest request = GetConnectionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Connection response = connectionServiceClient.getConnection(request);
+   * }
+   * 
+ * + * @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 Connection getConnection(GetConnectionRequest request) { + return getConnectionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns specified connection. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   GetConnectionRequest request = GetConnectionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Connection> future = connectionServiceClient.getConnectionCallable().futureCall(request);
+   *   // Do something
+   *   Connection response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getConnectionCallable() { + return stub.getConnectionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a list of connections in the given project. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   int pageSize = 0;
+   *   ListConnectionsRequest request = ListConnectionsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setPageSize(pageSize)
+   *     .build();
+   *   for (Connection element : connectionServiceClient.listConnections(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @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 ListConnectionsPagedResponse listConnections(ListConnectionsRequest request) { + return listConnectionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a list of connections in the given project. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   int pageSize = 0;
+   *   ListConnectionsRequest request = ListConnectionsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setPageSize(pageSize)
+   *     .build();
+   *   ApiFuture<ListConnectionsPagedResponse> future = connectionServiceClient.listConnectionsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Connection element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listConnectionsPagedCallable() { + return stub.listConnectionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a list of connections in the given project. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   int pageSize = 0;
+   *   ListConnectionsRequest request = ListConnectionsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setPageSize(pageSize)
+   *     .build();
+   *   while (true) {
+   *     ListConnectionsResponse response = connectionServiceClient.listConnectionsCallable().call(request);
+   *     for (Connection element : response.getConnectionsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listConnectionsCallable() { + return stub.listConnectionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified connection. For security reasons, also resets credential if connection + * properties are in the update field mask. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Connection connection = Connection.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Connection response = connectionServiceClient.updateConnection(name, connection, updateMask);
+   * }
+   * 
+ * + * @param name Required. Name of the connection to update, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * @param connection Required. Connection containing the updated fields. + * @param updateMask Required. Update mask for the connection fields to be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Connection updateConnection( + ConnectionName name, Connection connection, FieldMask updateMask) { + UpdateConnectionRequest request = + UpdateConnectionRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setConnection(connection) + .setUpdateMask(updateMask) + .build(); + return updateConnection(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified connection. For security reasons, also resets credential if connection + * properties are in the update field mask. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Connection connection = Connection.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Connection response = connectionServiceClient.updateConnection(name.toString(), connection, updateMask);
+   * }
+   * 
+ * + * @param name Required. Name of the connection to update, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * @param connection Required. Connection containing the updated fields. + * @param updateMask Required. Update mask for the connection fields to be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Connection updateConnection( + String name, Connection connection, FieldMask updateMask) { + UpdateConnectionRequest request = + UpdateConnectionRequest.newBuilder() + .setName(name) + .setConnection(connection) + .setUpdateMask(updateMask) + .build(); + return updateConnection(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified connection. For security reasons, also resets credential if connection + * properties are in the update field mask. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Connection connection = Connection.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateConnectionRequest request = UpdateConnectionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setConnection(connection)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   Connection response = connectionServiceClient.updateConnection(request);
+   * }
+   * 
+ * + * @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 Connection updateConnection(UpdateConnectionRequest request) { + return updateConnectionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified connection. For security reasons, also resets credential if connection + * properties are in the update field mask. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Connection connection = Connection.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateConnectionRequest request = UpdateConnectionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setConnection(connection)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   ApiFuture<Connection> future = connectionServiceClient.updateConnectionCallable().futureCall(request);
+   *   // Do something
+   *   Connection response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateConnectionCallable() { + return stub.updateConnectionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes connection and associated credential. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   connectionServiceClient.deleteConnection(name);
+   * }
+   * 
+ * + * @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. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   connectionServiceClient.deleteConnection(name.toString());
+   * }
+   * 
+ * + * @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. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   DeleteConnectionRequest request = DeleteConnectionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   connectionServiceClient.deleteConnection(request);
+   * }
+   * 
+ * + * @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. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   DeleteConnectionRequest request = DeleteConnectionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = connectionServiceClient.deleteConnectionCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable 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 + * and does not have a policy set. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   GetPolicyOptions options = GetPolicyOptions.newBuilder().build();
+   *   Policy response = connectionServiceClient.getIamPolicy(resource, options);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @param options OPTIONAL: A `GetPolicyOptions` object for specifying options to `GetIamPolicy`. + * This field is only used by Cloud IAM. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(ResourceName resource, GetPolicyOptions options) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setOptions(options) + .build(); + return getIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   GetPolicyOptions options = GetPolicyOptions.newBuilder().build();
+   *   Policy response = connectionServiceClient.getIamPolicy(resource.toString(), options);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @param options OPTIONAL: A `GetPolicyOptions` object for specifying options to `GetIamPolicy`. + * This field is only used by Cloud IAM. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(String resource, GetPolicyOptions options) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder().setResource(resource).setOptions(options).build(); + return getIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   Policy response = connectionServiceClient.getIamPolicy(request);
+   * }
+   * 
+ * + * @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 Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   ApiFuture<Policy> future = connectionServiceClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   Policy response = connectionServiceClient.setIamPolicy(resource, policy);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the + * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud + * Platform services (such as Projects) might reject them. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(ResourceName resource, Policy policy) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setPolicy(policy) + .build(); + return setIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   Policy response = connectionServiceClient.setIamPolicy(resource.toString(), policy);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the + * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud + * Platform services (such as Projects) might reject them. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(String resource, Policy policy) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); + return setIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setPolicy(policy)
+   *     .build();
+   *   Policy response = connectionServiceClient.setIamPolicy(request);
+   * }
+   * 
+ * + * @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 Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setPolicy(policy)
+   *     .build();
+   *   ApiFuture<Policy> future = connectionServiceClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a NOT_FOUND error. + * + *

Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response = connectionServiceClient.testIamPermissions(resource, permissions);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions( + ResourceName resource, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a NOT_FOUND error. + * + *

Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response = connectionServiceClient.testIamPermissions(resource.toString(), permissions);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions( + String resource, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a NOT_FOUND error. + * + *

Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .addAllPermissions(permissions)
+   *     .build();
+   *   TestIamPermissionsResponse response = connectionServiceClient.testIamPermissions(request);
+   * }
+   * 
+ * + * @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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a NOT_FOUND error. + * + *

Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *


+   * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
+   *   ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .addAllPermissions(permissions)
+   *     .build();
+   *   ApiFuture<TestIamPermissionsResponse> future = connectionServiceClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListConnectionsPagedResponse + extends AbstractPagedListResponse< + ListConnectionsRequest, + ListConnectionsResponse, + Connection, + ListConnectionsPage, + ListConnectionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListConnectionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListConnectionsPagedResponse apply(ListConnectionsPage input) { + return new ListConnectionsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListConnectionsPagedResponse(ListConnectionsPage page) { + super(page, ListConnectionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListConnectionsPage + extends AbstractPage< + ListConnectionsRequest, ListConnectionsResponse, Connection, ListConnectionsPage> { + + private ListConnectionsPage( + PageContext context, + ListConnectionsResponse response) { + super(context, response); + } + + private static ListConnectionsPage createEmptyPage() { + return new ListConnectionsPage(null, null); + } + + @Override + protected ListConnectionsPage createPage( + PageContext context, + ListConnectionsResponse response) { + return new ListConnectionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListConnectionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListConnectionsRequest, + ListConnectionsResponse, + Connection, + ListConnectionsPage, + ListConnectionsFixedSizeCollection> { + + private ListConnectionsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListConnectionsFixedSizeCollection createEmptyCollection() { + return new ListConnectionsFixedSizeCollection(null, 0); + } + + @Override + protected ListConnectionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListConnectionsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigqueryconnection/v1/ConnectionServiceSettings.java b/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigqueryconnection/v1/ConnectionServiceSettings.java new file mode 100644 index 00000000..5938f308 --- /dev/null +++ b/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigqueryconnection/v1/ConnectionServiceSettings.java @@ -0,0 +1,274 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigqueryconnection.v1; + +import static com.google.cloud.bigqueryconnection.v1.ConnectionServiceClient.ListConnectionsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.bigquery.connection.v1.Connection; +import com.google.cloud.bigquery.connection.v1.CreateConnectionRequest; +import com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest; +import com.google.cloud.bigquery.connection.v1.GetConnectionRequest; +import com.google.cloud.bigquery.connection.v1.ListConnectionsRequest; +import com.google.cloud.bigquery.connection.v1.ListConnectionsResponse; +import com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest; +import com.google.cloud.bigqueryconnection.v1.stub.ConnectionServiceStubSettings; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link ConnectionServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (bigqueryconnection.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

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. + * + *

For example, to set the total timeout of createConnection to 30 seconds: + * + *

+ * 
+ * ConnectionServiceSettings.Builder connectionServiceSettingsBuilder =
+ *     ConnectionServiceSettings.newBuilder();
+ * connectionServiceSettingsBuilder
+ *     .createConnectionSettings()
+ *     .setRetrySettings(
+ *         connectionServiceSettingsBuilder.createConnectionSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ConnectionServiceSettings connectionServiceSettings = connectionServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ConnectionServiceSettings extends ClientSettings { + /** Returns the object with the settings used for calls to createConnection. */ + public UnaryCallSettings createConnectionSettings() { + return ((ConnectionServiceStubSettings) getStubSettings()).createConnectionSettings(); + } + + /** Returns the object with the settings used for calls to getConnection. */ + public UnaryCallSettings getConnectionSettings() { + return ((ConnectionServiceStubSettings) getStubSettings()).getConnectionSettings(); + } + + /** Returns the object with the settings used for calls to listConnections. */ + public PagedCallSettings< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse> + listConnectionsSettings() { + return ((ConnectionServiceStubSettings) getStubSettings()).listConnectionsSettings(); + } + + /** Returns the object with the settings used for calls to updateConnection. */ + public UnaryCallSettings updateConnectionSettings() { + return ((ConnectionServiceStubSettings) getStubSettings()).updateConnectionSettings(); + } + + /** Returns the object with the settings used for calls to deleteConnection. */ + public UnaryCallSettings deleteConnectionSettings() { + return ((ConnectionServiceStubSettings) getStubSettings()).deleteConnectionSettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((ConnectionServiceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((ConnectionServiceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((ConnectionServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final ConnectionServiceSettings create(ConnectionServiceStubSettings stub) + throws IOException { + return new ConnectionServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ConnectionServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ConnectionServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ConnectionServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ConnectionServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ConnectionServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ConnectionServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ConnectionServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ConnectionServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ConnectionServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(ConnectionServiceStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(ConnectionServiceStubSettings.newBuilder()); + } + + protected Builder(ConnectionServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ConnectionServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public ConnectionServiceStubSettings.Builder getStubSettingsBuilder() { + return ((ConnectionServiceStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createConnection. */ + public UnaryCallSettings.Builder + createConnectionSettings() { + return getStubSettingsBuilder().createConnectionSettings(); + } + + /** Returns the builder for the settings used for calls to getConnection. */ + public UnaryCallSettings.Builder getConnectionSettings() { + return getStubSettingsBuilder().getConnectionSettings(); + } + + /** Returns the builder for the settings used for calls to listConnections. */ + public PagedCallSettings.Builder< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse> + listConnectionsSettings() { + return getStubSettingsBuilder().listConnectionsSettings(); + } + + /** Returns the builder for the settings used for calls to updateConnection. */ + public UnaryCallSettings.Builder + updateConnectionSettings() { + return getStubSettingsBuilder().updateConnectionSettings(); + } + + /** Returns the builder for the settings used for calls to deleteConnection. */ + public UnaryCallSettings.Builder deleteConnectionSettings() { + return getStubSettingsBuilder().deleteConnectionSettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public ConnectionServiceSettings build() throws IOException { + return new ConnectionServiceSettings(this); + } + } +} diff --git a/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigqueryconnection/v1/package-info.java b/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigqueryconnection/v1/package-info.java new file mode 100644 index 00000000..254d8027 --- /dev/null +++ b/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigqueryconnection/v1/package-info.java @@ -0,0 +1,42 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to BigQuery Connection API. + * + *

The interfaces provided are listed below, along with usage samples. + * + *

======================= ConnectionServiceClient ======================= + * + *

Service Description: Manages external data source connections and credentials. + * + *

Sample for ConnectionServiceClient: + * + *

+ * 
+ * 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);
+ * }
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +package com.google.cloud.bigqueryconnection.v1; + +import javax.annotation.Generated; diff --git a/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/ConnectionServiceStub.java b/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/ConnectionServiceStub.java new file mode 100644 index 00000000..94190eff --- /dev/null +++ b/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/ConnectionServiceStub.java @@ -0,0 +1,88 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigqueryconnection.v1.stub; + +import static com.google.cloud.bigqueryconnection.v1.ConnectionServiceClient.ListConnectionsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigquery.connection.v1.Connection; +import com.google.cloud.bigquery.connection.v1.CreateConnectionRequest; +import com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest; +import com.google.cloud.bigquery.connection.v1.GetConnectionRequest; +import com.google.cloud.bigquery.connection.v1.ListConnectionsRequest; +import com.google.cloud.bigquery.connection.v1.ListConnectionsResponse; +import com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for BigQuery Connection API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class ConnectionServiceStub implements BackgroundResource { + + public UnaryCallable createConnectionCallable() { + throw new UnsupportedOperationException("Not implemented: createConnectionCallable()"); + } + + public UnaryCallable getConnectionCallable() { + throw new UnsupportedOperationException("Not implemented: getConnectionCallable()"); + } + + public UnaryCallable + listConnectionsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listConnectionsPagedCallable()"); + } + + public UnaryCallable listConnectionsCallable() { + throw new UnsupportedOperationException("Not implemented: listConnectionsCallable()"); + } + + public UnaryCallable updateConnectionCallable() { + throw new UnsupportedOperationException("Not implemented: updateConnectionCallable()"); + } + + public UnaryCallable deleteConnectionCallable() { + throw new UnsupportedOperationException("Not implemented: deleteConnectionCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/ConnectionServiceStubSettings.java b/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/ConnectionServiceStubSettings.java new file mode 100644 index 00000000..89ceaa72 --- /dev/null +++ b/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/ConnectionServiceStubSettings.java @@ -0,0 +1,530 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigqueryconnection.v1.stub; + +import static com.google.cloud.bigqueryconnection.v1.ConnectionServiceClient.ListConnectionsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigquery.connection.v1.Connection; +import com.google.cloud.bigquery.connection.v1.CreateConnectionRequest; +import com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest; +import com.google.cloud.bigquery.connection.v1.GetConnectionRequest; +import com.google.cloud.bigquery.connection.v1.ListConnectionsRequest; +import com.google.cloud.bigquery.connection.v1.ListConnectionsResponse; +import com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link ConnectionServiceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (bigqueryconnection.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

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. + * + *

For example, to set the total timeout of createConnection to 30 seconds: + * + *

+ * 
+ * ConnectionServiceStubSettings.Builder connectionServiceSettingsBuilder =
+ *     ConnectionServiceStubSettings.newBuilder();
+ * connectionServiceSettingsBuilder
+ *     .createConnectionSettings()
+ *     .setRetrySettings(
+ *         connectionServiceSettingsBuilder.createConnectionSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ConnectionServiceStubSettings connectionServiceSettings = connectionServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ConnectionServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/bigquery") + .add("https://www.googleapis.com/auth/cloud-platform") + .build(); + + private final UnaryCallSettings createConnectionSettings; + private final UnaryCallSettings getConnectionSettings; + private final PagedCallSettings< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse> + listConnectionsSettings; + private final UnaryCallSettings updateConnectionSettings; + private final UnaryCallSettings deleteConnectionSettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + /** Returns the object with the settings used for calls to createConnection. */ + public UnaryCallSettings createConnectionSettings() { + return createConnectionSettings; + } + + /** Returns the object with the settings used for calls to getConnection. */ + public UnaryCallSettings getConnectionSettings() { + return getConnectionSettings; + } + + /** Returns the object with the settings used for calls to listConnections. */ + public PagedCallSettings< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse> + listConnectionsSettings() { + return listConnectionsSettings; + } + + /** Returns the object with the settings used for calls to updateConnection. */ + public UnaryCallSettings updateConnectionSettings() { + return updateConnectionSettings; + } + + /** Returns the object with the settings used for calls to deleteConnection. */ + public UnaryCallSettings deleteConnectionSettings() { + return deleteConnectionSettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ConnectionServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcConnectionServiceStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "bigqueryconnection.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ConnectionServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ConnectionServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createConnectionSettings = settingsBuilder.createConnectionSettings().build(); + getConnectionSettings = settingsBuilder.getConnectionSettings().build(); + listConnectionsSettings = settingsBuilder.listConnectionsSettings().build(); + updateConnectionSettings = settingsBuilder.updateConnectionSettings().build(); + deleteConnectionSettings = settingsBuilder.deleteConnectionSettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + private static final PagedListDescriptor< + ListConnectionsRequest, ListConnectionsResponse, Connection> + LIST_CONNECTIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListConnectionsRequest injectToken( + ListConnectionsRequest payload, String token) { + return ListConnectionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListConnectionsRequest injectPageSize( + ListConnectionsRequest payload, int pageSize) { + return ListConnectionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListConnectionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListConnectionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListConnectionsResponse payload) { + return payload.getConnectionsList() != null + ? payload.getConnectionsList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse> + LIST_CONNECTIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListConnectionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_CONNECTIONS_PAGE_STR_DESC, request, context); + return ListConnectionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for ConnectionServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder + createConnectionSettings; + private final UnaryCallSettings.Builder getConnectionSettings; + private final PagedCallSettings.Builder< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse> + listConnectionsSettings; + private final UnaryCallSettings.Builder + updateConnectionSettings; + private final UnaryCallSettings.Builder + deleteConnectionSettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listConnectionsSettings = PagedCallSettings.newBuilder(LIST_CONNECTIONS_PAGE_STR_FACT); + + updateConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createConnectionSettings, + getConnectionSettings, + listConnectionsSettings, + updateConnectionSettings, + deleteConnectionSettings, + getIamPolicySettings, + setIamPolicySettings, + testIamPermissionsSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .createConnectionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getConnectionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listConnectionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateConnectionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteConnectionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(ConnectionServiceStubSettings settings) { + super(settings); + + createConnectionSettings = settings.createConnectionSettings.toBuilder(); + getConnectionSettings = settings.getConnectionSettings.toBuilder(); + listConnectionsSettings = settings.listConnectionsSettings.toBuilder(); + updateConnectionSettings = settings.updateConnectionSettings.toBuilder(); + deleteConnectionSettings = settings.deleteConnectionSettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createConnectionSettings, + getConnectionSettings, + listConnectionsSettings, + updateConnectionSettings, + deleteConnectionSettings, + getIamPolicySettings, + setIamPolicySettings, + testIamPermissionsSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createConnection. */ + public UnaryCallSettings.Builder + createConnectionSettings() { + return createConnectionSettings; + } + + /** Returns the builder for the settings used for calls to getConnection. */ + public UnaryCallSettings.Builder getConnectionSettings() { + return getConnectionSettings; + } + + /** Returns the builder for the settings used for calls to listConnections. */ + public PagedCallSettings.Builder< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse> + listConnectionsSettings() { + return listConnectionsSettings; + } + + /** Returns the builder for the settings used for calls to updateConnection. */ + public UnaryCallSettings.Builder + updateConnectionSettings() { + return updateConnectionSettings; + } + + /** Returns the builder for the settings used for calls to deleteConnection. */ + public UnaryCallSettings.Builder deleteConnectionSettings() { + return deleteConnectionSettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public ConnectionServiceStubSettings build() throws IOException { + return new ConnectionServiceStubSettings(this); + } + } +} diff --git a/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/GrpcConnectionServiceCallableFactory.java b/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/GrpcConnectionServiceCallableFactory.java new file mode 100644 index 00000000..361af2a7 --- /dev/null +++ b/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/GrpcConnectionServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigqueryconnection.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for BigQuery Connection API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcConnectionServiceCallableFactory implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/GrpcConnectionServiceStub.java b/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/GrpcConnectionServiceStub.java new file mode 100644 index 00000000..f29e9d55 --- /dev/null +++ b/google-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/GrpcConnectionServiceStub.java @@ -0,0 +1,399 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigqueryconnection.v1.stub; + +import static com.google.cloud.bigqueryconnection.v1.ConnectionServiceClient.ListConnectionsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigquery.connection.v1.Connection; +import com.google.cloud.bigquery.connection.v1.CreateConnectionRequest; +import com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest; +import com.google.cloud.bigquery.connection.v1.GetConnectionRequest; +import com.google.cloud.bigquery.connection.v1.ListConnectionsRequest; +import com.google.cloud.bigquery.connection.v1.ListConnectionsResponse; +import com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest; +import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for BigQuery Connection API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcConnectionServiceStub extends ConnectionServiceStub { + + private static final MethodDescriptor + createConnectionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.connection.v1.ConnectionService/CreateConnection") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateConnectionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Connection.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getConnectionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.connection.v1.ConnectionService/GetConnection") + .setRequestMarshaller( + ProtoUtils.marshaller(GetConnectionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Connection.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listConnectionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.connection.v1.ConnectionService/ListConnections") + .setRequestMarshaller( + ProtoUtils.marshaller(ListConnectionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListConnectionsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateConnectionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.connection.v1.ConnectionService/UpdateConnection") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateConnectionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Connection.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteConnectionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.connection.v1.ConnectionService/DeleteConnection") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteConnectionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.bigquery.connection.v1.ConnectionService/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.bigquery.connection.v1.ConnectionService/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.bigquery.connection.v1.ConnectionService/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable createConnectionCallable; + private final UnaryCallable getConnectionCallable; + private final UnaryCallable + listConnectionsCallable; + private final UnaryCallable + listConnectionsPagedCallable; + private final UnaryCallable updateConnectionCallable; + private final UnaryCallable deleteConnectionCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcConnectionServiceStub create(ConnectionServiceStubSettings settings) + throws IOException { + return new GrpcConnectionServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcConnectionServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcConnectionServiceStub( + ConnectionServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcConnectionServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcConnectionServiceStub( + ConnectionServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcConnectionServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcConnectionServiceStub( + ConnectionServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcConnectionServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcConnectionServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcConnectionServiceStub( + ConnectionServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings createConnectionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createConnectionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateConnectionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getConnectionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getConnectionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetConnectionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + listConnectionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listConnectionsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListConnectionsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateConnectionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateConnectionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateConnectionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteConnectionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteConnectionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteConnectionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetIamPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(SetIamPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(TestIamPermissionsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + + this.createConnectionCallable = + callableFactory.createUnaryCallable( + createConnectionTransportSettings, settings.createConnectionSettings(), clientContext); + this.getConnectionCallable = + callableFactory.createUnaryCallable( + getConnectionTransportSettings, settings.getConnectionSettings(), clientContext); + this.listConnectionsCallable = + callableFactory.createUnaryCallable( + listConnectionsTransportSettings, settings.listConnectionsSettings(), clientContext); + this.listConnectionsPagedCallable = + callableFactory.createPagedCallable( + listConnectionsTransportSettings, settings.listConnectionsSettings(), clientContext); + this.updateConnectionCallable = + callableFactory.createUnaryCallable( + updateConnectionTransportSettings, settings.updateConnectionSettings(), clientContext); + this.deleteConnectionCallable = + callableFactory.createUnaryCallable( + deleteConnectionTransportSettings, settings.deleteConnectionSettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable createConnectionCallable() { + return createConnectionCallable; + } + + public UnaryCallable getConnectionCallable() { + return getConnectionCallable; + } + + public UnaryCallable + listConnectionsPagedCallable() { + return listConnectionsPagedCallable; + } + + public UnaryCallable listConnectionsCallable() { + return listConnectionsCallable; + } + + public UnaryCallable updateConnectionCallable() { + return updateConnectionCallable; + } + + public UnaryCallable deleteConnectionCallable() { + return deleteConnectionCallable; + } + + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-bigqueryconnection/src/test/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceClientTest.java b/google-cloud-bigqueryconnection/src/test/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceClientTest.java index 6aa6a630..a8755208 100644 --- a/google-cloud-bigqueryconnection/src/test/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceClientTest.java +++ b/google-cloud-bigqueryconnection/src/test/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceClientTest.java @@ -96,6 +96,43 @@ public void tearDown() throws Exception { client.close(); } + @Test + @SuppressWarnings("all") + public void deleteConnectionTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockConnectionService.addResponse(expectedResponse); + + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + + client.deleteConnection(name); + + List actualRequests = mockConnectionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteConnectionRequest actualRequest = (DeleteConnectionRequest) actualRequests.get(0); + + Assert.assertEquals(name, ConnectionName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteConnectionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConnectionService.addException(exception); + + try { + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + + client.deleteConnection(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void createConnectionTest() { @@ -348,43 +385,6 @@ public void updateConnectionCredentialExceptionTest() throws Exception { } } - @Test - @SuppressWarnings("all") - public void deleteConnectionTest() { - Empty expectedResponse = Empty.newBuilder().build(); - mockConnectionService.addResponse(expectedResponse); - - ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); - - client.deleteConnection(name); - - List actualRequests = mockConnectionService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteConnectionRequest actualRequest = (DeleteConnectionRequest) actualRequests.get(0); - - Assert.assertEquals(name, ConnectionName.parse(actualRequest.getName())); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - @SuppressWarnings("all") - public void deleteConnectionExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); - mockConnectionService.addException(exception); - - try { - ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); - - client.deleteConnection(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } - } - @Test @SuppressWarnings("all") public void getIamPolicyTest() { diff --git a/google-cloud-bigqueryconnection/src/test/java/com/google/cloud/bigqueryconnection/v1/ConnectionServiceClientTest.java b/google-cloud-bigqueryconnection/src/test/java/com/google/cloud/bigqueryconnection/v1/ConnectionServiceClientTest.java new file mode 100644 index 00000000..66657fd2 --- /dev/null +++ b/google-cloud-bigqueryconnection/src/test/java/com/google/cloud/bigqueryconnection/v1/ConnectionServiceClientTest.java @@ -0,0 +1,493 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigqueryconnection.v1; + +import static com.google.cloud.bigqueryconnection.v1.ConnectionServiceClient.ListConnectionsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.resourcenames.ResourceName; +import com.google.cloud.bigquery.connection.v1.Connection; +import com.google.cloud.bigquery.connection.v1.ConnectionName; +import com.google.cloud.bigquery.connection.v1.CreateConnectionRequest; +import com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest; +import com.google.cloud.bigquery.connection.v1.GetConnectionRequest; +import com.google.cloud.bigquery.connection.v1.ListConnectionsRequest; +import com.google.cloud.bigquery.connection.v1.ListConnectionsResponse; +import com.google.cloud.bigquery.connection.v1.LocationName; +import com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +import java.util.UUID; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class ConnectionServiceClientTest { + private static MockConnectionService mockConnectionService; + private static MockServiceHelper serviceHelper; + private ConnectionServiceClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockConnectionService = new MockConnectionService(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockConnectionService)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + ConnectionServiceSettings settings = + ConnectionServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ConnectionServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void createConnectionTest() { + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + String friendlyName = "friendlyName1451097503"; + String description = "description-1724546052"; + long creationTime = 1932333101L; + long lastModifiedTime = 671513446L; + boolean hasCredential = true; + Connection expectedResponse = + Connection.newBuilder() + .setName(name.toString()) + .setFriendlyName(friendlyName) + .setDescription(description) + .setCreationTime(creationTime) + .setLastModifiedTime(lastModifiedTime) + .setHasCredential(hasCredential) + .build(); + mockConnectionService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Connection connection = Connection.newBuilder().build(); + String connectionId = "connectionId-513204708"; + + Connection actualResponse = client.createConnection(parent, connection, connectionId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConnectionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateConnectionRequest actualRequest = (CreateConnectionRequest) actualRequests.get(0); + + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(connection, actualRequest.getConnection()); + Assert.assertEquals(connectionId, actualRequest.getConnectionId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createConnectionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConnectionService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Connection connection = Connection.newBuilder().build(); + String connectionId = "connectionId-513204708"; + + client.createConnection(parent, connection, connectionId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getConnectionTest() { + ConnectionName name2 = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + String friendlyName = "friendlyName1451097503"; + String description = "description-1724546052"; + long creationTime = 1932333101L; + long lastModifiedTime = 671513446L; + boolean hasCredential = true; + Connection expectedResponse = + Connection.newBuilder() + .setName(name2.toString()) + .setFriendlyName(friendlyName) + .setDescription(description) + .setCreationTime(creationTime) + .setLastModifiedTime(lastModifiedTime) + .setHasCredential(hasCredential) + .build(); + mockConnectionService.addResponse(expectedResponse); + + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + + Connection actualResponse = client.getConnection(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConnectionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetConnectionRequest actualRequest = (GetConnectionRequest) actualRequests.get(0); + + Assert.assertEquals(name, ConnectionName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getConnectionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConnectionService.addException(exception); + + try { + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + + client.getConnection(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listConnectionsTest() { + String nextPageToken = ""; + Connection connectionsElement = Connection.newBuilder().build(); + List connections = Arrays.asList(connectionsElement); + ListConnectionsResponse expectedResponse = + ListConnectionsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllConnections(connections) + .build(); + mockConnectionService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + int pageSize = 883849137; + ListConnectionsRequest request = + ListConnectionsRequest.newBuilder() + .setParent(parent.toString()) + .setPageSize(pageSize) + .build(); + + ListConnectionsPagedResponse pagedListResponse = client.listConnections(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getConnectionsList().get(0), resources.get(0)); + + List actualRequests = mockConnectionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListConnectionsRequest actualRequest = (ListConnectionsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(pageSize, actualRequest.getPageSize()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listConnectionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConnectionService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + int pageSize = 883849137; + ListConnectionsRequest request = + ListConnectionsRequest.newBuilder() + .setParent(parent.toString()) + .setPageSize(pageSize) + .build(); + + client.listConnections(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateConnectionTest() { + ConnectionName name2 = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + String friendlyName = "friendlyName1451097503"; + String description = "description-1724546052"; + long creationTime = 1932333101L; + long lastModifiedTime = 671513446L; + boolean hasCredential = true; + Connection expectedResponse = + Connection.newBuilder() + .setName(name2.toString()) + .setFriendlyName(friendlyName) + .setDescription(description) + .setCreationTime(creationTime) + .setLastModifiedTime(lastModifiedTime) + .setHasCredential(hasCredential) + .build(); + mockConnectionService.addResponse(expectedResponse); + + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + Connection connection = Connection.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Connection actualResponse = client.updateConnection(name, connection, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConnectionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateConnectionRequest actualRequest = (UpdateConnectionRequest) actualRequests.get(0); + + Assert.assertEquals(name, ConnectionName.parse(actualRequest.getName())); + Assert.assertEquals(connection, actualRequest.getConnection()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateConnectionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConnectionService.addException(exception); + + try { + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + Connection connection = Connection.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateConnection(name, connection, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteConnectionTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockConnectionService.addResponse(expectedResponse); + + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + + client.deleteConnection(name); + + List actualRequests = mockConnectionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteConnectionRequest actualRequest = (DeleteConnectionRequest) actualRequests.get(0); + + Assert.assertEquals(name, ConnectionName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteConnectionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConnectionService.addException(exception); + + try { + ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + + client.deleteConnection(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getIamPolicyTest() { + int version = 351608024; + ByteString etag = ByteString.copyFromUtf8("21"); + Policy expectedResponse = Policy.newBuilder().setVersion(version).setEtag(etag).build(); + mockConnectionService.addResponse(expectedResponse); + + ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + GetPolicyOptions options = GetPolicyOptions.newBuilder().build(); + + Policy actualResponse = client.getIamPolicy(resource, options); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConnectionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = (GetIamPolicyRequest) actualRequests.get(0); + + Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource())); + Assert.assertEquals(options, actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConnectionService.addException(exception); + + try { + ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + GetPolicyOptions options = GetPolicyOptions.newBuilder().build(); + + client.getIamPolicy(resource, options); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setIamPolicyTest() { + int version = 351608024; + ByteString etag = ByteString.copyFromUtf8("21"); + Policy expectedResponse = Policy.newBuilder().setVersion(version).setEtag(etag).build(); + mockConnectionService.addResponse(expectedResponse); + + ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + Policy policy = Policy.newBuilder().build(); + + Policy actualResponse = client.setIamPolicy(resource, policy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConnectionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = (SetIamPolicyRequest) actualRequests.get(0); + + Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource())); + Assert.assertEquals(policy, actualRequest.getPolicy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConnectionService.addException(exception); + + try { + ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + Policy policy = Policy.newBuilder().build(); + + client.setIamPolicy(resource, policy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsTest() { + TestIamPermissionsResponse expectedResponse = TestIamPermissionsResponse.newBuilder().build(); + mockConnectionService.addResponse(expectedResponse); + + ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + List permissions = new ArrayList<>(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConnectionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = (TestIamPermissionsRequest) actualRequests.get(0); + + Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource())); + Assert.assertEquals(permissions, actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockConnectionService.addException(exception); + + try { + ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + List permissions = new ArrayList<>(); + + client.testIamPermissions(resource, permissions); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-bigqueryconnection/src/test/java/com/google/cloud/bigqueryconnection/v1/MockConnectionService.java b/google-cloud-bigqueryconnection/src/test/java/com/google/cloud/bigqueryconnection/v1/MockConnectionService.java new file mode 100644 index 00000000..3ef04b3e --- /dev/null +++ b/google-cloud-bigqueryconnection/src/test/java/com/google/cloud/bigqueryconnection/v1/MockConnectionService.java @@ -0,0 +1,57 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigqueryconnection.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockConnectionService implements MockGrpcService { + private final MockConnectionServiceImpl serviceImpl; + + public MockConnectionService() { + serviceImpl = new MockConnectionServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-bigqueryconnection/src/test/java/com/google/cloud/bigqueryconnection/v1/MockConnectionServiceImpl.java b/google-cloud-bigqueryconnection/src/test/java/com/google/cloud/bigqueryconnection/v1/MockConnectionServiceImpl.java new file mode 100644 index 00000000..cc8f421e --- /dev/null +++ b/google-cloud-bigqueryconnection/src/test/java/com/google/cloud/bigqueryconnection/v1/MockConnectionServiceImpl.java @@ -0,0 +1,190 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigqueryconnection.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.bigquery.connection.v1.Connection; +import com.google.cloud.bigquery.connection.v1.ConnectionServiceGrpc.ConnectionServiceImplBase; +import com.google.cloud.bigquery.connection.v1.CreateConnectionRequest; +import com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest; +import com.google.cloud.bigquery.connection.v1.GetConnectionRequest; +import com.google.cloud.bigquery.connection.v1.ListConnectionsRequest; +import com.google.cloud.bigquery.connection.v1.ListConnectionsResponse; +import com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockConnectionServiceImpl extends ConnectionServiceImplBase { + private List requests; + private Queue responses; + + public MockConnectionServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void createConnection( + CreateConnectionRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Connection) { + requests.add(request); + responseObserver.onNext((Connection) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getConnection( + GetConnectionRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Connection) { + requests.add(request); + responseObserver.onNext((Connection) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listConnections( + ListConnectionsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListConnectionsResponse) { + requests.add(request); + responseObserver.onNext((ListConnectionsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateConnection( + UpdateConnectionRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Connection) { + requests.add(request); + responseObserver.onNext((Connection) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteConnection( + DeleteConnectionRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext((Policy) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext((Policy) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext((TestIamPermissionsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/grpc-google-cloud-bigqueryconnection-v1/pom.xml b/grpc-google-cloud-bigqueryconnection-v1/pom.xml new file mode 100644 index 00000000..7df4e455 --- /dev/null +++ b/grpc-google-cloud-bigqueryconnection-v1/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-bigqueryconnection-v1 + 0.0.1-SNAPSHOT + grpc-google-cloud-bigqueryconnection-v1 + GRPC library for grpc-google-cloud-bigqueryconnection-v1 + + com.google.cloud + google-cloud-bigqueryconnection-parent + 0.0.1-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-cloud-bigqueryconnection-v1 + + + com.google.guava + guava + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/grpc-google-cloud-bigquery-connection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceGrpc.java b/grpc-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ConnectionServiceGrpc.java similarity index 68% rename from grpc-google-cloud-bigquery-connection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceGrpc.java rename to grpc-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ConnectionServiceGrpc.java index 16d093ef..c6c1d7c2 100644 --- a/grpc-google-cloud-bigquery-connection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceGrpc.java +++ b/grpc-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ConnectionServiceGrpc.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.cloud.bigquery.connection.v1beta1; +package com.google.cloud.bigquery.connection.v1; import static io.grpc.MethodDescriptor.generateFullMethodName; import static io.grpc.stub.ClientCalls.asyncUnaryCall; @@ -31,34 +31,31 @@ */ @javax.annotation.Generated( value = "by gRPC proto compiler", - comments = "Source: google/cloud/bigquery/connection/v1beta1/connection.proto") + comments = "Source: google/cloud/bigquery/connection/v1/connection.proto") public final class ConnectionServiceGrpc { private ConnectionServiceGrpc() {} - public static final String SERVICE_NAME = - "google.cloud.bigquery.connection.v1beta1.ConnectionService"; + public static final String SERVICE_NAME = "google.cloud.bigquery.connection.v1.ConnectionService"; // Static method descriptors that strictly reflect the proto. private static volatile io.grpc.MethodDescriptor< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + com.google.cloud.bigquery.connection.v1.CreateConnectionRequest, + com.google.cloud.bigquery.connection.v1.Connection> getCreateConnectionMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "CreateConnection", - requestType = - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest - .class, - responseType = com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.class, + requestType = com.google.cloud.bigquery.connection.v1.CreateConnectionRequest.class, + responseType = com.google.cloud.bigquery.connection.v1.Connection.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + com.google.cloud.bigquery.connection.v1.CreateConnectionRequest, + com.google.cloud.bigquery.connection.v1.Connection> getCreateConnectionMethod() { io.grpc.MethodDescriptor< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + com.google.cloud.bigquery.connection.v1.CreateConnectionRequest, + com.google.cloud.bigquery.connection.v1.Connection> getCreateConnectionMethod; if ((getCreateConnectionMethod = ConnectionServiceGrpc.getCreateConnectionMethod) == null) { synchronized (ConnectionServiceGrpc.class) { @@ -66,21 +63,20 @@ private ConnectionServiceGrpc() {} ConnectionServiceGrpc.getCreateConnectionMethod = getCreateConnectionMethod = io.grpc.MethodDescriptor - . + . newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateConnection")) .setSampledToLocalTracing(true) .setRequestMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CreateConnectionRequest.getDefaultInstance())) + com.google.cloud.bigquery.connection.v1.CreateConnectionRequest + .getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .Connection.getDefaultInstance())) + com.google.cloud.bigquery.connection.v1.Connection + .getDefaultInstance())) .setSchemaDescriptor( new ConnectionServiceMethodDescriptorSupplier("CreateConnection")) .build(); @@ -91,23 +87,22 @@ private ConnectionServiceGrpc() {} } private static volatile io.grpc.MethodDescriptor< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + com.google.cloud.bigquery.connection.v1.GetConnectionRequest, + com.google.cloud.bigquery.connection.v1.Connection> getGetConnectionMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "GetConnection", - requestType = - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest.class, - responseType = com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.class, + requestType = com.google.cloud.bigquery.connection.v1.GetConnectionRequest.class, + responseType = com.google.cloud.bigquery.connection.v1.Connection.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + com.google.cloud.bigquery.connection.v1.GetConnectionRequest, + com.google.cloud.bigquery.connection.v1.Connection> getGetConnectionMethod() { io.grpc.MethodDescriptor< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + com.google.cloud.bigquery.connection.v1.GetConnectionRequest, + com.google.cloud.bigquery.connection.v1.Connection> getGetConnectionMethod; if ((getGetConnectionMethod = ConnectionServiceGrpc.getGetConnectionMethod) == null) { synchronized (ConnectionServiceGrpc.class) { @@ -115,21 +110,20 @@ private ConnectionServiceGrpc() {} ConnectionServiceGrpc.getGetConnectionMethod = getGetConnectionMethod = io.grpc.MethodDescriptor - . + . newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetConnection")) .setSampledToLocalTracing(true) .setRequestMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .GetConnectionRequest.getDefaultInstance())) + com.google.cloud.bigquery.connection.v1.GetConnectionRequest + .getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .Connection.getDefaultInstance())) + com.google.cloud.bigquery.connection.v1.Connection + .getDefaultInstance())) .setSchemaDescriptor( new ConnectionServiceMethodDescriptorSupplier("GetConnection")) .build(); @@ -140,25 +134,22 @@ private ConnectionServiceGrpc() {} } private static volatile io.grpc.MethodDescriptor< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse> + com.google.cloud.bigquery.connection.v1.ListConnectionsRequest, + com.google.cloud.bigquery.connection.v1.ListConnectionsResponse> getListConnectionsMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "ListConnections", - requestType = - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest.class, - responseType = - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse - .class, + requestType = com.google.cloud.bigquery.connection.v1.ListConnectionsRequest.class, + responseType = com.google.cloud.bigquery.connection.v1.ListConnectionsResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse> + com.google.cloud.bigquery.connection.v1.ListConnectionsRequest, + com.google.cloud.bigquery.connection.v1.ListConnectionsResponse> getListConnectionsMethod() { io.grpc.MethodDescriptor< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse> + com.google.cloud.bigquery.connection.v1.ListConnectionsRequest, + com.google.cloud.bigquery.connection.v1.ListConnectionsResponse> getListConnectionsMethod; if ((getListConnectionsMethod = ConnectionServiceGrpc.getListConnectionsMethod) == null) { synchronized (ConnectionServiceGrpc.class) { @@ -166,22 +157,20 @@ private ConnectionServiceGrpc() {} ConnectionServiceGrpc.getListConnectionsMethod = getListConnectionsMethod = io.grpc.MethodDescriptor - . + . newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListConnections")) .setSampledToLocalTracing(true) .setRequestMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsRequest.getDefaultInstance())) + com.google.cloud.bigquery.connection.v1.ListConnectionsRequest + .getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsResponse.getDefaultInstance())) + com.google.cloud.bigquery.connection.v1.ListConnectionsResponse + .getDefaultInstance())) .setSchemaDescriptor( new ConnectionServiceMethodDescriptorSupplier("ListConnections")) .build(); @@ -192,24 +181,22 @@ private ConnectionServiceGrpc() {} } private static volatile io.grpc.MethodDescriptor< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest, + com.google.cloud.bigquery.connection.v1.Connection> getUpdateConnectionMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "UpdateConnection", - requestType = - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest - .class, - responseType = com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.class, + requestType = com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest.class, + responseType = com.google.cloud.bigquery.connection.v1.Connection.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest, + com.google.cloud.bigquery.connection.v1.Connection> getUpdateConnectionMethod() { io.grpc.MethodDescriptor< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest, + com.google.cloud.bigquery.connection.v1.Connection> getUpdateConnectionMethod; if ((getUpdateConnectionMethod = ConnectionServiceGrpc.getUpdateConnectionMethod) == null) { synchronized (ConnectionServiceGrpc.class) { @@ -217,21 +204,20 @@ private ConnectionServiceGrpc() {} ConnectionServiceGrpc.getUpdateConnectionMethod = getUpdateConnectionMethod = io.grpc.MethodDescriptor - . + . newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateConnection")) .setSampledToLocalTracing(true) .setRequestMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionRequest.getDefaultInstance())) + com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest + .getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .Connection.getDefaultInstance())) + com.google.cloud.bigquery.connection.v1.Connection + .getDefaultInstance())) .setSchemaDescriptor( new ConnectionServiceMethodDescriptorSupplier("UpdateConnection")) .build(); @@ -242,81 +228,21 @@ private ConnectionServiceGrpc() {} } private static volatile io.grpc.MethodDescriptor< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest, - com.google.protobuf.Empty> - getUpdateConnectionCredentialMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "UpdateConnectionCredential", - requestType = - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest.class, - responseType = com.google.protobuf.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest, - com.google.protobuf.Empty> - getUpdateConnectionCredentialMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest, - com.google.protobuf.Empty> - getUpdateConnectionCredentialMethod; - if ((getUpdateConnectionCredentialMethod = - ConnectionServiceGrpc.getUpdateConnectionCredentialMethod) - == null) { - synchronized (ConnectionServiceGrpc.class) { - if ((getUpdateConnectionCredentialMethod = - ConnectionServiceGrpc.getUpdateConnectionCredentialMethod) - == null) { - ConnectionServiceGrpc.getUpdateConnectionCredentialMethod = - getUpdateConnectionCredentialMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - generateFullMethodName(SERVICE_NAME, "UpdateConnectionCredential")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.protobuf.Empty.getDefaultInstance())) - .setSchemaDescriptor( - new ConnectionServiceMethodDescriptorSupplier( - "UpdateConnectionCredential")) - .build(); - } - } - } - return getUpdateConnectionCredentialMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest, + com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest, com.google.protobuf.Empty> getDeleteConnectionMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "DeleteConnection", - requestType = - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest - .class, + requestType = com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest.class, responseType = com.google.protobuf.Empty.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest, + com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest, com.google.protobuf.Empty> getDeleteConnectionMethod() { io.grpc.MethodDescriptor< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest, + com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest, com.google.protobuf.Empty> getDeleteConnectionMethod; if ((getDeleteConnectionMethod = ConnectionServiceGrpc.getDeleteConnectionMethod) == null) { @@ -325,8 +251,7 @@ private ConnectionServiceGrpc() {} ConnectionServiceGrpc.getDeleteConnectionMethod = getDeleteConnectionMethod = io.grpc.MethodDescriptor - . newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) @@ -334,8 +259,8 @@ private ConnectionServiceGrpc() {} .setSampledToLocalTracing(true) .setRequestMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .DeleteConnectionRequest.getDefaultInstance())) + com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest + .getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( com.google.protobuf.Empty.getDefaultInstance())) @@ -528,10 +453,8 @@ public abstract static class ConnectionServiceImplBase implements io.grpc.Bindab * */ public void createConnection( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest - request, - io.grpc.stub.StreamObserver< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + com.google.cloud.bigquery.connection.v1.CreateConnectionRequest request, + io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getCreateConnectionMethod(), responseObserver); } @@ -544,9 +467,8 @@ public void createConnection( * */ public void getConnection( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest request, - io.grpc.stub.StreamObserver< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + com.google.cloud.bigquery.connection.v1.GetConnectionRequest request, + io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getGetConnectionMethod(), responseObserver); } @@ -559,10 +481,8 @@ public void getConnection( * */ public void listConnections( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest request, - io.grpc.stub.StreamObserver< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsResponse> + com.google.cloud.bigquery.connection.v1.ListConnectionsRequest request, + io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getListConnectionsMethod(), responseObserver); } @@ -576,29 +496,12 @@ public void listConnections( * */ public void updateConnection( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest - request, - io.grpc.stub.StreamObserver< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest request, + io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getUpdateConnectionMethod(), responseObserver); } - /** - * - * - *
-     * Sets the credential for the specified connection.
-     * 
- */ - public void updateConnectionCredential( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest - request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getUpdateConnectionCredentialMethod(), responseObserver); - } - /** * * @@ -607,8 +510,7 @@ public void updateConnectionCredential( * */ public void deleteConnection( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest - request, + com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getDeleteConnectionMethod(), responseObserver); } @@ -669,47 +571,35 @@ public final io.grpc.ServerServiceDefinition bindService() { getCreateConnectionMethod(), asyncUnaryCall( new MethodHandlers< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CreateConnectionRequest, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection>( + com.google.cloud.bigquery.connection.v1.CreateConnectionRequest, + com.google.cloud.bigquery.connection.v1.Connection>( this, METHODID_CREATE_CONNECTION))) .addMethod( getGetConnectionMethod(), asyncUnaryCall( new MethodHandlers< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .GetConnectionRequest, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection>( + com.google.cloud.bigquery.connection.v1.GetConnectionRequest, + com.google.cloud.bigquery.connection.v1.Connection>( this, METHODID_GET_CONNECTION))) .addMethod( getListConnectionsMethod(), asyncUnaryCall( new MethodHandlers< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsRequest, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsResponse>(this, METHODID_LIST_CONNECTIONS))) + com.google.cloud.bigquery.connection.v1.ListConnectionsRequest, + com.google.cloud.bigquery.connection.v1.ListConnectionsResponse>( + this, METHODID_LIST_CONNECTIONS))) .addMethod( getUpdateConnectionMethod(), asyncUnaryCall( new MethodHandlers< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionRequest, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection>( + com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest, + com.google.cloud.bigquery.connection.v1.Connection>( this, METHODID_UPDATE_CONNECTION))) - .addMethod( - getUpdateConnectionCredentialMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest, - com.google.protobuf.Empty>(this, METHODID_UPDATE_CONNECTION_CREDENTIAL))) .addMethod( getDeleteConnectionMethod(), asyncUnaryCall( new MethodHandlers< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .DeleteConnectionRequest, + com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest, com.google.protobuf.Empty>(this, METHODID_DELETE_CONNECTION))) .addMethod( getGetIamPolicyMethod(), @@ -761,10 +651,8 @@ protected ConnectionServiceStub build( * */ public void createConnection( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest - request, - io.grpc.stub.StreamObserver< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + com.google.cloud.bigquery.connection.v1.CreateConnectionRequest request, + io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( getChannel().newCall(getCreateConnectionMethod(), getCallOptions()), @@ -780,9 +668,8 @@ public void createConnection( * */ public void getConnection( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest request, - io.grpc.stub.StreamObserver< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + com.google.cloud.bigquery.connection.v1.GetConnectionRequest request, + io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( getChannel().newCall(getGetConnectionMethod(), getCallOptions()), @@ -798,10 +685,8 @@ public void getConnection( * */ public void listConnections( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest request, - io.grpc.stub.StreamObserver< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsResponse> + com.google.cloud.bigquery.connection.v1.ListConnectionsRequest request, + io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( getChannel().newCall(getListConnectionsMethod(), getCallOptions()), @@ -818,10 +703,8 @@ public void listConnections( * */ public void updateConnection( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest - request, - io.grpc.stub.StreamObserver< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> + com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest request, + io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( getChannel().newCall(getUpdateConnectionMethod(), getCallOptions()), @@ -829,24 +712,6 @@ public void updateConnection( responseObserver); } - /** - * - * - *
-     * Sets the credential for the specified connection.
-     * 
- */ - public void updateConnectionCredential( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest - request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getUpdateConnectionCredentialMethod(), getCallOptions()), - request, - responseObserver); - } - /** * * @@ -855,8 +720,7 @@ public void updateConnectionCredential( * */ public void deleteConnection( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest - request, + com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( getChannel().newCall(getDeleteConnectionMethod(), getCallOptions()), @@ -950,9 +814,8 @@ protected ConnectionServiceBlockingStub build( * Creates a new connection. * */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection createConnection( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest - request) { + public com.google.cloud.bigquery.connection.v1.Connection createConnection( + com.google.cloud.bigquery.connection.v1.CreateConnectionRequest request) { return blockingUnaryCall( getChannel(), getCreateConnectionMethod(), getCallOptions(), request); } @@ -964,8 +827,8 @@ public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection c * Returns specified connection. * */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection getConnection( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest request) { + public com.google.cloud.bigquery.connection.v1.Connection getConnection( + com.google.cloud.bigquery.connection.v1.GetConnectionRequest request) { return blockingUnaryCall(getChannel(), getGetConnectionMethod(), getCallOptions(), request); } @@ -976,10 +839,8 @@ public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection g * Returns a list of connections in the given project. * */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse - listConnections( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest - request) { + public com.google.cloud.bigquery.connection.v1.ListConnectionsResponse listConnections( + com.google.cloud.bigquery.connection.v1.ListConnectionsRequest request) { return blockingUnaryCall(getChannel(), getListConnectionsMethod(), getCallOptions(), request); } @@ -991,28 +852,12 @@ public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection g * credential if connection properties are in the update field mask. * */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection updateConnection( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest - request) { + public com.google.cloud.bigquery.connection.v1.Connection updateConnection( + com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest request) { return blockingUnaryCall( getChannel(), getUpdateConnectionMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Sets the credential for the specified connection.
-     * 
- */ - public com.google.protobuf.Empty updateConnectionCredential( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest - request) { - return blockingUnaryCall( - getChannel(), getUpdateConnectionCredentialMethod(), getCallOptions(), request); - } - /** * * @@ -1021,8 +866,7 @@ public com.google.protobuf.Empty updateConnectionCredential( * */ public com.google.protobuf.Empty deleteConnection( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest - request) { + com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest request) { return blockingUnaryCall( getChannel(), getDeleteConnectionMethod(), getCallOptions(), request); } @@ -1099,10 +943,8 @@ protected ConnectionServiceFutureStub build( * */ public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> - createConnection( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest - request) { + com.google.cloud.bigquery.connection.v1.Connection> + createConnection(com.google.cloud.bigquery.connection.v1.CreateConnectionRequest request) { return futureUnaryCall( getChannel().newCall(getCreateConnectionMethod(), getCallOptions()), request); } @@ -1115,10 +957,8 @@ protected ConnectionServiceFutureStub build( * */ public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> - getConnection( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest - request) { + com.google.cloud.bigquery.connection.v1.Connection> + getConnection(com.google.cloud.bigquery.connection.v1.GetConnectionRequest request) { return futureUnaryCall( getChannel().newCall(getGetConnectionMethod(), getCallOptions()), request); } @@ -1131,10 +971,8 @@ protected ConnectionServiceFutureStub build( * */ public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse> - listConnections( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest - request) { + com.google.cloud.bigquery.connection.v1.ListConnectionsResponse> + listConnections(com.google.cloud.bigquery.connection.v1.ListConnectionsRequest request) { return futureUnaryCall( getChannel().newCall(getListConnectionsMethod(), getCallOptions()), request); } @@ -1148,30 +986,12 @@ protected ConnectionServiceFutureStub build( * */ public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> - updateConnection( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest - request) { + com.google.cloud.bigquery.connection.v1.Connection> + updateConnection(com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest request) { return futureUnaryCall( getChannel().newCall(getUpdateConnectionMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Sets the credential for the specified connection.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - updateConnectionCredential( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest - request) { - return futureUnaryCall( - getChannel().newCall(getUpdateConnectionCredentialMethod(), getCallOptions()), request); - } - /** * * @@ -1180,9 +1000,7 @@ protected ConnectionServiceFutureStub build( * */ public com.google.common.util.concurrent.ListenableFuture - deleteConnection( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest - request) { + deleteConnection(com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest request) { return futureUnaryCall( getChannel().newCall(getDeleteConnectionMethod(), getCallOptions()), request); } @@ -1241,11 +1059,10 @@ protected ConnectionServiceFutureStub build( private static final int METHODID_GET_CONNECTION = 1; private static final int METHODID_LIST_CONNECTIONS = 2; private static final int METHODID_UPDATE_CONNECTION = 3; - private static final int METHODID_UPDATE_CONNECTION_CREDENTIAL = 4; - private static final int METHODID_DELETE_CONNECTION = 5; - private static final int METHODID_GET_IAM_POLICY = 6; - private static final int METHODID_SET_IAM_POLICY = 7; - private static final int METHODID_TEST_IAM_PERMISSIONS = 8; + private static final int METHODID_DELETE_CONNECTION = 4; + private static final int METHODID_GET_IAM_POLICY = 5; + private static final int METHODID_SET_IAM_POLICY = 6; + private static final int METHODID_TEST_IAM_PERMISSIONS = 7; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -1266,48 +1083,32 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv switch (methodId) { case METHODID_CREATE_CONNECTION: serviceImpl.createConnection( - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest) - request, - (io.grpc.stub.StreamObserver< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection>) + (com.google.cloud.bigquery.connection.v1.CreateConnectionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); break; case METHODID_GET_CONNECTION: serviceImpl.getConnection( - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest) - request, - (io.grpc.stub.StreamObserver< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection>) + (com.google.cloud.bigquery.connection.v1.GetConnectionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); break; case METHODID_LIST_CONNECTIONS: serviceImpl.listConnections( - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest) - request, + (com.google.cloud.bigquery.connection.v1.ListConnectionsRequest) request, (io.grpc.stub.StreamObserver< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsResponse>) + com.google.cloud.bigquery.connection.v1.ListConnectionsResponse>) responseObserver); break; case METHODID_UPDATE_CONNECTION: serviceImpl.updateConnection( - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest) - request, - (io.grpc.stub.StreamObserver< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection>) + (com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); break; - case METHODID_UPDATE_CONNECTION_CREDENTIAL: - serviceImpl.updateConnectionCredential( - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest) - request, - (io.grpc.stub.StreamObserver) responseObserver); - break; case METHODID_DELETE_CONNECTION: serviceImpl.deleteConnection( - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest) - request, + (com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; case METHODID_GET_IAM_POLICY: @@ -1349,7 +1150,7 @@ private abstract static class ConnectionServiceBaseDescriptorSupplier @java.lang.Override public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.getDescriptor(); + return com.google.cloud.bigquery.connection.v1.ConnectionProto.getDescriptor(); } @java.lang.Override @@ -1394,7 +1195,6 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getGetConnectionMethod()) .addMethod(getListConnectionsMethod()) .addMethod(getUpdateConnectionMethod()) - .addMethod(getUpdateConnectionCredentialMethod()) .addMethod(getDeleteConnectionMethod()) .addMethod(getGetIamPolicyMethod()) .addMethod(getSetIamPolicyMethod()) diff --git a/pom.xml b/pom.xml index 22620c16..67eba064 100644 --- a/pom.xml +++ b/pom.xml @@ -72,6 +72,16 @@ google-cloud-bigqueryconnection 0.0.1-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-bigqueryconnection-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-bigqueryconnection-v1 + 0.0.1-SNAPSHOT + com.google.api.grpc proto-google-cloud-bigqueryconnection-v1beta1 @@ -117,6 +127,8 @@ google-cloud-bigqueryconnection + proto-google-cloud-bigqueryconnection-v1 + grpc-google-cloud-bigqueryconnection-v1 proto-google-cloud-bigqueryconnection-v1beta1 grpc-google-cloud-bigqueryconnection-v1beta1 google-cloud-bigqueryconnection-bom diff --git a/proto-google-cloud-bigquery-connection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionProto.java b/proto-google-cloud-bigquery-connection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionProto.java deleted file mode 100644 index ac4e744f..00000000 --- a/proto-google-cloud-bigquery-connection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionProto.java +++ /dev/null @@ -1,13395 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/bigquery/connection/v1beta1/connection.proto - -package com.google.cloud.bigquery.connection.v1beta1; - -public final class ConnectionProto { - private ConnectionProto() {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); - } - - public interface CreateConnectionRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1beta1.CreateConnectionRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Required. Parent resource name.
-     * Must be in the format `projects/{project_id}/locations/{location_id}`
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - java.lang.String getParent(); - /** - * - * - *
-     * Required. Parent resource name.
-     * Must be in the format `projects/{project_id}/locations/{location_id}`
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - com.google.protobuf.ByteString getParentBytes(); - - /** - * - * - *
-     * Optional. Connection id that should be assigned to the created connection.
-     * 
- * - * string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The connectionId. - */ - java.lang.String getConnectionId(); - /** - * - * - *
-     * Optional. Connection id that should be assigned to the created connection.
-     * 
- * - * string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for connectionId. - */ - com.google.protobuf.ByteString getConnectionIdBytes(); - - /** - * - * - *
-     * Required. Connection to create.
-     * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the connection field is set. - */ - boolean hasConnection(); - /** - * - * - *
-     * Required. Connection to create.
-     * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The connection. - */ - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection getConnection(); - /** - * - * - *
-     * Required. Connection to create.
-     * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder - getConnectionOrBuilder(); - } - /** - * - * - *
-   * The request for [ConnectionService.CreateConnection][google.cloud.bigquery.connection.v1beta1.ConnectionService.CreateConnection].
-   * 
- * - * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.CreateConnectionRequest} - */ - public static final class CreateConnectionRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1beta1.CreateConnectionRequest) - CreateConnectionRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use CreateConnectionRequest.newBuilder() to construct. - private CreateConnectionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private CreateConnectionRequest() { - parent_ = ""; - connectionId_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CreateConnectionRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private CreateConnectionRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - connectionId_ = s; - break; - } - case 26: - { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder - subBuilder = null; - if (connection_ != null) { - subBuilder = connection_.toBuilder(); - } - connection_ = - input.readMessage( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection - .parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(connection_); - connection_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_CreateConnectionRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_CreateConnectionRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest - .class, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest - .Builder.class); - } - - public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; - /** - * - * - *
-     * Required. Parent resource name.
-     * Must be in the format `projects/{project_id}/locations/{location_id}`
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } - } - /** - * - * - *
-     * Required. Parent resource name.
-     * Must be in the format `projects/{project_id}/locations/{location_id}`
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - public com.google.protobuf.ByteString getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CONNECTION_ID_FIELD_NUMBER = 2; - private volatile java.lang.Object connectionId_; - /** - * - * - *
-     * Optional. Connection id that should be assigned to the created connection.
-     * 
- * - * string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The connectionId. - */ - public java.lang.String getConnectionId() { - java.lang.Object ref = connectionId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - connectionId_ = s; - return s; - } - } - /** - * - * - *
-     * Optional. Connection id that should be assigned to the created connection.
-     * 
- * - * string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for connectionId. - */ - public com.google.protobuf.ByteString getConnectionIdBytes() { - java.lang.Object ref = connectionId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - connectionId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CONNECTION_FIELD_NUMBER = 3; - private com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection connection_; - /** - * - * - *
-     * Required. Connection to create.
-     * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the connection field is set. - */ - public boolean hasConnection() { - return connection_ != null; - } - /** - * - * - *
-     * Required. Connection to create.
-     * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The connection. - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection getConnection() { - return connection_ == null - ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection - .getDefaultInstance() - : connection_; - } - /** - * - * - *
-     * Required. Connection to create.
-     * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder - getConnectionOrBuilder() { - return getConnection(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getParentBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); - } - if (!getConnectionIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, connectionId_); - } - if (connection_ != null) { - output.writeMessage(3, getConnection()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getParentBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); - } - if (!getConnectionIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, connectionId_); - } - if (connection_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getConnection()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj - instanceof - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest)) { - return super.equals(obj); - } - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest other = - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest) - obj; - - if (!getParent().equals(other.getParent())) return false; - if (!getConnectionId().equals(other.getConnectionId())) return false; - if (hasConnection() != other.hasConnection()) return false; - if (hasConnection()) { - if (!getConnection().equals(other.getConnection())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PARENT_FIELD_NUMBER; - hash = (53 * hash) + getParent().hashCode(); - hash = (37 * hash) + CONNECTION_ID_FIELD_NUMBER; - hash = (53 * hash) + getConnectionId().hashCode(); - if (hasConnection()) { - hash = (37 * hash) + CONNECTION_FIELD_NUMBER; - hash = (53 * hash) + getConnection().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CreateConnectionRequest - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CreateConnectionRequest - parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CreateConnectionRequest - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CreateConnectionRequest - parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CreateConnectionRequest - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CreateConnectionRequest - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CreateConnectionRequest - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CreateConnectionRequest - parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CreateConnectionRequest - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CreateConnectionRequest - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CreateConnectionRequest - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CreateConnectionRequest - parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest - prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * The request for [ConnectionService.CreateConnection][google.cloud.bigquery.connection.v1beta1.ConnectionService.CreateConnection].
-     * 
- * - * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.CreateConnectionRequest} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1beta1.CreateConnectionRequest) - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CreateConnectionRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_CreateConnectionRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_CreateConnectionRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest - .class, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest - .Builder.class); - } - - // Construct using - // com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - parent_ = ""; - - connectionId_ = ""; - - if (connectionBuilder_ == null) { - connection_ = null; - } else { - connection_ = null; - connectionBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_CreateConnectionRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest - getDefaultInstanceForType() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest - build() { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest - result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest - buildPartial() { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest - result = - new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CreateConnectionRequest(this); - result.parent_ = parent_; - result.connectionId_ = connectionId_; - if (connectionBuilder_ == null) { - result.connection_ = connection_; - } else { - result.connection_ = connectionBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest) { - return mergeFrom( - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest) - other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest - other) { - if (other - == com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest - .getDefaultInstance()) return this; - if (!other.getParent().isEmpty()) { - parent_ = other.parent_; - onChanged(); - } - if (!other.getConnectionId().isEmpty()) { - connectionId_ = other.connectionId_; - onChanged(); - } - if (other.hasConnection()) { - mergeConnection(other.getConnection()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest - parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object parent_ = ""; - /** - * - * - *
-       * Required. Parent resource name.
-       * Must be in the format `projects/{project_id}/locations/{location_id}`
-       * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * Required. Parent resource name.
-       * Must be in the format `projects/{project_id}/locations/{location_id}`
-       * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - public com.google.protobuf.ByteString getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * Required. Parent resource name.
-       * Must be in the format `projects/{project_id}/locations/{location_id}`
-       * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The parent to set. - * @return This builder for chaining. - */ - public Builder setParent(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - parent_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Required. Parent resource name.
-       * Must be in the format `projects/{project_id}/locations/{location_id}`
-       * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearParent() { - - parent_ = getDefaultInstance().getParent(); - onChanged(); - return this; - } - /** - * - * - *
-       * Required. Parent resource name.
-       * Must be in the format `projects/{project_id}/locations/{location_id}`
-       * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for parent to set. - * @return This builder for chaining. - */ - public Builder setParentBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - parent_ = value; - onChanged(); - return this; - } - - private java.lang.Object connectionId_ = ""; - /** - * - * - *
-       * Optional. Connection id that should be assigned to the created connection.
-       * 
- * - * string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The connectionId. - */ - public java.lang.String getConnectionId() { - java.lang.Object ref = connectionId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - connectionId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * Optional. Connection id that should be assigned to the created connection.
-       * 
- * - * string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for connectionId. - */ - public com.google.protobuf.ByteString getConnectionIdBytes() { - java.lang.Object ref = connectionId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - connectionId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * Optional. Connection id that should be assigned to the created connection.
-       * 
- * - * string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The connectionId to set. - * @return This builder for chaining. - */ - public Builder setConnectionId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - connectionId_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Optional. Connection id that should be assigned to the created connection.
-       * 
- * - * string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return This builder for chaining. - */ - public Builder clearConnectionId() { - - connectionId_ = getDefaultInstance().getConnectionId(); - onChanged(); - return this; - } - /** - * - * - *
-       * Optional. Connection id that should be assigned to the created connection.
-       * 
- * - * string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The bytes for connectionId to set. - * @return This builder for chaining. - */ - public Builder setConnectionIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - connectionId_ = value; - onChanged(); - return this; - } - - private com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection connection_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder> - connectionBuilder_; - /** - * - * - *
-       * Required. Connection to create.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the connection field is set. - */ - public boolean hasConnection() { - return connectionBuilder_ != null || connection_ != null; - } - /** - * - * - *
-       * Required. Connection to create.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The connection. - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection - getConnection() { - if (connectionBuilder_ == null) { - return connection_ == null - ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection - .getDefaultInstance() - : connection_; - } else { - return connectionBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Required. Connection to create.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setConnection( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection value) { - if (connectionBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - connection_ = value; - onChanged(); - } else { - connectionBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-       * Required. Connection to create.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setConnection( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder - builderForValue) { - if (connectionBuilder_ == null) { - connection_ = builderForValue.build(); - onChanged(); - } else { - connectionBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-       * Required. Connection to create.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeConnection( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection value) { - if (connectionBuilder_ == null) { - if (connection_ != null) { - connection_ = - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.newBuilder( - connection_) - .mergeFrom(value) - .buildPartial(); - } else { - connection_ = value; - } - onChanged(); - } else { - connectionBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-       * Required. Connection to create.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearConnection() { - if (connectionBuilder_ == null) { - connection_ = null; - onChanged(); - } else { - connection_ = null; - connectionBuilder_ = null; - } - - return this; - } - /** - * - * - *
-       * Required. Connection to create.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder - getConnectionBuilder() { - - onChanged(); - return getConnectionFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Required. Connection to create.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder - getConnectionOrBuilder() { - if (connectionBuilder_ != null) { - return connectionBuilder_.getMessageOrBuilder(); - } else { - return connection_ == null - ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection - .getDefaultInstance() - : connection_; - } - } - /** - * - * - *
-       * Required. Connection to create.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder> - getConnectionFieldBuilder() { - if (connectionBuilder_ == null) { - connectionBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder>( - getConnection(), getParentForChildren(), isClean()); - connection_ = null; - } - return connectionBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.connection.v1beta1.CreateConnectionRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1beta1.CreateConnectionRequest) - private static final com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CreateConnectionRequest - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CreateConnectionRequest(); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CreateConnectionRequest - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CreateConnectionRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CreateConnectionRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CreateConnectionRequest - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface GetConnectionRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1beta1.GetConnectionRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Required. Name of the requested connection, for example:
-     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-     * Required. Name of the requested connection, for example:
-     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); - } - /** - * - * - *
-   * The request for [ConnectionService.GetConnection][google.cloud.bigquery.connection.v1beta1.ConnectionService.GetConnection].
-   * 
- * - * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.GetConnectionRequest} - */ - public static final class GetConnectionRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1beta1.GetConnectionRequest) - GetConnectionRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use GetConnectionRequest.newBuilder() to construct. - private GetConnectionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private GetConnectionRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new GetConnectionRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private GetConnectionRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_GetConnectionRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_GetConnectionRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest - .class, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest - .Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * - * - *
-     * Required. Name of the requested connection, for example:
-     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * - * - *
-     * Required. Name of the requested connection, for example:
-     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj - instanceof - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest)) { - return super.equals(obj); - } - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest other = - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest) obj; - - if (!getName().equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest - parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest - parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest - parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest - parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest - prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * The request for [ConnectionService.GetConnection][google.cloud.bigquery.connection.v1beta1.ConnectionService.GetConnection].
-     * 
- * - * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.GetConnectionRequest} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1beta1.GetConnectionRequest) - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_GetConnectionRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_GetConnectionRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest - .class, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest - .Builder.class); - } - - // Construct using - // com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_GetConnectionRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest - getDefaultInstanceForType() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest - build() { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest result = - buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest - buildPartial() { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest result = - new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest( - this); - result.name_ = name_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest) { - return mergeFrom( - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest) - other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest other) { - if (other - == com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest - .getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest - parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - * - * - *
-       * Required. Name of the requested connection, for example:
-       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-       * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * Required. Name of the requested connection, for example:
-       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-       * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * Required. Name of the requested connection, for example:
-       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-       * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Required. Name of the requested connection, for example:
-       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-       * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * - * - *
-       * Required. Name of the requested connection, for example:
-       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-       * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.connection.v1beta1.GetConnectionRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1beta1.GetConnectionRequest) - private static final com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .GetConnectionRequest - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest(); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GetConnectionRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GetConnectionRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.GetConnectionRequest - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface ListConnectionsRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1beta1.ListConnectionsRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Required. Parent resource name.
-     * Must be in the form: `projects/{project_id}/locations/{location_id}`
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - java.lang.String getParent(); - /** - * - * - *
-     * Required. Parent resource name.
-     * Must be in the form: `projects/{project_id}/locations/{location_id}`
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - com.google.protobuf.ByteString getParentBytes(); - - /** - * - * - *
-     * Required. Maximum number of results per page.
-     * 
- * - * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the maxResults field is set. - */ - boolean hasMaxResults(); - /** - * - * - *
-     * Required. Maximum number of results per page.
-     * 
- * - * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The maxResults. - */ - com.google.protobuf.UInt32Value getMaxResults(); - /** - * - * - *
-     * Required. Maximum number of results per page.
-     * 
- * - * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.protobuf.UInt32ValueOrBuilder getMaxResultsOrBuilder(); - - /** - * - * - *
-     * Page token.
-     * 
- * - * string page_token = 3; - * - * @return The pageToken. - */ - java.lang.String getPageToken(); - /** - * - * - *
-     * Page token.
-     * 
- * - * string page_token = 3; - * - * @return The bytes for pageToken. - */ - com.google.protobuf.ByteString getPageTokenBytes(); - } - /** - * - * - *
-   * The request for [ConnectionService.ListConnections][google.cloud.bigquery.connection.v1beta1.ConnectionService.ListConnections].
-   * 
- * - * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.ListConnectionsRequest} - */ - public static final class ListConnectionsRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1beta1.ListConnectionsRequest) - ListConnectionsRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListConnectionsRequest.newBuilder() to construct. - private ListConnectionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListConnectionsRequest() { - parent_ = ""; - pageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListConnectionsRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ListConnectionsRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 18: - { - com.google.protobuf.UInt32Value.Builder subBuilder = null; - if (maxResults_ != null) { - subBuilder = maxResults_.toBuilder(); - } - maxResults_ = - input.readMessage(com.google.protobuf.UInt32Value.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(maxResults_); - maxResults_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest - .class, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest - .Builder.class); - } - - public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; - /** - * - * - *
-     * Required. Parent resource name.
-     * Must be in the form: `projects/{project_id}/locations/{location_id}`
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } - } - /** - * - * - *
-     * Required. Parent resource name.
-     * Must be in the form: `projects/{project_id}/locations/{location_id}`
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - public com.google.protobuf.ByteString getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int MAX_RESULTS_FIELD_NUMBER = 2; - private com.google.protobuf.UInt32Value maxResults_; - /** - * - * - *
-     * Required. Maximum number of results per page.
-     * 
- * - * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the maxResults field is set. - */ - public boolean hasMaxResults() { - return maxResults_ != null; - } - /** - * - * - *
-     * Required. Maximum number of results per page.
-     * 
- * - * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The maxResults. - */ - public com.google.protobuf.UInt32Value getMaxResults() { - return maxResults_ == null - ? com.google.protobuf.UInt32Value.getDefaultInstance() - : maxResults_; - } - /** - * - * - *
-     * Required. Maximum number of results per page.
-     * 
- * - * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.protobuf.UInt32ValueOrBuilder getMaxResultsOrBuilder() { - return getMaxResults(); - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 3; - private volatile java.lang.Object pageToken_; - /** - * - * - *
-     * Page token.
-     * 
- * - * string page_token = 3; - * - * @return The pageToken. - */ - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } - } - /** - * - * - *
-     * Page token.
-     * 
- * - * string page_token = 3; - * - * @return The bytes for pageToken. - */ - public com.google.protobuf.ByteString getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getParentBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); - } - if (maxResults_ != null) { - output.writeMessage(2, getMaxResults()); - } - if (!getPageTokenBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getParentBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); - } - if (maxResults_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMaxResults()); - } - if (!getPageTokenBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj - instanceof - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest)) { - return super.equals(obj); - } - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest other = - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest) obj; - - if (!getParent().equals(other.getParent())) return false; - if (hasMaxResults() != other.hasMaxResults()) return false; - if (hasMaxResults()) { - if (!getMaxResults().equals(other.getMaxResults())) return false; - } - if (!getPageToken().equals(other.getPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PARENT_FIELD_NUMBER; - hash = (53 * hash) + getParent().hashCode(); - if (hasMaxResults()) { - hash = (37 * hash) + MAX_RESULTS_FIELD_NUMBER; - hash = (53 * hash) + getMaxResults().hashCode(); - } - hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsRequest - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsRequest - parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsRequest - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsRequest - parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsRequest - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsRequest - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsRequest - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsRequest - parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsRequest - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsRequest - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsRequest - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsRequest - parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest - prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * The request for [ConnectionService.ListConnections][google.cloud.bigquery.connection.v1beta1.ConnectionService.ListConnections].
-     * 
- * - * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.ListConnectionsRequest} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1beta1.ListConnectionsRequest) - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest - .class, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest - .Builder.class); - } - - // Construct using - // com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - parent_ = ""; - - if (maxResultsBuilder_ == null) { - maxResults_ = null; - } else { - maxResults_ = null; - maxResultsBuilder_ = null; - } - pageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest - getDefaultInstanceForType() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest - build() { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest result = - buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest - buildPartial() { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest result = - new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest( - this); - result.parent_ = parent_; - if (maxResultsBuilder_ == null) { - result.maxResults_ = maxResults_; - } else { - result.maxResults_ = maxResultsBuilder_.build(); - } - result.pageToken_ = pageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest) { - return mergeFrom( - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest) - other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest - other) { - if (other - == com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest - .getDefaultInstance()) return this; - if (!other.getParent().isEmpty()) { - parent_ = other.parent_; - onChanged(); - } - if (other.hasMaxResults()) { - mergeMaxResults(other.getMaxResults()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest - parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object parent_ = ""; - /** - * - * - *
-       * Required. Parent resource name.
-       * Must be in the form: `projects/{project_id}/locations/{location_id}`
-       * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * Required. Parent resource name.
-       * Must be in the form: `projects/{project_id}/locations/{location_id}`
-       * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - public com.google.protobuf.ByteString getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * Required. Parent resource name.
-       * Must be in the form: `projects/{project_id}/locations/{location_id}`
-       * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The parent to set. - * @return This builder for chaining. - */ - public Builder setParent(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - parent_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Required. Parent resource name.
-       * Must be in the form: `projects/{project_id}/locations/{location_id}`
-       * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearParent() { - - parent_ = getDefaultInstance().getParent(); - onChanged(); - return this; - } - /** - * - * - *
-       * Required. Parent resource name.
-       * Must be in the form: `projects/{project_id}/locations/{location_id}`
-       * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for parent to set. - * @return This builder for chaining. - */ - public Builder setParentBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - parent_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.UInt32Value maxResults_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.UInt32Value, - com.google.protobuf.UInt32Value.Builder, - com.google.protobuf.UInt32ValueOrBuilder> - maxResultsBuilder_; - /** - * - * - *
-       * Required. Maximum number of results per page.
-       * 
- * - * - * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the maxResults field is set. - */ - public boolean hasMaxResults() { - return maxResultsBuilder_ != null || maxResults_ != null; - } - /** - * - * - *
-       * Required. Maximum number of results per page.
-       * 
- * - * - * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The maxResults. - */ - public com.google.protobuf.UInt32Value getMaxResults() { - if (maxResultsBuilder_ == null) { - return maxResults_ == null - ? com.google.protobuf.UInt32Value.getDefaultInstance() - : maxResults_; - } else { - return maxResultsBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Required. Maximum number of results per page.
-       * 
- * - * - * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setMaxResults(com.google.protobuf.UInt32Value value) { - if (maxResultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - maxResults_ = value; - onChanged(); - } else { - maxResultsBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-       * Required. Maximum number of results per page.
-       * 
- * - * - * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setMaxResults(com.google.protobuf.UInt32Value.Builder builderForValue) { - if (maxResultsBuilder_ == null) { - maxResults_ = builderForValue.build(); - onChanged(); - } else { - maxResultsBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-       * Required. Maximum number of results per page.
-       * 
- * - * - * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeMaxResults(com.google.protobuf.UInt32Value value) { - if (maxResultsBuilder_ == null) { - if (maxResults_ != null) { - maxResults_ = - com.google.protobuf.UInt32Value.newBuilder(maxResults_) - .mergeFrom(value) - .buildPartial(); - } else { - maxResults_ = value; - } - onChanged(); - } else { - maxResultsBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-       * Required. Maximum number of results per page.
-       * 
- * - * - * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearMaxResults() { - if (maxResultsBuilder_ == null) { - maxResults_ = null; - onChanged(); - } else { - maxResults_ = null; - maxResultsBuilder_ = null; - } - - return this; - } - /** - * - * - *
-       * Required. Maximum number of results per page.
-       * 
- * - * - * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.protobuf.UInt32Value.Builder getMaxResultsBuilder() { - - onChanged(); - return getMaxResultsFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Required. Maximum number of results per page.
-       * 
- * - * - * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.protobuf.UInt32ValueOrBuilder getMaxResultsOrBuilder() { - if (maxResultsBuilder_ != null) { - return maxResultsBuilder_.getMessageOrBuilder(); - } else { - return maxResults_ == null - ? com.google.protobuf.UInt32Value.getDefaultInstance() - : maxResults_; - } - } - /** - * - * - *
-       * Required. Maximum number of results per page.
-       * 
- * - * - * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.UInt32Value, - com.google.protobuf.UInt32Value.Builder, - com.google.protobuf.UInt32ValueOrBuilder> - getMaxResultsFieldBuilder() { - if (maxResultsBuilder_ == null) { - maxResultsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.UInt32Value, - com.google.protobuf.UInt32Value.Builder, - com.google.protobuf.UInt32ValueOrBuilder>( - getMaxResults(), getParentForChildren(), isClean()); - maxResults_ = null; - } - return maxResultsBuilder_; - } - - private java.lang.Object pageToken_ = ""; - /** - * - * - *
-       * Page token.
-       * 
- * - * string page_token = 3; - * - * @return The pageToken. - */ - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * Page token.
-       * 
- * - * string page_token = 3; - * - * @return The bytes for pageToken. - */ - public com.google.protobuf.ByteString getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * Page token.
-       * 
- * - * string page_token = 3; - * - * @param value The pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageToken(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - pageToken_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Page token.
-       * 
- * - * string page_token = 3; - * - * @return This builder for chaining. - */ - public Builder clearPageToken() { - - pageToken_ = getDefaultInstance().getPageToken(); - onChanged(); - return this; - } - /** - * - * - *
-       * Page token.
-       * 
- * - * string page_token = 3; - * - * @param value The bytes for pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - pageToken_ = value; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.connection.v1beta1.ListConnectionsRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1beta1.ListConnectionsRequest) - private static final com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsRequest - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest(); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsRequest - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListConnectionsRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListConnectionsRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsRequest - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface ListConnectionsResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1beta1.ListConnectionsResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Next page token.
-     * 
- * - * string next_page_token = 1; - * - * @return The nextPageToken. - */ - java.lang.String getNextPageToken(); - /** - * - * - *
-     * Next page token.
-     * 
- * - * string next_page_token = 1; - * - * @return The bytes for nextPageToken. - */ - com.google.protobuf.ByteString getNextPageTokenBytes(); - - /** - * - * - *
-     * List of connections.
-     * 
- * - * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; - */ - java.util.List - getConnectionsList(); - /** - * - * - *
-     * List of connections.
-     * 
- * - * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; - */ - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection getConnections( - int index); - /** - * - * - *
-     * List of connections.
-     * 
- * - * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; - */ - int getConnectionsCount(); - /** - * - * - *
-     * List of connections.
-     * 
- * - * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; - */ - java.util.List< - ? extends - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder> - getConnectionsOrBuilderList(); - /** - * - * - *
-     * List of connections.
-     * 
- * - * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; - */ - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder - getConnectionsOrBuilder(int index); - } - /** - * - * - *
-   * The response for [ConnectionService.ListConnections][google.cloud.bigquery.connection.v1beta1.ConnectionService.ListConnections].
-   * 
- * - * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.ListConnectionsResponse} - */ - public static final class ListConnectionsResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1beta1.ListConnectionsResponse) - ListConnectionsResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListConnectionsResponse.newBuilder() to construct. - private ListConnectionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListConnectionsResponse() { - nextPageToken_ = ""; - connections_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListConnectionsResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ListConnectionsResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - nextPageToken_ = s; - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - connections_ = - new java.util.ArrayList< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .Connection>(); - mutable_bitField0_ |= 0x00000001; - } - connections_.add( - input.readMessage( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection - .parser(), - extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - connections_ = java.util.Collections.unmodifiableList(connections_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse - .class, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse - .Builder.class); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 1; - private volatile java.lang.Object nextPageToken_; - /** - * - * - *
-     * Next page token.
-     * 
- * - * string next_page_token = 1; - * - * @return The nextPageToken. - */ - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } - } - /** - * - * - *
-     * Next page token.
-     * 
- * - * string next_page_token = 1; - * - * @return The bytes for nextPageToken. - */ - public com.google.protobuf.ByteString getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CONNECTIONS_FIELD_NUMBER = 2; - private java.util.List - connections_; - /** - * - * - *
-     * List of connections.
-     * 
- * - * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; - */ - public java.util.List - getConnectionsList() { - return connections_; - } - /** - * - * - *
-     * List of connections.
-     * 
- * - * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; - */ - public java.util.List< - ? extends - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder> - getConnectionsOrBuilderList() { - return connections_; - } - /** - * - * - *
-     * List of connections.
-     * 
- * - * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; - */ - public int getConnectionsCount() { - return connections_.size(); - } - /** - * - * - *
-     * List of connections.
-     * 
- * - * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection getConnections( - int index) { - return connections_.get(index); - } - /** - * - * - *
-     * List of connections.
-     * 
- * - * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder - getConnectionsOrBuilder(int index) { - return connections_.get(index); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNextPageTokenBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, nextPageToken_); - } - for (int i = 0; i < connections_.size(); i++) { - output.writeMessage(2, connections_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getNextPageTokenBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, nextPageToken_); - } - for (int i = 0; i < connections_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, connections_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj - instanceof - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse)) { - return super.equals(obj); - } - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse other = - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse) - obj; - - if (!getNextPageToken().equals(other.getNextPageToken())) return false; - if (!getConnectionsList().equals(other.getConnectionsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getNextPageToken().hashCode(); - if (getConnectionsCount() > 0) { - hash = (37 * hash) + CONNECTIONS_FIELD_NUMBER; - hash = (53 * hash) + getConnectionsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsResponse - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsResponse - parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsResponse - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsResponse - parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsResponse - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsResponse - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsResponse - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsResponse - parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsResponse - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsResponse - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsResponse - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsResponse - parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse - prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * The response for [ConnectionService.ListConnections][google.cloud.bigquery.connection.v1beta1.ConnectionService.ListConnections].
-     * 
- * - * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.ListConnectionsResponse} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1beta1.ListConnectionsResponse) - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse - .class, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse - .Builder.class); - } - - // Construct using - // com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getConnectionsFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - nextPageToken_ = ""; - - if (connectionsBuilder_ == null) { - connections_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - connectionsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsResponse_descriptor; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse - getDefaultInstanceForType() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse - build() { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse - result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse - buildPartial() { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse - result = - new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsResponse(this); - int from_bitField0_ = bitField0_; - result.nextPageToken_ = nextPageToken_; - if (connectionsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - connections_ = java.util.Collections.unmodifiableList(connections_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.connections_ = connections_; - } else { - result.connections_ = connectionsBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse) { - return mergeFrom( - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse) - other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse - other) { - if (other - == com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse - .getDefaultInstance()) return this; - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - onChanged(); - } - if (connectionsBuilder_ == null) { - if (!other.connections_.isEmpty()) { - if (connections_.isEmpty()) { - connections_ = other.connections_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureConnectionsIsMutable(); - connections_.addAll(other.connections_); - } - onChanged(); - } - } else { - if (!other.connections_.isEmpty()) { - if (connectionsBuilder_.isEmpty()) { - connectionsBuilder_.dispose(); - connectionsBuilder_ = null; - connections_ = other.connections_; - bitField0_ = (bitField0_ & ~0x00000001); - connectionsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getConnectionsFieldBuilder() - : null; - } else { - connectionsBuilder_.addAllMessages(other.connections_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse - parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.lang.Object nextPageToken_ = ""; - /** - * - * - *
-       * Next page token.
-       * 
- * - * string next_page_token = 1; - * - * @return The nextPageToken. - */ - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * Next page token.
-       * 
- * - * string next_page_token = 1; - * - * @return The bytes for nextPageToken. - */ - public com.google.protobuf.ByteString getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * Next page token.
-       * 
- * - * string next_page_token = 1; - * - * @param value The nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageToken(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - nextPageToken_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Next page token.
-       * 
- * - * string next_page_token = 1; - * - * @return This builder for chaining. - */ - public Builder clearNextPageToken() { - - nextPageToken_ = getDefaultInstance().getNextPageToken(); - onChanged(); - return this; - } - /** - * - * - *
-       * Next page token.
-       * 
- * - * string next_page_token = 1; - * - * @param value The bytes for nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - nextPageToken_ = value; - onChanged(); - return this; - } - - private java.util.List< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> - connections_ = java.util.Collections.emptyList(); - - private void ensureConnectionsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - connections_ = - new java.util.ArrayList< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection>( - connections_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder> - connectionsBuilder_; - - /** - * - * - *
-       * List of connections.
-       * 
- * - * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; - */ - public java.util.List - getConnectionsList() { - if (connectionsBuilder_ == null) { - return java.util.Collections.unmodifiableList(connections_); - } else { - return connectionsBuilder_.getMessageList(); - } - } - /** - * - * - *
-       * List of connections.
-       * 
- * - * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; - */ - public int getConnectionsCount() { - if (connectionsBuilder_ == null) { - return connections_.size(); - } else { - return connectionsBuilder_.getCount(); - } - } - /** - * - * - *
-       * List of connections.
-       * 
- * - * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection getConnections( - int index) { - if (connectionsBuilder_ == null) { - return connections_.get(index); - } else { - return connectionsBuilder_.getMessage(index); - } - } - /** - * - * - *
-       * List of connections.
-       * 
- * - * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; - */ - public Builder setConnections( - int index, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection value) { - if (connectionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureConnectionsIsMutable(); - connections_.set(index, value); - onChanged(); - } else { - connectionsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-       * List of connections.
-       * 
- * - * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; - */ - public Builder setConnections( - int index, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder - builderForValue) { - if (connectionsBuilder_ == null) { - ensureConnectionsIsMutable(); - connections_.set(index, builderForValue.build()); - onChanged(); - } else { - connectionsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * List of connections.
-       * 
- * - * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; - */ - public Builder addConnections( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection value) { - if (connectionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureConnectionsIsMutable(); - connections_.add(value); - onChanged(); - } else { - connectionsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-       * List of connections.
-       * 
- * - * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; - */ - public Builder addConnections( - int index, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection value) { - if (connectionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureConnectionsIsMutable(); - connections_.add(index, value); - onChanged(); - } else { - connectionsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-       * List of connections.
-       * 
- * - * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; - */ - public Builder addConnections( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder - builderForValue) { - if (connectionsBuilder_ == null) { - ensureConnectionsIsMutable(); - connections_.add(builderForValue.build()); - onChanged(); - } else { - connectionsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * List of connections.
-       * 
- * - * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; - */ - public Builder addConnections( - int index, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder - builderForValue) { - if (connectionsBuilder_ == null) { - ensureConnectionsIsMutable(); - connections_.add(index, builderForValue.build()); - onChanged(); - } else { - connectionsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * List of connections.
-       * 
- * - * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; - */ - public Builder addAllConnections( - java.lang.Iterable< - ? extends com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection> - values) { - if (connectionsBuilder_ == null) { - ensureConnectionsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, connections_); - onChanged(); - } else { - connectionsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-       * List of connections.
-       * 
- * - * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; - */ - public Builder clearConnections() { - if (connectionsBuilder_ == null) { - connections_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - connectionsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-       * List of connections.
-       * 
- * - * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; - */ - public Builder removeConnections(int index) { - if (connectionsBuilder_ == null) { - ensureConnectionsIsMutable(); - connections_.remove(index); - onChanged(); - } else { - connectionsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-       * List of connections.
-       * 
- * - * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder - getConnectionsBuilder(int index) { - return getConnectionsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-       * List of connections.
-       * 
- * - * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder - getConnectionsOrBuilder(int index) { - if (connectionsBuilder_ == null) { - return connections_.get(index); - } else { - return connectionsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-       * List of connections.
-       * 
- * - * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; - */ - public java.util.List< - ? extends - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder> - getConnectionsOrBuilderList() { - if (connectionsBuilder_ != null) { - return connectionsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(connections_); - } - } - /** - * - * - *
-       * List of connections.
-       * 
- * - * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder - addConnectionsBuilder() { - return getConnectionsFieldBuilder() - .addBuilder( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection - .getDefaultInstance()); - } - /** - * - * - *
-       * List of connections.
-       * 
- * - * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder - addConnectionsBuilder(int index) { - return getConnectionsFieldBuilder() - .addBuilder( - index, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection - .getDefaultInstance()); - } - /** - * - * - *
-       * List of connections.
-       * 
- * - * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; - */ - public java.util.List< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder> - getConnectionsBuilderList() { - return getConnectionsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder> - getConnectionsFieldBuilder() { - if (connectionsBuilder_ == null) { - connectionsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder>( - connections_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - connections_ = null; - } - return connectionsBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.connection.v1beta1.ListConnectionsResponse) - } - - // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1beta1.ListConnectionsResponse) - private static final com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsResponse - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsResponse(); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ListConnectionsResponse - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListConnectionsResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListConnectionsResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ListConnectionsResponse - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface UpdateConnectionRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1beta1.UpdateConnectionRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Required. Name of the connection to update, for example:
-     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-     * Required. Name of the connection to update, for example:
-     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * - * - *
-     * Required. Connection containing the updated fields.
-     * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the connection field is set. - */ - boolean hasConnection(); - /** - * - * - *
-     * Required. Connection containing the updated fields.
-     * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The connection. - */ - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection getConnection(); - /** - * - * - *
-     * Required. Connection containing the updated fields.
-     * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder - getConnectionOrBuilder(); - - /** - * - * - *
-     * Required. Update mask for the connection fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the updateMask field is set. - */ - boolean hasUpdateMask(); - /** - * - * - *
-     * Required. Update mask for the connection fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The updateMask. - */ - com.google.protobuf.FieldMask getUpdateMask(); - /** - * - * - *
-     * Required. Update mask for the connection fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); - } - /** - * - * - *
-   * The request for [ConnectionService.UpdateConnection][google.cloud.bigquery.connection.v1beta1.ConnectionService.UpdateConnection].
-   * 
- * - * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.UpdateConnectionRequest} - */ - public static final class UpdateConnectionRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1beta1.UpdateConnectionRequest) - UpdateConnectionRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use UpdateConnectionRequest.newBuilder() to construct. - private UpdateConnectionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private UpdateConnectionRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new UpdateConnectionRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private UpdateConnectionRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: - { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder - subBuilder = null; - if (connection_ != null) { - subBuilder = connection_.toBuilder(); - } - connection_ = - input.readMessage( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection - .parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(connection_); - connection_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - com.google.protobuf.FieldMask.Builder subBuilder = null; - if (updateMask_ != null) { - subBuilder = updateMask_.toBuilder(); - } - updateMask_ = - input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateMask_); - updateMask_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest - .class, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest - .Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * - * - *
-     * Required. Name of the connection to update, for example:
-     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * - * - *
-     * Required. Name of the connection to update, for example:
-     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CONNECTION_FIELD_NUMBER = 2; - private com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection connection_; - /** - * - * - *
-     * Required. Connection containing the updated fields.
-     * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the connection field is set. - */ - public boolean hasConnection() { - return connection_ != null; - } - /** - * - * - *
-     * Required. Connection containing the updated fields.
-     * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The connection. - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection getConnection() { - return connection_ == null - ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection - .getDefaultInstance() - : connection_; - } - /** - * - * - *
-     * Required. Connection containing the updated fields.
-     * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder - getConnectionOrBuilder() { - return getConnection(); - } - - public static final int UPDATE_MASK_FIELD_NUMBER = 3; - private com.google.protobuf.FieldMask updateMask_; - /** - * - * - *
-     * Required. Update mask for the connection fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the updateMask field is set. - */ - public boolean hasUpdateMask() { - return updateMask_ != null; - } - /** - * - * - *
-     * Required. Update mask for the connection fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The updateMask. - */ - public com.google.protobuf.FieldMask getUpdateMask() { - return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } - /** - * - * - *
-     * Required. Update mask for the connection fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - return getUpdateMask(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (connection_ != null) { - output.writeMessage(2, getConnection()); - } - if (updateMask_ != null) { - output.writeMessage(3, getUpdateMask()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (connection_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getConnection()); - } - if (updateMask_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateMask()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj - instanceof - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest)) { - return super.equals(obj); - } - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest other = - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest) - obj; - - if (!getName().equals(other.getName())) return false; - if (hasConnection() != other.hasConnection()) return false; - if (hasConnection()) { - if (!getConnection().equals(other.getConnection())) return false; - } - if (hasUpdateMask() != other.hasUpdateMask()) return false; - if (hasUpdateMask()) { - if (!getUpdateMask().equals(other.getUpdateMask())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - if (hasConnection()) { - hash = (37 * hash) + CONNECTION_FIELD_NUMBER; - hash = (53 * hash) + getConnection().hashCode(); - } - if (hasUpdateMask()) { - hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; - hash = (53 * hash) + getUpdateMask().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionRequest - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionRequest - parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionRequest - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionRequest - parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionRequest - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionRequest - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionRequest - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionRequest - parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionRequest - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionRequest - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionRequest - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionRequest - parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest - prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * The request for [ConnectionService.UpdateConnection][google.cloud.bigquery.connection.v1beta1.ConnectionService.UpdateConnection].
-     * 
- * - * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.UpdateConnectionRequest} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1beta1.UpdateConnectionRequest) - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest - .class, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest - .Builder.class); - } - - // Construct using - // com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - if (connectionBuilder_ == null) { - connection_ = null; - } else { - connection_ = null; - connectionBuilder_ = null; - } - if (updateMaskBuilder_ == null) { - updateMask_ = null; - } else { - updateMask_ = null; - updateMaskBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest - getDefaultInstanceForType() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest - build() { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest - result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest - buildPartial() { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest - result = - new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionRequest(this); - result.name_ = name_; - if (connectionBuilder_ == null) { - result.connection_ = connection_; - } else { - result.connection_ = connectionBuilder_.build(); - } - if (updateMaskBuilder_ == null) { - result.updateMask_ = updateMask_; - } else { - result.updateMask_ = updateMaskBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest) { - return mergeFrom( - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest) - other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest - other) { - if (other - == com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest - .getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.hasConnection()) { - mergeConnection(other.getConnection()); - } - if (other.hasUpdateMask()) { - mergeUpdateMask(other.getUpdateMask()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest - parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - * - * - *
-       * Required. Name of the connection to update, for example:
-       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-       * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * Required. Name of the connection to update, for example:
-       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-       * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * Required. Name of the connection to update, for example:
-       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-       * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Required. Name of the connection to update, for example:
-       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-       * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * - * - *
-       * Required. Name of the connection to update, for example:
-       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-       * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection connection_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder> - connectionBuilder_; - /** - * - * - *
-       * Required. Connection containing the updated fields.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the connection field is set. - */ - public boolean hasConnection() { - return connectionBuilder_ != null || connection_ != null; - } - /** - * - * - *
-       * Required. Connection containing the updated fields.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The connection. - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection - getConnection() { - if (connectionBuilder_ == null) { - return connection_ == null - ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection - .getDefaultInstance() - : connection_; - } else { - return connectionBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Required. Connection containing the updated fields.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setConnection( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection value) { - if (connectionBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - connection_ = value; - onChanged(); - } else { - connectionBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-       * Required. Connection containing the updated fields.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setConnection( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder - builderForValue) { - if (connectionBuilder_ == null) { - connection_ = builderForValue.build(); - onChanged(); - } else { - connectionBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-       * Required. Connection containing the updated fields.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeConnection( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection value) { - if (connectionBuilder_ == null) { - if (connection_ != null) { - connection_ = - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.newBuilder( - connection_) - .mergeFrom(value) - .buildPartial(); - } else { - connection_ = value; - } - onChanged(); - } else { - connectionBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-       * Required. Connection containing the updated fields.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearConnection() { - if (connectionBuilder_ == null) { - connection_ = null; - onChanged(); - } else { - connection_ = null; - connectionBuilder_ = null; - } - - return this; - } - /** - * - * - *
-       * Required. Connection containing the updated fields.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder - getConnectionBuilder() { - - onChanged(); - return getConnectionFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Required. Connection containing the updated fields.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder - getConnectionOrBuilder() { - if (connectionBuilder_ != null) { - return connectionBuilder_.getMessageOrBuilder(); - } else { - return connection_ == null - ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection - .getDefaultInstance() - : connection_; - } - } - /** - * - * - *
-       * Required. Connection containing the updated fields.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder> - getConnectionFieldBuilder() { - if (connectionBuilder_ == null) { - connectionBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder>( - getConnection(), getParentForChildren(), isClean()); - connection_ = null; - } - return connectionBuilder_; - } - - private com.google.protobuf.FieldMask updateMask_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, - com.google.protobuf.FieldMask.Builder, - com.google.protobuf.FieldMaskOrBuilder> - updateMaskBuilder_; - /** - * - * - *
-       * Required. Update mask for the connection fields to be updated.
-       * 
- * - * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the updateMask field is set. - */ - public boolean hasUpdateMask() { - return updateMaskBuilder_ != null || updateMask_ != null; - } - /** - * - * - *
-       * Required. Update mask for the connection fields to be updated.
-       * 
- * - * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The updateMask. - */ - public com.google.protobuf.FieldMask getUpdateMask() { - if (updateMaskBuilder_ == null) { - return updateMask_ == null - ? com.google.protobuf.FieldMask.getDefaultInstance() - : updateMask_; - } else { - return updateMaskBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Required. Update mask for the connection fields to be updated.
-       * 
- * - * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setUpdateMask(com.google.protobuf.FieldMask value) { - if (updateMaskBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - updateMask_ = value; - onChanged(); - } else { - updateMaskBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-       * Required. Update mask for the connection fields to be updated.
-       * 
- * - * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { - if (updateMaskBuilder_ == null) { - updateMask_ = builderForValue.build(); - onChanged(); - } else { - updateMaskBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-       * Required. Update mask for the connection fields to be updated.
-       * 
- * - * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { - if (updateMaskBuilder_ == null) { - if (updateMask_ != null) { - updateMask_ = - com.google.protobuf.FieldMask.newBuilder(updateMask_) - .mergeFrom(value) - .buildPartial(); - } else { - updateMask_ = value; - } - onChanged(); - } else { - updateMaskBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-       * Required. Update mask for the connection fields to be updated.
-       * 
- * - * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearUpdateMask() { - if (updateMaskBuilder_ == null) { - updateMask_ = null; - onChanged(); - } else { - updateMask_ = null; - updateMaskBuilder_ = null; - } - - return this; - } - /** - * - * - *
-       * Required. Update mask for the connection fields to be updated.
-       * 
- * - * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { - - onChanged(); - return getUpdateMaskFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Required. Update mask for the connection fields to be updated.
-       * 
- * - * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - if (updateMaskBuilder_ != null) { - return updateMaskBuilder_.getMessageOrBuilder(); - } else { - return updateMask_ == null - ? com.google.protobuf.FieldMask.getDefaultInstance() - : updateMask_; - } - } - /** - * - * - *
-       * Required. Update mask for the connection fields to be updated.
-       * 
- * - * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, - com.google.protobuf.FieldMask.Builder, - com.google.protobuf.FieldMaskOrBuilder> - getUpdateMaskFieldBuilder() { - if (updateMaskBuilder_ == null) { - updateMaskBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, - com.google.protobuf.FieldMask.Builder, - com.google.protobuf.FieldMaskOrBuilder>( - getUpdateMask(), getParentForChildren(), isClean()); - updateMask_ = null; - } - return updateMaskBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.connection.v1beta1.UpdateConnectionRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1beta1.UpdateConnectionRequest) - private static final com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionRequest - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionRequest(); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionRequest - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public UpdateConnectionRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new UpdateConnectionRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionRequest - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface UpdateConnectionCredentialRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1beta1.UpdateConnectionCredentialRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Required. Name of the connection, for example:
-     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}/credential`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-     * Required. Name of the connection, for example:
-     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}/credential`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * - * - *
-     * Required. Credential to use with the connection.
-     * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the credential field is set. - */ - boolean hasCredential(); - /** - * - * - *
-     * Required. Credential to use with the connection.
-     * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The credential. - */ - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - getCredential(); - /** - * - * - *
-     * Required. Credential to use with the connection.
-     * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredentialOrBuilder - getCredentialOrBuilder(); - } - /** - * - * - *
-   * The request for [ConnectionService.UpdateConnectionCredential][google.cloud.bigquery.connection.v1beta1.ConnectionService.UpdateConnectionCredential].
-   * 
- * - * Protobuf type {@code - * google.cloud.bigquery.connection.v1beta1.UpdateConnectionCredentialRequest} - */ - public static final class UpdateConnectionCredentialRequest - extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1beta1.UpdateConnectionCredentialRequest) - UpdateConnectionCredentialRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use UpdateConnectionCredentialRequest.newBuilder() to construct. - private UpdateConnectionCredentialRequest( - com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private UpdateConnectionCredentialRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new UpdateConnectionCredentialRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private UpdateConnectionCredentialRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: - { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - .Builder - subBuilder = null; - if (credential_ != null) { - subBuilder = credential_.toBuilder(); - } - credential_ = - input.readMessage( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ConnectionCredential.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(credential_); - credential_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionCredentialRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionCredentialRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest.class, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * - * - *
-     * Required. Name of the connection, for example:
-     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}/credential`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * - * - *
-     * Required. Name of the connection, for example:
-     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}/credential`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CREDENTIAL_FIELD_NUMBER = 2; - private com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - credential_; - /** - * - * - *
-     * Required. Credential to use with the connection.
-     * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the credential field is set. - */ - public boolean hasCredential() { - return credential_ != null; - } - /** - * - * - *
-     * Required. Credential to use with the connection.
-     * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The credential. - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - getCredential() { - return credential_ == null - ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - .getDefaultInstance() - : credential_; - } - /** - * - * - *
-     * Required. Credential to use with the connection.
-     * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ConnectionCredentialOrBuilder - getCredentialOrBuilder() { - return getCredential(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (credential_ != null) { - output.writeMessage(2, getCredential()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (credential_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCredential()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj - instanceof - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest)) { - return super.equals(obj); - } - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionCredentialRequest - other = - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest) - obj; - - if (!getName().equals(other.getName())) return false; - if (hasCredential() != other.hasCredential()) return false; - if (hasCredential()) { - if (!getCredential().equals(other.getCredential())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - if (hasCredential()) { - hash = (37 * hash) + CREDENTIAL_FIELD_NUMBER; - hash = (53 * hash) + getCredential().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest - parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest - parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest - parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest - parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest - prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * The request for [ConnectionService.UpdateConnectionCredential][google.cloud.bigquery.connection.v1beta1.ConnectionService.UpdateConnectionCredential].
-     * 
- * - * Protobuf type {@code - * google.cloud.bigquery.connection.v1beta1.UpdateConnectionCredentialRequest} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1beta1.UpdateConnectionCredentialRequest) - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionCredentialRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionCredentialRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest.class, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest.Builder.class); - } - - // Construct using - // com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.UpdateConnectionCredentialRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - if (credentialBuilder_ == null) { - credential_ = null; - } else { - credential_ = null; - credentialBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionCredentialRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest - getDefaultInstanceForType() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest - build() { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest - result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest - buildPartial() { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest - result = - new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest(this); - result.name_ = name_; - if (credentialBuilder_ == null) { - result.credential_ = credential_; - } else { - result.credential_ = credentialBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest) { - return mergeFrom( - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest) - other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest - other) { - if (other - == com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.hasCredential()) { - mergeCredential(other.getCredential()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest - parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - * - * - *
-       * Required. Name of the connection, for example:
-       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}/credential`
-       * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * Required. Name of the connection, for example:
-       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}/credential`
-       * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * Required. Name of the connection, for example:
-       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}/credential`
-       * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Required. Name of the connection, for example:
-       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}/credential`
-       * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * - * - *
-       * Required. Name of the connection, for example:
-       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}/credential`
-       * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - credential_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - .Builder, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ConnectionCredentialOrBuilder> - credentialBuilder_; - /** - * - * - *
-       * Required. Credential to use with the connection.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the credential field is set. - */ - public boolean hasCredential() { - return credentialBuilder_ != null || credential_ != null; - } - /** - * - * - *
-       * Required. Credential to use with the connection.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The credential. - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - getCredential() { - if (credentialBuilder_ == null) { - return credential_ == null - ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - .getDefaultInstance() - : credential_; - } else { - return credentialBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Required. Credential to use with the connection.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setCredential( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential value) { - if (credentialBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - credential_ = value; - onChanged(); - } else { - credentialBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-       * Required. Credential to use with the connection.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setCredential( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential.Builder - builderForValue) { - if (credentialBuilder_ == null) { - credential_ = builderForValue.build(); - onChanged(); - } else { - credentialBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-       * Required. Credential to use with the connection.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeCredential( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential value) { - if (credentialBuilder_ == null) { - if (credential_ != null) { - credential_ = - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - .newBuilder(credential_) - .mergeFrom(value) - .buildPartial(); - } else { - credential_ = value; - } - onChanged(); - } else { - credentialBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-       * Required. Credential to use with the connection.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearCredential() { - if (credentialBuilder_ == null) { - credential_ = null; - onChanged(); - } else { - credential_ = null; - credentialBuilder_ = null; - } - - return this; - } - /** - * - * - *
-       * Required. Credential to use with the connection.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - .Builder - getCredentialBuilder() { - - onChanged(); - return getCredentialFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Required. Credential to use with the connection.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ConnectionCredentialOrBuilder - getCredentialOrBuilder() { - if (credentialBuilder_ != null) { - return credentialBuilder_.getMessageOrBuilder(); - } else { - return credential_ == null - ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - .getDefaultInstance() - : credential_; - } - } - /** - * - * - *
-       * Required. Credential to use with the connection.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - .Builder, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ConnectionCredentialOrBuilder> - getCredentialFieldBuilder() { - if (credentialBuilder_ == null) { - credentialBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - .Builder, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ConnectionCredentialOrBuilder>( - getCredential(), getParentForChildren(), isClean()); - credential_ = null; - } - return credentialBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.connection.v1beta1.UpdateConnectionCredentialRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1beta1.UpdateConnectionCredentialRequest) - private static final com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest(); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public UpdateConnectionCredentialRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new UpdateConnectionCredentialRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .UpdateConnectionCredentialRequest - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface DeleteConnectionRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1beta1.DeleteConnectionRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Required. Name of the deleted connection, for example:
-     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-     * Required. Name of the deleted connection, for example:
-     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); - } - /** - * - * - *
-   * The request for [ConnectionService.DeleteConnectionRequest][].
-   * 
- * - * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.DeleteConnectionRequest} - */ - public static final class DeleteConnectionRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1beta1.DeleteConnectionRequest) - DeleteConnectionRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use DeleteConnectionRequest.newBuilder() to construct. - private DeleteConnectionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private DeleteConnectionRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DeleteConnectionRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private DeleteConnectionRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_DeleteConnectionRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_DeleteConnectionRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest - .class, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest - .Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * - * - *
-     * Required. Name of the deleted connection, for example:
-     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * - * - *
-     * Required. Name of the deleted connection, for example:
-     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj - instanceof - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest)) { - return super.equals(obj); - } - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest other = - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest) - obj; - - if (!getName().equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .DeleteConnectionRequest - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .DeleteConnectionRequest - parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .DeleteConnectionRequest - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .DeleteConnectionRequest - parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .DeleteConnectionRequest - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .DeleteConnectionRequest - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .DeleteConnectionRequest - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .DeleteConnectionRequest - parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .DeleteConnectionRequest - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .DeleteConnectionRequest - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .DeleteConnectionRequest - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .DeleteConnectionRequest - parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest - prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * The request for [ConnectionService.DeleteConnectionRequest][].
-     * 
- * - * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.DeleteConnectionRequest} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1beta1.DeleteConnectionRequest) - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .DeleteConnectionRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_DeleteConnectionRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_DeleteConnectionRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest - .class, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest - .Builder.class); - } - - // Construct using - // com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_DeleteConnectionRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest - getDefaultInstanceForType() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest - build() { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest - result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest - buildPartial() { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest - result = - new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .DeleteConnectionRequest(this); - result.name_ = name_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest) { - return mergeFrom( - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest) - other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest - other) { - if (other - == com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest - .getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest - parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - * - * - *
-       * Required. Name of the deleted connection, for example:
-       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-       * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * Required. Name of the deleted connection, for example:
-       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-       * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * Required. Name of the deleted connection, for example:
-       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-       * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Required. Name of the deleted connection, for example:
-       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-       * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * - * - *
-       * Required. Name of the deleted connection, for example:
-       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-       * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.connection.v1beta1.DeleteConnectionRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1beta1.DeleteConnectionRequest) - private static final com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .DeleteConnectionRequest - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .DeleteConnectionRequest(); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .DeleteConnectionRequest - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DeleteConnectionRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DeleteConnectionRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.DeleteConnectionRequest - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface ConnectionOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1beta1.Connection) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * The resource name of the connection in the form of:
-     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-     * 
- * - * string name = 1; - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-     * The resource name of the connection in the form of:
-     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-     * 
- * - * string name = 1; - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * - * - *
-     * User provided display name for the connection.
-     * 
- * - * string friendly_name = 2; - * - * @return The friendlyName. - */ - java.lang.String getFriendlyName(); - /** - * - * - *
-     * User provided display name for the connection.
-     * 
- * - * string friendly_name = 2; - * - * @return The bytes for friendlyName. - */ - com.google.protobuf.ByteString getFriendlyNameBytes(); - - /** - * - * - *
-     * User provided description.
-     * 
- * - * string description = 3; - * - * @return The description. - */ - java.lang.String getDescription(); - /** - * - * - *
-     * User provided description.
-     * 
- * - * string description = 3; - * - * @return The bytes for description. - */ - com.google.protobuf.ByteString getDescriptionBytes(); - - /** - * - * - *
-     * Cloud SQL properties.
-     * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; - * - * @return Whether the cloudSql field is set. - */ - boolean hasCloudSql(); - /** - * - * - *
-     * Cloud SQL properties.
-     * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; - * - * @return The cloudSql. - */ - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties getCloudSql(); - /** - * - * - *
-     * Cloud SQL properties.
-     * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; - */ - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlPropertiesOrBuilder - getCloudSqlOrBuilder(); - - /** - * - * - *
-     * Output only. The creation timestamp of the connection.
-     * 
- * - * int64 creation_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The creationTime. - */ - long getCreationTime(); - - /** - * - * - *
-     * Output only. The last update timestamp of the connection.
-     * 
- * - * int64 last_modified_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The lastModifiedTime. - */ - long getLastModifiedTime(); - - /** - * - * - *
-     * Output only. True, if credential is configured for this connection.
-     * 
- * - * bool has_credential = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The hasCredential. - */ - boolean getHasCredential(); - - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.PropertiesCase - getPropertiesCase(); - } - /** - * - * - *
-   * Configuration parameters to establish connection with an external data
-   * source, except the credential attributes.
-   * 
- * - * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.Connection} - */ - public static final class Connection extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1beta1.Connection) - ConnectionOrBuilder { - private static final long serialVersionUID = 0L; - // Use Connection.newBuilder() to construct. - private Connection(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Connection() { - name_ = ""; - friendlyName_ = ""; - description_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Connection(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Connection( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - friendlyName_ = s; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - description_ = s; - break; - } - case 34: - { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - .Builder - subBuilder = null; - if (propertiesCase_ == 4) { - subBuilder = - ((com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CloudSqlProperties) - properties_) - .toBuilder(); - } - properties_ = - input.readMessage( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CloudSqlProperties.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom( - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CloudSqlProperties) - properties_); - properties_ = subBuilder.buildPartial(); - } - propertiesCase_ = 4; - break; - } - case 40: - { - creationTime_ = input.readInt64(); - break; - } - case 48: - { - lastModifiedTime_ = input.readInt64(); - break; - } - case 56: - { - hasCredential_ = input.readBool(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_Connection_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_Connection_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.class, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder - .class); - } - - private int propertiesCase_ = 0; - private java.lang.Object properties_; - - public enum PropertiesCase - implements - com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - CLOUD_SQL(4), - PROPERTIES_NOT_SET(0); - private final int value; - - private PropertiesCase(int value) { - this.value = value; - } - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static PropertiesCase valueOf(int value) { - return forNumber(value); - } - - public static PropertiesCase forNumber(int value) { - switch (value) { - case 4: - return CLOUD_SQL; - case 0: - return PROPERTIES_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - }; - - public PropertiesCase getPropertiesCase() { - return PropertiesCase.forNumber(propertiesCase_); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * - * - *
-     * The resource name of the connection in the form of:
-     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-     * 
- * - * string name = 1; - * - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * - * - *
-     * The resource name of the connection in the form of:
-     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-     * 
- * - * string name = 1; - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int FRIENDLY_NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object friendlyName_; - /** - * - * - *
-     * User provided display name for the connection.
-     * 
- * - * string friendly_name = 2; - * - * @return The friendlyName. - */ - public java.lang.String getFriendlyName() { - java.lang.Object ref = friendlyName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - friendlyName_ = s; - return s; - } - } - /** - * - * - *
-     * User provided display name for the connection.
-     * 
- * - * string friendly_name = 2; - * - * @return The bytes for friendlyName. - */ - public com.google.protobuf.ByteString getFriendlyNameBytes() { - java.lang.Object ref = friendlyName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - friendlyName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DESCRIPTION_FIELD_NUMBER = 3; - private volatile java.lang.Object description_; - /** - * - * - *
-     * User provided description.
-     * 
- * - * string description = 3; - * - * @return The description. - */ - public java.lang.String getDescription() { - java.lang.Object ref = description_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - description_ = s; - return s; - } - } - /** - * - * - *
-     * User provided description.
-     * 
- * - * string description = 3; - * - * @return The bytes for description. - */ - public com.google.protobuf.ByteString getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CLOUD_SQL_FIELD_NUMBER = 4; - /** - * - * - *
-     * Cloud SQL properties.
-     * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; - * - * @return Whether the cloudSql field is set. - */ - public boolean hasCloudSql() { - return propertiesCase_ == 4; - } - /** - * - * - *
-     * Cloud SQL properties.
-     * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; - * - * @return The cloudSql. - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - getCloudSql() { - if (propertiesCase_ == 4) { - return (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties) - properties_; - } - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - .getDefaultInstance(); - } - /** - * - * - *
-     * Cloud SQL properties.
-     * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlPropertiesOrBuilder - getCloudSqlOrBuilder() { - if (propertiesCase_ == 4) { - return (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties) - properties_; - } - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - .getDefaultInstance(); - } - - public static final int CREATION_TIME_FIELD_NUMBER = 5; - private long creationTime_; - /** - * - * - *
-     * Output only. The creation timestamp of the connection.
-     * 
- * - * int64 creation_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The creationTime. - */ - public long getCreationTime() { - return creationTime_; - } - - public static final int LAST_MODIFIED_TIME_FIELD_NUMBER = 6; - private long lastModifiedTime_; - /** - * - * - *
-     * Output only. The last update timestamp of the connection.
-     * 
- * - * int64 last_modified_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The lastModifiedTime. - */ - public long getLastModifiedTime() { - return lastModifiedTime_; - } - - public static final int HAS_CREDENTIAL_FIELD_NUMBER = 7; - private boolean hasCredential_; - /** - * - * - *
-     * Output only. True, if credential is configured for this connection.
-     * 
- * - * bool has_credential = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The hasCredential. - */ - public boolean getHasCredential() { - return hasCredential_; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (!getFriendlyNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, friendlyName_); - } - if (!getDescriptionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); - } - if (propertiesCase_ == 4) { - output.writeMessage( - 4, - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties) - properties_); - } - if (creationTime_ != 0L) { - output.writeInt64(5, creationTime_); - } - if (lastModifiedTime_ != 0L) { - output.writeInt64(6, lastModifiedTime_); - } - if (hasCredential_ != false) { - output.writeBool(7, hasCredential_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (!getFriendlyNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, friendlyName_); - } - if (!getDescriptionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); - } - if (propertiesCase_ == 4) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 4, - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties) - properties_); - } - if (creationTime_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(5, creationTime_); - } - if (lastModifiedTime_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(6, lastModifiedTime_); - } - if (hasCredential_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(7, hasCredential_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj - instanceof com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection)) { - return super.equals(obj); - } - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection other = - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection) obj; - - if (!getName().equals(other.getName())) return false; - if (!getFriendlyName().equals(other.getFriendlyName())) return false; - if (!getDescription().equals(other.getDescription())) return false; - if (getCreationTime() != other.getCreationTime()) return false; - if (getLastModifiedTime() != other.getLastModifiedTime()) return false; - if (getHasCredential() != other.getHasCredential()) return false; - if (!getPropertiesCase().equals(other.getPropertiesCase())) return false; - switch (propertiesCase_) { - case 4: - if (!getCloudSql().equals(other.getCloudSql())) return false; - break; - case 0: - default: - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + FRIENDLY_NAME_FIELD_NUMBER; - hash = (53 * hash) + getFriendlyName().hashCode(); - hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getDescription().hashCode(); - hash = (37 * hash) + CREATION_TIME_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCreationTime()); - hash = (37 * hash) + LAST_MODIFIED_TIME_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getLastModifiedTime()); - hash = (37 * hash) + HAS_CREDENTIAL_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getHasCredential()); - switch (propertiesCase_) { - case 4: - hash = (37 * hash) + CLOUD_SQL_FIELD_NUMBER; - hash = (53 * hash) + getCloudSql().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * Configuration parameters to establish connection with an external data
-     * source, except the credential attributes.
-     * 
- * - * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.Connection} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1beta1.Connection) - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_Connection_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_Connection_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.class, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.Builder - .class); - } - - // Construct using - // com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - friendlyName_ = ""; - - description_ = ""; - - creationTime_ = 0L; - - lastModifiedTime_ = 0L; - - hasCredential_ = false; - - propertiesCase_ = 0; - properties_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_Connection_descriptor; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection - getDefaultInstanceForType() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection build() { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection result = - buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection - buildPartial() { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection result = - new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection(this); - result.name_ = name_; - result.friendlyName_ = friendlyName_; - result.description_ = description_; - if (propertiesCase_ == 4) { - if (cloudSqlBuilder_ == null) { - result.properties_ = properties_; - } else { - result.properties_ = cloudSqlBuilder_.build(); - } - } - result.creationTime_ = creationTime_; - result.lastModifiedTime_ = lastModifiedTime_; - result.hasCredential_ = hasCredential_; - result.propertiesCase_ = propertiesCase_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection) { - return mergeFrom( - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection other) { - if (other - == com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection - .getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getFriendlyName().isEmpty()) { - friendlyName_ = other.friendlyName_; - onChanged(); - } - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - onChanged(); - } - if (other.getCreationTime() != 0L) { - setCreationTime(other.getCreationTime()); - } - if (other.getLastModifiedTime() != 0L) { - setLastModifiedTime(other.getLastModifiedTime()); - } - if (other.getHasCredential() != false) { - setHasCredential(other.getHasCredential()); - } - switch (other.getPropertiesCase()) { - case CLOUD_SQL: - { - mergeCloudSql(other.getCloudSql()); - break; - } - case PROPERTIES_NOT_SET: - { - break; - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection parsedMessage = - null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int propertiesCase_ = 0; - private java.lang.Object properties_; - - public PropertiesCase getPropertiesCase() { - return PropertiesCase.forNumber(propertiesCase_); - } - - public Builder clearProperties() { - propertiesCase_ = 0; - properties_ = null; - onChanged(); - return this; - } - - private java.lang.Object name_ = ""; - /** - * - * - *
-       * The resource name of the connection in the form of:
-       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-       * 
- * - * string name = 1; - * - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * The resource name of the connection in the form of:
-       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-       * 
- * - * string name = 1; - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * The resource name of the connection in the form of:
-       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-       * 
- * - * string name = 1; - * - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * The resource name of the connection in the form of:
-       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-       * 
- * - * string name = 1; - * - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * - * - *
-       * The resource name of the connection in the form of:
-       * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
-       * 
- * - * string name = 1; - * - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object friendlyName_ = ""; - /** - * - * - *
-       * User provided display name for the connection.
-       * 
- * - * string friendly_name = 2; - * - * @return The friendlyName. - */ - public java.lang.String getFriendlyName() { - java.lang.Object ref = friendlyName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - friendlyName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * User provided display name for the connection.
-       * 
- * - * string friendly_name = 2; - * - * @return The bytes for friendlyName. - */ - public com.google.protobuf.ByteString getFriendlyNameBytes() { - java.lang.Object ref = friendlyName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - friendlyName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * User provided display name for the connection.
-       * 
- * - * string friendly_name = 2; - * - * @param value The friendlyName to set. - * @return This builder for chaining. - */ - public Builder setFriendlyName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - friendlyName_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * User provided display name for the connection.
-       * 
- * - * string friendly_name = 2; - * - * @return This builder for chaining. - */ - public Builder clearFriendlyName() { - - friendlyName_ = getDefaultInstance().getFriendlyName(); - onChanged(); - return this; - } - /** - * - * - *
-       * User provided display name for the connection.
-       * 
- * - * string friendly_name = 2; - * - * @param value The bytes for friendlyName to set. - * @return This builder for chaining. - */ - public Builder setFriendlyNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - friendlyName_ = value; - onChanged(); - return this; - } - - private java.lang.Object description_ = ""; - /** - * - * - *
-       * User provided description.
-       * 
- * - * string description = 3; - * - * @return The description. - */ - public java.lang.String getDescription() { - java.lang.Object ref = description_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - description_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * User provided description.
-       * 
- * - * string description = 3; - * - * @return The bytes for description. - */ - public com.google.protobuf.ByteString getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * User provided description.
-       * 
- * - * string description = 3; - * - * @param value The description to set. - * @return This builder for chaining. - */ - public Builder setDescription(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - description_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * User provided description.
-       * 
- * - * string description = 3; - * - * @return This builder for chaining. - */ - public Builder clearDescription() { - - description_ = getDefaultInstance().getDescription(); - onChanged(); - return this; - } - /** - * - * - *
-       * User provided description.
-       * 
- * - * string description = 3; - * - * @param value The bytes for description to set. - * @return This builder for chaining. - */ - public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - description_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - .Builder, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CloudSqlPropertiesOrBuilder> - cloudSqlBuilder_; - /** - * - * - *
-       * Cloud SQL properties.
-       * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; - * - * @return Whether the cloudSql field is set. - */ - public boolean hasCloudSql() { - return propertiesCase_ == 4; - } - /** - * - * - *
-       * Cloud SQL properties.
-       * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; - * - * @return The cloudSql. - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - getCloudSql() { - if (cloudSqlBuilder_ == null) { - if (propertiesCase_ == 4) { - return (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties) - properties_; - } - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - .getDefaultInstance(); - } else { - if (propertiesCase_ == 4) { - return cloudSqlBuilder_.getMessage(); - } - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - .getDefaultInstance(); - } - } - /** - * - * - *
-       * Cloud SQL properties.
-       * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; - */ - public Builder setCloudSql( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties value) { - if (cloudSqlBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - properties_ = value; - onChanged(); - } else { - cloudSqlBuilder_.setMessage(value); - } - propertiesCase_ = 4; - return this; - } - /** - * - * - *
-       * Cloud SQL properties.
-       * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; - */ - public Builder setCloudSql( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties.Builder - builderForValue) { - if (cloudSqlBuilder_ == null) { - properties_ = builderForValue.build(); - onChanged(); - } else { - cloudSqlBuilder_.setMessage(builderForValue.build()); - } - propertiesCase_ = 4; - return this; - } - /** - * - * - *
-       * Cloud SQL properties.
-       * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; - */ - public Builder mergeCloudSql( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties value) { - if (cloudSqlBuilder_ == null) { - if (propertiesCase_ == 4 - && properties_ - != com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - .getDefaultInstance()) { - properties_ = - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - .newBuilder( - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CloudSqlProperties) - properties_) - .mergeFrom(value) - .buildPartial(); - } else { - properties_ = value; - } - onChanged(); - } else { - if (propertiesCase_ == 4) { - cloudSqlBuilder_.mergeFrom(value); - } - cloudSqlBuilder_.setMessage(value); - } - propertiesCase_ = 4; - return this; - } - /** - * - * - *
-       * Cloud SQL properties.
-       * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; - */ - public Builder clearCloudSql() { - if (cloudSqlBuilder_ == null) { - if (propertiesCase_ == 4) { - propertiesCase_ = 0; - properties_ = null; - onChanged(); - } - } else { - if (propertiesCase_ == 4) { - propertiesCase_ = 0; - properties_ = null; - } - cloudSqlBuilder_.clear(); - } - return this; - } - /** - * - * - *
-       * Cloud SQL properties.
-       * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties.Builder - getCloudSqlBuilder() { - return getCloudSqlFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Cloud SQL properties.
-       * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CloudSqlPropertiesOrBuilder - getCloudSqlOrBuilder() { - if ((propertiesCase_ == 4) && (cloudSqlBuilder_ != null)) { - return cloudSqlBuilder_.getMessageOrBuilder(); - } else { - if (propertiesCase_ == 4) { - return (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties) - properties_; - } - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - .getDefaultInstance(); - } - } - /** - * - * - *
-       * Cloud SQL properties.
-       * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - .Builder, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CloudSqlPropertiesOrBuilder> - getCloudSqlFieldBuilder() { - if (cloudSqlBuilder_ == null) { - if (!(propertiesCase_ == 4)) { - properties_ = - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - .getDefaultInstance(); - } - cloudSqlBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - .Builder, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CloudSqlPropertiesOrBuilder>( - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties) - properties_, - getParentForChildren(), - isClean()); - properties_ = null; - } - propertiesCase_ = 4; - onChanged(); - ; - return cloudSqlBuilder_; - } - - private long creationTime_; - /** - * - * - *
-       * Output only. The creation timestamp of the connection.
-       * 
- * - * int64 creation_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The creationTime. - */ - public long getCreationTime() { - return creationTime_; - } - /** - * - * - *
-       * Output only. The creation timestamp of the connection.
-       * 
- * - * int64 creation_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The creationTime to set. - * @return This builder for chaining. - */ - public Builder setCreationTime(long value) { - - creationTime_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Output only. The creation timestamp of the connection.
-       * 
- * - * int64 creation_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return This builder for chaining. - */ - public Builder clearCreationTime() { - - creationTime_ = 0L; - onChanged(); - return this; - } - - private long lastModifiedTime_; - /** - * - * - *
-       * Output only. The last update timestamp of the connection.
-       * 
- * - * int64 last_modified_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The lastModifiedTime. - */ - public long getLastModifiedTime() { - return lastModifiedTime_; - } - /** - * - * - *
-       * Output only. The last update timestamp of the connection.
-       * 
- * - * int64 last_modified_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The lastModifiedTime to set. - * @return This builder for chaining. - */ - public Builder setLastModifiedTime(long value) { - - lastModifiedTime_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Output only. The last update timestamp of the connection.
-       * 
- * - * int64 last_modified_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return This builder for chaining. - */ - public Builder clearLastModifiedTime() { - - lastModifiedTime_ = 0L; - onChanged(); - return this; - } - - private boolean hasCredential_; - /** - * - * - *
-       * Output only. True, if credential is configured for this connection.
-       * 
- * - * bool has_credential = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The hasCredential. - */ - public boolean getHasCredential() { - return hasCredential_; - } - /** - * - * - *
-       * Output only. True, if credential is configured for this connection.
-       * 
- * - * bool has_credential = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The hasCredential to set. - * @return This builder for chaining. - */ - public Builder setHasCredential(boolean value) { - - hasCredential_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Output only. True, if credential is configured for this connection.
-       * 
- * - * bool has_credential = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return This builder for chaining. - */ - public Builder clearHasCredential() { - - hasCredential_ = false; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.connection.v1beta1.Connection) - } - - // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1beta1.Connection) - private static final com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection(); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Connection parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Connection(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface ConnectionCredentialOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1beta1.ConnectionCredential) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Credential for Cloud SQL database.
-     * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; - * - * @return Whether the cloudSql field is set. - */ - boolean hasCloudSql(); - /** - * - * - *
-     * Credential for Cloud SQL database.
-     * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; - * - * @return The cloudSql. - */ - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential getCloudSql(); - /** - * - * - *
-     * Credential for Cloud SQL database.
-     * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; - */ - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredentialOrBuilder - getCloudSqlOrBuilder(); - - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - .CredentialCase - getCredentialCase(); - } - /** - * - * - *
-   * Credential to use with a connection.
-   * 
- * - * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.ConnectionCredential} - */ - public static final class ConnectionCredential extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1beta1.ConnectionCredential) - ConnectionCredentialOrBuilder { - private static final long serialVersionUID = 0L; - // Use ConnectionCredential.newBuilder() to construct. - private ConnectionCredential(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ConnectionCredential() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ConnectionCredential(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ConnectionCredential( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - .Builder - subBuilder = null; - if (credentialCase_ == 1) { - subBuilder = - ((com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CloudSqlCredential) - credential_) - .toBuilder(); - } - credential_ = - input.readMessage( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CloudSqlCredential.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom( - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CloudSqlCredential) - credential_); - credential_ = subBuilder.buildPartial(); - } - credentialCase_ = 1; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_ConnectionCredential_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_ConnectionCredential_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - .class, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - .Builder.class); - } - - private int credentialCase_ = 0; - private java.lang.Object credential_; - - public enum CredentialCase - implements - com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - CLOUD_SQL(1), - CREDENTIAL_NOT_SET(0); - private final int value; - - private CredentialCase(int value) { - this.value = value; - } - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static CredentialCase valueOf(int value) { - return forNumber(value); - } - - public static CredentialCase forNumber(int value) { - switch (value) { - case 1: - return CLOUD_SQL; - case 0: - return CREDENTIAL_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - }; - - public CredentialCase getCredentialCase() { - return CredentialCase.forNumber(credentialCase_); - } - - public static final int CLOUD_SQL_FIELD_NUMBER = 1; - /** - * - * - *
-     * Credential for Cloud SQL database.
-     * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; - * - * @return Whether the cloudSql field is set. - */ - public boolean hasCloudSql() { - return credentialCase_ == 1; - } - /** - * - * - *
-     * Credential for Cloud SQL database.
-     * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; - * - * @return The cloudSql. - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - getCloudSql() { - if (credentialCase_ == 1) { - return (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential) - credential_; - } - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - .getDefaultInstance(); - } - /** - * - * - *
-     * Credential for Cloud SQL database.
-     * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredentialOrBuilder - getCloudSqlOrBuilder() { - if (credentialCase_ == 1) { - return (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential) - credential_; - } - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - .getDefaultInstance(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (credentialCase_ == 1) { - output.writeMessage( - 1, - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential) - credential_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (credentialCase_ == 1) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 1, - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential) - credential_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj - instanceof - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential)) { - return super.equals(obj); - } - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential other = - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential) obj; - - if (!getCredentialCase().equals(other.getCredentialCase())) return false; - switch (credentialCase_) { - case 1: - if (!getCloudSql().equals(other.getCloudSql())) return false; - break; - case 0: - default: - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - switch (credentialCase_) { - case 1: - hash = (37 * hash) + CLOUD_SQL_FIELD_NUMBER; - hash = (53 * hash) + getCloudSql().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * Credential to use with a connection.
-     * 
- * - * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.ConnectionCredential} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1beta1.ConnectionCredential) - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredentialOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_ConnectionCredential_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_ConnectionCredential_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - .class, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - .Builder.class); - } - - // Construct using - // com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - credentialCase_ = 0; - credential_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_ConnectionCredential_descriptor; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - getDefaultInstanceForType() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - build() { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential result = - buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - buildPartial() { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential result = - new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential( - this); - if (credentialCase_ == 1) { - if (cloudSqlBuilder_ == null) { - result.credential_ = credential_; - } else { - result.credential_ = cloudSqlBuilder_.build(); - } - } - result.credentialCase_ = credentialCase_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential) { - return mergeFrom( - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential) - other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential other) { - if (other - == com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - .getDefaultInstance()) return this; - switch (other.getCredentialCase()) { - case CLOUD_SQL: - { - mergeCloudSql(other.getCloudSql()); - break; - } - case CREDENTIAL_NOT_SET: - { - break; - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int credentialCase_ = 0; - private java.lang.Object credential_; - - public CredentialCase getCredentialCase() { - return CredentialCase.forNumber(credentialCase_); - } - - public Builder clearCredential() { - credentialCase_ = 0; - credential_ = null; - onChanged(); - return this; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - .Builder, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CloudSqlCredentialOrBuilder> - cloudSqlBuilder_; - /** - * - * - *
-       * Credential for Cloud SQL database.
-       * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; - * - * @return Whether the cloudSql field is set. - */ - public boolean hasCloudSql() { - return credentialCase_ == 1; - } - /** - * - * - *
-       * Credential for Cloud SQL database.
-       * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; - * - * @return The cloudSql. - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - getCloudSql() { - if (cloudSqlBuilder_ == null) { - if (credentialCase_ == 1) { - return (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential) - credential_; - } - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - .getDefaultInstance(); - } else { - if (credentialCase_ == 1) { - return cloudSqlBuilder_.getMessage(); - } - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - .getDefaultInstance(); - } - } - /** - * - * - *
-       * Credential for Cloud SQL database.
-       * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; - */ - public Builder setCloudSql( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential value) { - if (cloudSqlBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - credential_ = value; - onChanged(); - } else { - cloudSqlBuilder_.setMessage(value); - } - credentialCase_ = 1; - return this; - } - /** - * - * - *
-       * Credential for Cloud SQL database.
-       * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; - */ - public Builder setCloudSql( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential.Builder - builderForValue) { - if (cloudSqlBuilder_ == null) { - credential_ = builderForValue.build(); - onChanged(); - } else { - cloudSqlBuilder_.setMessage(builderForValue.build()); - } - credentialCase_ = 1; - return this; - } - /** - * - * - *
-       * Credential for Cloud SQL database.
-       * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; - */ - public Builder mergeCloudSql( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential value) { - if (cloudSqlBuilder_ == null) { - if (credentialCase_ == 1 - && credential_ - != com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - .getDefaultInstance()) { - credential_ = - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - .newBuilder( - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CloudSqlCredential) - credential_) - .mergeFrom(value) - .buildPartial(); - } else { - credential_ = value; - } - onChanged(); - } else { - if (credentialCase_ == 1) { - cloudSqlBuilder_.mergeFrom(value); - } - cloudSqlBuilder_.setMessage(value); - } - credentialCase_ = 1; - return this; - } - /** - * - * - *
-       * Credential for Cloud SQL database.
-       * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; - */ - public Builder clearCloudSql() { - if (cloudSqlBuilder_ == null) { - if (credentialCase_ == 1) { - credentialCase_ = 0; - credential_ = null; - onChanged(); - } - } else { - if (credentialCase_ == 1) { - credentialCase_ = 0; - credential_ = null; - } - cloudSqlBuilder_.clear(); - } - return this; - } - /** - * - * - *
-       * Credential for Cloud SQL database.
-       * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential.Builder - getCloudSqlBuilder() { - return getCloudSqlFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Credential for Cloud SQL database.
-       * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CloudSqlCredentialOrBuilder - getCloudSqlOrBuilder() { - if ((credentialCase_ == 1) && (cloudSqlBuilder_ != null)) { - return cloudSqlBuilder_.getMessageOrBuilder(); - } else { - if (credentialCase_ == 1) { - return (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential) - credential_; - } - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - .getDefaultInstance(); - } - } - /** - * - * - *
-       * Credential for Cloud SQL database.
-       * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - .Builder, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CloudSqlCredentialOrBuilder> - getCloudSqlFieldBuilder() { - if (cloudSqlBuilder_ == null) { - if (!(credentialCase_ == 1)) { - credential_ = - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - .getDefaultInstance(); - } - cloudSqlBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - .Builder, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CloudSqlCredentialOrBuilder>( - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential) - credential_, - getParentForChildren(), - isClean()); - credential_ = null; - } - credentialCase_ = 1; - onChanged(); - ; - return cloudSqlBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.connection.v1beta1.ConnectionCredential) - } - - // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1beta1.ConnectionCredential) - private static final com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .ConnectionCredential - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential(); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ConnectionCredential parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ConnectionCredential(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface CloudSqlPropertiesOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1beta1.CloudSqlProperties) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Cloud SQL instance ID in the form `project:location:instance`.
-     * 
- * - * string instance_id = 1; - * - * @return The instanceId. - */ - java.lang.String getInstanceId(); - /** - * - * - *
-     * Cloud SQL instance ID in the form `project:location:instance`.
-     * 
- * - * string instance_id = 1; - * - * @return The bytes for instanceId. - */ - com.google.protobuf.ByteString getInstanceIdBytes(); - - /** - * - * - *
-     * Database name.
-     * 
- * - * string database = 2; - * - * @return The database. - */ - java.lang.String getDatabase(); - /** - * - * - *
-     * Database name.
-     * 
- * - * string database = 2; - * - * @return The bytes for database. - */ - com.google.protobuf.ByteString getDatabaseBytes(); - - /** - * - * - *
-     * Type of the Cloud SQL database.
-     * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties.DatabaseType type = 3; - * - * - * @return The enum numeric value on the wire for type. - */ - int getTypeValue(); - /** - * - * - *
-     * Type of the Cloud SQL database.
-     * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties.DatabaseType type = 3; - * - * - * @return The type. - */ - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties.DatabaseType - getType(); - - /** - * - * - *
-     * Input only. Cloud SQL credential.
-     * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; - * - * - * @return Whether the credential field is set. - */ - boolean hasCredential(); - /** - * - * - *
-     * Input only. Cloud SQL credential.
-     * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; - * - * - * @return The credential. - */ - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential getCredential(); - /** - * - * - *
-     * Input only. Cloud SQL credential.
-     * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; - * - */ - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredentialOrBuilder - getCredentialOrBuilder(); - } - /** - * - * - *
-   * Connection properties specific to the Cloud SQL.
-   * 
- * - * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.CloudSqlProperties} - */ - public static final class CloudSqlProperties extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1beta1.CloudSqlProperties) - CloudSqlPropertiesOrBuilder { - private static final long serialVersionUID = 0L; - // Use CloudSqlProperties.newBuilder() to construct. - private CloudSqlProperties(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private CloudSqlProperties() { - instanceId_ = ""; - database_ = ""; - type_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CloudSqlProperties(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private CloudSqlProperties( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - instanceId_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - database_ = s; - break; - } - case 24: - { - int rawValue = input.readEnum(); - - type_ = rawValue; - break; - } - case 34: - { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - .Builder - subBuilder = null; - if (credential_ != null) { - subBuilder = credential_.toBuilder(); - } - credential_ = - input.readMessage( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CloudSqlCredential.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(credential_); - credential_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlProperties_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlProperties_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties.class, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - .Builder.class); - } - - /** - * - * - *
-     * Supported Cloud SQL database types.
-     * 
- * - * Protobuf enum {@code - * google.cloud.bigquery.connection.v1beta1.CloudSqlProperties.DatabaseType} - */ - public enum DatabaseType implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-       * Unspecified database type.
-       * 
- * - * DATABASE_TYPE_UNSPECIFIED = 0; - */ - DATABASE_TYPE_UNSPECIFIED(0), - /** - * - * - *
-       * Cloud SQL for PostgreSQL.
-       * 
- * - * POSTGRES = 1; - */ - POSTGRES(1), - /** - * - * - *
-       * Cloud SQL for MySQL.
-       * 
- * - * MYSQL = 2; - */ - MYSQL(2), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-       * Unspecified database type.
-       * 
- * - * DATABASE_TYPE_UNSPECIFIED = 0; - */ - public static final int DATABASE_TYPE_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-       * Cloud SQL for PostgreSQL.
-       * 
- * - * POSTGRES = 1; - */ - public static final int POSTGRES_VALUE = 1; - /** - * - * - *
-       * Cloud SQL for MySQL.
-       * 
- * - * MYSQL = 2; - */ - public static final int MYSQL_VALUE = 2; - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static DatabaseType valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static DatabaseType forNumber(int value) { - switch (value) { - case 0: - return DATABASE_TYPE_UNSPECIFIED; - case 1: - return POSTGRES; - case 2: - return MYSQL; - default: - return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { - return internalValueMap; - } - - private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public DatabaseType findValueByNumber(int number) { - return DatabaseType.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - return getDescriptor().getValues().get(ordinal()); - } - - public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { - return getDescriptor(); - } - - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - .getDescriptor() - .getEnumTypes() - .get(0); - } - - private static final DatabaseType[] VALUES = values(); - - public static DatabaseType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private DatabaseType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.bigquery.connection.v1beta1.CloudSqlProperties.DatabaseType) - } - - public static final int INSTANCE_ID_FIELD_NUMBER = 1; - private volatile java.lang.Object instanceId_; - /** - * - * - *
-     * Cloud SQL instance ID in the form `project:location:instance`.
-     * 
- * - * string instance_id = 1; - * - * @return The instanceId. - */ - public java.lang.String getInstanceId() { - java.lang.Object ref = instanceId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - instanceId_ = s; - return s; - } - } - /** - * - * - *
-     * Cloud SQL instance ID in the form `project:location:instance`.
-     * 
- * - * string instance_id = 1; - * - * @return The bytes for instanceId. - */ - public com.google.protobuf.ByteString getInstanceIdBytes() { - java.lang.Object ref = instanceId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - instanceId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DATABASE_FIELD_NUMBER = 2; - private volatile java.lang.Object database_; - /** - * - * - *
-     * Database name.
-     * 
- * - * string database = 2; - * - * @return The database. - */ - public java.lang.String getDatabase() { - java.lang.Object ref = database_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - database_ = s; - return s; - } - } - /** - * - * - *
-     * Database name.
-     * 
- * - * string database = 2; - * - * @return The bytes for database. - */ - public com.google.protobuf.ByteString getDatabaseBytes() { - java.lang.Object ref = database_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - database_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TYPE_FIELD_NUMBER = 3; - private int type_; - /** - * - * - *
-     * Type of the Cloud SQL database.
-     * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties.DatabaseType type = 3; - * - * - * @return The enum numeric value on the wire for type. - */ - public int getTypeValue() { - return type_; - } - /** - * - * - *
-     * Type of the Cloud SQL database.
-     * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties.DatabaseType type = 3; - * - * - * @return The type. - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - .DatabaseType - getType() { - @SuppressWarnings("deprecation") - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties.DatabaseType - result = - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - .DatabaseType.valueOf(type_); - return result == null - ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - .DatabaseType.UNRECOGNIZED - : result; - } - - public static final int CREDENTIAL_FIELD_NUMBER = 4; - private com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - credential_; - /** - * - * - *
-     * Input only. Cloud SQL credential.
-     * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; - * - * - * @return Whether the credential field is set. - */ - public boolean hasCredential() { - return credential_ != null; - } - /** - * - * - *
-     * Input only. Cloud SQL credential.
-     * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; - * - * - * @return The credential. - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - getCredential() { - return credential_ == null - ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - .getDefaultInstance() - : credential_; - } - /** - * - * - *
-     * Input only. Cloud SQL credential.
-     * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; - * - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredentialOrBuilder - getCredentialOrBuilder() { - return getCredential(); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getInstanceIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, instanceId_); - } - if (!getDatabaseBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, database_); - } - if (type_ - != com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - .DatabaseType.DATABASE_TYPE_UNSPECIFIED - .getNumber()) { - output.writeEnum(3, type_); - } - if (credential_ != null) { - output.writeMessage(4, getCredential()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getInstanceIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, instanceId_); - } - if (!getDatabaseBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, database_); - } - if (type_ - != com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - .DatabaseType.DATABASE_TYPE_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, type_); - } - if (credential_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCredential()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj - instanceof - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties)) { - return super.equals(obj); - } - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties other = - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties) obj; - - if (!getInstanceId().equals(other.getInstanceId())) return false; - if (!getDatabase().equals(other.getDatabase())) return false; - if (type_ != other.type_) return false; - if (hasCredential() != other.hasCredential()) return false; - if (hasCredential()) { - if (!getCredential().equals(other.getCredential())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + INSTANCE_ID_FIELD_NUMBER; - hash = (53 * hash) + getInstanceId().hashCode(); - hash = (37 * hash) + DATABASE_FIELD_NUMBER; - hash = (53 * hash) + getDatabase().hashCode(); - hash = (37 * hash) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + type_; - if (hasCredential()) { - hash = (37 * hash) + CREDENTIAL_FIELD_NUMBER; - hash = (53 * hash) + getCredential().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * Connection properties specific to the Cloud SQL.
-     * 
- * - * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.CloudSqlProperties} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1beta1.CloudSqlProperties) - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlPropertiesOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlProperties_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlProperties_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - .class, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - .Builder.class); - } - - // Construct using - // com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - instanceId_ = ""; - - database_ = ""; - - type_ = 0; - - if (credentialBuilder_ == null) { - credential_ = null; - } else { - credential_ = null; - credentialBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlProperties_descriptor; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - getDefaultInstanceForType() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - build() { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties result = - buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - buildPartial() { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties result = - new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties( - this); - result.instanceId_ = instanceId_; - result.database_ = database_; - result.type_ = type_; - if (credentialBuilder_ == null) { - result.credential_ = credential_; - } else { - result.credential_ = credentialBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties) { - return mergeFrom( - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties) - other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties other) { - if (other - == com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - .getDefaultInstance()) return this; - if (!other.getInstanceId().isEmpty()) { - instanceId_ = other.instanceId_; - onChanged(); - } - if (!other.getDatabase().isEmpty()) { - database_ = other.database_; - onChanged(); - } - if (other.type_ != 0) { - setTypeValue(other.getTypeValue()); - } - if (other.hasCredential()) { - mergeCredential(other.getCredential()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object instanceId_ = ""; - /** - * - * - *
-       * Cloud SQL instance ID in the form `project:location:instance`.
-       * 
- * - * string instance_id = 1; - * - * @return The instanceId. - */ - public java.lang.String getInstanceId() { - java.lang.Object ref = instanceId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - instanceId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * Cloud SQL instance ID in the form `project:location:instance`.
-       * 
- * - * string instance_id = 1; - * - * @return The bytes for instanceId. - */ - public com.google.protobuf.ByteString getInstanceIdBytes() { - java.lang.Object ref = instanceId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - instanceId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * Cloud SQL instance ID in the form `project:location:instance`.
-       * 
- * - * string instance_id = 1; - * - * @param value The instanceId to set. - * @return This builder for chaining. - */ - public Builder setInstanceId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - instanceId_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Cloud SQL instance ID in the form `project:location:instance`.
-       * 
- * - * string instance_id = 1; - * - * @return This builder for chaining. - */ - public Builder clearInstanceId() { - - instanceId_ = getDefaultInstance().getInstanceId(); - onChanged(); - return this; - } - /** - * - * - *
-       * Cloud SQL instance ID in the form `project:location:instance`.
-       * 
- * - * string instance_id = 1; - * - * @param value The bytes for instanceId to set. - * @return This builder for chaining. - */ - public Builder setInstanceIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - instanceId_ = value; - onChanged(); - return this; - } - - private java.lang.Object database_ = ""; - /** - * - * - *
-       * Database name.
-       * 
- * - * string database = 2; - * - * @return The database. - */ - public java.lang.String getDatabase() { - java.lang.Object ref = database_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - database_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * Database name.
-       * 
- * - * string database = 2; - * - * @return The bytes for database. - */ - public com.google.protobuf.ByteString getDatabaseBytes() { - java.lang.Object ref = database_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - database_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * Database name.
-       * 
- * - * string database = 2; - * - * @param value The database to set. - * @return This builder for chaining. - */ - public Builder setDatabase(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - database_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Database name.
-       * 
- * - * string database = 2; - * - * @return This builder for chaining. - */ - public Builder clearDatabase() { - - database_ = getDefaultInstance().getDatabase(); - onChanged(); - return this; - } - /** - * - * - *
-       * Database name.
-       * 
- * - * string database = 2; - * - * @param value The bytes for database to set. - * @return This builder for chaining. - */ - public Builder setDatabaseBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - database_ = value; - onChanged(); - return this; - } - - private int type_ = 0; - /** - * - * - *
-       * Type of the Cloud SQL database.
-       * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties.DatabaseType type = 3; - * - * - * @return The enum numeric value on the wire for type. - */ - public int getTypeValue() { - return type_; - } - /** - * - * - *
-       * Type of the Cloud SQL database.
-       * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties.DatabaseType type = 3; - * - * - * @param value The enum numeric value on the wire for type to set. - * @return This builder for chaining. - */ - public Builder setTypeValue(int value) { - type_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Type of the Cloud SQL database.
-       * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties.DatabaseType type = 3; - * - * - * @return The type. - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - .DatabaseType - getType() { - @SuppressWarnings("deprecation") - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties.DatabaseType - result = - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - .DatabaseType.valueOf(type_); - return result == null - ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - .DatabaseType.UNRECOGNIZED - : result; - } - /** - * - * - *
-       * Type of the Cloud SQL database.
-       * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties.DatabaseType type = 3; - * - * - * @param value The type to set. - * @return This builder for chaining. - */ - public Builder setType( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - .DatabaseType - value) { - if (value == null) { - throw new NullPointerException(); - } - - type_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-       * Type of the Cloud SQL database.
-       * 
- * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties.DatabaseType type = 3; - * - * - * @return This builder for chaining. - */ - public Builder clearType() { - - type_ = 0; - onChanged(); - return this; - } - - private com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - credential_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - .Builder, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CloudSqlCredentialOrBuilder> - credentialBuilder_; - /** - * - * - *
-       * Input only. Cloud SQL credential.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; - * - * - * @return Whether the credential field is set. - */ - public boolean hasCredential() { - return credentialBuilder_ != null || credential_ != null; - } - /** - * - * - *
-       * Input only. Cloud SQL credential.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; - * - * - * @return The credential. - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - getCredential() { - if (credentialBuilder_ == null) { - return credential_ == null - ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - .getDefaultInstance() - : credential_; - } else { - return credentialBuilder_.getMessage(); - } - } - /** - * - * - *
-       * Input only. Cloud SQL credential.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; - * - */ - public Builder setCredential( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential value) { - if (credentialBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - credential_ = value; - onChanged(); - } else { - credentialBuilder_.setMessage(value); - } - - return this; - } - /** - * - * - *
-       * Input only. Cloud SQL credential.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; - * - */ - public Builder setCredential( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential.Builder - builderForValue) { - if (credentialBuilder_ == null) { - credential_ = builderForValue.build(); - onChanged(); - } else { - credentialBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * - * - *
-       * Input only. Cloud SQL credential.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; - * - */ - public Builder mergeCredential( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential value) { - if (credentialBuilder_ == null) { - if (credential_ != null) { - credential_ = - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - .newBuilder(credential_) - .mergeFrom(value) - .buildPartial(); - } else { - credential_ = value; - } - onChanged(); - } else { - credentialBuilder_.mergeFrom(value); - } - - return this; - } - /** - * - * - *
-       * Input only. Cloud SQL credential.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; - * - */ - public Builder clearCredential() { - if (credentialBuilder_ == null) { - credential_ = null; - onChanged(); - } else { - credential_ = null; - credentialBuilder_ = null; - } - - return this; - } - /** - * - * - *
-       * Input only. Cloud SQL credential.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; - * - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential.Builder - getCredentialBuilder() { - - onChanged(); - return getCredentialFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * Input only. Cloud SQL credential.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; - * - */ - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CloudSqlCredentialOrBuilder - getCredentialOrBuilder() { - if (credentialBuilder_ != null) { - return credentialBuilder_.getMessageOrBuilder(); - } else { - return credential_ == null - ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - .getDefaultInstance() - : credential_; - } - } - /** - * - * - *
-       * Input only. Cloud SQL credential.
-       * 
- * - * - * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - .Builder, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CloudSqlCredentialOrBuilder> - getCredentialFieldBuilder() { - if (credentialBuilder_ == null) { - credentialBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - .Builder, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CloudSqlCredentialOrBuilder>( - getCredential(), getParentForChildren(), isClean()); - credential_ = null; - } - return credentialBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.connection.v1beta1.CloudSqlProperties) - } - - // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1beta1.CloudSqlProperties) - private static final com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CloudSqlProperties - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties(); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CloudSqlProperties parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CloudSqlProperties(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface CloudSqlCredentialOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1beta1.CloudSqlCredential) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * The username for the credential.
-     * 
- * - * string username = 1; - * - * @return The username. - */ - java.lang.String getUsername(); - /** - * - * - *
-     * The username for the credential.
-     * 
- * - * string username = 1; - * - * @return The bytes for username. - */ - com.google.protobuf.ByteString getUsernameBytes(); - - /** - * - * - *
-     * The password for the credential.
-     * 
- * - * string password = 2; - * - * @return The password. - */ - java.lang.String getPassword(); - /** - * - * - *
-     * The password for the credential.
-     * 
- * - * string password = 2; - * - * @return The bytes for password. - */ - com.google.protobuf.ByteString getPasswordBytes(); - } - /** - * - * - *
-   * Credential info for the Cloud SQL.
-   * 
- * - * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.CloudSqlCredential} - */ - public static final class CloudSqlCredential extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1beta1.CloudSqlCredential) - CloudSqlCredentialOrBuilder { - private static final long serialVersionUID = 0L; - // Use CloudSqlCredential.newBuilder() to construct. - private CloudSqlCredential(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private CloudSqlCredential() { - username_ = ""; - password_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CloudSqlCredential(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private CloudSqlCredential( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - username_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - password_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlCredential_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlCredential_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential.class, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - .Builder.class); - } - - public static final int USERNAME_FIELD_NUMBER = 1; - private volatile java.lang.Object username_; - /** - * - * - *
-     * The username for the credential.
-     * 
- * - * string username = 1; - * - * @return The username. - */ - public java.lang.String getUsername() { - java.lang.Object ref = username_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - username_ = s; - return s; - } - } - /** - * - * - *
-     * The username for the credential.
-     * 
- * - * string username = 1; - * - * @return The bytes for username. - */ - public com.google.protobuf.ByteString getUsernameBytes() { - java.lang.Object ref = username_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - username_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PASSWORD_FIELD_NUMBER = 2; - private volatile java.lang.Object password_; - /** - * - * - *
-     * The password for the credential.
-     * 
- * - * string password = 2; - * - * @return The password. - */ - public java.lang.String getPassword() { - java.lang.Object ref = password_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - password_ = s; - return s; - } - } - /** - * - * - *
-     * The password for the credential.
-     * 
- * - * string password = 2; - * - * @return The bytes for password. - */ - public com.google.protobuf.ByteString getPasswordBytes() { - java.lang.Object ref = password_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - password_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getUsernameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, username_); - } - if (!getPasswordBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, password_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getUsernameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, username_); - } - if (!getPasswordBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, password_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj - instanceof - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential)) { - return super.equals(obj); - } - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential other = - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential) obj; - - if (!getUsername().equals(other.getUsername())) return false; - if (!getPassword().equals(other.getPassword())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + USERNAME_FIELD_NUMBER; - hash = (53 * hash) + getUsername().hashCode(); - hash = (37 * hash) + PASSWORD_FIELD_NUMBER; - hash = (53 * hash) + getPassword().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * Credential info for the Cloud SQL.
-     * 
- * - * Protobuf type {@code google.cloud.bigquery.connection.v1beta1.CloudSqlCredential} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1beta1.CloudSqlCredential) - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredentialOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlCredential_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlCredential_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - .class, - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - .Builder.class); - } - - // Construct using - // com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - username_ = ""; - - password_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlCredential_descriptor; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - getDefaultInstanceForType() { - return com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - build() { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential result = - buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - buildPartial() { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential result = - new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential( - this); - result.username_ = username_; - result.password_ = password_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential) { - return mergeFrom( - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential) - other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential other) { - if (other - == com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - .getDefaultInstance()) return this; - if (!other.getUsername().isEmpty()) { - username_ = other.username_; - onChanged(); - } - if (!other.getPassword().isEmpty()) { - password_ = other.password_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object username_ = ""; - /** - * - * - *
-       * The username for the credential.
-       * 
- * - * string username = 1; - * - * @return The username. - */ - public java.lang.String getUsername() { - java.lang.Object ref = username_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - username_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * The username for the credential.
-       * 
- * - * string username = 1; - * - * @return The bytes for username. - */ - public com.google.protobuf.ByteString getUsernameBytes() { - java.lang.Object ref = username_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - username_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * The username for the credential.
-       * 
- * - * string username = 1; - * - * @param value The username to set. - * @return This builder for chaining. - */ - public Builder setUsername(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - username_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * The username for the credential.
-       * 
- * - * string username = 1; - * - * @return This builder for chaining. - */ - public Builder clearUsername() { - - username_ = getDefaultInstance().getUsername(); - onChanged(); - return this; - } - /** - * - * - *
-       * The username for the credential.
-       * 
- * - * string username = 1; - * - * @param value The bytes for username to set. - * @return This builder for chaining. - */ - public Builder setUsernameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - username_ = value; - onChanged(); - return this; - } - - private java.lang.Object password_ = ""; - /** - * - * - *
-       * The password for the credential.
-       * 
- * - * string password = 2; - * - * @return The password. - */ - public java.lang.String getPassword() { - java.lang.Object ref = password_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - password_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * The password for the credential.
-       * 
- * - * string password = 2; - * - * @return The bytes for password. - */ - public com.google.protobuf.ByteString getPasswordBytes() { - java.lang.Object ref = password_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - password_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * The password for the credential.
-       * 
- * - * string password = 2; - * - * @param value The password to set. - * @return This builder for chaining. - */ - public Builder setPassword(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - password_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * The password for the credential.
-       * 
- * - * string password = 2; - * - * @return This builder for chaining. - */ - public Builder clearPassword() { - - password_ = getDefaultInstance().getPassword(); - onChanged(); - return this; - } - /** - * - * - *
-       * The password for the credential.
-       * 
- * - * string password = 2; - * - * @param value The bytes for password to set. - * @return This builder for chaining. - */ - public Builder setPasswordBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - password_ = value; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.connection.v1beta1.CloudSqlCredential) - } - - // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1beta1.CloudSqlCredential) - private static final com.google.cloud.bigquery.connection.v1beta1.ConnectionProto - .CloudSqlCredential - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential(); - } - - public static com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CloudSqlCredential parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CloudSqlCredential(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_bigquery_connection_v1beta1_CreateConnectionRequest_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_bigquery_connection_v1beta1_CreateConnectionRequest_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_bigquery_connection_v1beta1_GetConnectionRequest_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_bigquery_connection_v1beta1_GetConnectionRequest_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsRequest_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsRequest_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsResponse_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsResponse_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionRequest_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionRequest_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionCredentialRequest_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionCredentialRequest_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_bigquery_connection_v1beta1_DeleteConnectionRequest_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_bigquery_connection_v1beta1_DeleteConnectionRequest_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_bigquery_connection_v1beta1_Connection_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_bigquery_connection_v1beta1_Connection_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_bigquery_connection_v1beta1_ConnectionCredential_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_bigquery_connection_v1beta1_ConnectionCredential_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlProperties_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlProperties_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlCredential_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlCredential_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - return descriptor; - } - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - - static { - java.lang.String[] descriptorData = { - "\n9google/cloud/bigquery/connection/v1bet" - + "a1/connection.proto\022(google.cloud.bigque" - + "ry.connection.v1beta1\032\034google/api/annota" - + "tions.proto\032\027google/api/client.proto\032\037go" - + "ogle/api/field_behavior.proto\032\031google/ap" - + "i/resource.proto\032\036google/iam/v1/iam_poli" - + "cy.proto\032\032google/iam/v1/policy.proto\032\033go" - + "ogle/protobuf/empty.proto\032 google/protob" - + "uf/field_mask.proto\032\036google/protobuf/wra" - + "ppers.proto\"\277\001\n\027CreateConnectionRequest\022" - + "9\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!locations.googl" - + "eapis.com/Location\022\032\n\rconnection_id\030\002 \001(" - + "\tB\003\340A\001\022M\n\nconnection\030\003 \001(\01324.google.clou" - + "d.bigquery.connection.v1beta1.Connection" - + "B\003\340A\002\"Z\n\024GetConnectionRequest\022B\n\004name\030\001 " - + "\001(\tB4\340A\002\372A.\n,bigqueryconnection.googleap" - + "is.com/Connection\"\237\001\n\026ListConnectionsReq" - + "uest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!locations." - + "googleapis.com/Location\0226\n\013max_results\030\002" - + " \001(\0132\034.google.protobuf.UInt32ValueB\003\340A\002\022" - + "\022\n\npage_token\030\003 \001(\t\"}\n\027ListConnectionsRe" - + "sponse\022\027\n\017next_page_token\030\001 \001(\t\022I\n\013conne" - + "ctions\030\002 \003(\01324.google.cloud.bigquery.con" - + "nection.v1beta1.Connection\"\342\001\n\027UpdateCon" - + "nectionRequest\022B\n\004name\030\001 \001(\tB4\340A\002\372A.\n,bi" - + "gqueryconnection.googleapis.com/Connecti" - + "on\022M\n\nconnection\030\002 \001(\01324.google.cloud.bi" - + "gquery.connection.v1beta1.ConnectionB\003\340A" - + "\002\0224\n\013update_mask\030\003 \001(\0132\032.google.protobuf" - + ".FieldMaskB\003\340A\002\"\217\001\n!UpdateConnectionCred" - + "entialRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\022W\n\ncred" - + "ential\030\002 \001(\0132>.google.cloud.bigquery.con" - + "nection.v1beta1.ConnectionCredentialB\003\340A" - + "\002\"]\n\027DeleteConnectionRequest\022B\n\004name\030\001 \001" - + "(\tB4\340A\002\372A.\n,bigqueryconnection.googleapi" - + "s.com/Connection\"\366\002\n\nConnection\022\014\n\004name\030" - + "\001 \001(\t\022\025\n\rfriendly_name\030\002 \001(\t\022\023\n\013descript" - + "ion\030\003 \001(\t\022Q\n\tcloud_sql\030\004 \001(\0132<.google.cl" - + "oud.bigquery.connection.v1beta1.CloudSql" - + "PropertiesH\000\022\032\n\rcreation_time\030\005 \001(\003B\003\340A\003" - + "\022\037\n\022last_modified_time\030\006 \001(\003B\003\340A\003\022\033\n\016has" - + "_credential\030\007 \001(\010B\003\340A\003:s\352Ap\n,bigquerycon" - + "nection.googleapis.com/Connection\022@proje" - + "cts/{project}/locations/{location}/conne" - + "ctions/{connection}B\014\n\nproperties\"w\n\024Con" - + "nectionCredential\022Q\n\tcloud_sql\030\001 \001(\0132<.g" - + "oogle.cloud.bigquery.connection.v1beta1." - + "CloudSqlCredentialH\000B\014\n\ncredential\"\263\002\n\022C" - + "loudSqlProperties\022\023\n\013instance_id\030\001 \001(\t\022\020" - + "\n\010database\030\002 \001(\t\022W\n\004type\030\003 \001(\0162I.google." - + "cloud.bigquery.connection.v1beta1.CloudS" - + "qlProperties.DatabaseType\022U\n\ncredential\030" - + "\004 \001(\0132<.google.cloud.bigquery.connection" - + ".v1beta1.CloudSqlCredentialB\003\340A\004\"F\n\014Data" - + "baseType\022\035\n\031DATABASE_TYPE_UNSPECIFIED\020\000\022" - + "\014\n\010POSTGRES\020\001\022\t\n\005MYSQL\020\002\"8\n\022CloudSqlCred" - + "ential\022\020\n\010username\030\001 \001(\t\022\020\n\010password\030\002 \001" - + "(\t2\230\020\n\021ConnectionService\022\367\001\n\020CreateConne" - + "ction\022A.google.cloud.bigquery.connection" - + ".v1beta1.CreateConnectionRequest\0324.googl" - + "e.cloud.bigquery.connection.v1beta1.Conn" - + "ection\"j\202\323\344\223\002B\"4/v1beta1/{parent=project" - + "s/*/locations/*}/connections:\nconnection" - + "\332A\037parent,connection,connection_id\022\312\001\n\rG" - + "etConnection\022>.google.cloud.bigquery.con" - + "nection.v1beta1.GetConnectionRequest\0324.g" - + "oogle.cloud.bigquery.connection.v1beta1." - + "Connection\"C\202\323\344\223\0026\0224/v1beta1/{name=proje" - + "cts/*/locations/*/connections/*}\332A\004name\022" - + "\351\001\n\017ListConnections\022@.google.cloud.bigqu" - + "ery.connection.v1beta1.ListConnectionsRe" - + "quest\032A.google.cloud.bigquery.connection" - + ".v1beta1.ListConnectionsResponse\"Q\202\323\344\223\0026" - + "\0224/v1beta1/{parent=projects/*/locations/" - + "*}/connections\332A\022parent,max_results\022\363\001\n\020" - + "UpdateConnection\022A.google.cloud.bigquery" - + ".connection.v1beta1.UpdateConnectionRequ" - + "est\0324.google.cloud.bigquery.connection.v" - + "1beta1.Connection\"f\202\323\344\223\002B24/v1beta1/{nam" - + "e=projects/*/locations/*/connections/*}:" - + "\nconnection\332A\033name,connection,update_mas" - + "k\022\350\001\n\032UpdateConnectionCredential\022K.googl" - + "e.cloud.bigquery.connection.v1beta1.Upda" - + "teConnectionCredentialRequest\032\026.google.p" - + "rotobuf.Empty\"e\202\323\344\223\002M2?/v1beta1/{name=pr" - + "ojects/*/locations/*/connections/*/crede" - + "ntial}:\ncredential\332A\017name,credential\022\262\001\n" - + "\020DeleteConnection\022A.google.cloud.bigquer" - + "y.connection.v1beta1.DeleteConnectionReq" - + "uest\032\026.google.protobuf.Empty\"C\202\323\344\223\0026*4/v" - + "1beta1/{name=projects/*/locations/*/conn" - + "ections/*}\332A\004name\022\256\001\n\014GetIamPolicy\022\".goo" - + "gle.iam.v1.GetIamPolicyRequest\032\025.google." - + "iam.v1.Policy\"c\202\323\344\223\002J\"E/v1beta1/{resourc" - + "e=projects/*/locations/*/connections/*}:" - + "getIamPolicy:\001*\332A\020resource,options\022\255\001\n\014S" - + "etIamPolicy\022\".google.iam.v1.SetIamPolicy" - + "Request\032\025.google.iam.v1.Policy\"b\202\323\344\223\002J\"E" - + "/v1beta1/{resource=projects/*/locations/" - + "*/connections/*}:setIamPolicy:\001*\332A\017resou" - + "rce,policy\022\330\001\n\022TestIamPermissions\022(.goog" - + "le.iam.v1.TestIamPermissionsRequest\032).go" - + "ogle.iam.v1.TestIamPermissionsResponse\"m" - + "\202\323\344\223\002P\"K/v1beta1/{resource=projects/*/lo" - + "cations/*/connections/*}:testIamPermissi" - + "ons:\001*\332A\024resource,permissions\032~\312A!bigque" - + "ryconnection.googleapis.com\322AWhttps://ww" - + "w.googleapis.com/auth/bigquery,https://w" - + "ww.googleapis.com/auth/cloud-platformB\276\001" - + "\n,com.google.cloud.bigquery.connection.v" - + "1beta1B\017ConnectionProtoZRgoogle.golang.o" - + "rg/genproto/googleapis/cloud/bigquery/co" - + "nnection/v1beta1;connection\252\002(Google.Clo" - + "ud.BigQuery.Connection.V1Beta1b\006proto3" - }; - descriptor = - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.api.AnnotationsProto.getDescriptor(), - com.google.api.ClientProto.getDescriptor(), - com.google.api.FieldBehaviorProto.getDescriptor(), - com.google.api.ResourceProto.getDescriptor(), - com.google.iam.v1.IamPolicyProto.getDescriptor(), - com.google.iam.v1.PolicyProto.getDescriptor(), - com.google.protobuf.EmptyProto.getDescriptor(), - com.google.protobuf.FieldMaskProto.getDescriptor(), - com.google.protobuf.WrappersProto.getDescriptor(), - }); - internal_static_google_cloud_bigquery_connection_v1beta1_CreateConnectionRequest_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_google_cloud_bigquery_connection_v1beta1_CreateConnectionRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_bigquery_connection_v1beta1_CreateConnectionRequest_descriptor, - new java.lang.String[] { - "Parent", "ConnectionId", "Connection", - }); - internal_static_google_cloud_bigquery_connection_v1beta1_GetConnectionRequest_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_google_cloud_bigquery_connection_v1beta1_GetConnectionRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_bigquery_connection_v1beta1_GetConnectionRequest_descriptor, - new java.lang.String[] { - "Name", - }); - internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsRequest_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsRequest_descriptor, - new java.lang.String[] { - "Parent", "MaxResults", "PageToken", - }); - internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsResponse_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_bigquery_connection_v1beta1_ListConnectionsResponse_descriptor, - new java.lang.String[] { - "NextPageToken", "Connections", - }); - internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionRequest_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionRequest_descriptor, - new java.lang.String[] { - "Name", "Connection", "UpdateMask", - }); - internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionCredentialRequest_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionCredentialRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_bigquery_connection_v1beta1_UpdateConnectionCredentialRequest_descriptor, - new java.lang.String[] { - "Name", "Credential", - }); - internal_static_google_cloud_bigquery_connection_v1beta1_DeleteConnectionRequest_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_google_cloud_bigquery_connection_v1beta1_DeleteConnectionRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_bigquery_connection_v1beta1_DeleteConnectionRequest_descriptor, - new java.lang.String[] { - "Name", - }); - internal_static_google_cloud_bigquery_connection_v1beta1_Connection_descriptor = - getDescriptor().getMessageTypes().get(7); - internal_static_google_cloud_bigquery_connection_v1beta1_Connection_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_bigquery_connection_v1beta1_Connection_descriptor, - new java.lang.String[] { - "Name", - "FriendlyName", - "Description", - "CloudSql", - "CreationTime", - "LastModifiedTime", - "HasCredential", - "Properties", - }); - internal_static_google_cloud_bigquery_connection_v1beta1_ConnectionCredential_descriptor = - getDescriptor().getMessageTypes().get(8); - internal_static_google_cloud_bigquery_connection_v1beta1_ConnectionCredential_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_bigquery_connection_v1beta1_ConnectionCredential_descriptor, - new java.lang.String[] { - "CloudSql", "Credential", - }); - internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlProperties_descriptor = - getDescriptor().getMessageTypes().get(9); - internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlProperties_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlProperties_descriptor, - new java.lang.String[] { - "InstanceId", "Database", "Type", "Credential", - }); - internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlCredential_descriptor = - getDescriptor().getMessageTypes().get(10); - internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlCredential_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_bigquery_connection_v1beta1_CloudSqlCredential_descriptor, - new java.lang.String[] { - "Username", "Password", - }); - com.google.protobuf.ExtensionRegistry registry = - com.google.protobuf.ExtensionRegistry.newInstance(); - registry.add(com.google.api.ClientProto.defaultHost); - registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); - registry.add(com.google.api.AnnotationsProto.http); - registry.add(com.google.api.ClientProto.methodSignature); - registry.add(com.google.api.ClientProto.oauthScopes); - registry.add(com.google.api.ResourceProto.resource); - registry.add(com.google.api.ResourceProto.resourceReference); - com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( - descriptor, registry); - com.google.api.AnnotationsProto.getDescriptor(); - com.google.api.ClientProto.getDescriptor(); - com.google.api.FieldBehaviorProto.getDescriptor(); - com.google.api.ResourceProto.getDescriptor(); - com.google.iam.v1.IamPolicyProto.getDescriptor(); - com.google.iam.v1.PolicyProto.getDescriptor(); - com.google.protobuf.EmptyProto.getDescriptor(); - com.google.protobuf.FieldMaskProto.getDescriptor(); - com.google.protobuf.WrappersProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/proto-google-cloud-bigqueryconnection-v1/pom.xml b/proto-google-cloud-bigqueryconnection-v1/pom.xml new file mode 100644 index 00000000..5caf86ad --- /dev/null +++ b/proto-google-cloud-bigqueryconnection-v1/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-bigqueryconnection-v1 + 0.0.1-SNAPSHOT + proto-google-cloud-bigqueryconnection-v1 + PROTO library for proto-google-cloud-bigqueryconnection-v1 + + com.google.cloud + google-cloud-bigqueryconnection-parent + 0.0.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api + api-common + + + com.google.guava + guava + + + com.google.api.grpc + proto-google-iam-v1 + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/CloudSqlCredential.java b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/CloudSqlCredential.java new file mode 100644 index 00000000..2c1cab94 --- /dev/null +++ b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/CloudSqlCredential.java @@ -0,0 +1,816 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/connection/v1/connection.proto + +package com.google.cloud.bigquery.connection.v1; + +/** + * + * + *
+ * Credential info for the Cloud SQL.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1.CloudSqlCredential} + */ +public final class CloudSqlCredential extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1.CloudSqlCredential) + CloudSqlCredentialOrBuilder { + private static final long serialVersionUID = 0L; + // Use CloudSqlCredential.newBuilder() to construct. + private CloudSqlCredential(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CloudSqlCredential() { + username_ = ""; + password_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CloudSqlCredential(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CloudSqlCredential( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + username_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + password_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_CloudSqlCredential_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_CloudSqlCredential_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1.CloudSqlCredential.class, + com.google.cloud.bigquery.connection.v1.CloudSqlCredential.Builder.class); + } + + public static final int USERNAME_FIELD_NUMBER = 1; + private volatile java.lang.Object username_; + /** + * + * + *
+   * The username for the credential.
+   * 
+ * + * string username = 1; + * + * @return The username. + */ + @java.lang.Override + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + username_ = s; + return s; + } + } + /** + * + * + *
+   * The username for the credential.
+   * 
+ * + * string username = 1; + * + * @return The bytes for username. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PASSWORD_FIELD_NUMBER = 2; + private volatile java.lang.Object password_; + /** + * + * + *
+   * The password for the credential.
+   * 
+ * + * string password = 2; + * + * @return The password. + */ + @java.lang.Override + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } + } + /** + * + * + *
+   * The password for the credential.
+   * 
+ * + * string password = 2; + * + * @return The bytes for password. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getUsernameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, username_); + } + if (!getPasswordBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, password_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getUsernameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, username_); + } + if (!getPasswordBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, password_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.connection.v1.CloudSqlCredential)) { + return super.equals(obj); + } + com.google.cloud.bigquery.connection.v1.CloudSqlCredential other = + (com.google.cloud.bigquery.connection.v1.CloudSqlCredential) obj; + + if (!getUsername().equals(other.getUsername())) return false; + if (!getPassword().equals(other.getPassword())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + USERNAME_FIELD_NUMBER; + hash = (53 * hash) + getUsername().hashCode(); + hash = (37 * hash) + PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPassword().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.connection.v1.CloudSqlCredential parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1.CloudSqlCredential parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.CloudSqlCredential parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1.CloudSqlCredential parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.CloudSqlCredential parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1.CloudSqlCredential parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.CloudSqlCredential parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1.CloudSqlCredential parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.CloudSqlCredential parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1.CloudSqlCredential parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.CloudSqlCredential parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1.CloudSqlCredential parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.bigquery.connection.v1.CloudSqlCredential prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Credential info for the Cloud SQL.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1.CloudSqlCredential} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1.CloudSqlCredential) + com.google.cloud.bigquery.connection.v1.CloudSqlCredentialOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_CloudSqlCredential_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_CloudSqlCredential_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1.CloudSqlCredential.class, + com.google.cloud.bigquery.connection.v1.CloudSqlCredential.Builder.class); + } + + // Construct using com.google.cloud.bigquery.connection.v1.CloudSqlCredential.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + username_ = ""; + + password_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_CloudSqlCredential_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.CloudSqlCredential getDefaultInstanceForType() { + return com.google.cloud.bigquery.connection.v1.CloudSqlCredential.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.CloudSqlCredential build() { + com.google.cloud.bigquery.connection.v1.CloudSqlCredential result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.CloudSqlCredential buildPartial() { + com.google.cloud.bigquery.connection.v1.CloudSqlCredential result = + new com.google.cloud.bigquery.connection.v1.CloudSqlCredential(this); + result.username_ = username_; + result.password_ = password_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.connection.v1.CloudSqlCredential) { + return mergeFrom((com.google.cloud.bigquery.connection.v1.CloudSqlCredential) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.connection.v1.CloudSqlCredential other) { + if (other == com.google.cloud.bigquery.connection.v1.CloudSqlCredential.getDefaultInstance()) + return this; + if (!other.getUsername().isEmpty()) { + username_ = other.username_; + onChanged(); + } + if (!other.getPassword().isEmpty()) { + password_ = other.password_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.bigquery.connection.v1.CloudSqlCredential parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.connection.v1.CloudSqlCredential) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object username_ = ""; + /** + * + * + *
+     * The username for the credential.
+     * 
+ * + * string username = 1; + * + * @return The username. + */ + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + username_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The username for the credential.
+     * 
+ * + * string username = 1; + * + * @return The bytes for username. + */ + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The username for the credential.
+     * 
+ * + * string username = 1; + * + * @param value The username to set. + * @return This builder for chaining. + */ + public Builder setUsername(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + username_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The username for the credential.
+     * 
+ * + * string username = 1; + * + * @return This builder for chaining. + */ + public Builder clearUsername() { + + username_ = getDefaultInstance().getUsername(); + onChanged(); + return this; + } + /** + * + * + *
+     * The username for the credential.
+     * 
+ * + * string username = 1; + * + * @param value The bytes for username to set. + * @return This builder for chaining. + */ + public Builder setUsernameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + username_ = value; + onChanged(); + return this; + } + + private java.lang.Object password_ = ""; + /** + * + * + *
+     * The password for the credential.
+     * 
+ * + * string password = 2; + * + * @return The password. + */ + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The password for the credential.
+     * 
+ * + * string password = 2; + * + * @return The bytes for password. + */ + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The password for the credential.
+     * 
+ * + * string password = 2; + * + * @param value The password to set. + * @return This builder for chaining. + */ + public Builder setPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + password_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The password for the credential.
+     * 
+ * + * string password = 2; + * + * @return This builder for chaining. + */ + public Builder clearPassword() { + + password_ = getDefaultInstance().getPassword(); + onChanged(); + return this; + } + /** + * + * + *
+     * The password for the credential.
+     * 
+ * + * string password = 2; + * + * @param value The bytes for password to set. + * @return This builder for chaining. + */ + public Builder setPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + password_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.connection.v1.CloudSqlCredential) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1.CloudSqlCredential) + private static final com.google.cloud.bigquery.connection.v1.CloudSqlCredential DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.connection.v1.CloudSqlCredential(); + } + + public static com.google.cloud.bigquery.connection.v1.CloudSqlCredential getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CloudSqlCredential parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CloudSqlCredential(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.CloudSqlCredential getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/CloudSqlCredentialOrBuilder.java b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/CloudSqlCredentialOrBuilder.java new file mode 100644 index 00000000..4ffc1de6 --- /dev/null +++ b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/CloudSqlCredentialOrBuilder.java @@ -0,0 +1,75 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/connection/v1/connection.proto + +package com.google.cloud.bigquery.connection.v1; + +public interface CloudSqlCredentialOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1.CloudSqlCredential) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The username for the credential.
+   * 
+ * + * string username = 1; + * + * @return The username. + */ + java.lang.String getUsername(); + /** + * + * + *
+   * The username for the credential.
+   * 
+ * + * string username = 1; + * + * @return The bytes for username. + */ + com.google.protobuf.ByteString getUsernameBytes(); + + /** + * + * + *
+   * The password for the credential.
+   * 
+ * + * string password = 2; + * + * @return The password. + */ + java.lang.String getPassword(); + /** + * + * + *
+   * The password for the credential.
+   * 
+ * + * string password = 2; + * + * @return The bytes for password. + */ + com.google.protobuf.ByteString getPasswordBytes(); +} diff --git a/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/CloudSqlProperties.java b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/CloudSqlProperties.java new file mode 100644 index 00000000..efaa8d06 --- /dev/null +++ b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/CloudSqlProperties.java @@ -0,0 +1,1443 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/connection/v1/connection.proto + +package com.google.cloud.bigquery.connection.v1; + +/** + * + * + *
+ * Connection properties specific to the Cloud SQL.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1.CloudSqlProperties} + */ +public final class CloudSqlProperties extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1.CloudSqlProperties) + CloudSqlPropertiesOrBuilder { + private static final long serialVersionUID = 0L; + // Use CloudSqlProperties.newBuilder() to construct. + private CloudSqlProperties(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CloudSqlProperties() { + instanceId_ = ""; + database_ = ""; + type_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CloudSqlProperties(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CloudSqlProperties( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + instanceId_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + database_ = s; + break; + } + case 24: + { + int rawValue = input.readEnum(); + + type_ = rawValue; + break; + } + case 34: + { + com.google.cloud.bigquery.connection.v1.CloudSqlCredential.Builder subBuilder = null; + if (credential_ != null) { + subBuilder = credential_.toBuilder(); + } + credential_ = + input.readMessage( + com.google.cloud.bigquery.connection.v1.CloudSqlCredential.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(credential_); + credential_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_CloudSqlProperties_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_CloudSqlProperties_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1.CloudSqlProperties.class, + com.google.cloud.bigquery.connection.v1.CloudSqlProperties.Builder.class); + } + + /** + * + * + *
+   * Supported Cloud SQL database types.
+   * 
+ * + * Protobuf enum {@code google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType} + */ + public enum DatabaseType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified database type.
+     * 
+ * + * DATABASE_TYPE_UNSPECIFIED = 0; + */ + DATABASE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Cloud SQL for PostgreSQL.
+     * 
+ * + * POSTGRES = 1; + */ + POSTGRES(1), + /** + * + * + *
+     * Cloud SQL for MySQL.
+     * 
+ * + * MYSQL = 2; + */ + MYSQL(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified database type.
+     * 
+ * + * DATABASE_TYPE_UNSPECIFIED = 0; + */ + public static final int DATABASE_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Cloud SQL for PostgreSQL.
+     * 
+ * + * POSTGRES = 1; + */ + public static final int POSTGRES_VALUE = 1; + /** + * + * + *
+     * Cloud SQL for MySQL.
+     * 
+ * + * MYSQL = 2; + */ + public static final int MYSQL_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DatabaseType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static DatabaseType forNumber(int value) { + switch (value) { + case 0: + return DATABASE_TYPE_UNSPECIFIED; + case 1: + return POSTGRES; + case 2: + return MYSQL; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public DatabaseType findValueByNumber(int number) { + return DatabaseType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1.CloudSqlProperties.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final DatabaseType[] VALUES = values(); + + public static DatabaseType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private DatabaseType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType) + } + + public static final int INSTANCE_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object instanceId_; + /** + * + * + *
+   * Cloud SQL instance ID in the form `project:location:instance`.
+   * 
+ * + * string instance_id = 1; + * + * @return The instanceId. + */ + @java.lang.Override + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instanceId_ = s; + return s; + } + } + /** + * + * + *
+   * Cloud SQL instance ID in the form `project:location:instance`.
+   * 
+ * + * string instance_id = 1; + * + * @return The bytes for instanceId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATABASE_FIELD_NUMBER = 2; + private volatile java.lang.Object database_; + /** + * + * + *
+   * Database name.
+   * 
+ * + * string database = 2; + * + * @return The database. + */ + @java.lang.Override + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } + } + /** + * + * + *
+   * Database name.
+   * 
+ * + * string database = 2; + * + * @return The bytes for database. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 3; + private int type_; + /** + * + * + *
+   * Type of the Cloud SQL database.
+   * 
+ * + * .google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType type = 3; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+   * Type of the Cloud SQL database.
+   * 
+ * + * .google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType type = 3; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType getType() { + @SuppressWarnings("deprecation") + com.google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType result = + com.google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType.valueOf(type_); + return result == null + ? com.google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType.UNRECOGNIZED + : result; + } + + public static final int CREDENTIAL_FIELD_NUMBER = 4; + private com.google.cloud.bigquery.connection.v1.CloudSqlCredential credential_; + /** + * + * + *
+   * Input only. Cloud SQL credential.
+   * 
+ * + * + * .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the credential field is set. + */ + @java.lang.Override + public boolean hasCredential() { + return credential_ != null; + } + /** + * + * + *
+   * Input only. Cloud SQL credential.
+   * 
+ * + * + * .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The credential. + */ + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.CloudSqlCredential getCredential() { + return credential_ == null + ? com.google.cloud.bigquery.connection.v1.CloudSqlCredential.getDefaultInstance() + : credential_; + } + /** + * + * + *
+   * Input only. Cloud SQL credential.
+   * 
+ * + * + * .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.CloudSqlCredentialOrBuilder + getCredentialOrBuilder() { + return getCredential(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getInstanceIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, instanceId_); + } + if (!getDatabaseBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, database_); + } + if (type_ + != com.google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType + .DATABASE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, type_); + } + if (credential_ != null) { + output.writeMessage(4, getCredential()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getInstanceIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, instanceId_); + } + if (!getDatabaseBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, database_); + } + if (type_ + != com.google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType + .DATABASE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, type_); + } + if (credential_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCredential()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.connection.v1.CloudSqlProperties)) { + return super.equals(obj); + } + com.google.cloud.bigquery.connection.v1.CloudSqlProperties other = + (com.google.cloud.bigquery.connection.v1.CloudSqlProperties) obj; + + if (!getInstanceId().equals(other.getInstanceId())) return false; + if (!getDatabase().equals(other.getDatabase())) return false; + if (type_ != other.type_) return false; + if (hasCredential() != other.hasCredential()) return false; + if (hasCredential()) { + if (!getCredential().equals(other.getCredential())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + INSTANCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getInstanceId().hashCode(); + hash = (37 * hash) + DATABASE_FIELD_NUMBER; + hash = (53 * hash) + getDatabase().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + if (hasCredential()) { + hash = (37 * hash) + CREDENTIAL_FIELD_NUMBER; + hash = (53 * hash) + getCredential().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.connection.v1.CloudSqlProperties parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1.CloudSqlProperties parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.CloudSqlProperties parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1.CloudSqlProperties parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.CloudSqlProperties parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1.CloudSqlProperties parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.CloudSqlProperties parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1.CloudSqlProperties parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.CloudSqlProperties parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1.CloudSqlProperties parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.CloudSqlProperties parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1.CloudSqlProperties parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.bigquery.connection.v1.CloudSqlProperties prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Connection properties specific to the Cloud SQL.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1.CloudSqlProperties} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1.CloudSqlProperties) + com.google.cloud.bigquery.connection.v1.CloudSqlPropertiesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_CloudSqlProperties_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_CloudSqlProperties_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1.CloudSqlProperties.class, + com.google.cloud.bigquery.connection.v1.CloudSqlProperties.Builder.class); + } + + // Construct using com.google.cloud.bigquery.connection.v1.CloudSqlProperties.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + instanceId_ = ""; + + database_ = ""; + + type_ = 0; + + if (credentialBuilder_ == null) { + credential_ = null; + } else { + credential_ = null; + credentialBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_CloudSqlProperties_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.CloudSqlProperties getDefaultInstanceForType() { + return com.google.cloud.bigquery.connection.v1.CloudSqlProperties.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.CloudSqlProperties build() { + com.google.cloud.bigquery.connection.v1.CloudSqlProperties result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.CloudSqlProperties buildPartial() { + com.google.cloud.bigquery.connection.v1.CloudSqlProperties result = + new com.google.cloud.bigquery.connection.v1.CloudSqlProperties(this); + result.instanceId_ = instanceId_; + result.database_ = database_; + result.type_ = type_; + if (credentialBuilder_ == null) { + result.credential_ = credential_; + } else { + result.credential_ = credentialBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.connection.v1.CloudSqlProperties) { + return mergeFrom((com.google.cloud.bigquery.connection.v1.CloudSqlProperties) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.connection.v1.CloudSqlProperties other) { + if (other == com.google.cloud.bigquery.connection.v1.CloudSqlProperties.getDefaultInstance()) + return this; + if (!other.getInstanceId().isEmpty()) { + instanceId_ = other.instanceId_; + onChanged(); + } + if (!other.getDatabase().isEmpty()) { + database_ = other.database_; + onChanged(); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (other.hasCredential()) { + mergeCredential(other.getCredential()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.bigquery.connection.v1.CloudSqlProperties parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.connection.v1.CloudSqlProperties) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object instanceId_ = ""; + /** + * + * + *
+     * Cloud SQL instance ID in the form `project:location:instance`.
+     * 
+ * + * string instance_id = 1; + * + * @return The instanceId. + */ + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instanceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Cloud SQL instance ID in the form `project:location:instance`.
+     * 
+ * + * string instance_id = 1; + * + * @return The bytes for instanceId. + */ + public com.google.protobuf.ByteString getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Cloud SQL instance ID in the form `project:location:instance`.
+     * 
+ * + * string instance_id = 1; + * + * @param value The instanceId to set. + * @return This builder for chaining. + */ + public Builder setInstanceId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + instanceId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Cloud SQL instance ID in the form `project:location:instance`.
+     * 
+ * + * string instance_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearInstanceId() { + + instanceId_ = getDefaultInstance().getInstanceId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Cloud SQL instance ID in the form `project:location:instance`.
+     * 
+ * + * string instance_id = 1; + * + * @param value The bytes for instanceId to set. + * @return This builder for chaining. + */ + public Builder setInstanceIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + instanceId_ = value; + onChanged(); + return this; + } + + private java.lang.Object database_ = ""; + /** + * + * + *
+     * Database name.
+     * 
+ * + * string database = 2; + * + * @return The database. + */ + public java.lang.String getDatabase() { + java.lang.Object ref = database_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + database_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Database name.
+     * 
+ * + * string database = 2; + * + * @return The bytes for database. + */ + public com.google.protobuf.ByteString getDatabaseBytes() { + java.lang.Object ref = database_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + database_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Database name.
+     * 
+ * + * string database = 2; + * + * @param value The database to set. + * @return This builder for chaining. + */ + public Builder setDatabase(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + database_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Database name.
+     * 
+ * + * string database = 2; + * + * @return This builder for chaining. + */ + public Builder clearDatabase() { + + database_ = getDefaultInstance().getDatabase(); + onChanged(); + return this; + } + /** + * + * + *
+     * Database name.
+     * 
+ * + * string database = 2; + * + * @param value The bytes for database to set. + * @return This builder for chaining. + */ + public Builder setDatabaseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + database_ = value; + onChanged(); + return this; + } + + private int type_ = 0; + /** + * + * + *
+     * Type of the Cloud SQL database.
+     * 
+ * + * .google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType type = 3; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+     * Type of the Cloud SQL database.
+     * 
+ * + * .google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType type = 3; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Type of the Cloud SQL database.
+     * 
+ * + * .google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType type = 3; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType getType() { + @SuppressWarnings("deprecation") + com.google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType result = + com.google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType.valueOf(type_); + return result == null + ? com.google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Type of the Cloud SQL database.
+     * 
+ * + * .google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType type = 3; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType( + com.google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Type of the Cloud SQL database.
+     * 
+ * + * .google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType type = 3; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.bigquery.connection.v1.CloudSqlCredential credential_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1.CloudSqlCredential, + com.google.cloud.bigquery.connection.v1.CloudSqlCredential.Builder, + com.google.cloud.bigquery.connection.v1.CloudSqlCredentialOrBuilder> + credentialBuilder_; + /** + * + * + *
+     * Input only. Cloud SQL credential.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the credential field is set. + */ + public boolean hasCredential() { + return credentialBuilder_ != null || credential_ != null; + } + /** + * + * + *
+     * Input only. Cloud SQL credential.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The credential. + */ + public com.google.cloud.bigquery.connection.v1.CloudSqlCredential getCredential() { + if (credentialBuilder_ == null) { + return credential_ == null + ? com.google.cloud.bigquery.connection.v1.CloudSqlCredential.getDefaultInstance() + : credential_; + } else { + return credentialBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Input only. Cloud SQL credential.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder setCredential(com.google.cloud.bigquery.connection.v1.CloudSqlCredential value) { + if (credentialBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + credential_ = value; + onChanged(); + } else { + credentialBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Input only. Cloud SQL credential.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder setCredential( + com.google.cloud.bigquery.connection.v1.CloudSqlCredential.Builder builderForValue) { + if (credentialBuilder_ == null) { + credential_ = builderForValue.build(); + onChanged(); + } else { + credentialBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Input only. Cloud SQL credential.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder mergeCredential( + com.google.cloud.bigquery.connection.v1.CloudSqlCredential value) { + if (credentialBuilder_ == null) { + if (credential_ != null) { + credential_ = + com.google.cloud.bigquery.connection.v1.CloudSqlCredential.newBuilder(credential_) + .mergeFrom(value) + .buildPartial(); + } else { + credential_ = value; + } + onChanged(); + } else { + credentialBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Input only. Cloud SQL credential.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder clearCredential() { + if (credentialBuilder_ == null) { + credential_ = null; + onChanged(); + } else { + credential_ = null; + credentialBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Input only. Cloud SQL credential.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public com.google.cloud.bigquery.connection.v1.CloudSqlCredential.Builder + getCredentialBuilder() { + + onChanged(); + return getCredentialFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Input only. Cloud SQL credential.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public com.google.cloud.bigquery.connection.v1.CloudSqlCredentialOrBuilder + getCredentialOrBuilder() { + if (credentialBuilder_ != null) { + return credentialBuilder_.getMessageOrBuilder(); + } else { + return credential_ == null + ? com.google.cloud.bigquery.connection.v1.CloudSqlCredential.getDefaultInstance() + : credential_; + } + } + /** + * + * + *
+     * Input only. Cloud SQL credential.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1.CloudSqlCredential, + com.google.cloud.bigquery.connection.v1.CloudSqlCredential.Builder, + com.google.cloud.bigquery.connection.v1.CloudSqlCredentialOrBuilder> + getCredentialFieldBuilder() { + if (credentialBuilder_ == null) { + credentialBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1.CloudSqlCredential, + com.google.cloud.bigquery.connection.v1.CloudSqlCredential.Builder, + com.google.cloud.bigquery.connection.v1.CloudSqlCredentialOrBuilder>( + getCredential(), getParentForChildren(), isClean()); + credential_ = null; + } + return credentialBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.connection.v1.CloudSqlProperties) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1.CloudSqlProperties) + private static final com.google.cloud.bigquery.connection.v1.CloudSqlProperties DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.connection.v1.CloudSqlProperties(); + } + + public static com.google.cloud.bigquery.connection.v1.CloudSqlProperties getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CloudSqlProperties parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CloudSqlProperties(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.CloudSqlProperties getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/CloudSqlPropertiesOrBuilder.java b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/CloudSqlPropertiesOrBuilder.java new file mode 100644 index 00000000..8c82ed6a --- /dev/null +++ b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/CloudSqlPropertiesOrBuilder.java @@ -0,0 +1,141 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/connection/v1/connection.proto + +package com.google.cloud.bigquery.connection.v1; + +public interface CloudSqlPropertiesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1.CloudSqlProperties) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Cloud SQL instance ID in the form `project:location:instance`.
+   * 
+ * + * string instance_id = 1; + * + * @return The instanceId. + */ + java.lang.String getInstanceId(); + /** + * + * + *
+   * Cloud SQL instance ID in the form `project:location:instance`.
+   * 
+ * + * string instance_id = 1; + * + * @return The bytes for instanceId. + */ + com.google.protobuf.ByteString getInstanceIdBytes(); + + /** + * + * + *
+   * Database name.
+   * 
+ * + * string database = 2; + * + * @return The database. + */ + java.lang.String getDatabase(); + /** + * + * + *
+   * Database name.
+   * 
+ * + * string database = 2; + * + * @return The bytes for database. + */ + com.google.protobuf.ByteString getDatabaseBytes(); + + /** + * + * + *
+   * Type of the Cloud SQL database.
+   * 
+ * + * .google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType type = 3; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * + * + *
+   * Type of the Cloud SQL database.
+   * 
+ * + * .google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType type = 3; + * + * @return The type. + */ + com.google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType getType(); + + /** + * + * + *
+   * Input only. Cloud SQL credential.
+   * 
+ * + * + * .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the credential field is set. + */ + boolean hasCredential(); + /** + * + * + *
+   * Input only. Cloud SQL credential.
+   * 
+ * + * + * .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The credential. + */ + com.google.cloud.bigquery.connection.v1.CloudSqlCredential getCredential(); + /** + * + * + *
+   * Input only. Cloud SQL credential.
+   * 
+ * + * + * .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * + */ + com.google.cloud.bigquery.connection.v1.CloudSqlCredentialOrBuilder getCredentialOrBuilder(); +} diff --git a/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/Connection.java b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/Connection.java new file mode 100644 index 00000000..802c6eb2 --- /dev/null +++ b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/Connection.java @@ -0,0 +1,1662 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/connection/v1/connection.proto + +package com.google.cloud.bigquery.connection.v1; + +/** + * + * + *
+ * Configuration parameters to establish connection with an external data
+ * source, except the credential attributes.
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1.Connection} + */ +public final class Connection extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1.Connection) + ConnectionOrBuilder { + private static final long serialVersionUID = 0L; + // Use Connection.newBuilder() to construct. + private Connection(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Connection() { + name_ = ""; + friendlyName_ = ""; + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Connection(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Connection( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + friendlyName_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 34: + { + com.google.cloud.bigquery.connection.v1.CloudSqlProperties.Builder subBuilder = null; + if (propertiesCase_ == 4) { + subBuilder = + ((com.google.cloud.bigquery.connection.v1.CloudSqlProperties) properties_) + .toBuilder(); + } + properties_ = + input.readMessage( + com.google.cloud.bigquery.connection.v1.CloudSqlProperties.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.bigquery.connection.v1.CloudSqlProperties) properties_); + properties_ = subBuilder.buildPartial(); + } + propertiesCase_ = 4; + break; + } + case 40: + { + creationTime_ = input.readInt64(); + break; + } + case 48: + { + lastModifiedTime_ = input.readInt64(); + break; + } + case 56: + { + hasCredential_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_Connection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_Connection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1.Connection.class, + com.google.cloud.bigquery.connection.v1.Connection.Builder.class); + } + + private int propertiesCase_ = 0; + private java.lang.Object properties_; + + public enum PropertiesCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CLOUD_SQL(4), + PROPERTIES_NOT_SET(0); + private final int value; + + private PropertiesCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PropertiesCase valueOf(int value) { + return forNumber(value); + } + + public static PropertiesCase forNumber(int value) { + switch (value) { + case 4: + return CLOUD_SQL; + case 0: + return PROPERTIES_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PropertiesCase getPropertiesCase() { + return PropertiesCase.forNumber(propertiesCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the connection in the form of:
+   * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the connection in the form of:
+   * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FRIENDLY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object friendlyName_; + /** + * + * + *
+   * User provided display name for the connection.
+   * 
+ * + * string friendly_name = 2; + * + * @return The friendlyName. + */ + @java.lang.Override + public java.lang.String getFriendlyName() { + java.lang.Object ref = friendlyName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + friendlyName_ = s; + return s; + } + } + /** + * + * + *
+   * User provided display name for the connection.
+   * 
+ * + * string friendly_name = 2; + * + * @return The bytes for friendlyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFriendlyNameBytes() { + java.lang.Object ref = friendlyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + friendlyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object description_; + /** + * + * + *
+   * User provided description.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * User provided description.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLOUD_SQL_FIELD_NUMBER = 4; + /** + * + * + *
+   * Cloud SQL properties.
+   * 
+ * + * .google.cloud.bigquery.connection.v1.CloudSqlProperties cloud_sql = 4; + * + * @return Whether the cloudSql field is set. + */ + @java.lang.Override + public boolean hasCloudSql() { + return propertiesCase_ == 4; + } + /** + * + * + *
+   * Cloud SQL properties.
+   * 
+ * + * .google.cloud.bigquery.connection.v1.CloudSqlProperties cloud_sql = 4; + * + * @return The cloudSql. + */ + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.CloudSqlProperties getCloudSql() { + if (propertiesCase_ == 4) { + return (com.google.cloud.bigquery.connection.v1.CloudSqlProperties) properties_; + } + return com.google.cloud.bigquery.connection.v1.CloudSqlProperties.getDefaultInstance(); + } + /** + * + * + *
+   * Cloud SQL properties.
+   * 
+ * + * .google.cloud.bigquery.connection.v1.CloudSqlProperties cloud_sql = 4; + */ + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.CloudSqlPropertiesOrBuilder + getCloudSqlOrBuilder() { + if (propertiesCase_ == 4) { + return (com.google.cloud.bigquery.connection.v1.CloudSqlProperties) properties_; + } + return com.google.cloud.bigquery.connection.v1.CloudSqlProperties.getDefaultInstance(); + } + + public static final int CREATION_TIME_FIELD_NUMBER = 5; + private long creationTime_; + /** + * + * + *
+   * Output only. The creation timestamp of the connection.
+   * 
+ * + * int64 creation_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The creationTime. + */ + @java.lang.Override + public long getCreationTime() { + return creationTime_; + } + + public static final int LAST_MODIFIED_TIME_FIELD_NUMBER = 6; + private long lastModifiedTime_; + /** + * + * + *
+   * Output only. The last update timestamp of the connection.
+   * 
+ * + * int64 last_modified_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The lastModifiedTime. + */ + @java.lang.Override + public long getLastModifiedTime() { + return lastModifiedTime_; + } + + public static final int HAS_CREDENTIAL_FIELD_NUMBER = 7; + private boolean hasCredential_; + /** + * + * + *
+   * Output only. True, if credential is configured for this connection.
+   * 
+ * + * bool has_credential = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The hasCredential. + */ + @java.lang.Override + public boolean getHasCredential() { + return hasCredential_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getFriendlyNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, friendlyName_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (propertiesCase_ == 4) { + output.writeMessage( + 4, (com.google.cloud.bigquery.connection.v1.CloudSqlProperties) properties_); + } + if (creationTime_ != 0L) { + output.writeInt64(5, creationTime_); + } + if (lastModifiedTime_ != 0L) { + output.writeInt64(6, lastModifiedTime_); + } + if (hasCredential_ != false) { + output.writeBool(7, hasCredential_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getFriendlyNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, friendlyName_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (propertiesCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.bigquery.connection.v1.CloudSqlProperties) properties_); + } + if (creationTime_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(5, creationTime_); + } + if (lastModifiedTime_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(6, lastModifiedTime_); + } + if (hasCredential_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(7, hasCredential_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.connection.v1.Connection)) { + return super.equals(obj); + } + com.google.cloud.bigquery.connection.v1.Connection other = + (com.google.cloud.bigquery.connection.v1.Connection) obj; + + if (!getName().equals(other.getName())) return false; + if (!getFriendlyName().equals(other.getFriendlyName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (getCreationTime() != other.getCreationTime()) return false; + if (getLastModifiedTime() != other.getLastModifiedTime()) return false; + if (getHasCredential() != other.getHasCredential()) return false; + if (!getPropertiesCase().equals(other.getPropertiesCase())) return false; + switch (propertiesCase_) { + case 4: + if (!getCloudSql().equals(other.getCloudSql())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + FRIENDLY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFriendlyName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + CREATION_TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCreationTime()); + hash = (37 * hash) + LAST_MODIFIED_TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getLastModifiedTime()); + hash = (37 * hash) + HAS_CREDENTIAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getHasCredential()); + switch (propertiesCase_) { + case 4: + hash = (37 * hash) + CLOUD_SQL_FIELD_NUMBER; + hash = (53 * hash) + getCloudSql().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.connection.v1.Connection parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1.Connection parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.Connection parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1.Connection parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.Connection parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1.Connection parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.Connection parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1.Connection parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.Connection parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1.Connection parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.Connection parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1.Connection parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.bigquery.connection.v1.Connection prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Configuration parameters to establish connection with an external data
+   * source, except the credential attributes.
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1.Connection} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1.Connection) + com.google.cloud.bigquery.connection.v1.ConnectionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_Connection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_Connection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1.Connection.class, + com.google.cloud.bigquery.connection.v1.Connection.Builder.class); + } + + // Construct using com.google.cloud.bigquery.connection.v1.Connection.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + friendlyName_ = ""; + + description_ = ""; + + creationTime_ = 0L; + + lastModifiedTime_ = 0L; + + hasCredential_ = false; + + propertiesCase_ = 0; + properties_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_Connection_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.Connection getDefaultInstanceForType() { + return com.google.cloud.bigquery.connection.v1.Connection.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.Connection build() { + com.google.cloud.bigquery.connection.v1.Connection result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.Connection buildPartial() { + com.google.cloud.bigquery.connection.v1.Connection result = + new com.google.cloud.bigquery.connection.v1.Connection(this); + result.name_ = name_; + result.friendlyName_ = friendlyName_; + result.description_ = description_; + if (propertiesCase_ == 4) { + if (cloudSqlBuilder_ == null) { + result.properties_ = properties_; + } else { + result.properties_ = cloudSqlBuilder_.build(); + } + } + result.creationTime_ = creationTime_; + result.lastModifiedTime_ = lastModifiedTime_; + result.hasCredential_ = hasCredential_; + result.propertiesCase_ = propertiesCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.connection.v1.Connection) { + return mergeFrom((com.google.cloud.bigquery.connection.v1.Connection) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.connection.v1.Connection other) { + if (other == com.google.cloud.bigquery.connection.v1.Connection.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getFriendlyName().isEmpty()) { + friendlyName_ = other.friendlyName_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.getCreationTime() != 0L) { + setCreationTime(other.getCreationTime()); + } + if (other.getLastModifiedTime() != 0L) { + setLastModifiedTime(other.getLastModifiedTime()); + } + if (other.getHasCredential() != false) { + setHasCredential(other.getHasCredential()); + } + switch (other.getPropertiesCase()) { + case CLOUD_SQL: + { + mergeCloudSql(other.getCloudSql()); + break; + } + case PROPERTIES_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.bigquery.connection.v1.Connection parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.connection.v1.Connection) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int propertiesCase_ = 0; + private java.lang.Object properties_; + + public PropertiesCase getPropertiesCase() { + return PropertiesCase.forNumber(propertiesCase_); + } + + public Builder clearProperties() { + propertiesCase_ = 0; + properties_ = null; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the connection in the form of:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the connection in the form of:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the connection in the form of:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the connection in the form of:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the connection in the form of:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object friendlyName_ = ""; + /** + * + * + *
+     * User provided display name for the connection.
+     * 
+ * + * string friendly_name = 2; + * + * @return The friendlyName. + */ + public java.lang.String getFriendlyName() { + java.lang.Object ref = friendlyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + friendlyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * User provided display name for the connection.
+     * 
+ * + * string friendly_name = 2; + * + * @return The bytes for friendlyName. + */ + public com.google.protobuf.ByteString getFriendlyNameBytes() { + java.lang.Object ref = friendlyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + friendlyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * User provided display name for the connection.
+     * 
+ * + * string friendly_name = 2; + * + * @param value The friendlyName to set. + * @return This builder for chaining. + */ + public Builder setFriendlyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + friendlyName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * User provided display name for the connection.
+     * 
+ * + * string friendly_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearFriendlyName() { + + friendlyName_ = getDefaultInstance().getFriendlyName(); + onChanged(); + return this; + } + /** + * + * + *
+     * User provided display name for the connection.
+     * 
+ * + * string friendly_name = 2; + * + * @param value The bytes for friendlyName to set. + * @return This builder for chaining. + */ + public Builder setFriendlyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + friendlyName_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * User provided description.
+     * 
+ * + * string description = 3; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * User provided description.
+     * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * User provided description.
+     * 
+ * + * string description = 3; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * User provided description.
+     * 
+ * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * User provided description.
+     * 
+ * + * string description = 3; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1.CloudSqlProperties, + com.google.cloud.bigquery.connection.v1.CloudSqlProperties.Builder, + com.google.cloud.bigquery.connection.v1.CloudSqlPropertiesOrBuilder> + cloudSqlBuilder_; + /** + * + * + *
+     * Cloud SQL properties.
+     * 
+ * + * .google.cloud.bigquery.connection.v1.CloudSqlProperties cloud_sql = 4; + * + * @return Whether the cloudSql field is set. + */ + @java.lang.Override + public boolean hasCloudSql() { + return propertiesCase_ == 4; + } + /** + * + * + *
+     * Cloud SQL properties.
+     * 
+ * + * .google.cloud.bigquery.connection.v1.CloudSqlProperties cloud_sql = 4; + * + * @return The cloudSql. + */ + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.CloudSqlProperties getCloudSql() { + if (cloudSqlBuilder_ == null) { + if (propertiesCase_ == 4) { + return (com.google.cloud.bigquery.connection.v1.CloudSqlProperties) properties_; + } + return com.google.cloud.bigquery.connection.v1.CloudSqlProperties.getDefaultInstance(); + } else { + if (propertiesCase_ == 4) { + return cloudSqlBuilder_.getMessage(); + } + return com.google.cloud.bigquery.connection.v1.CloudSqlProperties.getDefaultInstance(); + } + } + /** + * + * + *
+     * Cloud SQL properties.
+     * 
+ * + * .google.cloud.bigquery.connection.v1.CloudSqlProperties cloud_sql = 4; + */ + public Builder setCloudSql(com.google.cloud.bigquery.connection.v1.CloudSqlProperties value) { + if (cloudSqlBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + properties_ = value; + onChanged(); + } else { + cloudSqlBuilder_.setMessage(value); + } + propertiesCase_ = 4; + return this; + } + /** + * + * + *
+     * Cloud SQL properties.
+     * 
+ * + * .google.cloud.bigquery.connection.v1.CloudSqlProperties cloud_sql = 4; + */ + public Builder setCloudSql( + com.google.cloud.bigquery.connection.v1.CloudSqlProperties.Builder builderForValue) { + if (cloudSqlBuilder_ == null) { + properties_ = builderForValue.build(); + onChanged(); + } else { + cloudSqlBuilder_.setMessage(builderForValue.build()); + } + propertiesCase_ = 4; + return this; + } + /** + * + * + *
+     * Cloud SQL properties.
+     * 
+ * + * .google.cloud.bigquery.connection.v1.CloudSqlProperties cloud_sql = 4; + */ + public Builder mergeCloudSql(com.google.cloud.bigquery.connection.v1.CloudSqlProperties value) { + if (cloudSqlBuilder_ == null) { + if (propertiesCase_ == 4 + && properties_ + != com.google.cloud.bigquery.connection.v1.CloudSqlProperties + .getDefaultInstance()) { + properties_ = + com.google.cloud.bigquery.connection.v1.CloudSqlProperties.newBuilder( + (com.google.cloud.bigquery.connection.v1.CloudSqlProperties) properties_) + .mergeFrom(value) + .buildPartial(); + } else { + properties_ = value; + } + onChanged(); + } else { + if (propertiesCase_ == 4) { + cloudSqlBuilder_.mergeFrom(value); + } + cloudSqlBuilder_.setMessage(value); + } + propertiesCase_ = 4; + return this; + } + /** + * + * + *
+     * Cloud SQL properties.
+     * 
+ * + * .google.cloud.bigquery.connection.v1.CloudSqlProperties cloud_sql = 4; + */ + public Builder clearCloudSql() { + if (cloudSqlBuilder_ == null) { + if (propertiesCase_ == 4) { + propertiesCase_ = 0; + properties_ = null; + onChanged(); + } + } else { + if (propertiesCase_ == 4) { + propertiesCase_ = 0; + properties_ = null; + } + cloudSqlBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Cloud SQL properties.
+     * 
+ * + * .google.cloud.bigquery.connection.v1.CloudSqlProperties cloud_sql = 4; + */ + public com.google.cloud.bigquery.connection.v1.CloudSqlProperties.Builder getCloudSqlBuilder() { + return getCloudSqlFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Cloud SQL properties.
+     * 
+ * + * .google.cloud.bigquery.connection.v1.CloudSqlProperties cloud_sql = 4; + */ + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.CloudSqlPropertiesOrBuilder + getCloudSqlOrBuilder() { + if ((propertiesCase_ == 4) && (cloudSqlBuilder_ != null)) { + return cloudSqlBuilder_.getMessageOrBuilder(); + } else { + if (propertiesCase_ == 4) { + return (com.google.cloud.bigquery.connection.v1.CloudSqlProperties) properties_; + } + return com.google.cloud.bigquery.connection.v1.CloudSqlProperties.getDefaultInstance(); + } + } + /** + * + * + *
+     * Cloud SQL properties.
+     * 
+ * + * .google.cloud.bigquery.connection.v1.CloudSqlProperties cloud_sql = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1.CloudSqlProperties, + com.google.cloud.bigquery.connection.v1.CloudSqlProperties.Builder, + com.google.cloud.bigquery.connection.v1.CloudSqlPropertiesOrBuilder> + getCloudSqlFieldBuilder() { + if (cloudSqlBuilder_ == null) { + if (!(propertiesCase_ == 4)) { + properties_ = + com.google.cloud.bigquery.connection.v1.CloudSqlProperties.getDefaultInstance(); + } + cloudSqlBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1.CloudSqlProperties, + com.google.cloud.bigquery.connection.v1.CloudSqlProperties.Builder, + com.google.cloud.bigquery.connection.v1.CloudSqlPropertiesOrBuilder>( + (com.google.cloud.bigquery.connection.v1.CloudSqlProperties) properties_, + getParentForChildren(), + isClean()); + properties_ = null; + } + propertiesCase_ = 4; + onChanged(); + ; + return cloudSqlBuilder_; + } + + private long creationTime_; + /** + * + * + *
+     * Output only. The creation timestamp of the connection.
+     * 
+ * + * int64 creation_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The creationTime. + */ + @java.lang.Override + public long getCreationTime() { + return creationTime_; + } + /** + * + * + *
+     * Output only. The creation timestamp of the connection.
+     * 
+ * + * int64 creation_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The creationTime to set. + * @return This builder for chaining. + */ + public Builder setCreationTime(long value) { + + creationTime_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The creation timestamp of the connection.
+     * 
+ * + * int64 creation_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearCreationTime() { + + creationTime_ = 0L; + onChanged(); + return this; + } + + private long lastModifiedTime_; + /** + * + * + *
+     * Output only. The last update timestamp of the connection.
+     * 
+ * + * int64 last_modified_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The lastModifiedTime. + */ + @java.lang.Override + public long getLastModifiedTime() { + return lastModifiedTime_; + } + /** + * + * + *
+     * Output only. The last update timestamp of the connection.
+     * 
+ * + * int64 last_modified_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The lastModifiedTime to set. + * @return This builder for chaining. + */ + public Builder setLastModifiedTime(long value) { + + lastModifiedTime_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The last update timestamp of the connection.
+     * 
+ * + * int64 last_modified_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearLastModifiedTime() { + + lastModifiedTime_ = 0L; + onChanged(); + return this; + } + + private boolean hasCredential_; + /** + * + * + *
+     * Output only. True, if credential is configured for this connection.
+     * 
+ * + * bool has_credential = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The hasCredential. + */ + @java.lang.Override + public boolean getHasCredential() { + return hasCredential_; + } + /** + * + * + *
+     * Output only. True, if credential is configured for this connection.
+     * 
+ * + * bool has_credential = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The hasCredential to set. + * @return This builder for chaining. + */ + public Builder setHasCredential(boolean value) { + + hasCredential_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. True, if credential is configured for this connection.
+     * 
+ * + * bool has_credential = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearHasCredential() { + + hasCredential_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.connection.v1.Connection) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1.Connection) + private static final com.google.cloud.bigquery.connection.v1.Connection DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.connection.v1.Connection(); + } + + public static com.google.cloud.bigquery.connection.v1.Connection getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Connection parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Connection(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.Connection getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigquery-connection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionName.java b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ConnectionName.java similarity index 99% rename from proto-google-cloud-bigquery-connection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionName.java rename to proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ConnectionName.java index 2cbfc2f8..fe8290d4 100644 --- a/proto-google-cloud-bigquery-connection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionName.java +++ b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ConnectionName.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.cloud.bigquery.connection.v1beta1; +package com.google.cloud.bigquery.connection.v1; import com.google.api.pathtemplate.PathTemplate; import com.google.api.resourcenames.ResourceName; diff --git a/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ConnectionOrBuilder.java b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ConnectionOrBuilder.java new file mode 100644 index 00000000..0e8776d6 --- /dev/null +++ b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ConnectionOrBuilder.java @@ -0,0 +1,178 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/connection/v1/connection.proto + +package com.google.cloud.bigquery.connection.v1; + +public interface ConnectionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1.Connection) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the connection in the form of:
+   * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the connection in the form of:
+   * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * User provided display name for the connection.
+   * 
+ * + * string friendly_name = 2; + * + * @return The friendlyName. + */ + java.lang.String getFriendlyName(); + /** + * + * + *
+   * User provided display name for the connection.
+   * 
+ * + * string friendly_name = 2; + * + * @return The bytes for friendlyName. + */ + com.google.protobuf.ByteString getFriendlyNameBytes(); + + /** + * + * + *
+   * User provided description.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * User provided description.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Cloud SQL properties.
+   * 
+ * + * .google.cloud.bigquery.connection.v1.CloudSqlProperties cloud_sql = 4; + * + * @return Whether the cloudSql field is set. + */ + boolean hasCloudSql(); + /** + * + * + *
+   * Cloud SQL properties.
+   * 
+ * + * .google.cloud.bigquery.connection.v1.CloudSqlProperties cloud_sql = 4; + * + * @return The cloudSql. + */ + com.google.cloud.bigquery.connection.v1.CloudSqlProperties getCloudSql(); + /** + * + * + *
+   * Cloud SQL properties.
+   * 
+ * + * .google.cloud.bigquery.connection.v1.CloudSqlProperties cloud_sql = 4; + */ + com.google.cloud.bigquery.connection.v1.CloudSqlPropertiesOrBuilder getCloudSqlOrBuilder(); + + /** + * + * + *
+   * Output only. The creation timestamp of the connection.
+   * 
+ * + * int64 creation_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The creationTime. + */ + long getCreationTime(); + + /** + * + * + *
+   * Output only. The last update timestamp of the connection.
+   * 
+ * + * int64 last_modified_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The lastModifiedTime. + */ + long getLastModifiedTime(); + + /** + * + * + *
+   * Output only. True, if credential is configured for this connection.
+   * 
+ * + * bool has_credential = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The hasCredential. + */ + boolean getHasCredential(); + + public com.google.cloud.bigquery.connection.v1.Connection.PropertiesCase getPropertiesCase(); +} diff --git a/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ConnectionProto.java b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ConnectionProto.java new file mode 100644 index 00000000..7aff3729 --- /dev/null +++ b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ConnectionProto.java @@ -0,0 +1,289 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/connection/v1/connection.proto + +package com.google.cloud.bigquery.connection.v1; + +public final class ConnectionProto { + private ConnectionProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_connection_v1_CreateConnectionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_connection_v1_CreateConnectionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_connection_v1_GetConnectionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_connection_v1_GetConnectionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_connection_v1_ListConnectionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_connection_v1_ListConnectionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_connection_v1_ListConnectionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_connection_v1_ListConnectionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_connection_v1_UpdateConnectionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_connection_v1_UpdateConnectionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_connection_v1_DeleteConnectionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_connection_v1_DeleteConnectionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_connection_v1_Connection_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_connection_v1_Connection_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_connection_v1_CloudSqlProperties_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_connection_v1_CloudSqlProperties_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_bigquery_connection_v1_CloudSqlCredential_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_bigquery_connection_v1_CloudSqlCredential_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n4google/cloud/bigquery/connection/v1/co" + + "nnection.proto\022#google.cloud.bigquery.co" + + "nnection.v1\032\034google/api/annotations.prot" + + "o\032\027google/api/client.proto\032\037google/api/f" + + "ield_behavior.proto\032\031google/api/resource" + + ".proto\032\036google/iam/v1/iam_policy.proto\032\032" + + "google/iam/v1/policy.proto\032\033google/proto" + + "buf/empty.proto\032 google/protobuf/field_m" + + "ask.proto\032\036google/protobuf/wrappers.prot" + + "o\"\272\001\n\027CreateConnectionRequest\0229\n\006parent\030" + + "\001 \001(\tB)\340A\002\372A#\n!locations.googleapis.com/" + + "Location\022\032\n\rconnection_id\030\002 \001(\tB\003\340A\001\022H\n\n" + + "connection\030\003 \001(\0132/.google.cloud.bigquery" + + ".connection.v1.ConnectionB\003\340A\002\"Z\n\024GetCon" + + "nectionRequest\022B\n\004name\030\001 \001(\tB4\340A\002\372A.\n,bi" + + "gqueryconnection.googleapis.com/Connecti" + + "on\"\177\n\026ListConnectionsRequest\0229\n\006parent\030\001" + + " \001(\tB)\340A\002\372A#\n!locations.googleapis.com/L" + + "ocation\022\026\n\tpage_size\030\004 \001(\005B\003\340A\002\022\022\n\npage_" + + "token\030\003 \001(\t\"x\n\027ListConnectionsResponse\022\027" + + "\n\017next_page_token\030\001 \001(\t\022D\n\013connections\030\002" + + " \003(\0132/.google.cloud.bigquery.connection." + + "v1.Connection\"\335\001\n\027UpdateConnectionReques" + + "t\022B\n\004name\030\001 \001(\tB4\340A\002\372A.\n,bigqueryconnect" + + "ion.googleapis.com/Connection\022H\n\nconnect" + + "ion\030\002 \001(\0132/.google.cloud.bigquery.connec" + + "tion.v1.ConnectionB\003\340A\002\0224\n\013update_mask\030\003" + + " \001(\0132\032.google.protobuf.FieldMaskB\003\340A\002\"]\n" + + "\027DeleteConnectionRequest\022B\n\004name\030\001 \001(\tB4" + + "\340A\002\372A.\n,bigqueryconnection.googleapis.co" + + "m/Connection\"\361\002\n\nConnection\022\014\n\004name\030\001 \001(" + + "\t\022\025\n\rfriendly_name\030\002 \001(\t\022\023\n\013description\030" + + "\003 \001(\t\022L\n\tcloud_sql\030\004 \001(\01327.google.cloud." + + "bigquery.connection.v1.CloudSqlPropertie" + + "sH\000\022\032\n\rcreation_time\030\005 \001(\003B\003\340A\003\022\037\n\022last_" + + "modified_time\030\006 \001(\003B\003\340A\003\022\033\n\016has_credenti" + + "al\030\007 \001(\010B\003\340A\003:s\352Ap\n,bigqueryconnection.g" + + "oogleapis.com/Connection\022@projects/{proj" + + "ect}/locations/{location}/connections/{c" + + "onnection}B\014\n\nproperties\"\251\002\n\022CloudSqlPro" + + "perties\022\023\n\013instance_id\030\001 \001(\t\022\020\n\010database" + + "\030\002 \001(\t\022R\n\004type\030\003 \001(\0162D.google.cloud.bigq" + + "uery.connection.v1.CloudSqlProperties.Da" + + "tabaseType\022P\n\ncredential\030\004 \001(\01327.google." + + "cloud.bigquery.connection.v1.CloudSqlCre" + + "dentialB\003\340A\004\"F\n\014DatabaseType\022\035\n\031DATABASE" + + "_TYPE_UNSPECIFIED\020\000\022\014\n\010POSTGRES\020\001\022\t\n\005MYS" + + "QL\020\002\"8\n\022CloudSqlCredential\022\020\n\010username\030\001" + + " \001(\t\022\020\n\010password\030\002 \001(\t2\303\r\n\021ConnectionSer" + + "vice\022\350\001\n\020CreateConnection\022<.google.cloud" + + ".bigquery.connection.v1.CreateConnection" + + "Request\032/.google.cloud.bigquery.connecti" + + "on.v1.Connection\"e\202\323\344\223\002=\"//v1/{parent=pr" + + "ojects/*/locations/*}/connections:\nconne" + + "ction\332A\037parent,connection,connection_id\022" + + "\273\001\n\rGetConnection\0229.google.cloud.bigquer" + + "y.connection.v1.GetConnectionRequest\032/.g" + + "oogle.cloud.bigquery.connection.v1.Conne" + + "ction\">\202\323\344\223\0021\022//v1/{name=projects/*/loca" + + "tions/*/connections/*}\332A\004name\022\305\001\n\017ListCo" + + "nnections\022;.google.cloud.bigquery.connec" + + "tion.v1.ListConnectionsRequest\032<.google." + + "cloud.bigquery.connection.v1.ListConnect" + + "ionsResponse\"7\202\323\344\223\0021\022//v1/{parent=projec" + + "ts/*/locations/*}/connections\022\344\001\n\020Update" + + "Connection\022<.google.cloud.bigquery.conne" + + "ction.v1.UpdateConnectionRequest\032/.googl" + + "e.cloud.bigquery.connection.v1.Connectio" + + "n\"a\202\323\344\223\002=2//v1/{name=projects/*/location" + + "s/*/connections/*}:\nconnection\332A\033name,co" + + "nnection,update_mask\022\250\001\n\020DeleteConnectio" + + "n\022<.google.cloud.bigquery.connection.v1." + + "DeleteConnectionRequest\032\026.google.protobu" + + "f.Empty\">\202\323\344\223\0021*//v1/{name=projects/*/lo" + + "cations/*/connections/*}\332A\004name\022\251\001\n\014GetI" + + "amPolicy\022\".google.iam.v1.GetIamPolicyReq" + + "uest\032\025.google.iam.v1.Policy\"^\202\323\344\223\002E\"@/v1" + + "/{resource=projects/*/locations/*/connec" + + "tions/*}:getIamPolicy:\001*\332A\020resource,opti" + + "ons\022\250\001\n\014SetIamPolicy\022\".google.iam.v1.Set" + + "IamPolicyRequest\032\025.google.iam.v1.Policy\"" + + "]\202\323\344\223\002E\"@/v1/{resource=projects/*/locati" + + "ons/*/connections/*}:setIamPolicy:\001*\332A\017r" + + "esource,policy\022\323\001\n\022TestIamPermissions\022(." + + "google.iam.v1.TestIamPermissionsRequest\032" + + ").google.iam.v1.TestIamPermissionsRespon" + + "se\"h\202\323\344\223\002K\"F/v1/{resource=projects/*/loc" + + "ations/*/connections/*}:testIamPermissio" + + "ns:\001*\332A\024resource,permissions\032~\312A!bigquer" + + "yconnection.googleapis.com\322AWhttps://www" + + ".googleapis.com/auth/bigquery,https://ww" + + "w.googleapis.com/auth/cloud-platformB\261\001\n" + + "\'com.google.cloud.bigquery.connection.v1" + + "B\017ConnectionProtoP\001ZMgoogle.golang.org/g" + + "enproto/googleapis/cloud/bigquery/connec" + + "tion/v1;connection\252\002#Google.Cloud.BigQue" + + "ry.Connection.V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.iam.v1.IamPolicyProto.getDescriptor(), + com.google.iam.v1.PolicyProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.WrappersProto.getDescriptor(), + }); + internal_static_google_cloud_bigquery_connection_v1_CreateConnectionRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_bigquery_connection_v1_CreateConnectionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_connection_v1_CreateConnectionRequest_descriptor, + new java.lang.String[] { + "Parent", "ConnectionId", "Connection", + }); + internal_static_google_cloud_bigquery_connection_v1_GetConnectionRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_bigquery_connection_v1_GetConnectionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_connection_v1_GetConnectionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_bigquery_connection_v1_ListConnectionsRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_bigquery_connection_v1_ListConnectionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_connection_v1_ListConnectionsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_bigquery_connection_v1_ListConnectionsResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_bigquery_connection_v1_ListConnectionsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_connection_v1_ListConnectionsResponse_descriptor, + new java.lang.String[] { + "NextPageToken", "Connections", + }); + internal_static_google_cloud_bigquery_connection_v1_UpdateConnectionRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_bigquery_connection_v1_UpdateConnectionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_connection_v1_UpdateConnectionRequest_descriptor, + new java.lang.String[] { + "Name", "Connection", "UpdateMask", + }); + internal_static_google_cloud_bigquery_connection_v1_DeleteConnectionRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_bigquery_connection_v1_DeleteConnectionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_connection_v1_DeleteConnectionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_bigquery_connection_v1_Connection_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_bigquery_connection_v1_Connection_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_connection_v1_Connection_descriptor, + new java.lang.String[] { + "Name", + "FriendlyName", + "Description", + "CloudSql", + "CreationTime", + "LastModifiedTime", + "HasCredential", + "Properties", + }); + internal_static_google_cloud_bigquery_connection_v1_CloudSqlProperties_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_bigquery_connection_v1_CloudSqlProperties_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_connection_v1_CloudSqlProperties_descriptor, + new java.lang.String[] { + "InstanceId", "Database", "Type", "Credential", + }); + internal_static_google_cloud_bigquery_connection_v1_CloudSqlCredential_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_bigquery_connection_v1_CloudSqlCredential_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_bigquery_connection_v1_CloudSqlCredential_descriptor, + new java.lang.String[] { + "Username", "Password", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.iam.v1.IamPolicyProto.getDescriptor(); + com.google.iam.v1.PolicyProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.WrappersProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/CreateConnectionRequest.java b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/CreateConnectionRequest.java new file mode 100644 index 00000000..a45c2699 --- /dev/null +++ b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/CreateConnectionRequest.java @@ -0,0 +1,1147 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/connection/v1/connection.proto + +package com.google.cloud.bigquery.connection.v1; + +/** + * + * + *
+ * The request for [ConnectionService.CreateConnection][google.cloud.bigquery.connection.v1.ConnectionService.CreateConnection].
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1.CreateConnectionRequest} + */ +public final class CreateConnectionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1.CreateConnectionRequest) + CreateConnectionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateConnectionRequest.newBuilder() to construct. + private CreateConnectionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateConnectionRequest() { + parent_ = ""; + connectionId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateConnectionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateConnectionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + connectionId_ = s; + break; + } + case 26: + { + com.google.cloud.bigquery.connection.v1.Connection.Builder subBuilder = null; + if (connection_ != null) { + subBuilder = connection_.toBuilder(); + } + connection_ = + input.readMessage( + com.google.cloud.bigquery.connection.v1.Connection.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(connection_); + connection_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_CreateConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_CreateConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1.CreateConnectionRequest.class, + com.google.cloud.bigquery.connection.v1.CreateConnectionRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Parent resource name.
+   * Must be in the format `projects/{project_id}/locations/{location_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Parent resource name.
+   * Must be in the format `projects/{project_id}/locations/{location_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONNECTION_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object connectionId_; + /** + * + * + *
+   * Optional. Connection id that should be assigned to the created connection.
+   * 
+ * + * string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The connectionId. + */ + @java.lang.Override + public java.lang.String getConnectionId() { + java.lang.Object ref = connectionId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + connectionId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Connection id that should be assigned to the created connection.
+   * 
+ * + * string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for connectionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConnectionIdBytes() { + java.lang.Object ref = connectionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + connectionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONNECTION_FIELD_NUMBER = 3; + private com.google.cloud.bigquery.connection.v1.Connection connection_; + /** + * + * + *
+   * Required. Connection to create.
+   * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the connection field is set. + */ + @java.lang.Override + public boolean hasConnection() { + return connection_ != null; + } + /** + * + * + *
+   * Required. Connection to create.
+   * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The connection. + */ + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.Connection getConnection() { + return connection_ == null + ? com.google.cloud.bigquery.connection.v1.Connection.getDefaultInstance() + : connection_; + } + /** + * + * + *
+   * Required. Connection to create.
+   * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.ConnectionOrBuilder getConnectionOrBuilder() { + return getConnection(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getConnectionIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, connectionId_); + } + if (connection_ != null) { + output.writeMessage(3, getConnection()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getConnectionIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, connectionId_); + } + if (connection_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getConnection()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.connection.v1.CreateConnectionRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.connection.v1.CreateConnectionRequest other = + (com.google.cloud.bigquery.connection.v1.CreateConnectionRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getConnectionId().equals(other.getConnectionId())) return false; + if (hasConnection() != other.hasConnection()) return false; + if (hasConnection()) { + if (!getConnection().equals(other.getConnection())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + CONNECTION_ID_FIELD_NUMBER; + hash = (53 * hash) + getConnectionId().hashCode(); + if (hasConnection()) { + hash = (37 * hash) + CONNECTION_FIELD_NUMBER; + hash = (53 * hash) + getConnection().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.connection.v1.CreateConnectionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1.CreateConnectionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.CreateConnectionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1.CreateConnectionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.CreateConnectionRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1.CreateConnectionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.CreateConnectionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1.CreateConnectionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.CreateConnectionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1.CreateConnectionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.CreateConnectionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1.CreateConnectionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.bigquery.connection.v1.CreateConnectionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request for [ConnectionService.CreateConnection][google.cloud.bigquery.connection.v1.ConnectionService.CreateConnection].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1.CreateConnectionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1.CreateConnectionRequest) + com.google.cloud.bigquery.connection.v1.CreateConnectionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_CreateConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_CreateConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1.CreateConnectionRequest.class, + com.google.cloud.bigquery.connection.v1.CreateConnectionRequest.Builder.class); + } + + // Construct using com.google.cloud.bigquery.connection.v1.CreateConnectionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + connectionId_ = ""; + + if (connectionBuilder_ == null) { + connection_ = null; + } else { + connection_ = null; + connectionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_CreateConnectionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.CreateConnectionRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.connection.v1.CreateConnectionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.CreateConnectionRequest build() { + com.google.cloud.bigquery.connection.v1.CreateConnectionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.CreateConnectionRequest buildPartial() { + com.google.cloud.bigquery.connection.v1.CreateConnectionRequest result = + new com.google.cloud.bigquery.connection.v1.CreateConnectionRequest(this); + result.parent_ = parent_; + result.connectionId_ = connectionId_; + if (connectionBuilder_ == null) { + result.connection_ = connection_; + } else { + result.connection_ = connectionBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.connection.v1.CreateConnectionRequest) { + return mergeFrom((com.google.cloud.bigquery.connection.v1.CreateConnectionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.connection.v1.CreateConnectionRequest other) { + if (other + == com.google.cloud.bigquery.connection.v1.CreateConnectionRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getConnectionId().isEmpty()) { + connectionId_ = other.connectionId_; + onChanged(); + } + if (other.hasConnection()) { + mergeConnection(other.getConnection()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.bigquery.connection.v1.CreateConnectionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.connection.v1.CreateConnectionRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Parent resource name.
+     * Must be in the format `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Parent resource name.
+     * Must be in the format `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Parent resource name.
+     * Must be in the format `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent resource name.
+     * Must be in the format `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent resource name.
+     * Must be in the format `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object connectionId_ = ""; + /** + * + * + *
+     * Optional. Connection id that should be assigned to the created connection.
+     * 
+ * + * string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The connectionId. + */ + public java.lang.String getConnectionId() { + java.lang.Object ref = connectionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + connectionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Connection id that should be assigned to the created connection.
+     * 
+ * + * string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for connectionId. + */ + public com.google.protobuf.ByteString getConnectionIdBytes() { + java.lang.Object ref = connectionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + connectionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Connection id that should be assigned to the created connection.
+     * 
+ * + * string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The connectionId to set. + * @return This builder for chaining. + */ + public Builder setConnectionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + connectionId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Connection id that should be assigned to the created connection.
+     * 
+ * + * string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearConnectionId() { + + connectionId_ = getDefaultInstance().getConnectionId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Connection id that should be assigned to the created connection.
+     * 
+ * + * string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for connectionId to set. + * @return This builder for chaining. + */ + public Builder setConnectionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + connectionId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.bigquery.connection.v1.Connection connection_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1.Connection, + com.google.cloud.bigquery.connection.v1.Connection.Builder, + com.google.cloud.bigquery.connection.v1.ConnectionOrBuilder> + connectionBuilder_; + /** + * + * + *
+     * Required. Connection to create.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the connection field is set. + */ + public boolean hasConnection() { + return connectionBuilder_ != null || connection_ != null; + } + /** + * + * + *
+     * Required. Connection to create.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The connection. + */ + public com.google.cloud.bigquery.connection.v1.Connection getConnection() { + if (connectionBuilder_ == null) { + return connection_ == null + ? com.google.cloud.bigquery.connection.v1.Connection.getDefaultInstance() + : connection_; + } else { + return connectionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Connection to create.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConnection(com.google.cloud.bigquery.connection.v1.Connection value) { + if (connectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + connection_ = value; + onChanged(); + } else { + connectionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Connection to create.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConnection( + com.google.cloud.bigquery.connection.v1.Connection.Builder builderForValue) { + if (connectionBuilder_ == null) { + connection_ = builderForValue.build(); + onChanged(); + } else { + connectionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Connection to create.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeConnection(com.google.cloud.bigquery.connection.v1.Connection value) { + if (connectionBuilder_ == null) { + if (connection_ != null) { + connection_ = + com.google.cloud.bigquery.connection.v1.Connection.newBuilder(connection_) + .mergeFrom(value) + .buildPartial(); + } else { + connection_ = value; + } + onChanged(); + } else { + connectionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Connection to create.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearConnection() { + if (connectionBuilder_ == null) { + connection_ = null; + onChanged(); + } else { + connection_ = null; + connectionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Connection to create.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.bigquery.connection.v1.Connection.Builder getConnectionBuilder() { + + onChanged(); + return getConnectionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Connection to create.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.bigquery.connection.v1.ConnectionOrBuilder getConnectionOrBuilder() { + if (connectionBuilder_ != null) { + return connectionBuilder_.getMessageOrBuilder(); + } else { + return connection_ == null + ? com.google.cloud.bigquery.connection.v1.Connection.getDefaultInstance() + : connection_; + } + } + /** + * + * + *
+     * Required. Connection to create.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1.Connection, + com.google.cloud.bigquery.connection.v1.Connection.Builder, + com.google.cloud.bigquery.connection.v1.ConnectionOrBuilder> + getConnectionFieldBuilder() { + if (connectionBuilder_ == null) { + connectionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1.Connection, + com.google.cloud.bigquery.connection.v1.Connection.Builder, + com.google.cloud.bigquery.connection.v1.ConnectionOrBuilder>( + getConnection(), getParentForChildren(), isClean()); + connection_ = null; + } + return connectionBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.connection.v1.CreateConnectionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1.CreateConnectionRequest) + private static final com.google.cloud.bigquery.connection.v1.CreateConnectionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.connection.v1.CreateConnectionRequest(); + } + + public static com.google.cloud.bigquery.connection.v1.CreateConnectionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateConnectionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateConnectionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.CreateConnectionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/CreateConnectionRequestOrBuilder.java b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/CreateConnectionRequestOrBuilder.java new file mode 100644 index 00000000..850e155a --- /dev/null +++ b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/CreateConnectionRequestOrBuilder.java @@ -0,0 +1,122 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/connection/v1/connection.proto + +package com.google.cloud.bigquery.connection.v1; + +public interface CreateConnectionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1.CreateConnectionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent resource name.
+   * Must be in the format `projects/{project_id}/locations/{location_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent resource name.
+   * Must be in the format `projects/{project_id}/locations/{location_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Connection id that should be assigned to the created connection.
+   * 
+ * + * string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The connectionId. + */ + java.lang.String getConnectionId(); + /** + * + * + *
+   * Optional. Connection id that should be assigned to the created connection.
+   * 
+ * + * string connection_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for connectionId. + */ + com.google.protobuf.ByteString getConnectionIdBytes(); + + /** + * + * + *
+   * Required. Connection to create.
+   * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the connection field is set. + */ + boolean hasConnection(); + /** + * + * + *
+   * Required. Connection to create.
+   * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The connection. + */ + com.google.cloud.bigquery.connection.v1.Connection getConnection(); + /** + * + * + *
+   * Required. Connection to create.
+   * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.bigquery.connection.v1.ConnectionOrBuilder getConnectionOrBuilder(); +} diff --git a/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/DeleteConnectionRequest.java b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/DeleteConnectionRequest.java new file mode 100644 index 00000000..c1340207 --- /dev/null +++ b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/DeleteConnectionRequest.java @@ -0,0 +1,665 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/connection/v1/connection.proto + +package com.google.cloud.bigquery.connection.v1; + +/** + * + * + *
+ * The request for [ConnectionService.DeleteConnectionRequest][].
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1.DeleteConnectionRequest} + */ +public final class DeleteConnectionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1.DeleteConnectionRequest) + DeleteConnectionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteConnectionRequest.newBuilder() to construct. + private DeleteConnectionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteConnectionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteConnectionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteConnectionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_DeleteConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_DeleteConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest.class, + com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Name of the deleted connection, for example:
+   * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the deleted connection, for example:
+   * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest other = + (com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request for [ConnectionService.DeleteConnectionRequest][].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1.DeleteConnectionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1.DeleteConnectionRequest) + com.google.cloud.bigquery.connection.v1.DeleteConnectionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_DeleteConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_DeleteConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest.class, + com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest.Builder.class); + } + + // Construct using com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_DeleteConnectionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest build() { + com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest buildPartial() { + com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest result = + new com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest) { + return mergeFrom((com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest other) { + if (other + == com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the deleted connection, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the deleted connection, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the deleted connection, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the deleted connection, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the deleted connection, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.connection.v1.DeleteConnectionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1.DeleteConnectionRequest) + private static final com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest(); + } + + public static com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteConnectionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteConnectionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/DeleteConnectionRequestOrBuilder.java b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/DeleteConnectionRequestOrBuilder.java new file mode 100644 index 00000000..7dcb0a56 --- /dev/null +++ b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/DeleteConnectionRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/connection/v1/connection.proto + +package com.google.cloud.bigquery.connection.v1; + +public interface DeleteConnectionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1.DeleteConnectionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the deleted connection, for example:
+   * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the deleted connection, for example:
+   * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/GetConnectionRequest.java b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/GetConnectionRequest.java new file mode 100644 index 00000000..0ff709d4 --- /dev/null +++ b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/GetConnectionRequest.java @@ -0,0 +1,661 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/connection/v1/connection.proto + +package com.google.cloud.bigquery.connection.v1; + +/** + * + * + *
+ * The request for [ConnectionService.GetConnection][google.cloud.bigquery.connection.v1.ConnectionService.GetConnection].
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1.GetConnectionRequest} + */ +public final class GetConnectionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1.GetConnectionRequest) + GetConnectionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetConnectionRequest.newBuilder() to construct. + private GetConnectionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetConnectionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetConnectionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetConnectionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_GetConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_GetConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1.GetConnectionRequest.class, + com.google.cloud.bigquery.connection.v1.GetConnectionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Name of the requested connection, for example:
+   * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the requested connection, for example:
+   * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.connection.v1.GetConnectionRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.connection.v1.GetConnectionRequest other = + (com.google.cloud.bigquery.connection.v1.GetConnectionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.connection.v1.GetConnectionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1.GetConnectionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.GetConnectionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1.GetConnectionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.GetConnectionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1.GetConnectionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.GetConnectionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1.GetConnectionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.GetConnectionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1.GetConnectionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.GetConnectionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1.GetConnectionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.bigquery.connection.v1.GetConnectionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request for [ConnectionService.GetConnection][google.cloud.bigquery.connection.v1.ConnectionService.GetConnection].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1.GetConnectionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1.GetConnectionRequest) + com.google.cloud.bigquery.connection.v1.GetConnectionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_GetConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_GetConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1.GetConnectionRequest.class, + com.google.cloud.bigquery.connection.v1.GetConnectionRequest.Builder.class); + } + + // Construct using com.google.cloud.bigquery.connection.v1.GetConnectionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_GetConnectionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.GetConnectionRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.connection.v1.GetConnectionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.GetConnectionRequest build() { + com.google.cloud.bigquery.connection.v1.GetConnectionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.GetConnectionRequest buildPartial() { + com.google.cloud.bigquery.connection.v1.GetConnectionRequest result = + new com.google.cloud.bigquery.connection.v1.GetConnectionRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.connection.v1.GetConnectionRequest) { + return mergeFrom((com.google.cloud.bigquery.connection.v1.GetConnectionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.connection.v1.GetConnectionRequest other) { + if (other + == com.google.cloud.bigquery.connection.v1.GetConnectionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.bigquery.connection.v1.GetConnectionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.connection.v1.GetConnectionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the requested connection, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the requested connection, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the requested connection, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the requested connection, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the requested connection, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.connection.v1.GetConnectionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1.GetConnectionRequest) + private static final com.google.cloud.bigquery.connection.v1.GetConnectionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.connection.v1.GetConnectionRequest(); + } + + public static com.google.cloud.bigquery.connection.v1.GetConnectionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetConnectionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetConnectionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.GetConnectionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/GetConnectionRequestOrBuilder.java b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/GetConnectionRequestOrBuilder.java new file mode 100644 index 00000000..e2b275c5 --- /dev/null +++ b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/GetConnectionRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/connection/v1/connection.proto + +package com.google.cloud.bigquery.connection.v1; + +public interface GetConnectionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1.GetConnectionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the requested connection, for example:
+   * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the requested connection, for example:
+   * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ListConnectionsRequest.java b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ListConnectionsRequest.java new file mode 100644 index 00000000..5a09c54c --- /dev/null +++ b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ListConnectionsRequest.java @@ -0,0 +1,933 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/connection/v1/connection.proto + +package com.google.cloud.bigquery.connection.v1; + +/** + * + * + *
+ * The request for [ConnectionService.ListConnections][google.cloud.bigquery.connection.v1.ConnectionService.ListConnections].
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1.ListConnectionsRequest} + */ +public final class ListConnectionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1.ListConnectionsRequest) + ListConnectionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListConnectionsRequest.newBuilder() to construct. + private ListConnectionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListConnectionsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListConnectionsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListConnectionsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 32: + { + pageSize_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_ListConnectionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_ListConnectionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1.ListConnectionsRequest.class, + com.google.cloud.bigquery.connection.v1.ListConnectionsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Parent resource name.
+   * Must be in the form: `projects/{project_id}/locations/{location_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Parent resource name.
+   * Must be in the form: `projects/{project_id}/locations/{location_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 4; + private int pageSize_; + /** + * + * + *
+   * Required. Page size.
+   * 
+ * + * int32 page_size = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(4, pageSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, pageSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.connection.v1.ListConnectionsRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.connection.v1.ListConnectionsRequest other = + (com.google.cloud.bigquery.connection.v1.ListConnectionsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.connection.v1.ListConnectionsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1.ListConnectionsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.ListConnectionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1.ListConnectionsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.ListConnectionsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1.ListConnectionsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.ListConnectionsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1.ListConnectionsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.ListConnectionsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1.ListConnectionsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.ListConnectionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1.ListConnectionsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.bigquery.connection.v1.ListConnectionsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request for [ConnectionService.ListConnections][google.cloud.bigquery.connection.v1.ConnectionService.ListConnections].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1.ListConnectionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1.ListConnectionsRequest) + com.google.cloud.bigquery.connection.v1.ListConnectionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_ListConnectionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_ListConnectionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1.ListConnectionsRequest.class, + com.google.cloud.bigquery.connection.v1.ListConnectionsRequest.Builder.class); + } + + // Construct using com.google.cloud.bigquery.connection.v1.ListConnectionsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_ListConnectionsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.ListConnectionsRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.connection.v1.ListConnectionsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.ListConnectionsRequest build() { + com.google.cloud.bigquery.connection.v1.ListConnectionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.ListConnectionsRequest buildPartial() { + com.google.cloud.bigquery.connection.v1.ListConnectionsRequest result = + new com.google.cloud.bigquery.connection.v1.ListConnectionsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.connection.v1.ListConnectionsRequest) { + return mergeFrom((com.google.cloud.bigquery.connection.v1.ListConnectionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.bigquery.connection.v1.ListConnectionsRequest other) { + if (other + == com.google.cloud.bigquery.connection.v1.ListConnectionsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.bigquery.connection.v1.ListConnectionsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.connection.v1.ListConnectionsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Parent resource name.
+     * Must be in the form: `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Parent resource name.
+     * Must be in the form: `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Parent resource name.
+     * Must be in the form: `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent resource name.
+     * Must be in the form: `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent resource name.
+     * Must be in the form: `projects/{project_id}/locations/{location_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Required. Page size.
+     * 
+ * + * int32 page_size = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Required. Page size.
+     * 
+ * + * int32 page_size = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Page size.
+     * 
+ * + * int32 page_size = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Page token.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Page token.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Page token.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Page token.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Page token.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.connection.v1.ListConnectionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1.ListConnectionsRequest) + private static final com.google.cloud.bigquery.connection.v1.ListConnectionsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.connection.v1.ListConnectionsRequest(); + } + + public static com.google.cloud.bigquery.connection.v1.ListConnectionsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListConnectionsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListConnectionsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.ListConnectionsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ListConnectionsRequestOrBuilder.java b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ListConnectionsRequestOrBuilder.java new file mode 100644 index 00000000..fb517f43 --- /dev/null +++ b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ListConnectionsRequestOrBuilder.java @@ -0,0 +1,94 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/connection/v1/connection.proto + +package com.google.cloud.bigquery.connection.v1; + +public interface ListConnectionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1.ListConnectionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent resource name.
+   * Must be in the form: `projects/{project_id}/locations/{location_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent resource name.
+   * Must be in the form: `projects/{project_id}/locations/{location_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. Page size.
+   * 
+ * + * int32 page_size = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ListConnectionsResponse.java b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ListConnectionsResponse.java new file mode 100644 index 00000000..1383a3ed --- /dev/null +++ b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ListConnectionsResponse.java @@ -0,0 +1,1148 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/connection/v1/connection.proto + +package com.google.cloud.bigquery.connection.v1; + +/** + * + * + *
+ * The response for [ConnectionService.ListConnections][google.cloud.bigquery.connection.v1.ConnectionService.ListConnections].
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1.ListConnectionsResponse} + */ +public final class ListConnectionsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1.ListConnectionsResponse) + ListConnectionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListConnectionsResponse.newBuilder() to construct. + private ListConnectionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListConnectionsResponse() { + nextPageToken_ = ""; + connections_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListConnectionsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListConnectionsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + connections_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + connections_.add( + input.readMessage( + com.google.cloud.bigquery.connection.v1.Connection.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + connections_ = java.util.Collections.unmodifiableList(connections_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_ListConnectionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_ListConnectionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1.ListConnectionsResponse.class, + com.google.cloud.bigquery.connection.v1.ListConnectionsResponse.Builder.class); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 1; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Next page token.
+   * 
+ * + * string next_page_token = 1; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Next page token.
+   * 
+ * + * string next_page_token = 1; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONNECTIONS_FIELD_NUMBER = 2; + private java.util.List connections_; + /** + * + * + *
+   * List of connections.
+   * 
+ * + * repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + @java.lang.Override + public java.util.List getConnectionsList() { + return connections_; + } + /** + * + * + *
+   * List of connections.
+   * 
+ * + * repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + @java.lang.Override + public java.util.List + getConnectionsOrBuilderList() { + return connections_; + } + /** + * + * + *
+   * List of connections.
+   * 
+ * + * repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + @java.lang.Override + public int getConnectionsCount() { + return connections_.size(); + } + /** + * + * + *
+   * List of connections.
+   * 
+ * + * repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.Connection getConnections(int index) { + return connections_.get(index); + } + /** + * + * + *
+   * List of connections.
+   * 
+ * + * repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.ConnectionOrBuilder getConnectionsOrBuilder( + int index) { + return connections_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, nextPageToken_); + } + for (int i = 0; i < connections_.size(); i++) { + output.writeMessage(2, connections_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, nextPageToken_); + } + for (int i = 0; i < connections_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, connections_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.connection.v1.ListConnectionsResponse)) { + return super.equals(obj); + } + com.google.cloud.bigquery.connection.v1.ListConnectionsResponse other = + (com.google.cloud.bigquery.connection.v1.ListConnectionsResponse) obj; + + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getConnectionsList().equals(other.getConnectionsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getConnectionsCount() > 0) { + hash = (37 * hash) + CONNECTIONS_FIELD_NUMBER; + hash = (53 * hash) + getConnectionsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.connection.v1.ListConnectionsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1.ListConnectionsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.ListConnectionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1.ListConnectionsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.ListConnectionsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1.ListConnectionsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.ListConnectionsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1.ListConnectionsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.ListConnectionsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1.ListConnectionsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.ListConnectionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1.ListConnectionsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.bigquery.connection.v1.ListConnectionsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The response for [ConnectionService.ListConnections][google.cloud.bigquery.connection.v1.ConnectionService.ListConnections].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1.ListConnectionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1.ListConnectionsResponse) + com.google.cloud.bigquery.connection.v1.ListConnectionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_ListConnectionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_ListConnectionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1.ListConnectionsResponse.class, + com.google.cloud.bigquery.connection.v1.ListConnectionsResponse.Builder.class); + } + + // Construct using com.google.cloud.bigquery.connection.v1.ListConnectionsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getConnectionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + nextPageToken_ = ""; + + if (connectionsBuilder_ == null) { + connections_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + connectionsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_ListConnectionsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.ListConnectionsResponse + getDefaultInstanceForType() { + return com.google.cloud.bigquery.connection.v1.ListConnectionsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.ListConnectionsResponse build() { + com.google.cloud.bigquery.connection.v1.ListConnectionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.ListConnectionsResponse buildPartial() { + com.google.cloud.bigquery.connection.v1.ListConnectionsResponse result = + new com.google.cloud.bigquery.connection.v1.ListConnectionsResponse(this); + int from_bitField0_ = bitField0_; + result.nextPageToken_ = nextPageToken_; + if (connectionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + connections_ = java.util.Collections.unmodifiableList(connections_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.connections_ = connections_; + } else { + result.connections_ = connectionsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.connection.v1.ListConnectionsResponse) { + return mergeFrom((com.google.cloud.bigquery.connection.v1.ListConnectionsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.connection.v1.ListConnectionsResponse other) { + if (other + == com.google.cloud.bigquery.connection.v1.ListConnectionsResponse.getDefaultInstance()) + return this; + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (connectionsBuilder_ == null) { + if (!other.connections_.isEmpty()) { + if (connections_.isEmpty()) { + connections_ = other.connections_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureConnectionsIsMutable(); + connections_.addAll(other.connections_); + } + onChanged(); + } + } else { + if (!other.connections_.isEmpty()) { + if (connectionsBuilder_.isEmpty()) { + connectionsBuilder_.dispose(); + connectionsBuilder_ = null; + connections_ = other.connections_; + bitField0_ = (bitField0_ & ~0x00000001); + connectionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getConnectionsFieldBuilder() + : null; + } else { + connectionsBuilder_.addAllMessages(other.connections_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.bigquery.connection.v1.ListConnectionsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.connection.v1.ListConnectionsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Next page token.
+     * 
+ * + * string next_page_token = 1; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Next page token.
+     * 
+ * + * string next_page_token = 1; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Next page token.
+     * 
+ * + * string next_page_token = 1; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Next page token.
+     * 
+ * + * string next_page_token = 1; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Next page token.
+     * 
+ * + * string next_page_token = 1; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + private java.util.List connections_ = + java.util.Collections.emptyList(); + + private void ensureConnectionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + connections_ = + new java.util.ArrayList( + connections_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.bigquery.connection.v1.Connection, + com.google.cloud.bigquery.connection.v1.Connection.Builder, + com.google.cloud.bigquery.connection.v1.ConnectionOrBuilder> + connectionsBuilder_; + + /** + * + * + *
+     * List of connections.
+     * 
+ * + * repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + public java.util.List getConnectionsList() { + if (connectionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(connections_); + } else { + return connectionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of connections.
+     * 
+ * + * repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + public int getConnectionsCount() { + if (connectionsBuilder_ == null) { + return connections_.size(); + } else { + return connectionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of connections.
+     * 
+ * + * repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + public com.google.cloud.bigquery.connection.v1.Connection getConnections(int index) { + if (connectionsBuilder_ == null) { + return connections_.get(index); + } else { + return connectionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of connections.
+     * 
+ * + * repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + public Builder setConnections( + int index, com.google.cloud.bigquery.connection.v1.Connection value) { + if (connectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConnectionsIsMutable(); + connections_.set(index, value); + onChanged(); + } else { + connectionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of connections.
+     * 
+ * + * repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + public Builder setConnections( + int index, com.google.cloud.bigquery.connection.v1.Connection.Builder builderForValue) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.set(index, builderForValue.build()); + onChanged(); + } else { + connectionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of connections.
+     * 
+ * + * repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + public Builder addConnections(com.google.cloud.bigquery.connection.v1.Connection value) { + if (connectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConnectionsIsMutable(); + connections_.add(value); + onChanged(); + } else { + connectionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of connections.
+     * 
+ * + * repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + public Builder addConnections( + int index, com.google.cloud.bigquery.connection.v1.Connection value) { + if (connectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConnectionsIsMutable(); + connections_.add(index, value); + onChanged(); + } else { + connectionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of connections.
+     * 
+ * + * repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + public Builder addConnections( + com.google.cloud.bigquery.connection.v1.Connection.Builder builderForValue) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.add(builderForValue.build()); + onChanged(); + } else { + connectionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of connections.
+     * 
+ * + * repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + public Builder addConnections( + int index, com.google.cloud.bigquery.connection.v1.Connection.Builder builderForValue) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.add(index, builderForValue.build()); + onChanged(); + } else { + connectionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of connections.
+     * 
+ * + * repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + public Builder addAllConnections( + java.lang.Iterable values) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, connections_); + onChanged(); + } else { + connectionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of connections.
+     * 
+ * + * repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + public Builder clearConnections() { + if (connectionsBuilder_ == null) { + connections_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + connectionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of connections.
+     * 
+ * + * repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + public Builder removeConnections(int index) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.remove(index); + onChanged(); + } else { + connectionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of connections.
+     * 
+ * + * repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + public com.google.cloud.bigquery.connection.v1.Connection.Builder getConnectionsBuilder( + int index) { + return getConnectionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of connections.
+     * 
+ * + * repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + public com.google.cloud.bigquery.connection.v1.ConnectionOrBuilder getConnectionsOrBuilder( + int index) { + if (connectionsBuilder_ == null) { + return connections_.get(index); + } else { + return connectionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of connections.
+     * 
+ * + * repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + public java.util.List + getConnectionsOrBuilderList() { + if (connectionsBuilder_ != null) { + return connectionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(connections_); + } + } + /** + * + * + *
+     * List of connections.
+     * 
+ * + * repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + public com.google.cloud.bigquery.connection.v1.Connection.Builder addConnectionsBuilder() { + return getConnectionsFieldBuilder() + .addBuilder(com.google.cloud.bigquery.connection.v1.Connection.getDefaultInstance()); + } + /** + * + * + *
+     * List of connections.
+     * 
+ * + * repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + public com.google.cloud.bigquery.connection.v1.Connection.Builder addConnectionsBuilder( + int index) { + return getConnectionsFieldBuilder() + .addBuilder( + index, com.google.cloud.bigquery.connection.v1.Connection.getDefaultInstance()); + } + /** + * + * + *
+     * List of connections.
+     * 
+ * + * repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + public java.util.List + getConnectionsBuilderList() { + return getConnectionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.bigquery.connection.v1.Connection, + com.google.cloud.bigquery.connection.v1.Connection.Builder, + com.google.cloud.bigquery.connection.v1.ConnectionOrBuilder> + getConnectionsFieldBuilder() { + if (connectionsBuilder_ == null) { + connectionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.bigquery.connection.v1.Connection, + com.google.cloud.bigquery.connection.v1.Connection.Builder, + com.google.cloud.bigquery.connection.v1.ConnectionOrBuilder>( + connections_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + connections_ = null; + } + return connectionsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.connection.v1.ListConnectionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1.ListConnectionsResponse) + private static final com.google.cloud.bigquery.connection.v1.ListConnectionsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.connection.v1.ListConnectionsResponse(); + } + + public static com.google.cloud.bigquery.connection.v1.ListConnectionsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListConnectionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListConnectionsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.ListConnectionsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ListConnectionsResponseOrBuilder.java b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ListConnectionsResponseOrBuilder.java new file mode 100644 index 00000000..081a72ca --- /dev/null +++ b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ListConnectionsResponseOrBuilder.java @@ -0,0 +1,102 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/connection/v1/connection.proto + +package com.google.cloud.bigquery.connection.v1; + +public interface ListConnectionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1.ListConnectionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Next page token.
+   * 
+ * + * string next_page_token = 1; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Next page token.
+   * 
+ * + * string next_page_token = 1; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * List of connections.
+   * 
+ * + * repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + java.util.List getConnectionsList(); + /** + * + * + *
+   * List of connections.
+   * 
+ * + * repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + com.google.cloud.bigquery.connection.v1.Connection getConnections(int index); + /** + * + * + *
+   * List of connections.
+   * 
+ * + * repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + int getConnectionsCount(); + /** + * + * + *
+   * List of connections.
+   * 
+ * + * repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + java.util.List + getConnectionsOrBuilderList(); + /** + * + * + *
+   * List of connections.
+   * 
+ * + * repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + */ + com.google.cloud.bigquery.connection.v1.ConnectionOrBuilder getConnectionsOrBuilder(int index); +} diff --git a/proto-google-cloud-bigquery-connection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/LocationName.java b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/LocationName.java similarity index 98% rename from proto-google-cloud-bigquery-connection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/LocationName.java rename to proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/LocationName.java index d400af32..ed82e452 100644 --- a/proto-google-cloud-bigquery-connection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/LocationName.java +++ b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/LocationName.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.cloud.bigquery.connection.v1beta1; +package com.google.cloud.bigquery.connection.v1; import com.google.api.pathtemplate.PathTemplate; import com.google.api.resourcenames.ResourceName; diff --git a/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/UpdateConnectionRequest.java b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/UpdateConnectionRequest.java new file mode 100644 index 00000000..7b3ee6db --- /dev/null +++ b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/UpdateConnectionRequest.java @@ -0,0 +1,1252 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/connection/v1/connection.proto + +package com.google.cloud.bigquery.connection.v1; + +/** + * + * + *
+ * The request for [ConnectionService.UpdateConnection][google.cloud.bigquery.connection.v1.ConnectionService.UpdateConnection].
+ * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1.UpdateConnectionRequest} + */ +public final class UpdateConnectionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1.UpdateConnectionRequest) + UpdateConnectionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateConnectionRequest.newBuilder() to construct. + private UpdateConnectionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateConnectionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateConnectionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateConnectionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + com.google.cloud.bigquery.connection.v1.Connection.Builder subBuilder = null; + if (connection_ != null) { + subBuilder = connection_.toBuilder(); + } + connection_ = + input.readMessage( + com.google.cloud.bigquery.connection.v1.Connection.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(connection_); + connection_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_UpdateConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_UpdateConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest.class, + com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Name of the connection to update, for example:
+   * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the connection to update, for example:
+   * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONNECTION_FIELD_NUMBER = 2; + private com.google.cloud.bigquery.connection.v1.Connection connection_; + /** + * + * + *
+   * Required. Connection containing the updated fields.
+   * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the connection field is set. + */ + @java.lang.Override + public boolean hasConnection() { + return connection_ != null; + } + /** + * + * + *
+   * Required. Connection containing the updated fields.
+   * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The connection. + */ + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.Connection getConnection() { + return connection_ == null + ? com.google.cloud.bigquery.connection.v1.Connection.getDefaultInstance() + : connection_; + } + /** + * + * + *
+   * Required. Connection containing the updated fields.
+   * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.ConnectionOrBuilder getConnectionOrBuilder() { + return getConnection(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 3; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. Update mask for the connection fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. Update mask for the connection fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. Update mask for the connection fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (connection_ != null) { + output.writeMessage(2, getConnection()); + } + if (updateMask_ != null) { + output.writeMessage(3, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (connection_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getConnection()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest)) { + return super.equals(obj); + } + com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest other = + (com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasConnection() != other.hasConnection()) return false; + if (hasConnection()) { + if (!getConnection().equals(other.getConnection())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasConnection()) { + hash = (37 * hash) + CONNECTION_FIELD_NUMBER; + hash = (53 * hash) + getConnection().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request for [ConnectionService.UpdateConnection][google.cloud.bigquery.connection.v1.ConnectionService.UpdateConnection].
+   * 
+ * + * Protobuf type {@code google.cloud.bigquery.connection.v1.UpdateConnectionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1.UpdateConnectionRequest) + com.google.cloud.bigquery.connection.v1.UpdateConnectionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_UpdateConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_UpdateConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest.class, + com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest.Builder.class); + } + + // Construct using com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (connectionBuilder_ == null) { + connection_ = null; + } else { + connection_ = null; + connectionBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.bigquery.connection.v1.ConnectionProto + .internal_static_google_cloud_bigquery_connection_v1_UpdateConnectionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest + getDefaultInstanceForType() { + return com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest build() { + com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest buildPartial() { + com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest result = + new com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest(this); + result.name_ = name_; + if (connectionBuilder_ == null) { + result.connection_ = connection_; + } else { + result.connection_ = connectionBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest) { + return mergeFrom((com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest other) { + if (other + == com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasConnection()) { + mergeConnection(other.getConnection()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the connection to update, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the connection to update, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the connection to update, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the connection to update, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the connection to update, for example:
+     * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.cloud.bigquery.connection.v1.Connection connection_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1.Connection, + com.google.cloud.bigquery.connection.v1.Connection.Builder, + com.google.cloud.bigquery.connection.v1.ConnectionOrBuilder> + connectionBuilder_; + /** + * + * + *
+     * Required. Connection containing the updated fields.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the connection field is set. + */ + public boolean hasConnection() { + return connectionBuilder_ != null || connection_ != null; + } + /** + * + * + *
+     * Required. Connection containing the updated fields.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The connection. + */ + public com.google.cloud.bigquery.connection.v1.Connection getConnection() { + if (connectionBuilder_ == null) { + return connection_ == null + ? com.google.cloud.bigquery.connection.v1.Connection.getDefaultInstance() + : connection_; + } else { + return connectionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Connection containing the updated fields.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConnection(com.google.cloud.bigquery.connection.v1.Connection value) { + if (connectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + connection_ = value; + onChanged(); + } else { + connectionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Connection containing the updated fields.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConnection( + com.google.cloud.bigquery.connection.v1.Connection.Builder builderForValue) { + if (connectionBuilder_ == null) { + connection_ = builderForValue.build(); + onChanged(); + } else { + connectionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Connection containing the updated fields.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeConnection(com.google.cloud.bigquery.connection.v1.Connection value) { + if (connectionBuilder_ == null) { + if (connection_ != null) { + connection_ = + com.google.cloud.bigquery.connection.v1.Connection.newBuilder(connection_) + .mergeFrom(value) + .buildPartial(); + } else { + connection_ = value; + } + onChanged(); + } else { + connectionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Connection containing the updated fields.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearConnection() { + if (connectionBuilder_ == null) { + connection_ = null; + onChanged(); + } else { + connection_ = null; + connectionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Connection containing the updated fields.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.bigquery.connection.v1.Connection.Builder getConnectionBuilder() { + + onChanged(); + return getConnectionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Connection containing the updated fields.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.bigquery.connection.v1.ConnectionOrBuilder getConnectionOrBuilder() { + if (connectionBuilder_ != null) { + return connectionBuilder_.getMessageOrBuilder(); + } else { + return connection_ == null + ? com.google.cloud.bigquery.connection.v1.Connection.getDefaultInstance() + : connection_; + } + } + /** + * + * + *
+     * Required. Connection containing the updated fields.
+     * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1.Connection, + com.google.cloud.bigquery.connection.v1.Connection.Builder, + com.google.cloud.bigquery.connection.v1.ConnectionOrBuilder> + getConnectionFieldBuilder() { + if (connectionBuilder_ == null) { + connectionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.bigquery.connection.v1.Connection, + com.google.cloud.bigquery.connection.v1.Connection.Builder, + com.google.cloud.bigquery.connection.v1.ConnectionOrBuilder>( + getConnection(), getParentForChildren(), isClean()); + connection_ = null; + } + return connectionBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Required. Update mask for the connection fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Required. Update mask for the connection fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Update mask for the connection fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Update mask for the connection fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Update mask for the connection fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Update mask for the connection fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Update mask for the connection fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Update mask for the connection fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. Update mask for the connection fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.connection.v1.UpdateConnectionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.bigquery.connection.v1.UpdateConnectionRequest) + private static final com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest(); + } + + public static com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateConnectionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateConnectionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/UpdateConnectionRequestOrBuilder.java b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/UpdateConnectionRequestOrBuilder.java new file mode 100644 index 00000000..3ef85f0d --- /dev/null +++ b/proto-google-cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/UpdateConnectionRequestOrBuilder.java @@ -0,0 +1,135 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/bigquery/connection/v1/connection.proto + +package com.google.cloud.bigquery.connection.v1; + +public interface UpdateConnectionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.connection.v1.UpdateConnectionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the connection to update, for example:
+   * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the connection to update, for example:
+   * `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. Connection containing the updated fields.
+   * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the connection field is set. + */ + boolean hasConnection(); + /** + * + * + *
+   * Required. Connection containing the updated fields.
+   * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The connection. + */ + com.google.cloud.bigquery.connection.v1.Connection getConnection(); + /** + * + * + *
+   * Required. Connection containing the updated fields.
+   * 
+ * + * + * .google.cloud.bigquery.connection.v1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.bigquery.connection.v1.ConnectionOrBuilder getConnectionOrBuilder(); + + /** + * + * + *
+   * Required. Update mask for the connection fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. Update mask for the connection fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. Update mask for the connection fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-bigquery-connection-v1beta1/src/main/proto/google/cloud/bigquery/connection/v1beta1/connection.proto b/proto-google-cloud-bigqueryconnection-v1/src/main/proto/google/cloud/bigquery/connection/v1/connection.proto similarity index 77% rename from proto-google-cloud-bigquery-connection-v1beta1/src/main/proto/google/cloud/bigquery/connection/v1beta1/connection.proto rename to proto-google-cloud-bigqueryconnection-v1/src/main/proto/google/cloud/bigquery/connection/v1/connection.proto index 5b6d05df..3bde8c12 100644 --- a/proto-google-cloud-bigquery-connection-v1beta1/src/main/proto/google/cloud/bigquery/connection/v1beta1/connection.proto +++ b/proto-google-cloud-bigqueryconnection-v1/src/main/proto/google/cloud/bigquery/connection/v1/connection.proto @@ -14,7 +14,7 @@ syntax = "proto3"; -package google.cloud.bigquery.connection.v1beta1; +package google.cloud.bigquery.connection.v1; import "google/api/annotations.proto"; import "google/api/client.proto"; @@ -26,10 +26,11 @@ import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/wrappers.proto"; -option csharp_namespace = "Google.Cloud.BigQuery.Connection.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/connection/v1beta1;connection"; +option csharp_namespace = "Google.Cloud.BigQuery.Connection.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/connection/v1;connection"; +option java_multiple_files = true; option java_outer_classname = "ConnectionProto"; -option java_package = "com.google.cloud.bigquery.connection.v1beta1"; +option java_package = "com.google.cloud.bigquery.connection.v1"; // Manages external data source connections and credentials. service ConnectionService { @@ -41,7 +42,7 @@ service ConnectionService { // Creates a new connection. rpc CreateConnection(CreateConnectionRequest) returns (Connection) { option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/connections" + post: "/v1/{parent=projects/*/locations/*}/connections" body: "connection" }; option (google.api.method_signature) = "parent,connection,connection_id"; @@ -50,7 +51,7 @@ service ConnectionService { // Returns specified connection. rpc GetConnection(GetConnectionRequest) returns (Connection) { option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/connections/*}" + get: "/v1/{name=projects/*/locations/*/connections/*}" }; option (google.api.method_signature) = "name"; } @@ -58,34 +59,24 @@ service ConnectionService { // Returns a list of connections in the given project. rpc ListConnections(ListConnectionsRequest) returns (ListConnectionsResponse) { option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/connections" + get: "/v1/{parent=projects/*/locations/*}/connections" }; - option (google.api.method_signature) = "parent,max_results"; } // Updates the specified connection. For security reasons, also resets // credential if connection properties are in the update field mask. rpc UpdateConnection(UpdateConnectionRequest) returns (Connection) { option (google.api.http) = { - patch: "/v1beta1/{name=projects/*/locations/*/connections/*}" + patch: "/v1/{name=projects/*/locations/*/connections/*}" body: "connection" }; option (google.api.method_signature) = "name,connection,update_mask"; } - // Sets the credential for the specified connection. - rpc UpdateConnectionCredential(UpdateConnectionCredentialRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - patch: "/v1beta1/{name=projects/*/locations/*/connections/*/credential}" - body: "credential" - }; - option (google.api.method_signature) = "name,credential"; - } - // Deletes connection and associated credential. rpc DeleteConnection(DeleteConnectionRequest) returns (google.protobuf.Empty) { option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/connections/*}" + delete: "/v1/{name=projects/*/locations/*/connections/*}" }; option (google.api.method_signature) = "name"; } @@ -95,7 +86,7 @@ service ConnectionService { // set. rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { option (google.api.http) = { - post: "/v1beta1/{resource=projects/*/locations/*/connections/*}:getIamPolicy" + post: "/v1/{resource=projects/*/locations/*/connections/*}:getIamPolicy" body: "*" }; option (google.api.method_signature) = "resource,options"; @@ -107,7 +98,7 @@ service ConnectionService { // Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { option (google.api.http) = { - post: "/v1beta1/{resource=projects/*/locations/*/connections/*}:setIamPolicy" + post: "/v1/{resource=projects/*/locations/*/connections/*}:setIamPolicy" body: "*" }; option (google.api.method_signature) = "resource,policy"; @@ -122,14 +113,14 @@ service ConnectionService { // may "fail open" without warning. rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { option (google.api.http) = { - post: "/v1beta1/{resource=projects/*/locations/*/connections/*}:testIamPermissions" + post: "/v1/{resource=projects/*/locations/*/connections/*}:testIamPermissions" body: "*" }; option (google.api.method_signature) = "resource,permissions"; } } -// The request for [ConnectionService.CreateConnection][google.cloud.bigquery.connection.v1beta1.ConnectionService.CreateConnection]. +// The request for [ConnectionService.CreateConnection][google.cloud.bigquery.connection.v1.ConnectionService.CreateConnection]. message CreateConnectionRequest { // Required. Parent resource name. // Must be in the format `projects/{project_id}/locations/{location_id}` @@ -147,7 +138,7 @@ message CreateConnectionRequest { Connection connection = 3 [(google.api.field_behavior) = REQUIRED]; } -// The request for [ConnectionService.GetConnection][google.cloud.bigquery.connection.v1beta1.ConnectionService.GetConnection]. +// The request for [ConnectionService.GetConnection][google.cloud.bigquery.connection.v1.ConnectionService.GetConnection]. message GetConnectionRequest { // Required. Name of the requested connection, for example: // `projects/{project_id}/locations/{location_id}/connections/{connection_id}` @@ -159,7 +150,7 @@ message GetConnectionRequest { ]; } -// The request for [ConnectionService.ListConnections][google.cloud.bigquery.connection.v1beta1.ConnectionService.ListConnections]. +// The request for [ConnectionService.ListConnections][google.cloud.bigquery.connection.v1.ConnectionService.ListConnections]. message ListConnectionsRequest { // Required. Parent resource name. // Must be in the form: `projects/{project_id}/locations/{location_id}` @@ -170,14 +161,14 @@ message ListConnectionsRequest { } ]; - // Required. Maximum number of results per page. - google.protobuf.UInt32Value max_results = 2 [(google.api.field_behavior) = REQUIRED]; + // Required. Page size. + int32 page_size = 4 [(google.api.field_behavior) = REQUIRED]; // Page token. string page_token = 3; } -// The response for [ConnectionService.ListConnections][google.cloud.bigquery.connection.v1beta1.ConnectionService.ListConnections]. +// The response for [ConnectionService.ListConnections][google.cloud.bigquery.connection.v1.ConnectionService.ListConnections]. message ListConnectionsResponse { // Next page token. string next_page_token = 1; @@ -186,7 +177,7 @@ message ListConnectionsResponse { repeated Connection connections = 2; } -// The request for [ConnectionService.UpdateConnection][google.cloud.bigquery.connection.v1beta1.ConnectionService.UpdateConnection]. +// The request for [ConnectionService.UpdateConnection][google.cloud.bigquery.connection.v1.ConnectionService.UpdateConnection]. message UpdateConnectionRequest { // Required. Name of the connection to update, for example: // `projects/{project_id}/locations/{location_id}/connections/{connection_id}` @@ -204,16 +195,6 @@ message UpdateConnectionRequest { google.protobuf.FieldMask update_mask = 3 [(google.api.field_behavior) = REQUIRED]; } -// The request for [ConnectionService.UpdateConnectionCredential][google.cloud.bigquery.connection.v1beta1.ConnectionService.UpdateConnectionCredential]. -message UpdateConnectionCredentialRequest { - // Required. Name of the connection, for example: - // `projects/{project_id}/locations/{location_id}/connections/{connection_id}/credential` - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Credential to use with the connection. - ConnectionCredential credential = 2 [(google.api.field_behavior) = REQUIRED]; -} - // The request for [ConnectionService.DeleteConnectionRequest][]. message DeleteConnectionRequest { // Required. Name of the deleted connection, for example: @@ -260,15 +241,6 @@ message Connection { bool has_credential = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; } -// Credential to use with a connection. -message ConnectionCredential { - // Credential specific to the underlying data source. - oneof credential { - // Credential for Cloud SQL database. - CloudSqlCredential cloud_sql = 1; - } -} - // Connection properties specific to the Cloud SQL. message CloudSqlProperties { // Supported Cloud SQL database types. diff --git a/proto-google-cloud-bigqueryconnection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionProto.java b/proto-google-cloud-bigqueryconnection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionProto.java index ac4e744f..0131f29f 100644 --- a/proto-google-cloud-bigqueryconnection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionProto.java +++ b/proto-google-cloud-bigqueryconnection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionProto.java @@ -268,6 +268,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * @return The parent. */ + @java.lang.Override public java.lang.String getParent() { java.lang.Object ref = parent_; if (ref instanceof java.lang.String) { @@ -293,6 +294,7 @@ public java.lang.String getParent() { * * @return The bytes for parent. */ + @java.lang.Override public com.google.protobuf.ByteString getParentBytes() { java.lang.Object ref = parent_; if (ref instanceof java.lang.String) { @@ -318,6 +320,7 @@ public com.google.protobuf.ByteString getParentBytes() { * * @return The connectionId. */ + @java.lang.Override public java.lang.String getConnectionId() { java.lang.Object ref = connectionId_; if (ref instanceof java.lang.String) { @@ -340,6 +343,7 @@ public java.lang.String getConnectionId() { * * @return The bytes for connectionId. */ + @java.lang.Override public com.google.protobuf.ByteString getConnectionIdBytes() { java.lang.Object ref = connectionId_; if (ref instanceof java.lang.String) { @@ -367,6 +371,7 @@ public com.google.protobuf.ByteString getConnectionIdBytes() { * * @return Whether the connection field is set. */ + @java.lang.Override public boolean hasConnection() { return connection_ != null; } @@ -383,6 +388,7 @@ public boolean hasConnection() { * * @return The connection. */ + @java.lang.Override public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection getConnection() { return connection_ == null ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection @@ -400,6 +406,7 @@ public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection g * .google.cloud.bigquery.connection.v1beta1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; * */ + @java.lang.Override public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder getConnectionOrBuilder() { return getConnection(); @@ -1460,6 +1467,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * @return The name. */ + @java.lang.Override public java.lang.String getName() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { @@ -1485,6 +1493,7 @@ public java.lang.String getName() { * * @return The bytes for name. */ + @java.lang.Override public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { @@ -2257,6 +2266,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * @return The parent. */ + @java.lang.Override public java.lang.String getParent() { java.lang.Object ref = parent_; if (ref instanceof java.lang.String) { @@ -2282,6 +2292,7 @@ public java.lang.String getParent() { * * @return The bytes for parent. */ + @java.lang.Override public com.google.protobuf.ByteString getParentBytes() { java.lang.Object ref = parent_; if (ref instanceof java.lang.String) { @@ -2308,6 +2319,7 @@ public com.google.protobuf.ByteString getParentBytes() { * * @return Whether the maxResults field is set. */ + @java.lang.Override public boolean hasMaxResults() { return maxResults_ != null; } @@ -2323,6 +2335,7 @@ public boolean hasMaxResults() { * * @return The maxResults. */ + @java.lang.Override public com.google.protobuf.UInt32Value getMaxResults() { return maxResults_ == null ? com.google.protobuf.UInt32Value.getDefaultInstance() @@ -2338,6 +2351,7 @@ public com.google.protobuf.UInt32Value getMaxResults() { * .google.protobuf.UInt32Value max_results = 2 [(.google.api.field_behavior) = REQUIRED]; * */ + @java.lang.Override public com.google.protobuf.UInt32ValueOrBuilder getMaxResultsOrBuilder() { return getMaxResults(); } @@ -2355,6 +2369,7 @@ public com.google.protobuf.UInt32ValueOrBuilder getMaxResultsOrBuilder() { * * @return The pageToken. */ + @java.lang.Override public java.lang.String getPageToken() { java.lang.Object ref = pageToken_; if (ref instanceof java.lang.String) { @@ -2377,6 +2392,7 @@ public java.lang.String getPageToken() { * * @return The bytes for pageToken. */ + @java.lang.Override public com.google.protobuf.ByteString getPageTokenBytes() { java.lang.Object ref = pageToken_; if (ref instanceof java.lang.String) { @@ -3500,6 +3516,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * @return The nextPageToken. */ + @java.lang.Override public java.lang.String getNextPageToken() { java.lang.Object ref = nextPageToken_; if (ref instanceof java.lang.String) { @@ -3522,6 +3539,7 @@ public java.lang.String getNextPageToken() { * * @return The bytes for nextPageToken. */ + @java.lang.Override public com.google.protobuf.ByteString getNextPageTokenBytes() { java.lang.Object ref = nextPageToken_; if (ref instanceof java.lang.String) { @@ -3546,6 +3564,7 @@ public com.google.protobuf.ByteString getNextPageTokenBytes() { * * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; */ + @java.lang.Override public java.util.List getConnectionsList() { return connections_; @@ -3559,6 +3578,7 @@ public com.google.protobuf.ByteString getNextPageTokenBytes() { * * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; */ + @java.lang.Override public java.util.List< ? extends com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder> @@ -3574,6 +3594,7 @@ public com.google.protobuf.ByteString getNextPageTokenBytes() { * * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; */ + @java.lang.Override public int getConnectionsCount() { return connections_.size(); } @@ -3586,6 +3607,7 @@ public int getConnectionsCount() { * * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; */ + @java.lang.Override public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection getConnections( int index) { return connections_.get(index); @@ -3599,6 +3621,7 @@ public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection g * * repeated .google.cloud.bigquery.connection.v1beta1.Connection connections = 2; */ + @java.lang.Override public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder getConnectionsOrBuilder(int index) { return connections_.get(index); @@ -4836,6 +4859,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * @return The name. */ + @java.lang.Override public java.lang.String getName() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { @@ -4861,6 +4885,7 @@ public java.lang.String getName() { * * @return The bytes for name. */ + @java.lang.Override public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { @@ -4888,6 +4913,7 @@ public com.google.protobuf.ByteString getNameBytes() { * * @return Whether the connection field is set. */ + @java.lang.Override public boolean hasConnection() { return connection_ != null; } @@ -4904,6 +4930,7 @@ public boolean hasConnection() { * * @return The connection. */ + @java.lang.Override public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection getConnection() { return connection_ == null ? com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection @@ -4921,6 +4948,7 @@ public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection g * .google.cloud.bigquery.connection.v1beta1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; * */ + @java.lang.Override public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionOrBuilder getConnectionOrBuilder() { return getConnection(); @@ -4940,6 +4968,7 @@ public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.Connection g * * @return Whether the updateMask field is set. */ + @java.lang.Override public boolean hasUpdateMask() { return updateMask_ != null; } @@ -4955,6 +4984,7 @@ public boolean hasUpdateMask() { * * @return The updateMask. */ + @java.lang.Override public com.google.protobuf.FieldMask getUpdateMask() { return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; } @@ -4968,6 +4998,7 @@ public com.google.protobuf.FieldMask getUpdateMask() { * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; * */ + @java.lang.Override public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { return getUpdateMask(); } @@ -6187,6 +6218,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * @return The name. */ + @java.lang.Override public java.lang.String getName() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { @@ -6210,6 +6242,7 @@ public java.lang.String getName() { * * @return The bytes for name. */ + @java.lang.Override public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { @@ -6238,6 +6271,7 @@ public com.google.protobuf.ByteString getNameBytes() { * * @return Whether the credential field is set. */ + @java.lang.Override public boolean hasCredential() { return credential_ != null; } @@ -6254,6 +6288,7 @@ public boolean hasCredential() { * * @return The credential. */ + @java.lang.Override public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.ConnectionCredential getCredential() { return credential_ == null @@ -6272,6 +6307,7 @@ public boolean hasCredential() { * .google.cloud.bigquery.connection.v1beta1.ConnectionCredential credential = 2 [(.google.api.field_behavior) = REQUIRED]; * */ + @java.lang.Override public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto .ConnectionCredentialOrBuilder getCredentialOrBuilder() { @@ -7226,6 +7262,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * @return The name. */ + @java.lang.Override public java.lang.String getName() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { @@ -7251,6 +7288,7 @@ public java.lang.String getName() { * * @return The bytes for name. */ + @java.lang.Override public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { @@ -8179,6 +8217,7 @@ public PropertiesCase getPropertiesCase() { * * @return The name. */ + @java.lang.Override public java.lang.String getName() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { @@ -8202,6 +8241,7 @@ public java.lang.String getName() { * * @return The bytes for name. */ + @java.lang.Override public com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof java.lang.String) { @@ -8227,6 +8267,7 @@ public com.google.protobuf.ByteString getNameBytes() { * * @return The friendlyName. */ + @java.lang.Override public java.lang.String getFriendlyName() { java.lang.Object ref = friendlyName_; if (ref instanceof java.lang.String) { @@ -8249,6 +8290,7 @@ public java.lang.String getFriendlyName() { * * @return The bytes for friendlyName. */ + @java.lang.Override public com.google.protobuf.ByteString getFriendlyNameBytes() { java.lang.Object ref = friendlyName_; if (ref instanceof java.lang.String) { @@ -8274,6 +8316,7 @@ public com.google.protobuf.ByteString getFriendlyNameBytes() { * * @return The description. */ + @java.lang.Override public java.lang.String getDescription() { java.lang.Object ref = description_; if (ref instanceof java.lang.String) { @@ -8296,6 +8339,7 @@ public java.lang.String getDescription() { * * @return The bytes for description. */ + @java.lang.Override public com.google.protobuf.ByteString getDescriptionBytes() { java.lang.Object ref = description_; if (ref instanceof java.lang.String) { @@ -8320,6 +8364,7 @@ public com.google.protobuf.ByteString getDescriptionBytes() { * * @return Whether the cloudSql field is set. */ + @java.lang.Override public boolean hasCloudSql() { return propertiesCase_ == 4; } @@ -8334,6 +8379,7 @@ public boolean hasCloudSql() { * * @return The cloudSql. */ + @java.lang.Override public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties getCloudSql() { if (propertiesCase_ == 4) { @@ -8352,6 +8398,7 @@ public boolean hasCloudSql() { * * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; */ + @java.lang.Override public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlPropertiesOrBuilder getCloudSqlOrBuilder() { if (propertiesCase_ == 4) { @@ -8375,6 +8422,7 @@ public boolean hasCloudSql() { * * @return The creationTime. */ + @java.lang.Override public long getCreationTime() { return creationTime_; } @@ -8392,6 +8440,7 @@ public long getCreationTime() { * * @return The lastModifiedTime. */ + @java.lang.Override public long getLastModifiedTime() { return lastModifiedTime_; } @@ -8409,6 +8458,7 @@ public long getLastModifiedTime() { * * @return The hasCredential. */ + @java.lang.Override public boolean getHasCredential() { return hasCredential_; } @@ -9233,6 +9283,7 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { * * @return Whether the cloudSql field is set. */ + @java.lang.Override public boolean hasCloudSql() { return propertiesCase_ == 4; } @@ -9247,6 +9298,7 @@ public boolean hasCloudSql() { * * @return The cloudSql. */ + @java.lang.Override public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties getCloudSql() { if (cloudSqlBuilder_ == null) { @@ -9392,6 +9444,7 @@ public Builder clearCloudSql() { * * .google.cloud.bigquery.connection.v1beta1.CloudSqlProperties cloud_sql = 4; */ + @java.lang.Override public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto .CloudSqlPropertiesOrBuilder getCloudSqlOrBuilder() { @@ -9459,6 +9512,7 @@ public Builder clearCloudSql() { * * @return The creationTime. */ + @java.lang.Override public long getCreationTime() { return creationTime_; } @@ -9510,6 +9564,7 @@ public Builder clearCreationTime() { * * @return The lastModifiedTime. */ + @java.lang.Override public long getLastModifiedTime() { return lastModifiedTime_; } @@ -9561,6 +9616,7 @@ public Builder clearLastModifiedTime() { * * @return The hasCredential. */ + @java.lang.Override public boolean getHasCredential() { return hasCredential_; } @@ -9870,6 +9926,7 @@ public CredentialCase getCredentialCase() { * * @return Whether the cloudSql field is set. */ + @java.lang.Override public boolean hasCloudSql() { return credentialCase_ == 1; } @@ -9884,6 +9941,7 @@ public boolean hasCloudSql() { * * @return The cloudSql. */ + @java.lang.Override public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential getCloudSql() { if (credentialCase_ == 1) { @@ -9902,6 +9960,7 @@ public boolean hasCloudSql() { * * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; */ + @java.lang.Override public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredentialOrBuilder getCloudSqlOrBuilder() { if (credentialCase_ == 1) { @@ -10327,6 +10386,7 @@ public Builder clearCredential() { * * @return Whether the cloudSql field is set. */ + @java.lang.Override public boolean hasCloudSql() { return credentialCase_ == 1; } @@ -10341,6 +10401,7 @@ public boolean hasCloudSql() { * * @return The cloudSql. */ + @java.lang.Override public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential getCloudSql() { if (cloudSqlBuilder_ == null) { @@ -10486,6 +10547,7 @@ public Builder clearCloudSql() { * * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential cloud_sql = 1; */ + @java.lang.Override public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto .CloudSqlCredentialOrBuilder getCloudSqlOrBuilder() { @@ -10975,6 +11037,10 @@ public DatabaseType findValueByNumber(int number) { }; public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } return getDescriptor().getValues().get(ordinal()); } @@ -11023,6 +11089,7 @@ private DatabaseType(int value) { * * @return The instanceId. */ + @java.lang.Override public java.lang.String getInstanceId() { java.lang.Object ref = instanceId_; if (ref instanceof java.lang.String) { @@ -11045,6 +11112,7 @@ public java.lang.String getInstanceId() { * * @return The bytes for instanceId. */ + @java.lang.Override public com.google.protobuf.ByteString getInstanceIdBytes() { java.lang.Object ref = instanceId_; if (ref instanceof java.lang.String) { @@ -11070,6 +11138,7 @@ public com.google.protobuf.ByteString getInstanceIdBytes() { * * @return The database. */ + @java.lang.Override public java.lang.String getDatabase() { java.lang.Object ref = database_; if (ref instanceof java.lang.String) { @@ -11092,6 +11161,7 @@ public java.lang.String getDatabase() { * * @return The bytes for database. */ + @java.lang.Override public com.google.protobuf.ByteString getDatabaseBytes() { java.lang.Object ref = database_; if (ref instanceof java.lang.String) { @@ -11118,6 +11188,7 @@ public com.google.protobuf.ByteString getDatabaseBytes() { * * @return The enum numeric value on the wire for type. */ + @java.lang.Override public int getTypeValue() { return type_; } @@ -11133,6 +11204,7 @@ public int getTypeValue() { * * @return The type. */ + @java.lang.Override public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties .DatabaseType getType() { @@ -11163,6 +11235,7 @@ public int getTypeValue() { * * @return Whether the credential field is set. */ + @java.lang.Override public boolean hasCredential() { return credential_ != null; } @@ -11179,6 +11252,7 @@ public boolean hasCredential() { * * @return The credential. */ + @java.lang.Override public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredential getCredential() { return credential_ == null @@ -11197,6 +11271,7 @@ public boolean hasCredential() { * .google.cloud.bigquery.connection.v1beta1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; * */ + @java.lang.Override public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlCredentialOrBuilder getCredentialOrBuilder() { return getCredential(); @@ -11840,6 +11915,7 @@ public Builder setDatabaseBytes(com.google.protobuf.ByteString value) { * * @return The enum numeric value on the wire for type. */ + @java.lang.Override public int getTypeValue() { return type_; } @@ -11857,6 +11933,7 @@ public int getTypeValue() { * @return This builder for chaining. */ public Builder setTypeValue(int value) { + type_ = value; onChanged(); return this; @@ -11873,6 +11950,7 @@ public Builder setTypeValue(int value) { * * @return The type. */ + @java.lang.Override public com.google.cloud.bigquery.connection.v1beta1.ConnectionProto.CloudSqlProperties .DatabaseType getType() { @@ -12378,6 +12456,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * @return The username. */ + @java.lang.Override public java.lang.String getUsername() { java.lang.Object ref = username_; if (ref instanceof java.lang.String) { @@ -12400,6 +12479,7 @@ public java.lang.String getUsername() { * * @return The bytes for username. */ + @java.lang.Override public com.google.protobuf.ByteString getUsernameBytes() { java.lang.Object ref = username_; if (ref instanceof java.lang.String) { @@ -12425,6 +12505,7 @@ public com.google.protobuf.ByteString getUsernameBytes() { * * @return The password. */ + @java.lang.Override public java.lang.String getPassword() { java.lang.Object ref = password_; if (ref instanceof java.lang.String) { @@ -12447,6 +12528,7 @@ public java.lang.String getPassword() { * * @return The bytes for password. */ + @java.lang.Override public com.google.protobuf.ByteString getPasswordBytes() { java.lang.Object ref = password_; if (ref instanceof java.lang.String) { diff --git a/synth.metadata b/synth.metadata index c48805c4..dc5d4631 100644 --- a/synth.metadata +++ b/synth.metadata @@ -3,23 +3,31 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/java-bigqueryconnection.git", - "sha": "7bb7a4b179b61d3b93988189b0643a570174585b" + "remote": "git@github.com:stephaniewang526/java-bigqueryconnection.git", + "sha": "51741de087d29a3b272f0f74548eaf0633ca7d17" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "5a90d467aa65e7f038f87585e8fbb45d74475e7c", - "internalRef": "312088359" + "sha": "9309ee73424d2798a2557d607dfb3e91c8a433fb", + "internalRef": "313826599" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "9309ee73424d2798a2557d607dfb3e91c8a433fb", + "internalRef": "313826599" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5b48b0716a36ca069db3038da7e205c87a22ed19" + "sha": "385d537832113984af2d033aaf353f0432256527" } } ], @@ -32,6 +40,15 @@ "language": "java", "generator": "bazel" } + }, + { + "client": { + "source": "googleapis", + "apiName": "bigquery-connection", + "apiVersion": "v1", + "language": "java", + "generator": "bazel" + } } ] } \ No newline at end of file diff --git a/synth.py b/synth.py index b95e50d4..4c0c84fe 100644 --- a/synth.py +++ b/synth.py @@ -19,7 +19,7 @@ import synthtool.languages.java as java service = 'bigquery-connection' -versions = ['v1beta1'] +versions = ['v1beta1', 'v1'] for version in versions: java.bazel_library( @@ -27,6 +27,7 @@ version=version, proto_path=f'google/cloud/bigquery/connection/{version}', bazel_target=f'//google/cloud/bigquery/connection/{version}:google-cloud-{service}-{version}-java', + destination_name='bigqueryconnection', ) java.common_templates() \ No newline at end of file diff --git a/versions.txt b/versions.txt index a153a9e1..bcfd0c24 100644 --- a/versions.txt +++ b/versions.txt @@ -2,5 +2,7 @@ # module:released-version:current-version google-cloud-bigqueryconnection:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-bigqueryconnection-v1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-bigqueryconnection-v1:0.0.0:0.0.1-SNAPSHOT proto-google-cloud-bigqueryconnection-v1beta1:0.0.0:0.0.1-SNAPSHOT grpc-google-cloud-bigqueryconnection-v1beta1:0.0.0:0.0.1-SNAPSHOT \ No newline at end of file