Class RepositoryManagerClient (3.34.0)

GitHub RepositoryProduct Reference

Service Description: Manages connections to source code repositories.

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().

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

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

See the individual methods for example code.

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

This class can be customized by passing in a custom instance of 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.

Inheritance

java.lang.Object > RepositoryManagerClient

Static Methods

create()

public static final RepositoryManagerClient create()

Constructs an instance of RepositoryManagerClient with default settings.

Returns
TypeDescription
RepositoryManagerClient
Exceptions
TypeDescription
IOException

create(RepositoryManagerSettings settings)

public static final RepositoryManagerClient create(RepositoryManagerSettings settings)

Constructs an instance of RepositoryManagerClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.

Parameter
NameDescription
settingsRepositoryManagerSettings
Returns
TypeDescription
RepositoryManagerClient
Exceptions
TypeDescription
IOException

create(RepositoryManagerStub stub)

public static final RepositoryManagerClient create(RepositoryManagerStub stub)

Constructs an instance of RepositoryManagerClient, using the given stub for making calls. This is for advanced usage - prefer using create(RepositoryManagerSettings).

Parameter
NameDescription
stubRepositoryManagerStub
Returns
TypeDescription
RepositoryManagerClient

Constructors

RepositoryManagerClient(RepositoryManagerSettings settings)

protected RepositoryManagerClient(RepositoryManagerSettings settings)

Constructs an instance of RepositoryManagerClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.

Parameter
NameDescription
settingsRepositoryManagerSettings

RepositoryManagerClient(RepositoryManagerStub stub)

protected RepositoryManagerClient(RepositoryManagerStub stub)
Parameter
NameDescription
stubRepositoryManagerStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
NameDescription
durationlong
unitTimeUnit
Returns
TypeDescription
boolean
Exceptions
TypeDescription
InterruptedException

batchCreateRepositoriesAsync(BatchCreateRepositoriesRequest request)

public final OperationFuture<BatchCreateRepositoriesResponse,OperationMetadata> batchCreateRepositoriesAsync(BatchCreateRepositoriesRequest request)

Creates multiple repositories inside a connection.

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();
 }
 
Parameter
NameDescription
requestBatchCreateRepositoriesRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<BatchCreateRepositoriesResponse,OperationMetadata>

batchCreateRepositoriesAsync(ConnectionName parent, List<CreateRepositoryRequest> requests)

public final OperationFuture<BatchCreateRepositoriesResponse,OperationMetadata> batchCreateRepositoriesAsync(ConnectionName parent, List<CreateRepositoryRequest> requests)

Creates multiple repositories inside a connection.

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();
 }
 
Parameters
NameDescription
parentConnectionName

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.

requestsList<CreateRepositoryRequest>

Required. The request messages specifying the repositories to create.

Returns
TypeDescription
OperationFuture<BatchCreateRepositoriesResponse,OperationMetadata>

batchCreateRepositoriesAsync(String parent, List<CreateRepositoryRequest> requests)

public final OperationFuture<BatchCreateRepositoriesResponse,OperationMetadata> batchCreateRepositoriesAsync(String parent, List<CreateRepositoryRequest> requests)

Creates multiple repositories inside a connection.

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();
 }
 
Parameters
NameDescription
parentString

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.

requestsList<CreateRepositoryRequest>

Required. The request messages specifying the repositories to create.

Returns
TypeDescription
OperationFuture<BatchCreateRepositoriesResponse,OperationMetadata>

batchCreateRepositoriesCallable()

public final UnaryCallable<BatchCreateRepositoriesRequest,Operation> batchCreateRepositoriesCallable()

Creates multiple repositories inside a connection.

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();
 }
 
Returns
TypeDescription
UnaryCallable<BatchCreateRepositoriesRequest,Operation>

batchCreateRepositoriesOperationCallable()

public final OperationCallable<BatchCreateRepositoriesRequest,BatchCreateRepositoriesResponse,OperationMetadata> batchCreateRepositoriesOperationCallable()

Creates multiple repositories inside a connection.

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();
 }
 
Returns
TypeDescription
OperationCallable<BatchCreateRepositoriesRequest,BatchCreateRepositoriesResponse,OperationMetadata>

close()

public final void close()

createConnectionAsync(CreateConnectionRequest request)

public final OperationFuture<Connection,OperationMetadata> createConnectionAsync(CreateConnectionRequest request)

Creates a Connection.

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();
 }
 
Parameter
NameDescription
requestCreateConnectionRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Connection,OperationMetadata>

createConnectionAsync(LocationName parent, Connection connection, String connectionId)

public final OperationFuture<Connection,OperationMetadata> createConnectionAsync(LocationName parent, Connection connection, String connectionId)

Creates a Connection.

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();
 }
 
Parameters
NameDescription
parentLocationName

Required. Project and location where the connection will be created. Format: projects/*/locations/*.

connectionConnection

Required. The Connection to create.

connectionIdString

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 -._~%!$&amp;'()&#42;+,;=@.

Returns
TypeDescription
OperationFuture<Connection,OperationMetadata>

createConnectionAsync(String parent, Connection connection, String connectionId)

public final OperationFuture<Connection,OperationMetadata> createConnectionAsync(String parent, Connection connection, String connectionId)

Creates a Connection.

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();
 }
 
Parameters
NameDescription
parentString

Required. Project and location where the connection will be created. Format: projects/*/locations/*.

connectionConnection

Required. The Connection to create.

connectionIdString

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 -._~%!$&amp;'()&#42;+,;=@.

Returns
TypeDescription
OperationFuture<Connection,OperationMetadata>

createConnectionCallable()

public final UnaryCallable<CreateConnectionRequest,Operation> createConnectionCallable()

Creates a Connection.

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();
 }
 
Returns
TypeDescription
UnaryCallable<CreateConnectionRequest,Operation>

createConnectionOperationCallable()

public final OperationCallable<CreateConnectionRequest,Connection,OperationMetadata> createConnectionOperationCallable()

Creates a Connection.

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();
 }
 
Returns
TypeDescription
OperationCallable<CreateConnectionRequest,Connection,OperationMetadata>

createRepositoryAsync(ConnectionName parent, Repository repository, String repositoryId)

public final OperationFuture<Repository,OperationMetadata> createRepositoryAsync(ConnectionName parent, Repository repository, String repositoryId)

Creates a 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()) {
   ConnectionName parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
   Repository repository = Repository.newBuilder().build();
   String repositoryId = "repositoryId2113747461";
   Repository response =
       repositoryManagerClient.createRepositoryAsync(parent, repository, repositoryId).get();
 }
 
Parameters
NameDescription
parentConnectionName

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.

repositoryRepository

Required. The repository to create.

repositoryIdString

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 -._~%!$&amp;'()&#42;+,;=@.

Returns
TypeDescription
OperationFuture<Repository,OperationMetadata>

createRepositoryAsync(CreateRepositoryRequest request)

public final OperationFuture<Repository,OperationMetadata> createRepositoryAsync(CreateRepositoryRequest request)

Creates a 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()) {
   CreateRepositoryRequest request =
       CreateRepositoryRequest.newBuilder()
           .setParent(ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString())
           .setRepository(Repository.newBuilder().build())
           .setRepositoryId("repositoryId2113747461")
           .build();
   Repository response = repositoryManagerClient.createRepositoryAsync(request).get();
 }
 
Parameter
NameDescription
requestCreateRepositoryRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Repository,OperationMetadata>

createRepositoryAsync(String parent, Repository repository, String repositoryId)

public final OperationFuture<Repository,OperationMetadata> createRepositoryAsync(String parent, Repository repository, String repositoryId)

Creates a 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 parent = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]").toString();
   Repository repository = Repository.newBuilder().build();
   String repositoryId = "repositoryId2113747461";
   Repository response =
       repositoryManagerClient.createRepositoryAsync(parent, repository, repositoryId).get();
 }
 
Parameters
NameDescription
parentString

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.

repositoryRepository

Required. The repository to create.

repositoryIdString

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 -._~%!$&amp;'()&#42;+,;=@.

Returns
TypeDescription
OperationFuture<Repository,OperationMetadata>

createRepositoryCallable()

public final UnaryCallable<CreateRepositoryRequest,Operation> createRepositoryCallable()

Creates a 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()) {
   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();
 }
 
Returns
TypeDescription
UnaryCallable<CreateRepositoryRequest,Operation>

createRepositoryOperationCallable()

public final OperationCallable<CreateRepositoryRequest,Repository,OperationMetadata> createRepositoryOperationCallable()

Creates a 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()) {
   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();
 }
 
Returns
TypeDescription
OperationCallable<CreateRepositoryRequest,Repository,OperationMetadata>

deleteConnectionAsync(ConnectionName name)

public final OperationFuture<Empty,OperationMetadata> deleteConnectionAsync(ConnectionName name)

Deletes a single connection.

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();
 }
 
Parameter
NameDescription
nameConnectionName

Required. The name of the Connection to delete. Format: projects/*/locations/*/connections/*.

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteConnectionAsync(DeleteConnectionRequest request)

public final OperationFuture<Empty,OperationMetadata> deleteConnectionAsync(DeleteConnectionRequest request)

Deletes a single connection.

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();
 }
 
Parameter
NameDescription
requestDeleteConnectionRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteConnectionAsync(String name)

public final OperationFuture<Empty,OperationMetadata> deleteConnectionAsync(String name)

Deletes a single connection.

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();
 }
 
Parameter
NameDescription
nameString

Required. The name of the Connection to delete. Format: projects/*/locations/*/connections/*.

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteConnectionCallable()

public final UnaryCallable<DeleteConnectionRequest,Operation> deleteConnectionCallable()

Deletes a single connection.

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();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteConnectionRequest,Operation>

deleteConnectionOperationCallable()

public final OperationCallable<DeleteConnectionRequest,Empty,OperationMetadata> deleteConnectionOperationCallable()

Deletes a single connection.

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();
 }
 
Returns
TypeDescription
OperationCallable<DeleteConnectionRequest,Empty,OperationMetadata>

deleteRepositoryAsync(DeleteRepositoryRequest request)

public final OperationFuture<Empty,OperationMetadata> deleteRepositoryAsync(DeleteRepositoryRequest request)

Deletes a single 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()) {
   DeleteRepositoryRequest request =
       DeleteRepositoryRequest.newBuilder()
           .setName(
               RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]")
                   .toString())
           .setEtag("etag3123477")
           .setValidateOnly(true)
           .build();
   repositoryManagerClient.deleteRepositoryAsync(request).get();
 }
 
Parameter
NameDescription
requestDeleteRepositoryRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteRepositoryAsync(RepositoryName name)

public final OperationFuture<Empty,OperationMetadata> deleteRepositoryAsync(RepositoryName name)

Deletes a single 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 name =
       RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]");
   repositoryManagerClient.deleteRepositoryAsync(name).get();
 }
 
Parameter
NameDescription
nameRepositoryName

Required. The name of the Repository to delete. Format: projects/*/locations/*/connections/*/repositories/*.

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteRepositoryAsync(String name)

public final OperationFuture<Empty,OperationMetadata> deleteRepositoryAsync(String name)

Deletes a single 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 name =
       RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]").toString();
   repositoryManagerClient.deleteRepositoryAsync(name).get();
 }
 
Parameter
NameDescription
nameString

Required. The name of the Repository to delete. Format: projects/*/locations/*/connections/*/repositories/*.

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteRepositoryCallable()

public final UnaryCallable<DeleteRepositoryRequest,Operation> deleteRepositoryCallable()

Deletes a single 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()) {
   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();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteRepositoryRequest,Operation>

deleteRepositoryOperationCallable()

public final OperationCallable<DeleteRepositoryRequest,Empty,OperationMetadata> deleteRepositoryOperationCallable()

Deletes a single 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()) {
   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();
 }
 
Returns
TypeDescription
OperationCallable<DeleteRepositoryRequest,Empty,OperationMetadata>

fetchGitRefs(FetchGitRefsRequest request)

public final FetchGitRefsResponse fetchGitRefs(FetchGitRefsRequest request)

Fetch the list of branches or tags for a given 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()) {
   FetchGitRefsRequest request =
       FetchGitRefsRequest.newBuilder()
           .setRepository(
               RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]")
                   .toString())
           .build();
   FetchGitRefsResponse response = repositoryManagerClient.fetchGitRefs(request);
 }
 
Parameter
NameDescription
requestFetchGitRefsRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
FetchGitRefsResponse

fetchGitRefs(RepositoryName repository)

public final FetchGitRefsResponse fetchGitRefs(RepositoryName repository)

Fetch the list of branches or tags for a given 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);
 }
 
Parameter
NameDescription
repositoryRepositoryName

Required. The resource name of the repository in the format projects/*/locations/*/connections/*/repositories/*.

Returns
TypeDescription
FetchGitRefsResponse

fetchGitRefs(String repository)

public final FetchGitRefsResponse fetchGitRefs(String repository)

Fetch the list of branches or tags for a given 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);
 }
 
Parameter
NameDescription
repositoryString

Required. The resource name of the repository in the format projects/*/locations/*/connections/*/repositories/*.

Returns
TypeDescription
FetchGitRefsResponse

fetchGitRefsCallable()

public final UnaryCallable<FetchGitRefsRequest,FetchGitRefsResponse> fetchGitRefsCallable()

Fetch the list of branches or tags for a given 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()) {
   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();
 }
 
Returns
TypeDescription
UnaryCallable<FetchGitRefsRequest,FetchGitRefsResponse>

fetchLinkableRepositories(FetchLinkableRepositoriesRequest request)

public final RepositoryManagerClient.FetchLinkableRepositoriesPagedResponse fetchLinkableRepositories(FetchLinkableRepositoriesRequest request)

FetchLinkableRepositories get repositories from SCM that are accessible and could be added to the connection.

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);
   }
 }
 
Parameter
NameDescription
requestFetchLinkableRepositoriesRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
RepositoryManagerClient.FetchLinkableRepositoriesPagedResponse

fetchLinkableRepositoriesCallable()

public final UnaryCallable<FetchLinkableRepositoriesRequest,FetchLinkableRepositoriesResponse> fetchLinkableRepositoriesCallable()

FetchLinkableRepositories get repositories from SCM that are accessible and could be added to the connection.

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;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<FetchLinkableRepositoriesRequest,FetchLinkableRepositoriesResponse>

fetchLinkableRepositoriesPagedCallable()

public final UnaryCallable<FetchLinkableRepositoriesRequest,RepositoryManagerClient.FetchLinkableRepositoriesPagedResponse> fetchLinkableRepositoriesPagedCallable()

FetchLinkableRepositories get repositories from SCM that are accessible and could be added to the connection.

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);
   }
 }
 
Returns
TypeDescription
UnaryCallable<FetchLinkableRepositoriesRequest,FetchLinkableRepositoriesPagedResponse>

fetchReadToken(FetchReadTokenRequest request)

public final FetchReadTokenResponse fetchReadToken(FetchReadTokenRequest request)

Fetches read token of a given 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()) {
   FetchReadTokenRequest request =
       FetchReadTokenRequest.newBuilder()
           .setRepository(
               RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]")
                   .toString())
           .build();
   FetchReadTokenResponse response = repositoryManagerClient.fetchReadToken(request);
 }
 
Parameter
NameDescription
requestFetchReadTokenRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
FetchReadTokenResponse

fetchReadToken(RepositoryName repository)

public final FetchReadTokenResponse fetchReadToken(RepositoryName repository)

Fetches read token of a given 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);
 }
 
Parameter
NameDescription
repositoryRepositoryName

Required. The resource name of the repository in the format projects/*/locations/*/connections/*/repositories/*.

Returns
TypeDescription
FetchReadTokenResponse

fetchReadToken(String repository)

public final FetchReadTokenResponse fetchReadToken(String repository)

Fetches read token of a given 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);
 }
 
Parameter
NameDescription
repositoryString

Required. The resource name of the repository in the format projects/*/locations/*/connections/*/repositories/*.

Returns
TypeDescription
FetchReadTokenResponse

fetchReadTokenCallable()

public final UnaryCallable<FetchReadTokenRequest,FetchReadTokenResponse> fetchReadTokenCallable()

Fetches read token of a given 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()) {
   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();
 }
 
Returns
TypeDescription
UnaryCallable<FetchReadTokenRequest,FetchReadTokenResponse>

fetchReadWriteToken(FetchReadWriteTokenRequest request)

public final FetchReadWriteTokenResponse fetchReadWriteToken(FetchReadWriteTokenRequest request)

Fetches read/write token of a given 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()) {
   FetchReadWriteTokenRequest request =
       FetchReadWriteTokenRequest.newBuilder()
           .setRepository(
               RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]")
                   .toString())
           .build();
   FetchReadWriteTokenResponse response = repositoryManagerClient.fetchReadWriteToken(request);
 }
 
Parameter
NameDescription
requestFetchReadWriteTokenRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
FetchReadWriteTokenResponse

fetchReadWriteToken(RepositoryName repository)

public final FetchReadWriteTokenResponse fetchReadWriteToken(RepositoryName repository)

Fetches read/write token of a given 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);
 }
 
Parameter
NameDescription
repositoryRepositoryName

Required. The resource name of the repository in the format projects/*/locations/*/connections/*/repositories/*.

Returns
TypeDescription
FetchReadWriteTokenResponse

fetchReadWriteToken(String repository)

public final FetchReadWriteTokenResponse fetchReadWriteToken(String repository)

Fetches read/write token of a given 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);
 }
 
Parameter
NameDescription
repositoryString

Required. The resource name of the repository in the format projects/*/locations/*/connections/*/repositories/*.

Returns
TypeDescription
FetchReadWriteTokenResponse

fetchReadWriteTokenCallable()

public final UnaryCallable<FetchReadWriteTokenRequest,FetchReadWriteTokenResponse> fetchReadWriteTokenCallable()

Fetches read/write token of a given 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()) {
   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();
 }
 
Returns
TypeDescription
UnaryCallable<FetchReadWriteTokenRequest,FetchReadWriteTokenResponse>

getConnection(ConnectionName name)

public final Connection getConnection(ConnectionName name)

Gets details of a single connection.

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);
 }
 
Parameter
NameDescription
nameConnectionName

Required. The name of the Connection to retrieve. Format: projects/*/locations/*/connections/*.

Returns
TypeDescription
Connection

getConnection(GetConnectionRequest request)

public final Connection getConnection(GetConnectionRequest request)

Gets details of a single connection.

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);
 }
 
Parameter
NameDescription
requestGetConnectionRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
Connection

getConnection(String name)

public final Connection getConnection(String name)

Gets details of a single connection.

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);
 }
 
Parameter
NameDescription
nameString

Required. The name of the Connection to retrieve. Format: projects/*/locations/*/connections/*.

Returns
TypeDescription
Connection

getConnectionCallable()

public final UnaryCallable<GetConnectionRequest,Connection> getConnectionCallable()

Gets details of a single connection.

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();
 }
 
Returns
TypeDescription
UnaryCallable<GetConnectionRequest,Connection>

getHttpJsonOperationsClient()

public final OperationsClient getHttpJsonOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.

Returns
TypeDescription
OperationsClient

getIamPolicy(GetIamPolicyRequest request)

public final Policy getIamPolicy(GetIamPolicyRequest request)

Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

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);
 }
 
Parameter
NameDescription
requestcom.google.iam.v1.GetIamPolicyRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
com.google.iam.v1.Policy

getIamPolicyCallable()

public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()

Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

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();
 }
 
Returns
TypeDescription
UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy>

getOperationsClient()

public final OperationsClient getOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.

Returns
TypeDescription
OperationsClient

getRepository(GetRepositoryRequest request)

public final Repository getRepository(GetRepositoryRequest request)

Gets details of a single 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()) {
   GetRepositoryRequest request =
       GetRepositoryRequest.newBuilder()
           .setName(
               RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]")
                   .toString())
           .build();
   Repository response = repositoryManagerClient.getRepository(request);
 }
 
Parameter
NameDescription
requestGetRepositoryRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
Repository

getRepository(RepositoryName name)

public final Repository getRepository(RepositoryName name)

Gets details of a single 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 name =
       RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]");
   Repository response = repositoryManagerClient.getRepository(name);
 }
 
Parameter
NameDescription
nameRepositoryName

Required. The name of the Repository to retrieve. Format: projects/*/locations/*/connections/*/repositories/*.

Returns
TypeDescription
Repository

getRepository(String name)

public final Repository getRepository(String name)

Gets details of a single 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 name =
       RepositoryName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]", "[REPOSITORY]").toString();
   Repository response = repositoryManagerClient.getRepository(name);
 }
 
Parameter
NameDescription
nameString

Required. The name of the Repository to retrieve. Format: projects/*/locations/*/connections/*/repositories/*.

Returns
TypeDescription
Repository

getRepositoryCallable()

public final UnaryCallable<GetRepositoryRequest,Repository> getRepositoryCallable()

Gets details of a single 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()) {
   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();
 }
 
Returns
TypeDescription
UnaryCallable<GetRepositoryRequest,Repository>

getSettings()

public final RepositoryManagerSettings getSettings()
Returns
TypeDescription
RepositoryManagerSettings

getStub()

public RepositoryManagerStub getStub()
Returns
TypeDescription
RepositoryManagerStub

isShutdown()

public boolean isShutdown()
Returns
TypeDescription
boolean

isTerminated()

public boolean isTerminated()
Returns
TypeDescription
boolean

listConnections(ListConnectionsRequest request)

public final RepositoryManagerClient.ListConnectionsPagedResponse listConnections(ListConnectionsRequest request)

Lists Connections in a given project and location.

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);
   }
 }
 
Parameter
NameDescription
requestListConnectionsRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
RepositoryManagerClient.ListConnectionsPagedResponse

listConnections(LocationName parent)

public final RepositoryManagerClient.ListConnectionsPagedResponse listConnections(LocationName parent)

Lists Connections in a given project and location.

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);
   }
 }
 
Parameter
NameDescription
parentLocationName

Required. The parent, which owns this collection of Connections. Format: projects/*/locations/*.

Returns
TypeDescription
RepositoryManagerClient.ListConnectionsPagedResponse

listConnections(String parent)

public final RepositoryManagerClient.ListConnectionsPagedResponse listConnections(String parent)

Lists Connections in a given project and location.

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);
   }
 }
 
Parameter
NameDescription
parentString

Required. The parent, which owns this collection of Connections. Format: projects/*/locations/*.

Returns
TypeDescription
RepositoryManagerClient.ListConnectionsPagedResponse

listConnectionsCallable()

public final UnaryCallable<ListConnectionsRequest,ListConnectionsResponse> listConnectionsCallable()

Lists Connections in a given project and location.

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;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListConnectionsRequest,ListConnectionsResponse>

listConnectionsPagedCallable()

public final UnaryCallable<ListConnectionsRequest,RepositoryManagerClient.ListConnectionsPagedResponse> listConnectionsPagedCallable()

Lists Connections in a given project and location.

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);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListConnectionsRequest,ListConnectionsPagedResponse>

listRepositories(ConnectionName parent)

public final RepositoryManagerClient.ListRepositoriesPagedResponse listRepositories(ConnectionName parent)

Lists Repositories in a given connection.

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);
   }
 }
 
Parameter
NameDescription
parentConnectionName

Required. The parent, which owns this collection of Repositories. Format: projects/*/locations/*/connections/*.

Returns
TypeDescription
RepositoryManagerClient.ListRepositoriesPagedResponse

listRepositories(ListRepositoriesRequest request)

public final RepositoryManagerClient.ListRepositoriesPagedResponse listRepositories(ListRepositoriesRequest request)

Lists Repositories in a given connection.

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);
   }
 }
 
Parameter
NameDescription
requestListRepositoriesRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
RepositoryManagerClient.ListRepositoriesPagedResponse

listRepositories(String parent)

public final RepositoryManagerClient.ListRepositoriesPagedResponse listRepositories(String parent)

Lists Repositories in a given connection.

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);
   }
 }
 
Parameter
NameDescription
parentString

Required. The parent, which owns this collection of Repositories. Format: projects/*/locations/*/connections/*.

Returns
TypeDescription
RepositoryManagerClient.ListRepositoriesPagedResponse

listRepositoriesCallable()

public final UnaryCallable<ListRepositoriesRequest,ListRepositoriesResponse> listRepositoriesCallable()

Lists Repositories in a given connection.

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;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListRepositoriesRequest,ListRepositoriesResponse>

listRepositoriesPagedCallable()

public final UnaryCallable<ListRepositoriesRequest,RepositoryManagerClient.ListRepositoriesPagedResponse> listRepositoriesPagedCallable()

Lists Repositories in a given connection.

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);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListRepositoriesRequest,ListRepositoriesPagedResponse>

setIamPolicy(SetIamPolicyRequest request)

public final Policy setIamPolicy(SetIamPolicyRequest request)

Sets the access control policy on the specified resource. Replacesany existing policy.

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

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);
 }
 
Parameter
NameDescription
requestcom.google.iam.v1.SetIamPolicyRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
com.google.iam.v1.Policy

setIamPolicyCallable()

public final UnaryCallable<SetIamPolicyRequest,Policy> setIamPolicyCallable()

Sets the access control policy on the specified resource. Replacesany existing policy.

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

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();
 }
 
Returns
TypeDescription
UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

testIamPermissions(TestIamPermissionsRequest request)

public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request)

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.

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);
 }
 
Parameter
NameDescription
requestcom.google.iam.v1.TestIamPermissionsRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
com.google.iam.v1.TestIamPermissionsResponse

testIamPermissionsCallable()

public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()

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.

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();
 }
 
Returns
TypeDescription
UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse>

updateConnectionAsync(Connection connection, FieldMask updateMask)

public final OperationFuture<Connection,OperationMetadata> updateConnectionAsync(Connection connection, FieldMask updateMask)

Updates a single connection.

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();
 }
 
Parameters
NameDescription
connectionConnection

Required. The Connection to update.

updateMaskFieldMask

The list of fields to be updated.

Returns
TypeDescription
OperationFuture<Connection,OperationMetadata>

updateConnectionAsync(UpdateConnectionRequest request)

public final OperationFuture<Connection,OperationMetadata> updateConnectionAsync(UpdateConnectionRequest request)

Updates a single connection.

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();
 }
 
Parameter
NameDescription
requestUpdateConnectionRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Connection,OperationMetadata>

updateConnectionCallable()

public final UnaryCallable<UpdateConnectionRequest,Operation> updateConnectionCallable()

Updates a single connection.

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();
 }
 
Returns
TypeDescription
UnaryCallable<UpdateConnectionRequest,Operation>

updateConnectionOperationCallable()

public final OperationCallable<UpdateConnectionRequest,Connection,OperationMetadata> updateConnectionOperationCallable()

Updates a single connection.

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();
 }
 
Returns
TypeDescription
OperationCallable<UpdateConnectionRequest,Connection,OperationMetadata>