Class DeveloperConnectClient (0.9.0)

Service Description: Service describing handlers for resources

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
ConnectionNamename=ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]");
Connectionresponse=developerConnectClient.getConnection(name);
}

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

Methods
Method Description Method Variants

ListConnections

Lists Connections in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listConnections(ListConnectionsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listConnections(LocationName parent)

  • listConnections(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listConnectionsPagedCallable()

  • listConnectionsCallable()

GetConnection

Gets details of a single Connection.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getConnection(GetConnectionRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getConnection(ConnectionName name)

  • getConnection(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getConnectionCallable()

CreateConnection

Creates a new Connection in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createConnectionAsync(CreateConnectionRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • createConnectionAsync(LocationName parent, Connection connection, String connectionId)

  • createConnectionAsync(String parent, Connection connection, String connectionId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createConnectionOperationCallable()

  • createConnectionCallable()

UpdateConnection

Updates the parameters of a single Connection.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateConnectionAsync(UpdateConnectionRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • updateConnectionAsync(Connection connection, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateConnectionOperationCallable()

  • updateConnectionCallable()

DeleteConnection

Deletes a single Connection.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteConnectionAsync(DeleteConnectionRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • deleteConnectionAsync(ConnectionName name)

  • deleteConnectionAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteConnectionOperationCallable()

  • deleteConnectionCallable()

CreateGitRepositoryLink

Creates a GitRepositoryLink. Upon linking a Git Repository, Developer Connect will configure the Git Repository to send webhook events to Developer Connect. Connections that use Firebase GitHub Application will have events forwarded to the Firebase service. All other Connections will have events forwarded to Cloud Build.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createGitRepositoryLinkAsync(CreateGitRepositoryLinkRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • createGitRepositoryLinkAsync(ConnectionName parent, GitRepositoryLink gitRepositoryLink, String gitRepositoryLinkId)

  • createGitRepositoryLinkAsync(String parent, GitRepositoryLink gitRepositoryLink, String gitRepositoryLinkId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createGitRepositoryLinkOperationCallable()

  • createGitRepositoryLinkCallable()

DeleteGitRepositoryLink

Deletes a single GitRepositoryLink.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteGitRepositoryLinkAsync(DeleteGitRepositoryLinkRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • deleteGitRepositoryLinkAsync(GitRepositoryLinkName name)

  • deleteGitRepositoryLinkAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteGitRepositoryLinkOperationCallable()

  • deleteGitRepositoryLinkCallable()

ListGitRepositoryLinks

Lists GitRepositoryLinks in a given project, location, and connection.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listGitRepositoryLinks(ListGitRepositoryLinksRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listGitRepositoryLinks(ConnectionName parent)

  • listGitRepositoryLinks(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listGitRepositoryLinksPagedCallable()

  • listGitRepositoryLinksCallable()

GetGitRepositoryLink

Gets details of a single GitRepositoryLink.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getGitRepositoryLink(GetGitRepositoryLinkRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getGitRepositoryLink(GitRepositoryLinkName name)

  • getGitRepositoryLink(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getGitRepositoryLinkCallable()

FetchReadWriteToken

Fetches read/write token of a given gitRepositoryLink.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • fetchReadWriteToken(FetchReadWriteTokenRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • fetchReadWriteToken(GitRepositoryLinkName gitRepositoryLink)

  • fetchReadWriteToken(String gitRepositoryLink)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • fetchReadWriteTokenCallable()

FetchReadToken

Fetches read token of a given gitRepositoryLink.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • fetchReadToken(FetchReadTokenRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • fetchReadToken(GitRepositoryLinkName gitRepositoryLink)

  • fetchReadToken(String gitRepositoryLink)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • fetchReadTokenCallable()

FetchLinkableGitRepositories

FetchLinkableGitRepositories returns a list of git repositories from an SCM that are available to be added to a Connection.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • fetchLinkableGitRepositories(FetchLinkableGitRepositoriesRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • fetchLinkableGitRepositories(ConnectionName connection)

  • fetchLinkableGitRepositories(String connection)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • fetchLinkableGitRepositoriesPagedCallable()

  • fetchLinkableGitRepositoriesCallable()

FetchGitHubInstallations

FetchGitHubInstallations returns the list of GitHub Installations that are available to be added to a Connection. For github.com, only installations accessible to the authorizer token are returned. For GitHub Enterprise, all installations are returned.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • fetchGitHubInstallations(FetchGitHubInstallationsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • fetchGitHubInstallations(ConnectionName connection)

  • fetchGitHubInstallations(String connection)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • fetchGitHubInstallationsCallable()

FetchGitRefs

Fetch the list of branches or tags for a given repository.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • fetchGitRefs(FetchGitRefsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • fetchGitRefs(GitRepositoryLinkName gitRepositoryLink, FetchGitRefsRequest.RefType refType)

  • fetchGitRefs(String gitRepositoryLink, FetchGitRefsRequest.RefType refType)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • fetchGitRefsPagedCallable()

  • fetchGitRefsCallable()

ListLocations

Lists information about the supported locations for this service.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listLocations(ListLocationsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Gets information about a location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getLocation(GetLocationRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getLocationCallable()

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 DeveloperConnectSettings 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
DeveloperConnectSettingsdeveloperConnectSettings=
DeveloperConnectSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
DeveloperConnectClientdeveloperConnectClient=
DeveloperConnectClient.create(developerConnectSettings);

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
DeveloperConnectSettingsdeveloperConnectSettings=
DeveloperConnectSettings.newBuilder().setEndpoint(myEndpoint).build();
DeveloperConnectClientdeveloperConnectClient=
DeveloperConnectClient.create(developerConnectSettings);

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
DeveloperConnectSettingsdeveloperConnectSettings=
DeveloperConnectSettings.newHttpJsonBuilder().build();
DeveloperConnectClientdeveloperConnectClient=
DeveloperConnectClient.create(developerConnectSettings);

Please refer to the GitHub repository's samples for more quickstart code snippets.

Inheritance

java.lang.Object > DeveloperConnectClient

Static Methods

create()

publicstaticfinalDeveloperConnectClientcreate()

Constructs an instance of DeveloperConnectClient with default settings.

Returns
Type Description
DeveloperConnectClient
Exceptions
Type Description
IOException

create(DeveloperConnectSettings settings)

publicstaticfinalDeveloperConnectClientcreate(DeveloperConnectSettingssettings)

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

Parameter
Name Description
settings DeveloperConnectSettings
Returns
Type Description
DeveloperConnectClient
Exceptions
Type Description
IOException

create(DeveloperConnectStub stub)

publicstaticfinalDeveloperConnectClientcreate(DeveloperConnectStubstub)

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

Parameter
Name Description
stub DeveloperConnectStub
Returns
Type Description
DeveloperConnectClient

Constructors

DeveloperConnectClient(DeveloperConnectSettings settings)

protectedDeveloperConnectClient(DeveloperConnectSettingssettings)

Constructs an instance of DeveloperConnectClient, 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
Name Description
settings DeveloperConnectSettings

DeveloperConnectClient(DeveloperConnectStub stub)

protectedDeveloperConnectClient(DeveloperConnectStubstub)
Parameter
Name Description
stub DeveloperConnectStub

Methods

awaitTermination(long duration, TimeUnit unit)

publicbooleanawaitTermination(longduration,TimeUnitunit)
Parameters
Name Description
duration long
unit TimeUnit
Returns
Type Description
boolean
Exceptions
Type Description
InterruptedException

close()

publicfinalvoidclose()

createConnectionAsync(CreateConnectionRequest request)

publicfinalOperationFuture<Connection,OperationMetadata>createConnectionAsync(CreateConnectionRequestrequest)

Creates a new Connection 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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
CreateConnectionRequestrequest=
CreateConnectionRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setConnectionId("connectionId1923106969")
.setConnection(Connection.newBuilder().build())
.setRequestId("requestId693933066")
.setValidateOnly(true)
.build();
Connectionresponse=developerConnectClient.createConnectionAsync(request).get();
}
Parameter
Name Description
request CreateConnectionRequest

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

Returns
Type Description
OperationFuture<Connection,OperationMetadata>

createConnectionAsync(LocationName parent, Connection connection, String connectionId)

publicfinalOperationFuture<Connection,OperationMetadata>createConnectionAsync(LocationNameparent,Connectionconnection,StringconnectionId)

Creates a new Connection 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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
LocationNameparent=LocationName.of("[PROJECT]","[LOCATION]");
Connectionconnection=Connection.newBuilder().build();
StringconnectionId="connectionId1923106969";
Connectionresponse=
developerConnectClient.createConnectionAsync(parent,connection,connectionId).get();
}
Parameters
Name Description
parent LocationName

Required. Value for parent.

connection Connection

Required. The resource being created

connectionId String

Required. Id of the requesting object If auto-generating Id server-side, remove this field and connection_id from the method_signature of Create RPC

Returns
Type Description
OperationFuture<Connection,OperationMetadata>

createConnectionAsync(String parent, Connection connection, String connectionId)

publicfinalOperationFuture<Connection,OperationMetadata>createConnectionAsync(Stringparent,Connectionconnection,StringconnectionId)

Creates a new Connection 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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
Stringparent=LocationName.of("[PROJECT]","[LOCATION]").toString();
Connectionconnection=Connection.newBuilder().build();
StringconnectionId="connectionId1923106969";
Connectionresponse=
developerConnectClient.createConnectionAsync(parent,connection,connectionId).get();
}
Parameters
Name Description
parent String

Required. Value for parent.

connection Connection

Required. The resource being created

connectionId String

Required. Id of the requesting object If auto-generating Id server-side, remove this field and connection_id from the method_signature of Create RPC

Returns
Type Description
OperationFuture<Connection,OperationMetadata>

createConnectionCallable()

publicfinalUnaryCallable<CreateConnectionRequest,Operation>createConnectionCallable()

Creates a new Connection 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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
CreateConnectionRequestrequest=
CreateConnectionRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setConnectionId("connectionId1923106969")
.setConnection(Connection.newBuilder().build())
.setRequestId("requestId693933066")
.setValidateOnly(true)
.build();
ApiFuture<Operation>future=
developerConnectClient.createConnectionCallable().futureCall(request);
// Do something.
Operationresponse=future.get();
}
Returns
Type Description
UnaryCallable<CreateConnectionRequest,Operation>

createConnectionOperationCallable()

publicfinalOperationCallable<CreateConnectionRequest,Connection,OperationMetadata>createConnectionOperationCallable()

Creates a new Connection 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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
CreateConnectionRequestrequest=
CreateConnectionRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setConnectionId("connectionId1923106969")
.setConnection(Connection.newBuilder().build())
.setRequestId("requestId693933066")
.setValidateOnly(true)
.build();
OperationFuture<Connection,OperationMetadata>future=
developerConnectClient.createConnectionOperationCallable().futureCall(request);
// Do something.
Connectionresponse=future.get();
}
Returns
Type Description
OperationCallable<CreateConnectionRequest,Connection,OperationMetadata>
publicfinalOperationFuture<GitRepositoryLink,OperationMetadata>createGitRepositoryLinkAsync(ConnectionNameparent,GitRepositoryLinkgitRepositoryLink,StringgitRepositoryLinkId)

Creates a GitRepositoryLink. Upon linking a Git Repository, Developer Connect will configure the Git Repository to send webhook events to Developer Connect. Connections that use Firebase GitHub Application will have events forwarded to the Firebase service. All other Connections will have events forwarded to Cloud Build.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
ConnectionNameparent=ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]");
GitRepositoryLinkgitRepositoryLink=GitRepositoryLink.newBuilder().build();
StringgitRepositoryLinkId="gitRepositoryLinkId684669585";
GitRepositoryLinkresponse=
developerConnectClient
.createGitRepositoryLinkAsync(parent,gitRepositoryLink,gitRepositoryLinkId)
.get();
}
Parameters
Name Description
parent ConnectionName

Required. Value for parent.

gitRepositoryLink GitRepositoryLink

Required. The resource being created

gitRepositoryLinkId String

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
Type Description
OperationFuture<GitRepositoryLink,OperationMetadata>

createGitRepositoryLinkAsync(CreateGitRepositoryLinkRequest request)

publicfinalOperationFuture<GitRepositoryLink,OperationMetadata>createGitRepositoryLinkAsync(CreateGitRepositoryLinkRequestrequest)

Creates a GitRepositoryLink. Upon linking a Git Repository, Developer Connect will configure the Git Repository to send webhook events to Developer Connect. Connections that use Firebase GitHub Application will have events forwarded to the Firebase service. All other Connections will have events forwarded to Cloud Build.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
CreateGitRepositoryLinkRequestrequest=
CreateGitRepositoryLinkRequest.newBuilder()
.setParent(ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]").toString())
.setGitRepositoryLink(GitRepositoryLink.newBuilder().build())
.setGitRepositoryLinkId("gitRepositoryLinkId684669585")
.setRequestId("requestId693933066")
.setValidateOnly(true)
.build();
GitRepositoryLinkresponse=
developerConnectClient.createGitRepositoryLinkAsync(request).get();
}
Parameter
Name Description
request CreateGitRepositoryLinkRequest

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

Returns
Type Description
OperationFuture<GitRepositoryLink,OperationMetadata>
publicfinalOperationFuture<GitRepositoryLink,OperationMetadata>createGitRepositoryLinkAsync(Stringparent,GitRepositoryLinkgitRepositoryLink,StringgitRepositoryLinkId)

Creates a GitRepositoryLink. Upon linking a Git Repository, Developer Connect will configure the Git Repository to send webhook events to Developer Connect. Connections that use Firebase GitHub Application will have events forwarded to the Firebase service. All other Connections will have events forwarded to Cloud Build.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
Stringparent=ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]").toString();
GitRepositoryLinkgitRepositoryLink=GitRepositoryLink.newBuilder().build();
StringgitRepositoryLinkId="gitRepositoryLinkId684669585";
GitRepositoryLinkresponse=
developerConnectClient
.createGitRepositoryLinkAsync(parent,gitRepositoryLink,gitRepositoryLinkId)
.get();
}
Parameters
Name Description
parent String

Required. Value for parent.

gitRepositoryLink GitRepositoryLink

Required. The resource being created

gitRepositoryLinkId String

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
Type Description
OperationFuture<GitRepositoryLink,OperationMetadata>

createGitRepositoryLinkCallable()

publicfinalUnaryCallable<CreateGitRepositoryLinkRequest,Operation>createGitRepositoryLinkCallable()

Creates a GitRepositoryLink. Upon linking a Git Repository, Developer Connect will configure the Git Repository to send webhook events to Developer Connect. Connections that use Firebase GitHub Application will have events forwarded to the Firebase service. All other Connections will have events forwarded to Cloud Build.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
CreateGitRepositoryLinkRequestrequest=
CreateGitRepositoryLinkRequest.newBuilder()
.setParent(ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]").toString())
.setGitRepositoryLink(GitRepositoryLink.newBuilder().build())
.setGitRepositoryLinkId("gitRepositoryLinkId684669585")
.setRequestId("requestId693933066")
.setValidateOnly(true)
.build();
ApiFuture<Operation>future=
developerConnectClient.createGitRepositoryLinkCallable().futureCall(request);
// Do something.
Operationresponse=future.get();
}
Returns
Type Description
UnaryCallable<CreateGitRepositoryLinkRequest,Operation>

createGitRepositoryLinkOperationCallable()

publicfinalOperationCallable<CreateGitRepositoryLinkRequest,GitRepositoryLink,OperationMetadata>createGitRepositoryLinkOperationCallable()

Creates a GitRepositoryLink. Upon linking a Git Repository, Developer Connect will configure the Git Repository to send webhook events to Developer Connect. Connections that use Firebase GitHub Application will have events forwarded to the Firebase service. All other Connections will have events forwarded to Cloud Build.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
CreateGitRepositoryLinkRequestrequest=
CreateGitRepositoryLinkRequest.newBuilder()
.setParent(ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]").toString())
.setGitRepositoryLink(GitRepositoryLink.newBuilder().build())
.setGitRepositoryLinkId("gitRepositoryLinkId684669585")
.setRequestId("requestId693933066")
.setValidateOnly(true)
.build();
OperationFuture<GitRepositoryLink,OperationMetadata>future=
developerConnectClient.createGitRepositoryLinkOperationCallable().futureCall(request);
// Do something.
GitRepositoryLinkresponse=future.get();
}
Returns
Type Description
OperationCallable<CreateGitRepositoryLinkRequest,GitRepositoryLink,OperationMetadata>

deleteConnectionAsync(ConnectionName name)

publicfinalOperationFuture<Empty,OperationMetadata>deleteConnectionAsync(ConnectionNamename)

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
ConnectionNamename=ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]");
developerConnectClient.deleteConnectionAsync(name).get();
}
Parameter
Name Description
name ConnectionName

Required. Name of the resource

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteConnectionAsync(DeleteConnectionRequest request)

publicfinalOperationFuture<Empty,OperationMetadata>deleteConnectionAsync(DeleteConnectionRequestrequest)

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
DeleteConnectionRequestrequest=
DeleteConnectionRequest.newBuilder()
.setName(ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]").toString())
.setRequestId("requestId693933066")
.setValidateOnly(true)
.setEtag("etag3123477")
.build();
developerConnectClient.deleteConnectionAsync(request).get();
}
Parameter
Name Description
request DeleteConnectionRequest

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

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteConnectionAsync(String name)

publicfinalOperationFuture<Empty,OperationMetadata>deleteConnectionAsync(Stringname)

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
Stringname=ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]").toString();
developerConnectClient.deleteConnectionAsync(name).get();
}
Parameter
Name Description
name String

Required. Name of the resource

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteConnectionCallable()

publicfinalUnaryCallable<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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
DeleteConnectionRequestrequest=
DeleteConnectionRequest.newBuilder()
.setName(ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]").toString())
.setRequestId("requestId693933066")
.setValidateOnly(true)
.setEtag("etag3123477")
.build();
ApiFuture<Operation>future=
developerConnectClient.deleteConnectionCallable().futureCall(request);
// Do something.
future.get();
}
Returns
Type Description
UnaryCallable<DeleteConnectionRequest,Operation>

deleteConnectionOperationCallable()

publicfinalOperationCallable<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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
DeleteConnectionRequestrequest=
DeleteConnectionRequest.newBuilder()
.setName(ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]").toString())
.setRequestId("requestId693933066")
.setValidateOnly(true)
.setEtag("etag3123477")
.build();
OperationFuture<Empty,OperationMetadata>future=
developerConnectClient.deleteConnectionOperationCallable().futureCall(request);
// Do something.
future.get();
}
Returns
Type Description
OperationCallable<DeleteConnectionRequest,Empty,OperationMetadata>

deleteGitRepositoryLinkAsync(DeleteGitRepositoryLinkRequest request)

publicfinalOperationFuture<Empty,OperationMetadata>deleteGitRepositoryLinkAsync(DeleteGitRepositoryLinkRequestrequest)

Deletes a single GitRepositoryLink.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
DeleteGitRepositoryLinkRequestrequest=
DeleteGitRepositoryLinkRequest.newBuilder()
.setName(
GitRepositoryLinkName.of(
"[PROJECT]","[LOCATION]","[CONNECTION]","[GIT_REPOSITORY_LINK]")
.toString())
.setRequestId("requestId693933066")
.setValidateOnly(true)
.setEtag("etag3123477")
.build();
developerConnectClient.deleteGitRepositoryLinkAsync(request).get();
}
Parameter
Name Description
request DeleteGitRepositoryLinkRequest

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

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteGitRepositoryLinkAsync(GitRepositoryLinkName name)

publicfinalOperationFuture<Empty,OperationMetadata>deleteGitRepositoryLinkAsync(GitRepositoryLinkNamename)

Deletes a single GitRepositoryLink.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
GitRepositoryLinkNamename=
GitRepositoryLinkName.of(
"[PROJECT]","[LOCATION]","[CONNECTION]","[GIT_REPOSITORY_LINK]");
developerConnectClient.deleteGitRepositoryLinkAsync(name).get();
}
Parameter
Name Description
name GitRepositoryLinkName

Required. Name of the resource

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteGitRepositoryLinkAsync(String name)

publicfinalOperationFuture<Empty,OperationMetadata>deleteGitRepositoryLinkAsync(Stringname)

Deletes a single GitRepositoryLink.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
Stringname=
GitRepositoryLinkName.of(
"[PROJECT]","[LOCATION]","[CONNECTION]","[GIT_REPOSITORY_LINK]")
.toString();
developerConnectClient.deleteGitRepositoryLinkAsync(name).get();
}
Parameter
Name Description
name String

Required. Name of the resource

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteGitRepositoryLinkCallable()

publicfinalUnaryCallable<DeleteGitRepositoryLinkRequest,Operation>deleteGitRepositoryLinkCallable()

Deletes a single GitRepositoryLink.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
DeleteGitRepositoryLinkRequestrequest=
DeleteGitRepositoryLinkRequest.newBuilder()
.setName(
GitRepositoryLinkName.of(
"[PROJECT]","[LOCATION]","[CONNECTION]","[GIT_REPOSITORY_LINK]")
.toString())
.setRequestId("requestId693933066")
.setValidateOnly(true)
.setEtag("etag3123477")
.build();
ApiFuture<Operation>future=
developerConnectClient.deleteGitRepositoryLinkCallable().futureCall(request);
// Do something.
future.get();
}
Returns
Type Description
UnaryCallable<DeleteGitRepositoryLinkRequest,Operation>

deleteGitRepositoryLinkOperationCallable()

publicfinalOperationCallable<DeleteGitRepositoryLinkRequest,Empty,OperationMetadata>deleteGitRepositoryLinkOperationCallable()

Deletes a single GitRepositoryLink.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
DeleteGitRepositoryLinkRequestrequest=
DeleteGitRepositoryLinkRequest.newBuilder()
.setName(
GitRepositoryLinkName.of(
"[PROJECT]","[LOCATION]","[CONNECTION]","[GIT_REPOSITORY_LINK]")
.toString())
.setRequestId("requestId693933066")
.setValidateOnly(true)
.setEtag("etag3123477")
.build();
OperationFuture<Empty,OperationMetadata>future=
developerConnectClient.deleteGitRepositoryLinkOperationCallable().futureCall(request);
// Do something.
future.get();
}
Returns
Type Description
OperationCallable<DeleteGitRepositoryLinkRequest,Empty,OperationMetadata>

fetchGitHubInstallations(ConnectionName connection)

publicfinalFetchGitHubInstallationsResponsefetchGitHubInstallations(ConnectionNameconnection)

FetchGitHubInstallations returns the list of GitHub Installations that are available to be added to a Connection. For github.com, only installations accessible to the authorizer token are returned. For GitHub Enterprise, all installations are returned.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
ConnectionNameconnection=ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]");
FetchGitHubInstallationsResponseresponse=
developerConnectClient.fetchGitHubInstallations(connection);
}
Parameter
Name Description
connection ConnectionName

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

Returns
Type Description
FetchGitHubInstallationsResponse

fetchGitHubInstallations(FetchGitHubInstallationsRequest request)

publicfinalFetchGitHubInstallationsResponsefetchGitHubInstallations(FetchGitHubInstallationsRequestrequest)

FetchGitHubInstallations returns the list of GitHub Installations that are available to be added to a Connection. For github.com, only installations accessible to the authorizer token are returned. For GitHub Enterprise, all installations are returned.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
FetchGitHubInstallationsRequestrequest=
FetchGitHubInstallationsRequest.newBuilder()
.setConnection(
ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]").toString())
.build();
FetchGitHubInstallationsResponseresponse=
developerConnectClient.fetchGitHubInstallations(request);
}
Parameter
Name Description
request FetchGitHubInstallationsRequest

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

Returns
Type Description
FetchGitHubInstallationsResponse

fetchGitHubInstallations(String connection)

publicfinalFetchGitHubInstallationsResponsefetchGitHubInstallations(Stringconnection)

FetchGitHubInstallations returns the list of GitHub Installations that are available to be added to a Connection. For github.com, only installations accessible to the authorizer token are returned. For GitHub Enterprise, all installations are returned.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
Stringconnection=ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]").toString();
FetchGitHubInstallationsResponseresponse=
developerConnectClient.fetchGitHubInstallations(connection);
}
Parameter
Name Description
connection String

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

Returns
Type Description
FetchGitHubInstallationsResponse

fetchGitHubInstallationsCallable()

publicfinalUnaryCallable<FetchGitHubInstallationsRequest,FetchGitHubInstallationsResponse>fetchGitHubInstallationsCallable()

FetchGitHubInstallations returns the list of GitHub Installations that are available to be added to a Connection. For github.com, only installations accessible to the authorizer token are returned. For GitHub Enterprise, all installations are returned.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
FetchGitHubInstallationsRequestrequest=
FetchGitHubInstallationsRequest.newBuilder()
.setConnection(
ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]").toString())
.build();
ApiFuture<FetchGitHubInstallationsResponse>future=
developerConnectClient.fetchGitHubInstallationsCallable().futureCall(request);
// Do something.
FetchGitHubInstallationsResponseresponse=future.get();
}
Returns
Type Description
UnaryCallable<FetchGitHubInstallationsRequest,FetchGitHubInstallationsResponse>

fetchGitRefs(FetchGitRefsRequest request)

publicfinalDeveloperConnectClient.FetchGitRefsPagedResponsefetchGitRefs(FetchGitRefsRequestrequest)

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
FetchGitRefsRequestrequest=
FetchGitRefsRequest.newBuilder()
.setGitRepositoryLink(
GitRepositoryLinkName.of(
"[PROJECT]","[LOCATION]","[CONNECTION]","[GIT_REPOSITORY_LINK]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for(Stringelement:developerConnectClient.fetchGitRefs(request).iterateAll()){
// doThingsWith(element);
}
}
Parameter
Name Description
request FetchGitRefsRequest

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

Returns
Type Description
DeveloperConnectClient.FetchGitRefsPagedResponse

fetchGitRefs(GitRepositoryLinkName gitRepositoryLink, FetchGitRefsRequest.RefType refType)

publicfinalDeveloperConnectClient.FetchGitRefsPagedResponsefetchGitRefs(GitRepositoryLinkNamegitRepositoryLink,FetchGitRefsRequest.RefTyperefType)

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
GitRepositoryLinkNamegitRepositoryLink=
GitRepositoryLinkName.of(
"[PROJECT]","[LOCATION]","[CONNECTION]","[GIT_REPOSITORY_LINK]");
FetchGitRefsRequest.RefTyperefType=FetchGitRefsRequest.RefType.forNumber(0);
for(Stringelement:
developerConnectClient.fetchGitRefs(gitRepositoryLink,refType).iterateAll()){
// doThingsWith(element);
}
}
Parameters
Name Description
gitRepositoryLink GitRepositoryLinkName

Required. The resource name of GitRepositoryLink in the format projects/*/locations/*/connections/*/gitRepositoryLinks/*.

refType FetchGitRefsRequest.RefType

Required. Type of refs to fetch.

Returns
Type Description
DeveloperConnectClient.FetchGitRefsPagedResponse

fetchGitRefs(String gitRepositoryLink, FetchGitRefsRequest.RefType refType)

publicfinalDeveloperConnectClient.FetchGitRefsPagedResponsefetchGitRefs(StringgitRepositoryLink,FetchGitRefsRequest.RefTyperefType)

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
StringgitRepositoryLink=
GitRepositoryLinkName.of(
"[PROJECT]","[LOCATION]","[CONNECTION]","[GIT_REPOSITORY_LINK]")
.toString();
FetchGitRefsRequest.RefTyperefType=FetchGitRefsRequest.RefType.forNumber(0);
for(Stringelement:
developerConnectClient.fetchGitRefs(gitRepositoryLink,refType).iterateAll()){
// doThingsWith(element);
}
}
Parameters
Name Description
gitRepositoryLink String

Required. The resource name of GitRepositoryLink in the format projects/*/locations/*/connections/*/gitRepositoryLinks/*.

refType FetchGitRefsRequest.RefType

Required. Type of refs to fetch.

Returns
Type Description
DeveloperConnectClient.FetchGitRefsPagedResponse

fetchGitRefsCallable()

publicfinalUnaryCallable<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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
FetchGitRefsRequestrequest=
FetchGitRefsRequest.newBuilder()
.setGitRepositoryLink(
GitRepositoryLinkName.of(
"[PROJECT]","[LOCATION]","[CONNECTION]","[GIT_REPOSITORY_LINK]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while(true){
FetchGitRefsResponseresponse=developerConnectClient.fetchGitRefsCallable().call(request);
for(Stringelement:response.getRefNamesList()){
// doThingsWith(element);
}
StringnextPageToken=response.getNextPageToken();
if(!Strings.isNullOrEmpty(nextPageToken)){
request=request.toBuilder().setPageToken(nextPageToken).build();
}else{
break;
}
}
}
Returns
Type Description
UnaryCallable<FetchGitRefsRequest,FetchGitRefsResponse>

fetchGitRefsPagedCallable()

publicfinalUnaryCallable<FetchGitRefsRequest,DeveloperConnectClient.FetchGitRefsPagedResponse>fetchGitRefsPagedCallable()

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
FetchGitRefsRequestrequest=
FetchGitRefsRequest.newBuilder()
.setGitRepositoryLink(
GitRepositoryLinkName.of(
"[PROJECT]","[LOCATION]","[CONNECTION]","[GIT_REPOSITORY_LINK]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<String>future=
developerConnectClient.fetchGitRefsPagedCallable().futureCall(request);
// Do something.
for(Stringelement:future.get().iterateAll()){
// doThingsWith(element);
}
}
Returns
Type Description
UnaryCallable<FetchGitRefsRequest,FetchGitRefsPagedResponse>

fetchLinkableGitRepositories(ConnectionName connection)

publicfinalDeveloperConnectClient.FetchLinkableGitRepositoriesPagedResponsefetchLinkableGitRepositories(ConnectionNameconnection)

FetchLinkableGitRepositories returns a list of git repositories from an SCM that are available to be added to 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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
ConnectionNameconnection=ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]");
for(LinkableGitRepositoryelement:
developerConnectClient.fetchLinkableGitRepositories(connection).iterateAll()){
// doThingsWith(element);
}
}
Parameter
Name Description
connection ConnectionName

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

Returns
Type Description
DeveloperConnectClient.FetchLinkableGitRepositoriesPagedResponse

fetchLinkableGitRepositories(FetchLinkableGitRepositoriesRequest request)

publicfinalDeveloperConnectClient.FetchLinkableGitRepositoriesPagedResponsefetchLinkableGitRepositories(FetchLinkableGitRepositoriesRequestrequest)

FetchLinkableGitRepositories returns a list of git repositories from an SCM that are available to be added to 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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
FetchLinkableGitRepositoriesRequestrequest=
FetchLinkableGitRepositoriesRequest.newBuilder()
.setConnection(
ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for(LinkableGitRepositoryelement:
developerConnectClient.fetchLinkableGitRepositories(request).iterateAll()){
// doThingsWith(element);
}
}
Parameter
Name Description
request FetchLinkableGitRepositoriesRequest

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

Returns
Type Description
DeveloperConnectClient.FetchLinkableGitRepositoriesPagedResponse

fetchLinkableGitRepositories(String connection)

publicfinalDeveloperConnectClient.FetchLinkableGitRepositoriesPagedResponsefetchLinkableGitRepositories(Stringconnection)

FetchLinkableGitRepositories returns a list of git repositories from an SCM that are available to be added to 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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
Stringconnection=ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]").toString();
for(LinkableGitRepositoryelement:
developerConnectClient.fetchLinkableGitRepositories(connection).iterateAll()){
// doThingsWith(element);
}
}
Parameter
Name Description
connection String

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

Returns
Type Description
DeveloperConnectClient.FetchLinkableGitRepositoriesPagedResponse

fetchLinkableGitRepositoriesCallable()

publicfinalUnaryCallable<FetchLinkableGitRepositoriesRequest,FetchLinkableGitRepositoriesResponse>fetchLinkableGitRepositoriesCallable()

FetchLinkableGitRepositories returns a list of git repositories from an SCM that are available to be added to 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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
FetchLinkableGitRepositoriesRequestrequest=
FetchLinkableGitRepositoriesRequest.newBuilder()
.setConnection(
ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while(true){
FetchLinkableGitRepositoriesResponseresponse=
developerConnectClient.fetchLinkableGitRepositoriesCallable().call(request);
for(LinkableGitRepositoryelement:response.getLinkableGitRepositoriesList()){
// doThingsWith(element);
}
StringnextPageToken=response.getNextPageToken();
if(!Strings.isNullOrEmpty(nextPageToken)){
request=request.toBuilder().setPageToken(nextPageToken).build();
}else{
break;
}
}
}
Returns
Type Description
UnaryCallable<FetchLinkableGitRepositoriesRequest,FetchLinkableGitRepositoriesResponse>

fetchLinkableGitRepositoriesPagedCallable()

publicfinalUnaryCallable<FetchLinkableGitRepositoriesRequest,DeveloperConnectClient.FetchLinkableGitRepositoriesPagedResponse>fetchLinkableGitRepositoriesPagedCallable()

FetchLinkableGitRepositories returns a list of git repositories from an SCM that are available to be added to 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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
FetchLinkableGitRepositoriesRequestrequest=
FetchLinkableGitRepositoriesRequest.newBuilder()
.setConnection(
ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<LinkableGitRepository>future=
developerConnectClient.fetchLinkableGitRepositoriesPagedCallable().futureCall(request);
// Do something.
for(LinkableGitRepositoryelement:future.get().iterateAll()){
// doThingsWith(element);
}
}
Returns
Type Description
UnaryCallable<FetchLinkableGitRepositoriesRequest,FetchLinkableGitRepositoriesPagedResponse>

fetchReadToken(FetchReadTokenRequest request)

publicfinalFetchReadTokenResponsefetchReadToken(FetchReadTokenRequestrequest)

Fetches read token of a given gitRepositoryLink.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
FetchReadTokenRequestrequest=
FetchReadTokenRequest.newBuilder()
.setGitRepositoryLink(
GitRepositoryLinkName.of(
"[PROJECT]","[LOCATION]","[CONNECTION]","[GIT_REPOSITORY_LINK]")
.toString())
.build();
FetchReadTokenResponseresponse=developerConnectClient.fetchReadToken(request);
}
Parameter
Name Description
request FetchReadTokenRequest

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

Returns
Type Description
FetchReadTokenResponse

fetchReadToken(GitRepositoryLinkName gitRepositoryLink)

publicfinalFetchReadTokenResponsefetchReadToken(GitRepositoryLinkNamegitRepositoryLink)

Fetches read token of a given gitRepositoryLink.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
GitRepositoryLinkNamegitRepositoryLink=
GitRepositoryLinkName.of(
"[PROJECT]","[LOCATION]","[CONNECTION]","[GIT_REPOSITORY_LINK]");
FetchReadTokenResponseresponse=developerConnectClient.fetchReadToken(gitRepositoryLink);
}
Parameter
Name Description
gitRepositoryLink GitRepositoryLinkName

Required. The resource name of the gitRepositoryLink in the format projects/*/locations/*/connections/*/gitRepositoryLinks/*.

Returns
Type Description
FetchReadTokenResponse

fetchReadToken(String gitRepositoryLink)

publicfinalFetchReadTokenResponsefetchReadToken(StringgitRepositoryLink)

Fetches read token of a given gitRepositoryLink.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
StringgitRepositoryLink=
GitRepositoryLinkName.of(
"[PROJECT]","[LOCATION]","[CONNECTION]","[GIT_REPOSITORY_LINK]")
.toString();
FetchReadTokenResponseresponse=developerConnectClient.fetchReadToken(gitRepositoryLink);
}
Parameter
Name Description
gitRepositoryLink String

Required. The resource name of the gitRepositoryLink in the format projects/*/locations/*/connections/*/gitRepositoryLinks/*.

Returns
Type Description
FetchReadTokenResponse

fetchReadTokenCallable()

publicfinalUnaryCallable<FetchReadTokenRequest,FetchReadTokenResponse>fetchReadTokenCallable()

Fetches read token of a given gitRepositoryLink.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
FetchReadTokenRequestrequest=
FetchReadTokenRequest.newBuilder()
.setGitRepositoryLink(
GitRepositoryLinkName.of(
"[PROJECT]","[LOCATION]","[CONNECTION]","[GIT_REPOSITORY_LINK]")
.toString())
.build();
ApiFuture<FetchReadTokenResponse>future=
developerConnectClient.fetchReadTokenCallable().futureCall(request);
// Do something.
FetchReadTokenResponseresponse=future.get();
}
Returns
Type Description
UnaryCallable<FetchReadTokenRequest,FetchReadTokenResponse>

fetchReadWriteToken(FetchReadWriteTokenRequest request)

publicfinalFetchReadWriteTokenResponsefetchReadWriteToken(FetchReadWriteTokenRequestrequest)

Fetches read/write token of a given gitRepositoryLink.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
FetchReadWriteTokenRequestrequest=
FetchReadWriteTokenRequest.newBuilder()
.setGitRepositoryLink(
GitRepositoryLinkName.of(
"[PROJECT]","[LOCATION]","[CONNECTION]","[GIT_REPOSITORY_LINK]")
.toString())
.build();
FetchReadWriteTokenResponseresponse=developerConnectClient.fetchReadWriteToken(request);
}
Parameter
Name Description
request FetchReadWriteTokenRequest

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

Returns
Type Description
FetchReadWriteTokenResponse

fetchReadWriteToken(GitRepositoryLinkName gitRepositoryLink)

publicfinalFetchReadWriteTokenResponsefetchReadWriteToken(GitRepositoryLinkNamegitRepositoryLink)

Fetches read/write token of a given gitRepositoryLink.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
GitRepositoryLinkNamegitRepositoryLink=
GitRepositoryLinkName.of(
"[PROJECT]","[LOCATION]","[CONNECTION]","[GIT_REPOSITORY_LINK]");
FetchReadWriteTokenResponseresponse=
developerConnectClient.fetchReadWriteToken(gitRepositoryLink);
}
Parameter
Name Description
gitRepositoryLink GitRepositoryLinkName

Required. The resource name of the gitRepositoryLink in the format projects/*/locations/*/connections/*/gitRepositoryLinks/*.

Returns
Type Description
FetchReadWriteTokenResponse

fetchReadWriteToken(String gitRepositoryLink)

publicfinalFetchReadWriteTokenResponsefetchReadWriteToken(StringgitRepositoryLink)

Fetches read/write token of a given gitRepositoryLink.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
StringgitRepositoryLink=
GitRepositoryLinkName.of(
"[PROJECT]","[LOCATION]","[CONNECTION]","[GIT_REPOSITORY_LINK]")
.toString();
FetchReadWriteTokenResponseresponse=
developerConnectClient.fetchReadWriteToken(gitRepositoryLink);
}
Parameter
Name Description
gitRepositoryLink String

Required. The resource name of the gitRepositoryLink in the format projects/*/locations/*/connections/*/gitRepositoryLinks/*.

Returns
Type Description
FetchReadWriteTokenResponse

fetchReadWriteTokenCallable()

publicfinalUnaryCallable<FetchReadWriteTokenRequest,FetchReadWriteTokenResponse>fetchReadWriteTokenCallable()

Fetches read/write token of a given gitRepositoryLink.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
FetchReadWriteTokenRequestrequest=
FetchReadWriteTokenRequest.newBuilder()
.setGitRepositoryLink(
GitRepositoryLinkName.of(
"[PROJECT]","[LOCATION]","[CONNECTION]","[GIT_REPOSITORY_LINK]")
.toString())
.build();
ApiFuture<FetchReadWriteTokenResponse>future=
developerConnectClient.fetchReadWriteTokenCallable().futureCall(request);
// Do something.
FetchReadWriteTokenResponseresponse=future.get();
}
Returns
Type Description
UnaryCallable<FetchReadWriteTokenRequest,FetchReadWriteTokenResponse>

getConnection(ConnectionName name)

publicfinalConnectiongetConnection(ConnectionNamename)

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
ConnectionNamename=ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]");
Connectionresponse=developerConnectClient.getConnection(name);
}
Parameter
Name Description
name ConnectionName

Required. Name of the resource

Returns
Type Description
Connection

getConnection(GetConnectionRequest request)

publicfinalConnectiongetConnection(GetConnectionRequestrequest)

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
GetConnectionRequestrequest=
GetConnectionRequest.newBuilder()
.setName(ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]").toString())
.build();
Connectionresponse=developerConnectClient.getConnection(request);
}
Parameter
Name Description
request GetConnectionRequest

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

Returns
Type Description
Connection

getConnection(String name)

publicfinalConnectiongetConnection(Stringname)

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
Stringname=ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]").toString();
Connectionresponse=developerConnectClient.getConnection(name);
}
Parameter
Name Description
name String

Required. Name of the resource

Returns
Type Description
Connection

getConnectionCallable()

publicfinalUnaryCallable<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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
GetConnectionRequestrequest=
GetConnectionRequest.newBuilder()
.setName(ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]").toString())
.build();
ApiFuture<Connection>future=
developerConnectClient.getConnectionCallable().futureCall(request);
// Do something.
Connectionresponse=future.get();
}
Returns
Type Description
UnaryCallable<GetConnectionRequest,Connection>
publicfinalGitRepositoryLinkgetGitRepositoryLink(GetGitRepositoryLinkRequestrequest)

Gets details of a single GitRepositoryLink.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
GetGitRepositoryLinkRequestrequest=
GetGitRepositoryLinkRequest.newBuilder()
.setName(
GitRepositoryLinkName.of(
"[PROJECT]","[LOCATION]","[CONNECTION]","[GIT_REPOSITORY_LINK]")
.toString())
.build();
GitRepositoryLinkresponse=developerConnectClient.getGitRepositoryLink(request);
}
Parameter
Name Description
request GetGitRepositoryLinkRequest

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

Returns
Type Description
GitRepositoryLink
publicfinalGitRepositoryLinkgetGitRepositoryLink(GitRepositoryLinkNamename)

Gets details of a single GitRepositoryLink.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
GitRepositoryLinkNamename=
GitRepositoryLinkName.of(
"[PROJECT]","[LOCATION]","[CONNECTION]","[GIT_REPOSITORY_LINK]");
GitRepositoryLinkresponse=developerConnectClient.getGitRepositoryLink(name);
}
Parameter
Name Description
name GitRepositoryLinkName

Required. Name of the resource

Returns
Type Description
GitRepositoryLink
publicfinalGitRepositoryLinkgetGitRepositoryLink(Stringname)

Gets details of a single GitRepositoryLink.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
Stringname=
GitRepositoryLinkName.of(
"[PROJECT]","[LOCATION]","[CONNECTION]","[GIT_REPOSITORY_LINK]")
.toString();
GitRepositoryLinkresponse=developerConnectClient.getGitRepositoryLink(name);
}
Parameter
Name Description
name String

Required. Name of the resource

Returns
Type Description
GitRepositoryLink

getGitRepositoryLinkCallable()

publicfinalUnaryCallable<GetGitRepositoryLinkRequest,GitRepositoryLink>getGitRepositoryLinkCallable()

Gets details of a single GitRepositoryLink.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
GetGitRepositoryLinkRequestrequest=
GetGitRepositoryLinkRequest.newBuilder()
.setName(
GitRepositoryLinkName.of(
"[PROJECT]","[LOCATION]","[CONNECTION]","[GIT_REPOSITORY_LINK]")
.toString())
.build();
ApiFuture<GitRepositoryLink>future=
developerConnectClient.getGitRepositoryLinkCallable().futureCall(request);
// Do something.
GitRepositoryLinkresponse=future.get();
}
Returns
Type Description
UnaryCallable<GetGitRepositoryLinkRequest,GitRepositoryLink>

getHttpJsonOperationsClient()

publicfinalOperationsClientgetHttpJsonOperationsClient()

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

Returns
Type Description
OperationsClient

getLocation(GetLocationRequest request)

publicfinalLocationgetLocation(GetLocationRequestrequest)

Gets information about a 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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
GetLocationRequestrequest=GetLocationRequest.newBuilder().setName("name3373707").build();
Locationresponse=developerConnectClient.getLocation(request);
}
Parameter
Name Description
request com.google.cloud.location.GetLocationRequest

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

Returns
Type Description
com.google.cloud.location.Location

getLocationCallable()

publicfinalUnaryCallable<GetLocationRequest,Location>getLocationCallable()

Gets information about a 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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
GetLocationRequestrequest=GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location>future=developerConnectClient.getLocationCallable().futureCall(request);
// Do something.
Locationresponse=future.get();
}
Returns
Type Description
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>

getOperationsClient()

publicfinalOperationsClientgetOperationsClient()

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

Returns
Type Description
OperationsClient

getSettings()

publicfinalDeveloperConnectSettingsgetSettings()
Returns
Type Description
DeveloperConnectSettings

getStub()

publicDeveloperConnectStubgetStub()
Returns
Type Description
DeveloperConnectStub

isShutdown()

publicbooleanisShutdown()
Returns
Type Description
boolean

isTerminated()

publicbooleanisTerminated()
Returns
Type Description
boolean

listConnections(ListConnectionsRequest request)

publicfinalDeveloperConnectClient.ListConnectionsPagedResponselistConnections(ListConnectionsRequestrequest)

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
ListConnectionsRequestrequest=
ListConnectionsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for(Connectionelement:developerConnectClient.listConnections(request).iterateAll()){
// doThingsWith(element);
}
}
Parameter
Name Description
request ListConnectionsRequest

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

Returns
Type Description
DeveloperConnectClient.ListConnectionsPagedResponse

listConnections(LocationName parent)

publicfinalDeveloperConnectClient.ListConnectionsPagedResponselistConnections(LocationNameparent)

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
LocationNameparent=LocationName.of("[PROJECT]","[LOCATION]");
for(Connectionelement:developerConnectClient.listConnections(parent).iterateAll()){
// doThingsWith(element);
}
}
Parameter
Name Description
parent LocationName

Required. Parent value for ListConnectionsRequest

Returns
Type Description
DeveloperConnectClient.ListConnectionsPagedResponse

listConnections(String parent)

publicfinalDeveloperConnectClient.ListConnectionsPagedResponselistConnections(Stringparent)

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
Stringparent=LocationName.of("[PROJECT]","[LOCATION]").toString();
for(Connectionelement:developerConnectClient.listConnections(parent).iterateAll()){
// doThingsWith(element);
}
}
Parameter
Name Description
parent String

Required. Parent value for ListConnectionsRequest

Returns
Type Description
DeveloperConnectClient.ListConnectionsPagedResponse

listConnectionsCallable()

publicfinalUnaryCallable<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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
ListConnectionsRequestrequest=
ListConnectionsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while(true){
ListConnectionsResponseresponse=
developerConnectClient.listConnectionsCallable().call(request);
for(Connectionelement:response.getConnectionsList()){
// doThingsWith(element);
}
StringnextPageToken=response.getNextPageToken();
if(!Strings.isNullOrEmpty(nextPageToken)){
request=request.toBuilder().setPageToken(nextPageToken).build();
}else{
break;
}
}
}
Returns
Type Description
UnaryCallable<ListConnectionsRequest,ListConnectionsResponse>

listConnectionsPagedCallable()

publicfinalUnaryCallable<ListConnectionsRequest,DeveloperConnectClient.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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
ListConnectionsRequestrequest=
ListConnectionsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<Connection>future=
developerConnectClient.listConnectionsPagedCallable().futureCall(request);
// Do something.
for(Connectionelement:future.get().iterateAll()){
// doThingsWith(element);
}
}
Returns
Type Description
UnaryCallable<ListConnectionsRequest,ListConnectionsPagedResponse>
publicfinalDeveloperConnectClient.ListGitRepositoryLinksPagedResponselistGitRepositoryLinks(ConnectionNameparent)

Lists GitRepositoryLinks in a given project, location, and 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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
ConnectionNameparent=ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]");
for(GitRepositoryLinkelement:
developerConnectClient.listGitRepositoryLinks(parent).iterateAll()){
// doThingsWith(element);
}
}
Parameter
Name Description
parent ConnectionName

Required. Parent value for ListGitRepositoryLinksRequest

Returns
Type Description
DeveloperConnectClient.ListGitRepositoryLinksPagedResponse
publicfinalDeveloperConnectClient.ListGitRepositoryLinksPagedResponselistGitRepositoryLinks(ListGitRepositoryLinksRequestrequest)

Lists GitRepositoryLinks in a given project, location, and 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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
ListGitRepositoryLinksRequestrequest=
ListGitRepositoryLinksRequest.newBuilder()
.setParent(ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for(GitRepositoryLinkelement:
developerConnectClient.listGitRepositoryLinks(request).iterateAll()){
// doThingsWith(element);
}
}
Parameter
Name Description
request ListGitRepositoryLinksRequest

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

Returns
Type Description
DeveloperConnectClient.ListGitRepositoryLinksPagedResponse
publicfinalDeveloperConnectClient.ListGitRepositoryLinksPagedResponselistGitRepositoryLinks(Stringparent)

Lists GitRepositoryLinks in a given project, location, and 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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
Stringparent=ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]").toString();
for(GitRepositoryLinkelement:
developerConnectClient.listGitRepositoryLinks(parent).iterateAll()){
// doThingsWith(element);
}
}
Parameter
Name Description
parent String

Required. Parent value for ListGitRepositoryLinksRequest

Returns
Type Description
DeveloperConnectClient.ListGitRepositoryLinksPagedResponse

listGitRepositoryLinksCallable()

publicfinalUnaryCallable<ListGitRepositoryLinksRequest,ListGitRepositoryLinksResponse>listGitRepositoryLinksCallable()

Lists GitRepositoryLinks in a given project, location, and 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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
ListGitRepositoryLinksRequestrequest=
ListGitRepositoryLinksRequest.newBuilder()
.setParent(ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while(true){
ListGitRepositoryLinksResponseresponse=
developerConnectClient.listGitRepositoryLinksCallable().call(request);
for(GitRepositoryLinkelement:response.getGitRepositoryLinksList()){
// doThingsWith(element);
}
StringnextPageToken=response.getNextPageToken();
if(!Strings.isNullOrEmpty(nextPageToken)){
request=request.toBuilder().setPageToken(nextPageToken).build();
}else{
break;
}
}
}
Returns
Type Description
UnaryCallable<ListGitRepositoryLinksRequest,ListGitRepositoryLinksResponse>

listGitRepositoryLinksPagedCallable()

publicfinalUnaryCallable<ListGitRepositoryLinksRequest,DeveloperConnectClient.ListGitRepositoryLinksPagedResponse>listGitRepositoryLinksPagedCallable()

Lists GitRepositoryLinks in a given project, location, and 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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
ListGitRepositoryLinksRequestrequest=
ListGitRepositoryLinksRequest.newBuilder()
.setParent(ConnectionName.of("[PROJECT]","[LOCATION]","[CONNECTION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<GitRepositoryLink>future=
developerConnectClient.listGitRepositoryLinksPagedCallable().futureCall(request);
// Do something.
for(GitRepositoryLinkelement:future.get().iterateAll()){
// doThingsWith(element);
}
}
Returns
Type Description
UnaryCallable<ListGitRepositoryLinksRequest,ListGitRepositoryLinksPagedResponse>

listLocations(ListLocationsRequest request)

publicfinalDeveloperConnectClient.ListLocationsPagedResponselistLocations(ListLocationsRequestrequest)

Lists information about the supported locations for this service.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
ListLocationsRequestrequest=
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for(Locationelement:developerConnectClient.listLocations(request).iterateAll()){
// doThingsWith(element);
}
}
Parameter
Name Description
request com.google.cloud.location.ListLocationsRequest

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

Returns
Type Description
DeveloperConnectClient.ListLocationsPagedResponse

listLocationsCallable()

publicfinalUnaryCallable<ListLocationsRequest,ListLocationsResponse>listLocationsCallable()

Lists information about the supported locations for this service.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
ListLocationsRequestrequest=
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while(true){
ListLocationsResponseresponse=
developerConnectClient.listLocationsCallable().call(request);
for(Locationelement:response.getLocationsList()){
// doThingsWith(element);
}
StringnextPageToken=response.getNextPageToken();
if(!Strings.isNullOrEmpty(nextPageToken)){
request=request.toBuilder().setPageToken(nextPageToken).build();
}else{
break;
}
}
}
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>

listLocationsPagedCallable()

publicfinalUnaryCallable<ListLocationsRequest,DeveloperConnectClient.ListLocationsPagedResponse>listLocationsPagedCallable()

Lists information about the supported locations for this service.

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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
ListLocationsRequestrequest=
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Location>future=
developerConnectClient.listLocationsPagedCallable().futureCall(request);
// Do something.
for(Locationelement:future.get().iterateAll()){
// doThingsWith(element);
}
}
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse>

shutdown()

publicvoidshutdown()

shutdownNow()

publicvoidshutdownNow()

updateConnectionAsync(Connection connection, FieldMask updateMask)

publicfinalOperationFuture<Connection,OperationMetadata>updateConnectionAsync(Connectionconnection,FieldMaskupdateMask)

Updates the parameters 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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
Connectionconnection=Connection.newBuilder().build();
FieldMaskupdateMask=FieldMask.newBuilder().build();
Connectionresponse=
developerConnectClient.updateConnectionAsync(connection,updateMask).get();
}
Parameters
Name Description
connection Connection

Required. The resource being updated

updateMask FieldMask

Required. Field mask is used to specify the fields to be overwritten in the Connection resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.

Returns
Type Description
OperationFuture<Connection,OperationMetadata>

updateConnectionAsync(UpdateConnectionRequest request)

publicfinalOperationFuture<Connection,OperationMetadata>updateConnectionAsync(UpdateConnectionRequestrequest)

Updates the parameters 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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
UpdateConnectionRequestrequest=
UpdateConnectionRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setConnection(Connection.newBuilder().build())
.setRequestId("requestId693933066")
.setAllowMissing(true)
.setValidateOnly(true)
.build();
Connectionresponse=developerConnectClient.updateConnectionAsync(request).get();
}
Parameter
Name Description
request UpdateConnectionRequest

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

Returns
Type Description
OperationFuture<Connection,OperationMetadata>

updateConnectionCallable()

publicfinalUnaryCallable<UpdateConnectionRequest,Operation>updateConnectionCallable()

Updates the parameters 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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
UpdateConnectionRequestrequest=
UpdateConnectionRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setConnection(Connection.newBuilder().build())
.setRequestId("requestId693933066")
.setAllowMissing(true)
.setValidateOnly(true)
.build();
ApiFuture<Operation>future=
developerConnectClient.updateConnectionCallable().futureCall(request);
// Do something.
Operationresponse=future.get();
}
Returns
Type Description
UnaryCallable<UpdateConnectionRequest,Operation>

updateConnectionOperationCallable()

publicfinalOperationCallable<UpdateConnectionRequest,Connection,OperationMetadata>updateConnectionOperationCallable()

Updates the parameters 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(DeveloperConnectClientdeveloperConnectClient=DeveloperConnectClient.create()){
UpdateConnectionRequestrequest=
UpdateConnectionRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setConnection(Connection.newBuilder().build())
.setRequestId("requestId693933066")
.setAllowMissing(true)
.setValidateOnly(true)
.build();
OperationFuture<Connection,OperationMetadata>future=
developerConnectClient.updateConnectionOperationCallable().futureCall(request);
// Do something.
Connectionresponse=future.get();
}
Returns
Type Description
OperationCallable<UpdateConnectionRequest,Connection,OperationMetadata>

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年11月19日 UTC.