Class TargetTcpProxiesClient (1.23.0)

public class TargetTcpProxiesClient implements BackgroundResource

Service Description: The TargetTcpProxies API.

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 (TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.create()) {
   String project = "project-309310695";
   String targetTcpProxy = "targetTcpProxy-337144898";
   TargetTcpProxy response = targetTcpProxiesClient.get(project, targetTcpProxy);
 }
 

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

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

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

See the individual methods for example code.

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

This class can be customized by passing in a custom instance of TargetTcpProxiesSettings 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
 TargetTcpProxiesSettings targetTcpProxiesSettings =
     TargetTcpProxiesSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 TargetTcpProxiesClient targetTcpProxiesClient =
     TargetTcpProxiesClient.create(targetTcpProxiesSettings);
 

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
 TargetTcpProxiesSettings targetTcpProxiesSettings =
     TargetTcpProxiesSettings.newBuilder().setEndpoint(myEndpoint).build();
 TargetTcpProxiesClient targetTcpProxiesClient =
     TargetTcpProxiesClient.create(targetTcpProxiesSettings);
 

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

Inheritance

java.lang.Object > TargetTcpProxiesClient

Implements

BackgroundResource

Static Methods

create()

public static final TargetTcpProxiesClient create()

Constructs an instance of TargetTcpProxiesClient with default settings.

Returns
TypeDescription
TargetTcpProxiesClient
Exceptions
TypeDescription
IOException

create(TargetTcpProxiesSettings settings)

public static final TargetTcpProxiesClient create(TargetTcpProxiesSettings settings)

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

Parameter
NameDescription
settingsTargetTcpProxiesSettings
Returns
TypeDescription
TargetTcpProxiesClient
Exceptions
TypeDescription
IOException

create(TargetTcpProxiesStub stub)

public static final TargetTcpProxiesClient create(TargetTcpProxiesStub stub)

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

Parameter
NameDescription
stubTargetTcpProxiesStub
Returns
TypeDescription
TargetTcpProxiesClient

Constructors

TargetTcpProxiesClient(TargetTcpProxiesSettings settings)

protected TargetTcpProxiesClient(TargetTcpProxiesSettings settings)

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

Parameter
NameDescription
settingsTargetTcpProxiesSettings

TargetTcpProxiesClient(TargetTcpProxiesStub stub)

protected TargetTcpProxiesClient(TargetTcpProxiesStub stub)
Parameter
NameDescription
stubTargetTcpProxiesStub

Methods

aggregatedList(AggregatedListTargetTcpProxiesRequest request)

public final TargetTcpProxiesClient.AggregatedListPagedResponse aggregatedList(AggregatedListTargetTcpProxiesRequest request)

Retrieves the list of all TargetTcpProxy resources, regional and global, available to the specified project.

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 (TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.create()) {
   AggregatedListTargetTcpProxiesRequest request =
       AggregatedListTargetTcpProxiesRequest.newBuilder()
           .setFilter("filter-1274492040")
           .setIncludeAllScopes(true)
           .setMaxResults(1128457243)
           .setOrderBy("orderBy-1207110587")
           .setPageToken("pageToken873572522")
           .setProject("project-309310695")
           .setReturnPartialSuccess(true)
           .build();
   for (Map.Entry<String, TargetTcpProxiesScopedList> element :
       targetTcpProxiesClient.aggregatedList(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestAggregatedListTargetTcpProxiesRequest

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

Returns
TypeDescription
TargetTcpProxiesClient.AggregatedListPagedResponse

aggregatedList(String project)

public final TargetTcpProxiesClient.AggregatedListPagedResponse aggregatedList(String project)

Retrieves the list of all TargetTcpProxy resources, regional and global, available to the specified project.

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 (TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.create()) {
   String project = "project-309310695";
   for (Map.Entry<String, TargetTcpProxiesScopedList> element :
       targetTcpProxiesClient.aggregatedList(project).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
projectString

Name of the project scoping this request.

Returns
TypeDescription
TargetTcpProxiesClient.AggregatedListPagedResponse

aggregatedListCallable()

public final UnaryCallable<AggregatedListTargetTcpProxiesRequest,TargetTcpProxyAggregatedList> aggregatedListCallable()

Retrieves the list of all TargetTcpProxy resources, regional and global, available to the specified project.

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 (TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.create()) {
   AggregatedListTargetTcpProxiesRequest request =
       AggregatedListTargetTcpProxiesRequest.newBuilder()
           .setFilter("filter-1274492040")
           .setIncludeAllScopes(true)
           .setMaxResults(1128457243)
           .setOrderBy("orderBy-1207110587")
           .setPageToken("pageToken873572522")
           .setProject("project-309310695")
           .setReturnPartialSuccess(true)
           .build();
   while (true) {
     TargetTcpProxyAggregatedList response =
         targetTcpProxiesClient.aggregatedListCallable().call(request);
     for (Map.Entry<String, TargetTcpProxiesScopedList> element : response.getItemsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<AggregatedListTargetTcpProxiesRequest,TargetTcpProxyAggregatedList>

aggregatedListPagedCallable()

public final UnaryCallable<AggregatedListTargetTcpProxiesRequest,TargetTcpProxiesClient.AggregatedListPagedResponse> aggregatedListPagedCallable()

Retrieves the list of all TargetTcpProxy resources, regional and global, available to the specified project.

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 (TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.create()) {
   AggregatedListTargetTcpProxiesRequest request =
       AggregatedListTargetTcpProxiesRequest.newBuilder()
           .setFilter("filter-1274492040")
           .setIncludeAllScopes(true)
           .setMaxResults(1128457243)
           .setOrderBy("orderBy-1207110587")
           .setPageToken("pageToken873572522")
           .setProject("project-309310695")
           .setReturnPartialSuccess(true)
           .build();
   ApiFuture<Map.Entry<String, TargetTcpProxiesScopedList>> future =
       targetTcpProxiesClient.aggregatedListPagedCallable().futureCall(request);
   // Do something.
   for (Map.Entry<String, TargetTcpProxiesScopedList> element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<AggregatedListTargetTcpProxiesRequest,AggregatedListPagedResponse>

awaitTermination(long duration, TimeUnit unit)

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

close()

public final void close()

deleteAsync(DeleteTargetTcpProxyRequest request)

public final OperationFuture<Operation,Operation> deleteAsync(DeleteTargetTcpProxyRequest request)

Deletes the specified TargetTcpProxy resource.

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 (TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.create()) {
   DeleteTargetTcpProxyRequest request =
       DeleteTargetTcpProxyRequest.newBuilder()
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .setTargetTcpProxy("targetTcpProxy-337144898")
           .build();
   Operation response = targetTcpProxiesClient.deleteAsync(request).get();
 }
 
Parameter
NameDescription
requestDeleteTargetTcpProxyRequest

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

Returns
TypeDescription
OperationFuture<Operation,Operation>

deleteAsync(String project, String targetTcpProxy)

public final OperationFuture<Operation,Operation> deleteAsync(String project, String targetTcpProxy)

Deletes the specified TargetTcpProxy resource.

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 (TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.create()) {
   String project = "project-309310695";
   String targetTcpProxy = "targetTcpProxy-337144898";
   Operation response = targetTcpProxiesClient.deleteAsync(project, targetTcpProxy).get();
 }
 
Parameters
NameDescription
projectString

Project ID for this request.

targetTcpProxyString

Name of the TargetTcpProxy resource to delete.

Returns
TypeDescription
OperationFuture<Operation,Operation>

deleteCallable()

public final UnaryCallable<DeleteTargetTcpProxyRequest,Operation> deleteCallable()

Deletes the specified TargetTcpProxy resource.

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 (TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.create()) {
   DeleteTargetTcpProxyRequest request =
       DeleteTargetTcpProxyRequest.newBuilder()
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .setTargetTcpProxy("targetTcpProxy-337144898")
           .build();
   ApiFuture<Operation> future = targetTcpProxiesClient.deleteCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteTargetTcpProxyRequest,Operation>

deleteOperationCallable()

public final OperationCallable<DeleteTargetTcpProxyRequest,Operation,Operation> deleteOperationCallable()

Deletes the specified TargetTcpProxy resource.

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 (TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.create()) {
   DeleteTargetTcpProxyRequest request =
       DeleteTargetTcpProxyRequest.newBuilder()
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .setTargetTcpProxy("targetTcpProxy-337144898")
           .build();
   OperationFuture<Operation, Operation> future =
       targetTcpProxiesClient.deleteOperationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<DeleteTargetTcpProxyRequest,Operation,Operation>

get(GetTargetTcpProxyRequest request)

public final TargetTcpProxy get(GetTargetTcpProxyRequest request)

Returns the specified TargetTcpProxy resource.

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 (TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.create()) {
   GetTargetTcpProxyRequest request =
       GetTargetTcpProxyRequest.newBuilder()
           .setProject("project-309310695")
           .setTargetTcpProxy("targetTcpProxy-337144898")
           .build();
   TargetTcpProxy response = targetTcpProxiesClient.get(request);
 }
 
Parameter
NameDescription
requestGetTargetTcpProxyRequest

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

Returns
TypeDescription
TargetTcpProxy

get(String project, String targetTcpProxy)

public final TargetTcpProxy get(String project, String targetTcpProxy)

Returns the specified TargetTcpProxy resource.

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 (TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.create()) {
   String project = "project-309310695";
   String targetTcpProxy = "targetTcpProxy-337144898";
   TargetTcpProxy response = targetTcpProxiesClient.get(project, targetTcpProxy);
 }
 
Parameters
NameDescription
projectString

Project ID for this request.

targetTcpProxyString

Name of the TargetTcpProxy resource to return.

Returns
TypeDescription
TargetTcpProxy

getCallable()

public final UnaryCallable<GetTargetTcpProxyRequest,TargetTcpProxy> getCallable()

Returns the specified TargetTcpProxy resource.

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 (TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.create()) {
   GetTargetTcpProxyRequest request =
       GetTargetTcpProxyRequest.newBuilder()
           .setProject("project-309310695")
           .setTargetTcpProxy("targetTcpProxy-337144898")
           .build();
   ApiFuture<TargetTcpProxy> future = targetTcpProxiesClient.getCallable().futureCall(request);
   // Do something.
   TargetTcpProxy response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetTargetTcpProxyRequest,TargetTcpProxy>

getSettings()

public final TargetTcpProxiesSettings getSettings()
Returns
TypeDescription
TargetTcpProxiesSettings

getStub()

public TargetTcpProxiesStub getStub()
Returns
TypeDescription
TargetTcpProxiesStub

insertAsync(InsertTargetTcpProxyRequest request)

public final OperationFuture<Operation,Operation> insertAsync(InsertTargetTcpProxyRequest request)

Creates a TargetTcpProxy resource in the specified project using the data included in the request.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.create()) {
   InsertTargetTcpProxyRequest request =
       InsertTargetTcpProxyRequest.newBuilder()
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .setTargetTcpProxyResource(TargetTcpProxy.newBuilder().build())
           .build();
   Operation response = targetTcpProxiesClient.insertAsync(request).get();
 }
 
Parameter
NameDescription
requestInsertTargetTcpProxyRequest

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

Returns
TypeDescription
OperationFuture<Operation,Operation>

insertAsync(String project, TargetTcpProxy targetTcpProxyResource)

public final OperationFuture<Operation,Operation> insertAsync(String project, TargetTcpProxy targetTcpProxyResource)

Creates a TargetTcpProxy resource in the specified project using the data included in the request.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.create()) {
   String project = "project-309310695";
   TargetTcpProxy targetTcpProxyResource = TargetTcpProxy.newBuilder().build();
   Operation response =
       targetTcpProxiesClient.insertAsync(project, targetTcpProxyResource).get();
 }
 
Parameters
NameDescription
projectString

Project ID for this request.

targetTcpProxyResourceTargetTcpProxy

The body resource for this request

Returns
TypeDescription
OperationFuture<Operation,Operation>

insertCallable()

public final UnaryCallable<InsertTargetTcpProxyRequest,Operation> insertCallable()

Creates a TargetTcpProxy resource in the specified project using the data included in the request.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.create()) {
   InsertTargetTcpProxyRequest request =
       InsertTargetTcpProxyRequest.newBuilder()
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .setTargetTcpProxyResource(TargetTcpProxy.newBuilder().build())
           .build();
   ApiFuture<Operation> future = targetTcpProxiesClient.insertCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<InsertTargetTcpProxyRequest,Operation>

insertOperationCallable()

public final OperationCallable<InsertTargetTcpProxyRequest,Operation,Operation> insertOperationCallable()

Creates a TargetTcpProxy resource in the specified project using the data included in the request.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.create()) {
   InsertTargetTcpProxyRequest request =
       InsertTargetTcpProxyRequest.newBuilder()
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .setTargetTcpProxyResource(TargetTcpProxy.newBuilder().build())
           .build();
   OperationFuture<Operation, Operation> future =
       targetTcpProxiesClient.insertOperationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<InsertTargetTcpProxyRequest,Operation,Operation>

isShutdown()

public boolean isShutdown()
Returns
TypeDescription
boolean

isTerminated()

public boolean isTerminated()
Returns
TypeDescription
boolean

list(ListTargetTcpProxiesRequest request)

public final TargetTcpProxiesClient.ListPagedResponse list(ListTargetTcpProxiesRequest request)

Retrieves the list of TargetTcpProxy resources available to the specified project.

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 (TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.create()) {
   ListTargetTcpProxiesRequest request =
       ListTargetTcpProxiesRequest.newBuilder()
           .setFilter("filter-1274492040")
           .setMaxResults(1128457243)
           .setOrderBy("orderBy-1207110587")
           .setPageToken("pageToken873572522")
           .setProject("project-309310695")
           .setReturnPartialSuccess(true)
           .build();
   for (TargetTcpProxy element : targetTcpProxiesClient.list(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListTargetTcpProxiesRequest

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

Returns
TypeDescription
TargetTcpProxiesClient.ListPagedResponse

list(String project)

public final TargetTcpProxiesClient.ListPagedResponse list(String project)

Retrieves the list of TargetTcpProxy resources available to the specified project.

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 (TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.create()) {
   String project = "project-309310695";
   for (TargetTcpProxy element : targetTcpProxiesClient.list(project).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
projectString

Project ID for this request.

Returns
TypeDescription
TargetTcpProxiesClient.ListPagedResponse

listCallable()

public final UnaryCallable<ListTargetTcpProxiesRequest,TargetTcpProxyList> listCallable()

Retrieves the list of TargetTcpProxy resources available to the specified project.

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 (TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.create()) {
   ListTargetTcpProxiesRequest request =
       ListTargetTcpProxiesRequest.newBuilder()
           .setFilter("filter-1274492040")
           .setMaxResults(1128457243)
           .setOrderBy("orderBy-1207110587")
           .setPageToken("pageToken873572522")
           .setProject("project-309310695")
           .setReturnPartialSuccess(true)
           .build();
   while (true) {
     TargetTcpProxyList response = targetTcpProxiesClient.listCallable().call(request);
     for (TargetTcpProxy element : response.getItemsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListTargetTcpProxiesRequest,TargetTcpProxyList>

listPagedCallable()

public final UnaryCallable<ListTargetTcpProxiesRequest,TargetTcpProxiesClient.ListPagedResponse> listPagedCallable()

Retrieves the list of TargetTcpProxy resources available to the specified project.

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 (TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.create()) {
   ListTargetTcpProxiesRequest request =
       ListTargetTcpProxiesRequest.newBuilder()
           .setFilter("filter-1274492040")
           .setMaxResults(1128457243)
           .setOrderBy("orderBy-1207110587")
           .setPageToken("pageToken873572522")
           .setProject("project-309310695")
           .setReturnPartialSuccess(true)
           .build();
   ApiFuture<TargetTcpProxy> future =
       targetTcpProxiesClient.listPagedCallable().futureCall(request);
   // Do something.
   for (TargetTcpProxy element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListTargetTcpProxiesRequest,ListPagedResponse>

setBackendServiceAsync(SetBackendServiceTargetTcpProxyRequest request)

public final OperationFuture<Operation,Operation> setBackendServiceAsync(SetBackendServiceTargetTcpProxyRequest request)

Changes the BackendService for TargetTcpProxy.

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 (TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.create()) {
   SetBackendServiceTargetTcpProxyRequest request =
       SetBackendServiceTargetTcpProxyRequest.newBuilder()
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .setTargetTcpProxiesSetBackendServiceRequestResource(
               TargetTcpProxiesSetBackendServiceRequest.newBuilder().build())
           .setTargetTcpProxy("targetTcpProxy-337144898")
           .build();
   Operation response = targetTcpProxiesClient.setBackendServiceAsync(request).get();
 }
 
Parameter
NameDescription
requestSetBackendServiceTargetTcpProxyRequest

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

Returns
TypeDescription
OperationFuture<Operation,Operation>

setBackendServiceAsync(String project, String targetTcpProxy, TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource)

public final OperationFuture<Operation,Operation> setBackendServiceAsync(String project, String targetTcpProxy, TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource)

Changes the BackendService for TargetTcpProxy.

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 (TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.create()) {
   String project = "project-309310695";
   String targetTcpProxy = "targetTcpProxy-337144898";
   TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource =
       TargetTcpProxiesSetBackendServiceRequest.newBuilder().build();
   Operation response =
       targetTcpProxiesClient
           .setBackendServiceAsync(
               project, targetTcpProxy, targetTcpProxiesSetBackendServiceRequestResource)
           .get();
 }
 
Parameters
NameDescription
projectString

Project ID for this request.

targetTcpProxyString

Name of the TargetTcpProxy resource whose BackendService resource is to be set.

targetTcpProxiesSetBackendServiceRequestResourceTargetTcpProxiesSetBackendServiceRequest

The body resource for this request

Returns
TypeDescription
OperationFuture<Operation,Operation>

setBackendServiceCallable()

public final UnaryCallable<SetBackendServiceTargetTcpProxyRequest,Operation> setBackendServiceCallable()

Changes the BackendService for TargetTcpProxy.

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 (TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.create()) {
   SetBackendServiceTargetTcpProxyRequest request =
       SetBackendServiceTargetTcpProxyRequest.newBuilder()
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .setTargetTcpProxiesSetBackendServiceRequestResource(
               TargetTcpProxiesSetBackendServiceRequest.newBuilder().build())
           .setTargetTcpProxy("targetTcpProxy-337144898")
           .build();
   ApiFuture<Operation> future =
       targetTcpProxiesClient.setBackendServiceCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<SetBackendServiceTargetTcpProxyRequest,Operation>

setBackendServiceOperationCallable()

public final OperationCallable<SetBackendServiceTargetTcpProxyRequest,Operation,Operation> setBackendServiceOperationCallable()

Changes the BackendService for TargetTcpProxy.

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 (TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.create()) {
   SetBackendServiceTargetTcpProxyRequest request =
       SetBackendServiceTargetTcpProxyRequest.newBuilder()
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .setTargetTcpProxiesSetBackendServiceRequestResource(
               TargetTcpProxiesSetBackendServiceRequest.newBuilder().build())
           .setTargetTcpProxy("targetTcpProxy-337144898")
           .build();
   OperationFuture<Operation, Operation> future =
       targetTcpProxiesClient.setBackendServiceOperationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<SetBackendServiceTargetTcpProxyRequest,Operation,Operation>

setProxyHeaderAsync(SetProxyHeaderTargetTcpProxyRequest request)

public final OperationFuture<Operation,Operation> setProxyHeaderAsync(SetProxyHeaderTargetTcpProxyRequest request)

Changes the ProxyHeaderType for TargetTcpProxy.

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 (TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.create()) {
   SetProxyHeaderTargetTcpProxyRequest request =
       SetProxyHeaderTargetTcpProxyRequest.newBuilder()
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .setTargetTcpProxiesSetProxyHeaderRequestResource(
               TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build())
           .setTargetTcpProxy("targetTcpProxy-337144898")
           .build();
   Operation response = targetTcpProxiesClient.setProxyHeaderAsync(request).get();
 }
 
Parameter
NameDescription
requestSetProxyHeaderTargetTcpProxyRequest

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

Returns
TypeDescription
OperationFuture<Operation,Operation>

setProxyHeaderAsync(String project, String targetTcpProxy, TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource)

public final OperationFuture<Operation,Operation> setProxyHeaderAsync(String project, String targetTcpProxy, TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource)

Changes the ProxyHeaderType for TargetTcpProxy.

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 (TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.create()) {
   String project = "project-309310695";
   String targetTcpProxy = "targetTcpProxy-337144898";
   TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource =
       TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build();
   Operation response =
       targetTcpProxiesClient
           .setProxyHeaderAsync(
               project, targetTcpProxy, targetTcpProxiesSetProxyHeaderRequestResource)
           .get();
 }
 
Parameters
NameDescription
projectString

Project ID for this request.

targetTcpProxyString

Name of the TargetTcpProxy resource whose ProxyHeader is to be set.

targetTcpProxiesSetProxyHeaderRequestResourceTargetTcpProxiesSetProxyHeaderRequest

The body resource for this request

Returns
TypeDescription
OperationFuture<Operation,Operation>

setProxyHeaderCallable()

public final UnaryCallable<SetProxyHeaderTargetTcpProxyRequest,Operation> setProxyHeaderCallable()

Changes the ProxyHeaderType for TargetTcpProxy.

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 (TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.create()) {
   SetProxyHeaderTargetTcpProxyRequest request =
       SetProxyHeaderTargetTcpProxyRequest.newBuilder()
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .setTargetTcpProxiesSetProxyHeaderRequestResource(
               TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build())
           .setTargetTcpProxy("targetTcpProxy-337144898")
           .build();
   ApiFuture<Operation> future =
       targetTcpProxiesClient.setProxyHeaderCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<SetProxyHeaderTargetTcpProxyRequest,Operation>

setProxyHeaderOperationCallable()

public final OperationCallable<SetProxyHeaderTargetTcpProxyRequest,Operation,Operation> setProxyHeaderOperationCallable()

Changes the ProxyHeaderType for TargetTcpProxy.

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 (TargetTcpProxiesClient targetTcpProxiesClient = TargetTcpProxiesClient.create()) {
   SetProxyHeaderTargetTcpProxyRequest request =
       SetProxyHeaderTargetTcpProxyRequest.newBuilder()
           .setProject("project-309310695")
           .setRequestId("requestId693933066")
           .setTargetTcpProxiesSetProxyHeaderRequestResource(
               TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build())
           .setTargetTcpProxy("targetTcpProxy-337144898")
           .build();
   OperationFuture<Operation, Operation> future =
       targetTcpProxiesClient.setProxyHeaderOperationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<SetProxyHeaderTargetTcpProxyRequest,Operation,Operation>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()