@Generated(value="by gapic-generator-java") public class RepositoryManagerClient extends Object implements com.google.api.gax.core.BackgroundResource
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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
Connection response = repositoryManagerClient.getConnection(name);
}
Note: close() needs to be called on the RepositoryManagerClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
CreateConnection |
Creates a Connection. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetConnection |
Gets details of a single connection. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListConnections |
Lists Connections in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateConnection |
Updates a single connection. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteConnection |
Deletes a single connection. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateRepository |
Creates a Repository. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
BatchCreateRepositories |
Creates multiple repositories inside a connection. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetRepository |
Gets details of a single repository. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListRepositories |
Lists Repositories in a given connection. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteRepository |
Deletes a single repository. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
FetchReadWriteToken |
Fetches read/write token of a given repository. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
FetchReadToken |
Fetches read token of a given repository. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
FetchLinkableRepositories |
FetchLinkableRepositories get repositories from SCM that are accessible and could be added to the connection. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
FetchGitRefs |
Fetch the list of branches or tags for a given repository. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetIamPolicy |
Sets the access control policy on the specified resource. Replacesany existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetIamPolicy |
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
TestIamPermissions |
Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return 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 RepositoryManagerSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
RepositoryManagerSettings repositoryManagerSettings =
RepositoryManagerSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
RepositoryManagerClient repositoryManagerClient =
RepositoryManagerClient.create(repositoryManagerSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
RepositoryManagerSettings repositoryManagerSettings =
RepositoryManagerSettings.newBuilder().setEndpoint(myEndpoint).build();
RepositoryManagerClient repositoryManagerClient =
RepositoryManagerClient.create(repositoryManagerSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
RepositoryManagerSettings repositoryManagerSettings =
RepositoryManagerSettings.newHttpJsonBuilder().build();
RepositoryManagerClient repositoryManagerClient =
RepositoryManagerClient.create(repositoryManagerSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
RepositoryManagerClient.FetchLinkableRepositoriesFixedSizeCollection |
static class |
RepositoryManagerClient.FetchLinkableRepositoriesPage |
static class |
RepositoryManagerClient.FetchLinkableRepositoriesPagedResponse |
static class |
RepositoryManagerClient.ListConnectionsFixedSizeCollection |
static class |
RepositoryManagerClient.ListConnectionsPage |
static class |
RepositoryManagerClient.ListConnectionsPagedResponse |
static class |
RepositoryManagerClient.ListRepositoriesFixedSizeCollection |
static class |
RepositoryManagerClient.ListRepositoriesPage |
static class |
RepositoryManagerClient.ListRepositoriesPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
RepositoryManagerClient(RepositoryManagerSettings settings)
Constructs an instance of RepositoryManagerClient, using the given settings.
|
protected |
RepositoryManagerClient(RepositoryManagerStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
com.google.api.gax.longrunning.OperationFuture<BatchCreateRepositoriesResponse,OperationMetadata> |
batchCreateRepositoriesAsync(BatchCreateRepositoriesRequest request)
Creates multiple repositories inside a connection.
|
com.google.api.gax.longrunning.OperationFuture<BatchCreateRepositoriesResponse,OperationMetadata> |
batchCreateRepositoriesAsync(ConnectionName parent,
List<CreateRepositoryRequest> requests)
Creates multiple repositories inside a connection.
|
com.google.api.gax.longrunning.OperationFuture<BatchCreateRepositoriesResponse,OperationMetadata> |
batchCreateRepositoriesAsync(String parent,
List<CreateRepositoryRequest> requests)
Creates multiple repositories inside a connection.
|
com.google.api.gax.rpc.UnaryCallable<BatchCreateRepositoriesRequest,com.google.longrunning.Operation> |
batchCreateRepositoriesCallable()
Creates multiple repositories inside a connection.
|
com.google.api.gax.rpc.OperationCallable<BatchCreateRepositoriesRequest,BatchCreateRepositoriesResponse,OperationMetadata> |
batchCreateRepositoriesOperationCallable()
Creates multiple repositories inside a connection.
|
void |
close() |
static RepositoryManagerClient |
create()
Constructs an instance of RepositoryManagerClient with default settings.
|
static RepositoryManagerClient |
create(RepositoryManagerSettings settings)
Constructs an instance of RepositoryManagerClient, using the given settings.
|
static RepositoryManagerClient |
create(RepositoryManagerStub stub)
Constructs an instance of RepositoryManagerClient, using the given stub for making calls.
|
com.google.api.gax.longrunning.OperationFuture<Connection,OperationMetadata> |
createConnectionAsync(CreateConnectionRequest request)
Creates a Connection.
|
com.google.api.gax.longrunning.OperationFuture<Connection,OperationMetadata> |
createConnectionAsync(LocationName parent,
Connection connection,
String connectionId)
Creates a Connection.
|
com.google.api.gax.longrunning.OperationFuture<Connection,OperationMetadata> |
createConnectionAsync(String parent,
Connection connection,
String connectionId)
Creates a Connection.
|
com.google.api.gax.rpc.UnaryCallable<CreateConnectionRequest,com.google.longrunning.Operation> |
createConnectionCallable()
Creates a Connection.
|
com.google.api.gax.rpc.OperationCallable<CreateConnectionRequest,Connection,OperationMetadata> |
createConnectionOperationCallable()
Creates a Connection.
|
com.google.api.gax.longrunning.OperationFuture<Repository,OperationMetadata> |
createRepositoryAsync(ConnectionName parent,
Repository repository,
String repositoryId)
Creates a Repository.
|
com.google.api.gax.longrunning.OperationFuture<Repository,OperationMetadata> |
createRepositoryAsync(CreateRepositoryRequest request)
Creates a Repository.
|
com.google.api.gax.longrunning.OperationFuture<Repository,OperationMetadata> |
createRepositoryAsync(String parent,
Repository repository,
String repositoryId)
Creates a Repository.
|
com.google.api.gax.rpc.UnaryCallable<CreateRepositoryRequest,com.google.longrunning.Operation> |
createRepositoryCallable()
Creates a Repository.
|
com.google.api.gax.rpc.OperationCallable<CreateRepositoryRequest,Repository,OperationMetadata> |
createRepositoryOperationCallable()
Creates a Repository.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteConnectionAsync(ConnectionName name)
Deletes a single connection.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteConnectionAsync(DeleteConnectionRequest request)
Deletes a single connection.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteConnectionAsync(String name)
Deletes a single connection.
|
com.google.api.gax.rpc.UnaryCallable<DeleteConnectionRequest,com.google.longrunning.Operation> |
deleteConnectionCallable()
Deletes a single connection.
|
com.google.api.gax.rpc.OperationCallable<DeleteConnectionRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteConnectionOperationCallable()
Deletes a single connection.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteRepositoryAsync(DeleteRepositoryRequest request)
Deletes a single repository.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteRepositoryAsync(RepositoryName name)
Deletes a single repository.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteRepositoryAsync(String name)
Deletes a single repository.
|
com.google.api.gax.rpc.UnaryCallable<DeleteRepositoryRequest,com.google.longrunning.Operation> |
deleteRepositoryCallable()
Deletes a single repository.
|
com.google.api.gax.rpc.OperationCallable<DeleteRepositoryRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteRepositoryOperationCallable()
Deletes a single repository.
|
FetchGitRefsResponse |
fetchGitRefs(FetchGitRefsRequest request)
Fetch the list of branches or tags for a given repository.
|
FetchGitRefsResponse |
fetchGitRefs(RepositoryName repository)
Fetch the list of branches or tags for a given repository.
|
FetchGitRefsResponse |
fetchGitRefs(String repository)
Fetch the list of branches or tags for a given repository.
|
com.google.api.gax.rpc.UnaryCallable<FetchGitRefsRequest,FetchGitRefsResponse> |
fetchGitRefsCallable()
Fetch the list of branches or tags for a given repository.
|
RepositoryManagerClient.FetchLinkableRepositoriesPagedResponse |
fetchLinkableRepositories(FetchLinkableRepositoriesRequest request)
FetchLinkableRepositories get repositories from SCM that are accessible and could be added to
the connection.
|
com.google.api.gax.rpc.UnaryCallable<FetchLinkableRepositoriesRequest,FetchLinkableRepositoriesResponse> |
fetchLinkableRepositoriesCallable()
FetchLinkableRepositories get repositories from SCM that are accessible and could be added to
the connection.
|
com.google.api.gax.rpc.UnaryCallable<FetchLinkableRepositoriesRequest,RepositoryManagerClient.FetchLinkableRepositoriesPagedResponse> |
fetchLinkableRepositoriesPagedCallable()
FetchLinkableRepositories get repositories from SCM that are accessible and could be added to
the connection.
|
FetchReadTokenResponse |
fetchReadToken(FetchReadTokenRequest request)
Fetches read token of a given repository.
|
FetchReadTokenResponse |
fetchReadToken(RepositoryName repository)
Fetches read token of a given repository.
|
FetchReadTokenResponse |
fetchReadToken(String repository)
Fetches read token of a given repository.
|
com.google.api.gax.rpc.UnaryCallable<FetchReadTokenRequest,FetchReadTokenResponse> |
fetchReadTokenCallable()
Fetches read token of a given repository.
|
FetchReadWriteTokenResponse |
fetchReadWriteToken(FetchReadWriteTokenRequest request)
Fetches read/write token of a given repository.
|
FetchReadWriteTokenResponse |
fetchReadWriteToken(RepositoryName repository)
Fetches read/write token of a given repository.
|
FetchReadWriteTokenResponse |
fetchReadWriteToken(String repository)
Fetches read/write token of a given repository.
|
com.google.api.gax.rpc.UnaryCallable<FetchReadWriteTokenRequest,FetchReadWriteTokenResponse> |
fetchReadWriteTokenCallable()
Fetches read/write token of a given repository.
|
Connection |
getConnection(ConnectionName name)
Gets details of a single connection.
|
Connection |
getConnection(GetConnectionRequest request)
Gets details of a single connection.
|
Connection |
getConnection(String name)
Gets details of a single connection.
|
com.google.api.gax.rpc.UnaryCallable<GetConnectionRequest,Connection> |
getConnectionCallable()
Gets details of a single connection.
|
com.google.api.gax.httpjson.longrunning.OperationsClient |
getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
com.google.iam.v1.Policy |
getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
Gets the access control policy for a resource.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> |
getIamPolicyCallable()
Gets the access control policy for a resource.
|
com.google.longrunning.OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
Repository |
getRepository(GetRepositoryRequest request)
Gets details of a single repository.
|
Repository |
getRepository(RepositoryName name)
Gets details of a single repository.
|
Repository |
getRepository(String name)
Gets details of a single repository.
|
com.google.api.gax.rpc.UnaryCallable<GetRepositoryRequest,Repository> |
getRepositoryCallable()
Gets details of a single repository.
|
RepositoryManagerSettings |
getSettings() |
RepositoryManagerStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
RepositoryManagerClient.ListConnectionsPagedResponse |
listConnections(ListConnectionsRequest request)
Lists Connections in a given project and location.
|
RepositoryManagerClient.ListConnectionsPagedResponse |
listConnections(LocationName parent)
Lists Connections in a given project and location.
|
RepositoryManagerClient.ListConnectionsPagedResponse |
listConnections(String parent)
Lists Connections in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListConnectionsRequest,ListConnectionsResponse> |
listConnectionsCallable()
Lists Connections in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListConnectionsRequest,RepositoryManagerClient.ListConnectionsPagedResponse> |
listConnectionsPagedCallable()
Lists Connections in a given project and location.
|
RepositoryManagerClient.ListRepositoriesPagedResponse |
listRepositories(ConnectionName parent)
Lists Repositories in a given connection.
|
RepositoryManagerClient.ListRepositoriesPagedResponse |
listRepositories(ListRepositoriesRequest request)
Lists Repositories in a given connection.
|
RepositoryManagerClient.ListRepositoriesPagedResponse |
listRepositories(String parent)
Lists Repositories in a given connection.
|
com.google.api.gax.rpc.UnaryCallable<ListRepositoriesRequest,ListRepositoriesResponse> |
listRepositoriesCallable()
Lists Repositories in a given connection.
|
com.google.api.gax.rpc.UnaryCallable<ListRepositoriesRequest,RepositoryManagerClient.ListRepositoriesPagedResponse> |
listRepositoriesPagedCallable()
Lists Repositories in a given connection.
|
com.google.iam.v1.Policy |
setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
Sets the access control policy on the specified resource.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> |
setIamPolicyCallable()
Sets the access control policy on the specified resource.
|
void |
shutdown() |
void |
shutdownNow() |
com.google.iam.v1.TestIamPermissionsResponse |
testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
Returns permissions that a caller has on the specified resource.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> |
testIamPermissionsCallable()
Returns permissions that a caller has on the specified resource.
|
com.google.api.gax.longrunning.OperationFuture<Connection,OperationMetadata> |
updateConnectionAsync(Connection connection,
com.google.protobuf.FieldMask updateMask)
Updates a single connection.
|
com.google.api.gax.longrunning.OperationFuture<Connection,OperationMetadata> |
updateConnectionAsync(UpdateConnectionRequest request)
Updates a single connection.
|
com.google.api.gax.rpc.UnaryCallable<UpdateConnectionRequest,com.google.longrunning.Operation> |
updateConnectionCallable()
Updates a single connection.
|
com.google.api.gax.rpc.OperationCallable<UpdateConnectionRequest,Connection,OperationMetadata> |
updateConnectionOperationCallable()
Updates a single connection.
|
protected RepositoryManagerClient(RepositoryManagerSettings settings) throws IOException
IOExceptionprotected RepositoryManagerClient(RepositoryManagerStub stub)
public static final RepositoryManagerClient create() throws IOException
IOExceptionpublic static final RepositoryManagerClient create(RepositoryManagerSettings settings) throws IOException
IOExceptionpublic static final RepositoryManagerClient create(RepositoryManagerStub stub)
public final RepositoryManagerSettings getSettings()
public RepositoryManagerStub getStub()
public final com.google.longrunning.OperationsClient getOperationsClient()
@BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
public final com.google.api.gax.longrunning.OperationFuture<Connection,OperationMetadata> createConnectionAsync(LocationName parent, Connection connection, String connectionId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Connection connection = Connection.newBuilder().build();
String connectionId = "connectionId1923106969";
Connection response =
repositoryManagerClient.createConnectionAsync(parent, connection, connectionId).get();
}
parent - Required. Project and location where the connection will be created. Format:
`projects/*/locations/*`.connection - Required. The Connection to create.connectionId - Required. The ID to use for the Connection, which will become the final
component of the Connection's resource name. Names must be unique per-project per-location.
Allows alphanumeric characters and any of -._~%!$&'()*+,;=@.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Connection,OperationMetadata> createConnectionAsync(String parent, Connection connection, String connectionId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
Connection connection = Connection.newBuilder().build();
String connectionId = "connectionId1923106969";
Connection response =
repositoryManagerClient.createConnectionAsync(parent, connection, connectionId).get();
}
parent - Required. Project and location where the connection will be created. Format:
`projects/*/locations/*`.connection - Required. The Connection to create.connectionId - Required. The ID to use for the Connection, which will become the final
component of the Connection's resource name. Names must be unique per-project per-location.
Allows alphanumeric characters and any of -._~%!$&'()*+,;=@.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Connection,OperationMetadata> createConnectionAsync(CreateConnectionRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
CreateConnectionRequest request =
CreateConnectionRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setConnection(Connection.newBuilder().build())
.setConnectionId("connectionId1923106969")
.build();
Connection response = repositoryManagerClient.createConnectionAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateConnectionRequest,Connection,OperationMetadata> createConnectionOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
CreateConnectionRequest request =
CreateConnectionRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setConnection(Connection.newBuilder().build())
.setConnectionId("connectionId1923106969")
.build();
OperationFuture<Connection, OperationMetadata> future =
repositoryManagerClient.createConnectionOperationCallable().futureCall(request);
// Do something.
Connection response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateConnectionRequest,com.google.longrunning.Operation> createConnectionCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
CreateConnectionRequest request =
CreateConnectionRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setConnection(Connection.newBuilder().build())
.setConnectionId("connectionId1923106969")
.build();
ApiFuture<Operation> future =
repositoryManagerClient.createConnectionCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final Connection getConnection(ConnectionName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
Connection response = repositoryManagerClient.getConnection(name);
}
name - Required. The name of the Connection to retrieve. Format:
`projects/*/locations/*/connections/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Connection getConnection(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
String name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString();
Connection response = repositoryManagerClient.getConnection(name);
}
name - Required. The name of the Connection to retrieve. Format:
`projects/*/locations/*/connections/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Connection getConnection(GetConnectionRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
GetConnectionRequest request =
GetConnectionRequest.newBuilder()
.setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
.build();
Connection response = repositoryManagerClient.getConnection(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetConnectionRequest,Connection> getConnectionCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
GetConnectionRequest request =
GetConnectionRequest.newBuilder()
.setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
.build();
ApiFuture<Connection> future =
repositoryManagerClient.getConnectionCallable().futureCall(request);
// Do something.
Connection response = future.get();
}
public final RepositoryManagerClient.ListConnectionsPagedResponse listConnections(LocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Connection element : repositoryManagerClient.listConnections(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent, which owns this collection of Connections. Format:
`projects/*/locations/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final RepositoryManagerClient.ListConnectionsPagedResponse listConnections(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (Connection element : repositoryManagerClient.listConnections(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent, which owns this collection of Connections. Format:
`projects/*/locations/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final RepositoryManagerClient.ListConnectionsPagedResponse listConnections(ListConnectionsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
ListConnectionsRequest request =
ListConnectionsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Connection element : repositoryManagerClient.listConnections(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListConnectionsRequest,RepositoryManagerClient.ListConnectionsPagedResponse> listConnectionsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
ListConnectionsRequest request =
ListConnectionsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Connection> future =
repositoryManagerClient.listConnectionsPagedCallable().futureCall(request);
// Do something.
for (Connection element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListConnectionsRequest,ListConnectionsResponse> listConnectionsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
ListConnectionsRequest request =
ListConnectionsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListConnectionsResponse response =
repositoryManagerClient.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 com.google.api.gax.longrunning.OperationFuture<Connection,OperationMetadata> updateConnectionAsync(Connection connection, com.google.protobuf.FieldMask updateMask)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
Connection connection = Connection.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Connection response =
repositoryManagerClient.updateConnectionAsync(connection, updateMask).get();
}
connection - Required. The Connection to update.updateMask - The list of fields to be updated.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Connection,OperationMetadata> updateConnectionAsync(UpdateConnectionRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
UpdateConnectionRequest request =
UpdateConnectionRequest.newBuilder()
.setConnection(Connection.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setAllowMissing(true)
.setEtag("etag3123477")
.build();
Connection response = repositoryManagerClient.updateConnectionAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpdateConnectionRequest,Connection,OperationMetadata> updateConnectionOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
UpdateConnectionRequest request =
UpdateConnectionRequest.newBuilder()
.setConnection(Connection.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setAllowMissing(true)
.setEtag("etag3123477")
.build();
OperationFuture<Connection, OperationMetadata> future =
repositoryManagerClient.updateConnectionOperationCallable().futureCall(request);
// Do something.
Connection response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateConnectionRequest,com.google.longrunning.Operation> updateConnectionCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
UpdateConnectionRequest request =
UpdateConnectionRequest.newBuilder()
.setConnection(Connection.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setAllowMissing(true)
.setEtag("etag3123477")
.build();
ApiFuture<Operation> future =
repositoryManagerClient.updateConnectionCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteConnectionAsync(ConnectionName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
repositoryManagerClient.deleteConnectionAsync(name).get();
}
name - Required. The name of the Connection to delete. Format:
`projects/*/locations/*/connections/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteConnectionAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
String name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString();
repositoryManagerClient.deleteConnectionAsync(name).get();
}
name - Required. The name of the Connection to delete. Format:
`projects/*/locations/*/connections/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteConnectionAsync(DeleteConnectionRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
DeleteConnectionRequest request =
DeleteConnectionRequest.newBuilder()
.setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
.setEtag("etag3123477")
.setValidateOnly(true)
.build();
repositoryManagerClient.deleteConnectionAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteConnectionRequest,com.google.protobuf.Empty,OperationMetadata> deleteConnectionOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
DeleteConnectionRequest request =
DeleteConnectionRequest.newBuilder()
.setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
.setEtag("etag3123477")
.setValidateOnly(true)
.build();
OperationFuture<Empty, OperationMetadata> future =
repositoryManagerClient.deleteConnectionOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteConnectionRequest,com.google.longrunning.Operation> deleteConnectionCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
DeleteConnectionRequest request =
DeleteConnectionRequest.newBuilder()
.setName(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
.setEtag("etag3123477")
.setValidateOnly(true)
.build();
ApiFuture<Operation> future =
repositoryManagerClient.deleteConnectionCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Repository,OperationMetadata> createRepositoryAsync(ConnectionName parent, Repository repository, String repositoryId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
ConnectionName parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
Repository repository = Repository.newBuilder().build();
String repositoryId = "repositoryId2113747461";
Repository response =
repositoryManagerClient.createRepositoryAsync(parent, repository, repositoryId).get();
}
parent - Required. The connection to contain the repository. If the request is part of a
BatchCreateRepositoriesRequest, this field should be empty or match the parent specified
there.repository - Required. The repository to create.repositoryId - Required. The ID to use for the repository, which will become the final
component of the repository's resource name. This ID should be unique in the connection.
Allows alphanumeric characters and any of -._~%!$&'()*+,;=@.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Repository,OperationMetadata> createRepositoryAsync(String parent, Repository repository, String repositoryId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
String parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString();
Repository repository = Repository.newBuilder().build();
String repositoryId = "repositoryId2113747461";
Repository response =
repositoryManagerClient.createRepositoryAsync(parent, repository, repositoryId).get();
}
parent - Required. The connection to contain the repository. If the request is part of a
BatchCreateRepositoriesRequest, this field should be empty or match the parent specified
there.repository - Required. The repository to create.repositoryId - Required. The ID to use for the repository, which will become the final
component of the repository's resource name. This ID should be unique in the connection.
Allows alphanumeric characters and any of -._~%!$&'()*+,;=@.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Repository,OperationMetadata> createRepositoryAsync(CreateRepositoryRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
CreateRepositoryRequest request =
CreateRepositoryRequest.newBuilder()
.setParent(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
.setRepository(Repository.newBuilder().build())
.setRepositoryId("repositoryId2113747461")
.build();
Repository response = repositoryManagerClient.createRepositoryAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateRepositoryRequest,Repository,OperationMetadata> createRepositoryOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
CreateRepositoryRequest request =
CreateRepositoryRequest.newBuilder()
.setParent(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
.setRepository(Repository.newBuilder().build())
.setRepositoryId("repositoryId2113747461")
.build();
OperationFuture<Repository, OperationMetadata> future =
repositoryManagerClient.createRepositoryOperationCallable().futureCall(request);
// Do something.
Repository response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateRepositoryRequest,com.google.longrunning.Operation> createRepositoryCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
CreateRepositoryRequest request =
CreateRepositoryRequest.newBuilder()
.setParent(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
.setRepository(Repository.newBuilder().build())
.setRepositoryId("repositoryId2113747461")
.build();
ApiFuture<Operation> future =
repositoryManagerClient.createRepositoryCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<BatchCreateRepositoriesResponse,OperationMetadata> batchCreateRepositoriesAsync(ConnectionName parent, List<CreateRepositoryRequest> requests)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
ConnectionName parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
List<CreateRepositoryRequest> requests = new ArrayList<>();
BatchCreateRepositoriesResponse response =
repositoryManagerClient.batchCreateRepositoriesAsync(parent, requests).get();
}
parent - Required. The connection to contain all the repositories being created. Format:
projects/*/locations/*/connections/* The parent field in the
CreateRepositoryRequest messages must either be empty or match this field.requests - Required. The request messages specifying the repositories to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<BatchCreateRepositoriesResponse,OperationMetadata> batchCreateRepositoriesAsync(String parent, List<CreateRepositoryRequest> requests)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
String parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString();
List<CreateRepositoryRequest> requests = new ArrayList<>();
BatchCreateRepositoriesResponse response =
repositoryManagerClient.batchCreateRepositoriesAsync(parent, requests).get();
}
parent - Required. The connection to contain all the repositories being created. Format:
projects/*/locations/*/connections/* The parent field in the
CreateRepositoryRequest messages must either be empty or match this field.requests - Required. The request messages specifying the repositories to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<BatchCreateRepositoriesResponse,OperationMetadata> batchCreateRepositoriesAsync(BatchCreateRepositoriesRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
BatchCreateRepositoriesRequest request =
BatchCreateRepositoriesRequest.newBuilder()
.setParent(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
.addAllRequests(new ArrayList<CreateRepositoryRequest>())
.build();
BatchCreateRepositoriesResponse response =
repositoryManagerClient.batchCreateRepositoriesAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<BatchCreateRepositoriesRequest,BatchCreateRepositoriesResponse,OperationMetadata> batchCreateRepositoriesOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
BatchCreateRepositoriesRequest request =
BatchCreateRepositoriesRequest.newBuilder()
.setParent(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
.addAllRequests(new ArrayList<CreateRepositoryRequest>())
.build();
OperationFuture<BatchCreateRepositoriesResponse, OperationMetadata> future =
repositoryManagerClient.batchCreateRepositoriesOperationCallable().futureCall(request);
// Do something.
BatchCreateRepositoriesResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<BatchCreateRepositoriesRequest,com.google.longrunning.Operation> batchCreateRepositoriesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
BatchCreateRepositoriesRequest request =
BatchCreateRepositoriesRequest.newBuilder()
.setParent(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
.addAllRequests(new ArrayList<CreateRepositoryRequest>())
.build();
ApiFuture<Operation> future =
repositoryManagerClient.batchCreateRepositoriesCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final Repository getRepository(RepositoryName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
RepositoryName name =
RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]");
Repository response = repositoryManagerClient.getRepository(name);
}
name - Required. The name of the Repository to retrieve. Format:
`projects/*/locations/*/connections/*/repositories/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Repository getRepository(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
String name =
RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]").toString();
Repository response = repositoryManagerClient.getRepository(name);
}
name - Required. The name of the Repository to retrieve. Format:
`projects/*/locations/*/connections/*/repositories/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Repository getRepository(GetRepositoryRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
GetRepositoryRequest request =
GetRepositoryRequest.newBuilder()
.setName(
RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]")
.toString())
.build();
Repository response = repositoryManagerClient.getRepository(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetRepositoryRequest,Repository> getRepositoryCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
GetRepositoryRequest request =
GetRepositoryRequest.newBuilder()
.setName(
RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]")
.toString())
.build();
ApiFuture<Repository> future =
repositoryManagerClient.getRepositoryCallable().futureCall(request);
// Do something.
Repository response = future.get();
}
public final RepositoryManagerClient.ListRepositoriesPagedResponse listRepositories(ConnectionName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
ConnectionName parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
for (Repository element : repositoryManagerClient.listRepositories(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent, which owns this collection of Repositories. Format:
`projects/*/locations/*/connections/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final RepositoryManagerClient.ListRepositoriesPagedResponse listRepositories(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
String parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString();
for (Repository element : repositoryManagerClient.listRepositories(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent, which owns this collection of Repositories. Format:
`projects/*/locations/*/connections/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final RepositoryManagerClient.ListRepositoriesPagedResponse listRepositories(ListRepositoriesRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
ListRepositoriesRequest request =
ListRepositoriesRequest.newBuilder()
.setParent(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
for (Repository element : repositoryManagerClient.listRepositories(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListRepositoriesRequest,RepositoryManagerClient.ListRepositoriesPagedResponse> listRepositoriesPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
ListRepositoriesRequest request =
ListRepositoriesRequest.newBuilder()
.setParent(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
ApiFuture<Repository> future =
repositoryManagerClient.listRepositoriesPagedCallable().futureCall(request);
// Do something.
for (Repository element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListRepositoriesRequest,ListRepositoriesResponse> listRepositoriesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
ListRepositoriesRequest request =
ListRepositoriesRequest.newBuilder()
.setParent(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
while (true) {
ListRepositoriesResponse response =
repositoryManagerClient.listRepositoriesCallable().call(request);
for (Repository element : response.getRepositoriesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteRepositoryAsync(RepositoryName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
RepositoryName name =
RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]");
repositoryManagerClient.deleteRepositoryAsync(name).get();
}
name - Required. The name of the Repository to delete. Format:
`projects/*/locations/*/connections/*/repositories/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteRepositoryAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
String name =
RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]").toString();
repositoryManagerClient.deleteRepositoryAsync(name).get();
}
name - Required. The name of the Repository to delete. Format:
`projects/*/locations/*/connections/*/repositories/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteRepositoryAsync(DeleteRepositoryRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
DeleteRepositoryRequest request =
DeleteRepositoryRequest.newBuilder()
.setName(
RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]")
.toString())
.setEtag("etag3123477")
.setValidateOnly(true)
.build();
repositoryManagerClient.deleteRepositoryAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteRepositoryRequest,com.google.protobuf.Empty,OperationMetadata> deleteRepositoryOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
DeleteRepositoryRequest request =
DeleteRepositoryRequest.newBuilder()
.setName(
RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]")
.toString())
.setEtag("etag3123477")
.setValidateOnly(true)
.build();
OperationFuture<Empty, OperationMetadata> future =
repositoryManagerClient.deleteRepositoryOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteRepositoryRequest,com.google.longrunning.Operation> deleteRepositoryCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
DeleteRepositoryRequest request =
DeleteRepositoryRequest.newBuilder()
.setName(
RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]")
.toString())
.setEtag("etag3123477")
.setValidateOnly(true)
.build();
ApiFuture<Operation> future =
repositoryManagerClient.deleteRepositoryCallable().futureCall(request);
// Do something.
future.get();
}
public final FetchReadWriteTokenResponse fetchReadWriteToken(RepositoryName repository)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
RepositoryName repository =
RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]");
FetchReadWriteTokenResponse response =
repositoryManagerClient.fetchReadWriteToken(repository);
}
repository - Required. The resource name of the repository in the format
`projects/*/locations/*/connections/*/repositories/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final FetchReadWriteTokenResponse fetchReadWriteToken(String repository)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
String repository =
RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]").toString();
FetchReadWriteTokenResponse response =
repositoryManagerClient.fetchReadWriteToken(repository);
}
repository - Required. The resource name of the repository in the format
`projects/*/locations/*/connections/*/repositories/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final FetchReadWriteTokenResponse fetchReadWriteToken(FetchReadWriteTokenRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
FetchReadWriteTokenRequest request =
FetchReadWriteTokenRequest.newBuilder()
.setRepository(
RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]")
.toString())
.build();
FetchReadWriteTokenResponse response = repositoryManagerClient.fetchReadWriteToken(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<FetchReadWriteTokenRequest,FetchReadWriteTokenResponse> fetchReadWriteTokenCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
FetchReadWriteTokenRequest request =
FetchReadWriteTokenRequest.newBuilder()
.setRepository(
RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]")
.toString())
.build();
ApiFuture<FetchReadWriteTokenResponse> future =
repositoryManagerClient.fetchReadWriteTokenCallable().futureCall(request);
// Do something.
FetchReadWriteTokenResponse response = future.get();
}
public final FetchReadTokenResponse fetchReadToken(RepositoryName repository)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
RepositoryName repository =
RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]");
FetchReadTokenResponse response = repositoryManagerClient.fetchReadToken(repository);
}
repository - Required. The resource name of the repository in the format
`projects/*/locations/*/connections/*/repositories/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final FetchReadTokenResponse fetchReadToken(String repository)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
String repository =
RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]").toString();
FetchReadTokenResponse response = repositoryManagerClient.fetchReadToken(repository);
}
repository - Required. The resource name of the repository in the format
`projects/*/locations/*/connections/*/repositories/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final FetchReadTokenResponse fetchReadToken(FetchReadTokenRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
FetchReadTokenRequest request =
FetchReadTokenRequest.newBuilder()
.setRepository(
RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]")
.toString())
.build();
FetchReadTokenResponse response = repositoryManagerClient.fetchReadToken(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<FetchReadTokenRequest,FetchReadTokenResponse> fetchReadTokenCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
FetchReadTokenRequest request =
FetchReadTokenRequest.newBuilder()
.setRepository(
RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]")
.toString())
.build();
ApiFuture<FetchReadTokenResponse> future =
repositoryManagerClient.fetchReadTokenCallable().futureCall(request);
// Do something.
FetchReadTokenResponse response = future.get();
}
public final RepositoryManagerClient.FetchLinkableRepositoriesPagedResponse fetchLinkableRepositories(FetchLinkableRepositoriesRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
FetchLinkableRepositoriesRequest request =
FetchLinkableRepositoriesRequest.newBuilder()
.setConnection(
ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Repository element :
repositoryManagerClient.fetchLinkableRepositories(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<FetchLinkableRepositoriesRequest,RepositoryManagerClient.FetchLinkableRepositoriesPagedResponse> fetchLinkableRepositoriesPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
FetchLinkableRepositoriesRequest request =
FetchLinkableRepositoriesRequest.newBuilder()
.setConnection(
ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Repository> future =
repositoryManagerClient.fetchLinkableRepositoriesPagedCallable().futureCall(request);
// Do something.
for (Repository element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<FetchLinkableRepositoriesRequest,FetchLinkableRepositoriesResponse> fetchLinkableRepositoriesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
FetchLinkableRepositoriesRequest request =
FetchLinkableRepositoriesRequest.newBuilder()
.setConnection(
ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
FetchLinkableRepositoriesResponse response =
repositoryManagerClient.fetchLinkableRepositoriesCallable().call(request);
for (Repository element : response.getRepositoriesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final FetchGitRefsResponse fetchGitRefs(RepositoryName repository)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
RepositoryName repository =
RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]");
FetchGitRefsResponse response = repositoryManagerClient.fetchGitRefs(repository);
}
repository - Required. The resource name of the repository in the format
`projects/*/locations/*/connections/*/repositories/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final FetchGitRefsResponse fetchGitRefs(String repository)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
String repository =
RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]").toString();
FetchGitRefsResponse response = repositoryManagerClient.fetchGitRefs(repository);
}
repository - Required. The resource name of the repository in the format
`projects/*/locations/*/connections/*/repositories/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final FetchGitRefsResponse fetchGitRefs(FetchGitRefsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
FetchGitRefsRequest request =
FetchGitRefsRequest.newBuilder()
.setRepository(
RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]")
.toString())
.build();
FetchGitRefsResponse response = repositoryManagerClient.fetchGitRefs(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<FetchGitRefsRequest,FetchGitRefsResponse> fetchGitRefsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
FetchGitRefsRequest request =
FetchGitRefsRequest.newBuilder()
.setRepository(
RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]")
.toString())
.build();
ApiFuture<FetchGitRefsResponse> future =
repositoryManagerClient.fetchGitRefsCallable().futureCall(request);
// Do something.
FetchGitRefsResponse response = future.get();
}
public final com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
SetIamPolicyRequest request =
SetIamPolicyRequest.newBuilder()
.setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Policy response = repositoryManagerClient.setIamPolicy(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> setIamPolicyCallable()
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
SetIamPolicyRequest request =
SetIamPolicyRequest.newBuilder()
.setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Policy> future = repositoryManagerClient.setIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
public final com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
GetIamPolicyRequest request =
GetIamPolicyRequest.newBuilder()
.setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
Policy response = repositoryManagerClient.getIamPolicy(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> getIamPolicyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
GetIamPolicyRequest request =
GetIamPolicyRequest.newBuilder()
.setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
ApiFuture<Policy> future = repositoryManagerClient.getIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
public final com.google.iam.v1.TestIamPermissionsResponse testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
TestIamPermissionsRequest request =
TestIamPermissionsRequest.newBuilder()
.setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
.addAllPermissions(new ArrayList<String>())
.build();
TestIamPermissionsResponse response = repositoryManagerClient.testIamPermissions(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> testIamPermissionsCallable()
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RepositoryManagerClient repositoryManagerClient = RepositoryManagerClient.create()) {
TestIamPermissionsRequest request =
TestIamPermissionsRequest.newBuilder()
.setResource(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
.addAllPermissions(new ArrayList<String>())
.build();
ApiFuture<TestIamPermissionsResponse> future =
repositoryManagerClient.testIamPermissionsCallable().futureCall(request);
// Do something.
TestIamPermissionsResponse response = future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2024 Google LLC. All rights reserved.