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 2eb9440a..169448af 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 @@ -43,6 +43,16 @@ *
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: * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * ConnectionProto.Connection connection = ConnectionProto.Connection.newBuilder().build(); + * String connectionId = "connectionId1923106969"; + * ConnectionProto.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(). @@ -150,6 +160,18 @@ public ConnectionServiceStub getStub() { /** * Creates a new connection. * + *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * ConnectionProto.Connection connection = ConnectionProto.Connection.newBuilder().build(); + * String connectionId = "connectionId1923106969"; + * ConnectionProto.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. @@ -171,6 +193,18 @@ public final ConnectionProto.Connection createConnection( /** * Creates a new connection. * + *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * ConnectionProto.Connection connection = ConnectionProto.Connection.newBuilder().build(); + * String connectionId = "connectionId1923106969"; + * ConnectionProto.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. @@ -192,6 +226,19 @@ public final ConnectionProto.Connection createConnection( /** * Creates a new connection. * + *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * ConnectionProto.CreateConnectionRequest request = + * ConnectionProto.CreateConnectionRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setConnectionId("connectionId1923106969") + * .build(); + * ConnectionProto.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 */ @@ -205,6 +252,20 @@ public final ConnectionProto.Connection createConnection( * Creates a new connection. * *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * ConnectionProto.CreateConnectionRequest request = + * ConnectionProto.CreateConnectionRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setConnectionId("connectionId1923106969") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * connectionServiceClient.createConnectionCallable().futureCall(request); + * // Do something. + * ConnectionProto.Connection response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + * ConnectionProto.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 @@ -231,6 +301,15 @@ public final ConnectionProto.Connection getConnection(ConnectionName name) { /** * Returns specified connection. * + *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * String name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString(); + * ConnectionProto.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 @@ -245,6 +324,18 @@ public final ConnectionProto.Connection getConnection(String name) { /** * Returns specified connection. * + *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * ConnectionProto.GetConnectionRequest request = + * ConnectionProto.GetConnectionRequest.newBuilder() + * .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + * .build(); + * ConnectionProto.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 */ @@ -258,6 +349,19 @@ public final ConnectionProto.Connection getConnection( * Returns specified connection. * *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * ConnectionProto.GetConnectionRequest request = + * ConnectionProto.GetConnectionRequest.newBuilder() + * .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * connectionServiceClient.getConnectionCallable().futureCall(request); + * // Do something. + * ConnectionProto.Connection response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * UInt32Value maxResults = UInt32Value.newBuilder().build(); + * ConnectionProto.ListConnectionsResponse response = + * connectionServiceClient.listConnections(parent, maxResults); + * } + * }+ * * @param parent Required. Parent resource name. Must be in the form: * `projects/{project_id}/locations/{location_id}` * @param maxResults Required. Maximum number of results per page. @@ -287,6 +402,17 @@ public final ConnectionProto.ListConnectionsResponse listConnections( /** * Returns a list of connections in the given project. * + *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * UInt32Value maxResults = UInt32Value.newBuilder().build(); + * ConnectionProto.ListConnectionsResponse response = + * connectionServiceClient.listConnections(parent, maxResults); + * } + * }+ * * @param parent Required. Parent resource name. Must be in the form: * `projects/{project_id}/locations/{location_id}` * @param maxResults Required. Maximum number of results per page. @@ -306,6 +432,21 @@ public final ConnectionProto.ListConnectionsResponse listConnections( /** * Returns a list of connections in the given project. * + *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * ConnectionProto.ListConnectionsRequest request = + * ConnectionProto.ListConnectionsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setMaxResults(UInt32Value.newBuilder().build()) + * .setPageToken("pageToken873572522") + * .build(); + * ConnectionProto.ListConnectionsResponse response = + * connectionServiceClient.listConnections(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 */ @@ -319,6 +460,21 @@ public final ConnectionProto.ListConnectionsResponse listConnections( * Returns a list of connections in the given project. * *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * ConnectionProto.ListConnectionsRequest request = + * ConnectionProto.ListConnectionsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setMaxResults(UInt32Value.newBuilder().build()) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallable< ConnectionProto.ListConnectionsRequest, ConnectionProto.ListConnectionsResponse> @@ -331,6 +487,18 @@ public final ConnectionProto.ListConnectionsResponse listConnections( * Updates the specified connection. For security reasons, also resets credential if connection * properties are in the update field mask. * + *future = + * connectionServiceClient.listConnectionsCallable().futureCall(request); + * // Do something. + * ConnectionProto.ListConnectionsResponse response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + * ConnectionProto.Connection connection = ConnectionProto.Connection.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * ConnectionProto.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. @@ -353,6 +521,18 @@ public final ConnectionProto.Connection updateConnection( * Updates the specified connection. For security reasons, also resets credential if connection * properties are in the update field mask. * + *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * String name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString(); + * ConnectionProto.Connection connection = ConnectionProto.Connection.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * ConnectionProto.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. @@ -375,6 +555,19 @@ public final ConnectionProto.Connection updateConnection( * Updates the specified connection. For security reasons, also resets credential if connection * properties are in the update field mask. * + *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * ConnectionProto.UpdateConnectionRequest request = + * ConnectionProto.UpdateConnectionRequest.newBuilder() + * .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ConnectionProto.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 */ @@ -389,6 +582,20 @@ public final ConnectionProto.Connection updateConnection( * properties are in the update field mask. * *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * ConnectionProto.UpdateConnectionRequest request = + * ConnectionProto.UpdateConnectionRequest.newBuilder() + * .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * connectionServiceClient.updateConnectionCallable().futureCall(request); + * // Do something. + * ConnectionProto.Connection response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * String name = "name3373707"; + * ConnectionProto.ConnectionCredential credential = + * ConnectionProto.ConnectionCredential.newBuilder().build(); + * connectionServiceClient.updateConnectionCredential(name, credential); + * } + * }+ * * @param name Required. Name of the connection, for example: * `projects/{project_id}/locations/{location_id}/connections/{connection_id}/credential` * @param credential Required. Credential to use with the connection. @@ -418,6 +636,18 @@ public final void updateConnectionCredential( /** * Sets the credential for the specified connection. * + *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * ConnectionProto.UpdateConnectionCredentialRequest request = + * ConnectionProto.UpdateConnectionCredentialRequest.newBuilder() + * .setName("name3373707") + * .build(); + * connectionServiceClient.updateConnectionCredential(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 */ @@ -431,6 +661,19 @@ public final void updateConnectionCredential( * Sets the credential for the specified connection. * *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * ConnectionProto.UpdateConnectionCredentialRequest request = + * ConnectionProto.UpdateConnectionCredentialRequest.newBuilder() + * .setName("name3373707") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * connectionServiceClient.updateConnectionCredentialCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@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 @@ -457,6 +709,15 @@ public final void deleteConnection(ConnectionName name) { /** * Deletes connection and associated credential. * + *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * String name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString(); + * 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 @@ -471,6 +732,18 @@ public final void deleteConnection(String name) { /** * Deletes connection and associated credential. * + *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * ConnectionProto.DeleteConnectionRequest request = + * ConnectionProto.DeleteConnectionRequest.newBuilder() + * .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").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 */ @@ -483,6 +756,19 @@ public final void deleteConnection(ConnectionProto.DeleteConnectionRequest reque * Deletes connection and associated credential. * *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * ConnectionProto.DeleteConnectionRequest request = + * ConnectionProto.DeleteConnectionRequest.newBuilder() + * .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * connectionServiceClient.deleteConnectionCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@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`. @@ -514,6 +810,16 @@ public final Policy getIamPolicy(ResourceName resource, GetPolicyOptions options * 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: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * String resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString(); + * 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`. @@ -531,6 +837,19 @@ public final Policy getIamPolicy(String resource, GetPolicyOptions options) { * 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: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * GetIamPolicyRequest request = + * GetIamPolicyRequest.newBuilder() + * .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + * .setOptions(GetPolicyOptions.newBuilder().build()) + * .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 */ @@ -544,6 +863,19 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) { * and does not have a policy set. * *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * GetIamPolicyRequest request = + * GetIamPolicyRequest.newBuilder() + * .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + * .setOptions(GetPolicyOptions.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = connectionServiceClient.getIamPolicyCallable().futureCall(request); + * // Do something. + * Policy response = future.get(); + * } + * }
Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED * + *
Sample code: + * + *
{@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 @@ -577,6 +919,16 @@ public final Policy setIamPolicy(ResourceName resource, Policy policy) { * *
Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED * + *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * String resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString(); + * 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 @@ -596,6 +948,19 @@ public final Policy setIamPolicy(String resource, Policy policy) { * *
Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED * + *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * SetIamPolicyRequest request = + * SetIamPolicyRequest.newBuilder() + * .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + * .setPolicy(Policy.newBuilder().build()) + * .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 */ @@ -610,6 +975,19 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) { *
Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED * *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * SetIamPolicyRequest request = + * SetIamPolicyRequest.newBuilder() + * .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + * .setPolicy(Policy.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = connectionServiceClient.setIamPolicyCallable().futureCall(request); + * // Do something. + * Policy response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + * List+ * * @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 @@ -650,6 +1039,17 @@ public final TestIamPermissionsResponse testIamPermissions( * command-line tools, not for authorization checking. This operation may "fail open" without * warning. * + *permissions = new ArrayList<>(); + * TestIamPermissionsResponse response = + * connectionServiceClient.testIamPermissions(resource, permissions); + * } + * }
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * String resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString(); + * List+ * * @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 @@ -676,6 +1076,19 @@ public final TestIamPermissionsResponse testIamPermissions( * command-line tools, not for authorization checking. This operation may "fail open" without * warning. * + *permissions = new ArrayList<>(); + * TestIamPermissionsResponse response = + * connectionServiceClient.testIamPermissions(resource, permissions); + * } + * }
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * TestIamPermissionsRequest request = + * TestIamPermissionsRequest.newBuilder() + * .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + * .addAllPermissions(new ArrayList+ * * @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 */ @@ -693,6 +1106,20 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq * warning. * *()) + * .build(); + * TestIamPermissionsResponse response = connectionServiceClient.testIamPermissions(request); + * } + * }
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * TestIamPermissionsRequest request = + * TestIamPermissionsRequest.newBuilder() + * .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + * .addAllPermissions(new ArrayList*/ public final UnaryCallable()) + * .build(); + * ApiFuture future = + * connectionServiceClient.testIamPermissionsCallable().futureCall(request); + * // Do something. + * TestIamPermissionsResponse response = future.get(); + * } + * }
Service Description: Manages external data source connections and credentials. * *
Sample for ConnectionServiceClient: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * ConnectionProto.Connection connection = ConnectionProto.Connection.newBuilder().build(); + * String connectionId = "connectionId1923106969"; + * ConnectionProto.Connection response = + * connectionServiceClient.createConnection(parent, connection, connectionId); + * } + * }*/ @Generated("by gapic-generator-java") package com.google.cloud.bigquery.connection.v1beta1; 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 index f2c98c42..10f0361b 100644 --- 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 @@ -59,6 +59,16 @@ *
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: * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * Connection connection = Connection.newBuilder().build(); + * String connectionId = "connectionId1923106969"; + * 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(). @@ -165,6 +175,18 @@ public ConnectionServiceStub getStub() { /** * Creates a new connection. * + *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * Connection connection = Connection.newBuilder().build(); + * String connectionId = "connectionId1923106969"; + * 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. @@ -186,6 +208,18 @@ public final Connection createConnection( /** * Creates a new connection. * + *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * Connection connection = Connection.newBuilder().build(); + * String connectionId = "connectionId1923106969"; + * 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. @@ -207,6 +241,20 @@ public final Connection createConnection( /** * Creates a new connection. * + *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * CreateConnectionRequest request = + * CreateConnectionRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setConnectionId("connectionId1923106969") + * .setConnection(Connection.newBuilder().build()) + * .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 */ @@ -219,6 +267,21 @@ public final Connection createConnection(CreateConnectionRequest request) { * Creates a new connection. * *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * CreateConnectionRequest request = + * CreateConnectionRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setConnectionId("connectionId1923106969") + * .setConnection(Connection.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * connectionServiceClient.createConnectionCallable().futureCall(request); + * // Do something. + * Connection response = future.get(); + * } + * }
Sample code: + * + *
{@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 @@ -242,6 +314,15 @@ public final Connection getConnection(ConnectionName name) { /** * Returns specified connection. * + *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * String name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString(); + * 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 @@ -255,6 +336,18 @@ public final Connection getConnection(String name) { /** * Returns specified connection. * + *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * GetConnectionRequest request = + * GetConnectionRequest.newBuilder() + * .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").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 */ @@ -267,6 +360,19 @@ public final Connection getConnection(GetConnectionRequest request) { * Returns specified connection. * *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * GetConnectionRequest request = + * GetConnectionRequest.newBuilder() + * .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * connectionServiceClient.getConnectionCallable().futureCall(request); + * // Do something. + * Connection response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (Connection element : connectionServiceClient.listConnections(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. Parent resource name. Must be in the form: * `projects/{project_id}/locations/{location_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -292,6 +409,17 @@ public final ListConnectionsPagedResponse listConnections(LocationName parent) { /** * Returns a list of connections in the given project. * + *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * for (Connection element : connectionServiceClient.listConnections(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. Parent resource name. Must be in the form: * `projects/{project_id}/locations/{location_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -305,6 +433,22 @@ public final ListConnectionsPagedResponse listConnections(String parent) { /** * Returns a list of connections in the given project. * + *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * ListConnectionsRequest request = + * ListConnectionsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .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 */ @@ -317,6 +461,23 @@ public final ListConnectionsPagedResponse listConnections(ListConnectionsRequest * Returns a list of connections in the given project. * *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * ListConnectionsRequest request = + * ListConnectionsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * connectionServiceClient.listConnectionsPagedCallable().futureCall(request); + * // Do something. + * for (Connection element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * while (true) { + * ListConnectionsResponse response = + * connectionServiceClient.listConnectionsCallable().call(request); + * for (Connection element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@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. @@ -361,6 +551,17 @@ public final Connection updateConnection( * Updates the specified connection. For security reasons, also resets credential if connection * properties are in the update field mask. * + *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * String name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString(); + * 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. @@ -383,6 +584,20 @@ public final Connection updateConnection( * Updates the specified connection. For security reasons, also resets credential if connection * properties are in the update field mask. * + *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * UpdateConnectionRequest request = + * UpdateConnectionRequest.newBuilder() + * .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + * .setConnection(Connection.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .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 */ @@ -396,6 +611,21 @@ public final Connection updateConnection(UpdateConnectionRequest request) { * properties are in the update field mask. * *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * UpdateConnectionRequest request = + * UpdateConnectionRequest.newBuilder() + * .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + * .setConnection(Connection.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * connectionServiceClient.updateConnectionCallable().futureCall(request); + * // Do something. + * Connection response = future.get(); + * } + * }
Sample code: + * + *
{@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 @@ -419,6 +658,15 @@ public final void deleteConnection(ConnectionName name) { /** * Deletes connection and associated credential. * + *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * String name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString(); + * 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 @@ -432,6 +680,18 @@ public final void deleteConnection(String name) { /** * Deletes connection and associated credential. * + *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * DeleteConnectionRequest request = + * DeleteConnectionRequest.newBuilder() + * .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").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 */ @@ -444,6 +704,19 @@ public final void deleteConnection(DeleteConnectionRequest request) { * Deletes connection and associated credential. * *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * DeleteConnectionRequest request = + * DeleteConnectionRequest.newBuilder() + * .setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * connectionServiceClient.deleteConnectionCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@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`. @@ -474,6 +757,16 @@ public final Policy getIamPolicy(ResourceName resource, GetPolicyOptions options * 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: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * String resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString(); + * 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`. @@ -491,6 +784,19 @@ public final Policy getIamPolicy(String resource, GetPolicyOptions options) { * 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: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * GetIamPolicyRequest request = + * GetIamPolicyRequest.newBuilder() + * .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + * .setOptions(GetPolicyOptions.newBuilder().build()) + * .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 */ @@ -504,6 +810,19 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) { * and does not have a policy set. * *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * GetIamPolicyRequest request = + * GetIamPolicyRequest.newBuilder() + * .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + * .setOptions(GetPolicyOptions.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = connectionServiceClient.getIamPolicyCallable().futureCall(request); + * // Do something. + * Policy response = future.get(); + * } + * }
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. * + *
Sample code: + * + *
{@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 @@ -537,6 +866,16 @@ public final Policy setIamPolicy(ResourceName resource, Policy policy) { * *
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. * + *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * String resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString(); + * 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 @@ -556,6 +895,19 @@ public final Policy setIamPolicy(String resource, Policy policy) { * *
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. * + *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * SetIamPolicyRequest request = + * SetIamPolicyRequest.newBuilder() + * .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + * .setPolicy(Policy.newBuilder().build()) + * .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 */ @@ -570,6 +922,19 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) { *
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. * *
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * SetIamPolicyRequest request = + * SetIamPolicyRequest.newBuilder() + * .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + * .setPolicy(Policy.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = connectionServiceClient.setIamPolicyCallable().futureCall(request); + * // Do something. + * Policy response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * ResourceName resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]"); + * List+ * * @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 @@ -610,6 +986,17 @@ public final TestIamPermissionsResponse testIamPermissions( * command-line tools, not for authorization checking. This operation may "fail open" without * warning. * + *permissions = new ArrayList<>(); + * TestIamPermissionsResponse response = + * connectionServiceClient.testIamPermissions(resource, permissions); + * } + * }
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * String resource = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString(); + * List+ * * @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 @@ -636,6 +1023,19 @@ public final TestIamPermissionsResponse testIamPermissions( * command-line tools, not for authorization checking. This operation may "fail open" without * warning. * + *permissions = new ArrayList<>(); + * TestIamPermissionsResponse response = + * connectionServiceClient.testIamPermissions(resource, permissions); + * } + * }
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * TestIamPermissionsRequest request = + * TestIamPermissionsRequest.newBuilder() + * .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + * .addAllPermissions(new ArrayList+ * * @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 */ @@ -653,6 +1053,20 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq * warning. * *()) + * .build(); + * TestIamPermissionsResponse response = connectionServiceClient.testIamPermissions(request); + * } + * }
Sample code: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * TestIamPermissionsRequest request = + * TestIamPermissionsRequest.newBuilder() + * .setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString()) + * .addAllPermissions(new ArrayList*/ public final UnaryCallable()) + * .build(); + * ApiFuture future = + * connectionServiceClient.testIamPermissionsCallable().futureCall(request); + * // Do something. + * TestIamPermissionsResponse response = future.get(); + * } + * }
Service Description: Manages external data source connections and credentials. * *
Sample for ConnectionServiceClient: + * + *
{@code + * try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * Connection connection = Connection.newBuilder().build(); + * String connectionId = "connectionId1923106969"; + * Connection response = + * connectionServiceClient.createConnection(parent, connection, connectionId); + * } + * }*/ @Generated("by gapic-generator-java") package com.google.cloud.bigqueryconnection.v1; diff --git a/synth.metadata b/synth.metadata index e718d2e8..73d7466f 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,23 +4,23 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigqueryconnection.git", - "sha": "496c126a4de82c3359c39127d085dd4286446b3f" + "sha": "3ffb3f24a820613e0d8fc7eb102e1035e23ad0bf" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb", + "internalRef": "356341083" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb", + "internalRef": "356341083" } }, {