@Generated(value="by gapic-generator-java") public class TargetTcpProxiesClient extends Object implements com.google.api.gax.core.BackgroundResource
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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().
| Method | Description | Method Variants |
|---|---|---|
AggregatedList |
Retrieves the list of all TargetTcpProxy resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Delete |
Deletes the specified TargetTcpProxy resource. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Get |
Returns the specified TargetTcpProxy resource. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Insert |
Creates a TargetTcpProxy resource in the specified project using the data included in the request. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
List |
Retrieves the list of TargetTcpProxy resources available to the specified project. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetBackendService |
Changes the BackendService for TargetTcpProxy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetProxyHeader |
Changes the ProxyHeaderType for TargetTcpProxy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
| Modifier and Type | Class and Description |
|---|---|
static class |
TargetTcpProxiesClient.AggregatedListFixedSizeCollection |
static class |
TargetTcpProxiesClient.AggregatedListPage |
static class |
TargetTcpProxiesClient.AggregatedListPagedResponse |
static class |
TargetTcpProxiesClient.ListFixedSizeCollection |
static class |
TargetTcpProxiesClient.ListPage |
static class |
TargetTcpProxiesClient.ListPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
TargetTcpProxiesClient(TargetTcpProxiesSettings settings)
Constructs an instance of TargetTcpProxiesClient, using the given settings.
|
protected |
TargetTcpProxiesClient(TargetTcpProxiesStub stub) |
| Modifier and Type | Method and Description |
|---|---|
TargetTcpProxiesClient.AggregatedListPagedResponse |
aggregatedList(AggregatedListTargetTcpProxiesRequest request)
Retrieves the list of all TargetTcpProxy resources, regional and global, available to the
specified project.
|
TargetTcpProxiesClient.AggregatedListPagedResponse |
aggregatedList(String project)
Retrieves the list of all TargetTcpProxy resources, regional and global, available to the
specified project.
|
com.google.api.gax.rpc.UnaryCallable<AggregatedListTargetTcpProxiesRequest,TargetTcpProxyAggregatedList> |
aggregatedListCallable()
Retrieves the list of all TargetTcpProxy resources, regional and global, available to the
specified project.
|
com.google.api.gax.rpc.UnaryCallable<AggregatedListTargetTcpProxiesRequest,TargetTcpProxiesClient.AggregatedListPagedResponse> |
aggregatedListPagedCallable()
Retrieves the list of all TargetTcpProxy resources, regional and global, available to the
specified project.
|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static TargetTcpProxiesClient |
create()
Constructs an instance of TargetTcpProxiesClient with default settings.
|
static TargetTcpProxiesClient |
create(TargetTcpProxiesSettings settings)
Constructs an instance of TargetTcpProxiesClient, using the given settings.
|
static TargetTcpProxiesClient |
create(TargetTcpProxiesStub stub)
Constructs an instance of TargetTcpProxiesClient, using the given stub for making calls.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
deleteAsync(DeleteTargetTcpProxyRequest request)
Deletes the specified TargetTcpProxy resource.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
deleteAsync(String project,
String targetTcpProxy)
Deletes the specified TargetTcpProxy resource.
|
com.google.api.gax.rpc.UnaryCallable<DeleteTargetTcpProxyRequest,Operation> |
deleteCallable()
Deletes the specified TargetTcpProxy resource.
|
com.google.api.gax.rpc.OperationCallable<DeleteTargetTcpProxyRequest,Operation,Operation> |
deleteOperationCallable()
Deletes the specified TargetTcpProxy resource.
|
TargetTcpProxy |
get(GetTargetTcpProxyRequest request)
Returns the specified TargetTcpProxy resource.
|
TargetTcpProxy |
get(String project,
String targetTcpProxy)
Returns the specified TargetTcpProxy resource.
|
com.google.api.gax.rpc.UnaryCallable<GetTargetTcpProxyRequest,TargetTcpProxy> |
getCallable()
Returns the specified TargetTcpProxy resource.
|
TargetTcpProxiesSettings |
getSettings() |
TargetTcpProxiesStub |
getStub() |
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
insertAsync(InsertTargetTcpProxyRequest request)
Creates a TargetTcpProxy resource in the specified project using the data included in the
request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
insertAsync(String project,
TargetTcpProxy targetTcpProxyResource)
Creates a TargetTcpProxy resource in the specified project using the data included in the
request.
|
com.google.api.gax.rpc.UnaryCallable<InsertTargetTcpProxyRequest,Operation> |
insertCallable()
Creates a TargetTcpProxy resource in the specified project using the data included in the
request.
|
com.google.api.gax.rpc.OperationCallable<InsertTargetTcpProxyRequest,Operation,Operation> |
insertOperationCallable()
Creates a TargetTcpProxy resource in the specified project using the data included in the
request.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
TargetTcpProxiesClient.ListPagedResponse |
list(ListTargetTcpProxiesRequest request)
Retrieves the list of TargetTcpProxy resources available to the specified project.
|
TargetTcpProxiesClient.ListPagedResponse |
list(String project)
Retrieves the list of TargetTcpProxy resources available to the specified project.
|
com.google.api.gax.rpc.UnaryCallable<ListTargetTcpProxiesRequest,TargetTcpProxyList> |
listCallable()
Retrieves the list of TargetTcpProxy resources available to the specified project.
|
com.google.api.gax.rpc.UnaryCallable<ListTargetTcpProxiesRequest,TargetTcpProxiesClient.ListPagedResponse> |
listPagedCallable()
Retrieves the list of TargetTcpProxy resources available to the specified project.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setBackendServiceAsync(SetBackendServiceTargetTcpProxyRequest request)
Changes the BackendService for TargetTcpProxy.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setBackendServiceAsync(String project,
String targetTcpProxy,
TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource)
Changes the BackendService for TargetTcpProxy.
|
com.google.api.gax.rpc.UnaryCallable<SetBackendServiceTargetTcpProxyRequest,Operation> |
setBackendServiceCallable()
Changes the BackendService for TargetTcpProxy.
|
com.google.api.gax.rpc.OperationCallable<SetBackendServiceTargetTcpProxyRequest,Operation,Operation> |
setBackendServiceOperationCallable()
Changes the BackendService for TargetTcpProxy.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setProxyHeaderAsync(SetProxyHeaderTargetTcpProxyRequest request)
Changes the ProxyHeaderType for TargetTcpProxy.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setProxyHeaderAsync(String project,
String targetTcpProxy,
TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource)
Changes the ProxyHeaderType for TargetTcpProxy.
|
com.google.api.gax.rpc.UnaryCallable<SetProxyHeaderTargetTcpProxyRequest,Operation> |
setProxyHeaderCallable()
Changes the ProxyHeaderType for TargetTcpProxy.
|
com.google.api.gax.rpc.OperationCallable<SetProxyHeaderTargetTcpProxyRequest,Operation,Operation> |
setProxyHeaderOperationCallable()
Changes the ProxyHeaderType for TargetTcpProxy.
|
void |
shutdown() |
void |
shutdownNow() |
protected TargetTcpProxiesClient(TargetTcpProxiesSettings settings) throws IOException
IOExceptionprotected TargetTcpProxiesClient(TargetTcpProxiesStub stub)
public static final TargetTcpProxiesClient create() throws IOException
IOExceptionpublic static final TargetTcpProxiesClient create(TargetTcpProxiesSettings settings) throws IOException
IOExceptionpublic static final TargetTcpProxiesClient create(TargetTcpProxiesStub stub)
public final TargetTcpProxiesSettings getSettings()
public TargetTcpProxiesStub getStub()
public final TargetTcpProxiesClient.AggregatedListPagedResponse aggregatedList(String 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);
}
}
project - Name of the project scoping this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final TargetTcpProxiesClient.AggregatedListPagedResponse aggregatedList(AggregatedListTargetTcpProxiesRequest 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()) {
AggregatedListTargetTcpProxiesRequest request =
AggregatedListTargetTcpProxiesRequest.newBuilder()
.setFilter("filter-1274492040")
.setIncludeAllScopes(true)
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setServiceProjectNumber(-1293855239)
.build();
for (Map.Entry<String, TargetTcpProxiesScopedList> element :
targetTcpProxiesClient.aggregatedList(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<AggregatedListTargetTcpProxiesRequest,TargetTcpProxiesClient.AggregatedListPagedResponse> aggregatedListPagedCallable()
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)
.setServiceProjectNumber(-1293855239)
.build();
ApiFuture<Map.Entry<String, TargetTcpProxiesScopedList>> future =
targetTcpProxiesClient.aggregatedListPagedCallable().futureCall(request);
// Do something.
for (Map.Entry<String, TargetTcpProxiesScopedList> element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<AggregatedListTargetTcpProxiesRequest,TargetTcpProxyAggregatedList> aggregatedListCallable()
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)
.setServiceProjectNumber(-1293855239)
.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;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> deleteAsync(String project, String 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";
Operation response = targetTcpProxiesClient.deleteAsync(project, targetTcpProxy).get();
}
project - Project ID for this request.targetTcpProxy - Name of the TargetTcpProxy resource to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> deleteAsync(DeleteTargetTcpProxyRequest 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()) {
DeleteTargetTcpProxyRequest request =
DeleteTargetTcpProxyRequest.newBuilder()
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setTargetTcpProxy("targetTcpProxy-337144898")
.build();
Operation response = targetTcpProxiesClient.deleteAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteTargetTcpProxyRequest,Operation,Operation> deleteOperationCallable()
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();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteTargetTcpProxyRequest,Operation> deleteCallable()
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();
}
public final TargetTcpProxy get(String project, String 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";
TargetTcpProxy response = targetTcpProxiesClient.get(project, targetTcpProxy);
}
project - Project ID for this request.targetTcpProxy - Name of the TargetTcpProxy resource to return.com.google.api.gax.rpc.ApiException - if the remote call failspublic final TargetTcpProxy get(GetTargetTcpProxyRequest 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()) {
GetTargetTcpProxyRequest request =
GetTargetTcpProxyRequest.newBuilder()
.setProject("project-309310695")
.setTargetTcpProxy("targetTcpProxy-337144898")
.build();
TargetTcpProxy response = targetTcpProxiesClient.get(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetTargetTcpProxyRequest,TargetTcpProxy> getCallable()
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();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> insertAsync(String project, TargetTcpProxy targetTcpProxyResource)
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();
}
project - Project ID for this request.targetTcpProxyResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> insertAsync(InsertTargetTcpProxyRequest 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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<InsertTargetTcpProxyRequest,Operation,Operation> insertOperationCallable()
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();
}
public final com.google.api.gax.rpc.UnaryCallable<InsertTargetTcpProxyRequest,Operation> insertCallable()
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();
}
public final TargetTcpProxiesClient.ListPagedResponse list(String 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);
}
}
project - Project ID for this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final TargetTcpProxiesClient.ListPagedResponse list(ListTargetTcpProxiesRequest 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()) {
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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListTargetTcpProxiesRequest,TargetTcpProxiesClient.ListPagedResponse> listPagedCallable()
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);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListTargetTcpProxiesRequest,TargetTcpProxyList> listCallable()
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;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setBackendServiceAsync(String project, String targetTcpProxy, TargetTcpProxiesSetBackendServiceRequest targetTcpProxiesSetBackendServiceRequestResource)
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();
}
project - Project ID for this request.targetTcpProxy - Name of the TargetTcpProxy resource whose BackendService resource is to
be set.targetTcpProxiesSetBackendServiceRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setBackendServiceAsync(SetBackendServiceTargetTcpProxyRequest 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()) {
SetBackendServiceTargetTcpProxyRequest request =
SetBackendServiceTargetTcpProxyRequest.newBuilder()
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setTargetTcpProxiesSetBackendServiceRequestResource(
TargetTcpProxiesSetBackendServiceRequest.newBuilder().build())
.setTargetTcpProxy("targetTcpProxy-337144898")
.build();
Operation response = targetTcpProxiesClient.setBackendServiceAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<SetBackendServiceTargetTcpProxyRequest,Operation,Operation> setBackendServiceOperationCallable()
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();
}
public final com.google.api.gax.rpc.UnaryCallable<SetBackendServiceTargetTcpProxyRequest,Operation> setBackendServiceCallable()
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();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setProxyHeaderAsync(String project, String targetTcpProxy, TargetTcpProxiesSetProxyHeaderRequest targetTcpProxiesSetProxyHeaderRequestResource)
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();
}
project - Project ID for this request.targetTcpProxy - Name of the TargetTcpProxy resource whose ProxyHeader is to be set.targetTcpProxiesSetProxyHeaderRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setProxyHeaderAsync(SetProxyHeaderTargetTcpProxyRequest 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()) {
SetProxyHeaderTargetTcpProxyRequest request =
SetProxyHeaderTargetTcpProxyRequest.newBuilder()
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setTargetTcpProxiesSetProxyHeaderRequestResource(
TargetTcpProxiesSetProxyHeaderRequest.newBuilder().build())
.setTargetTcpProxy("targetTcpProxy-337144898")
.build();
Operation response = targetTcpProxiesClient.setProxyHeaderAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<SetProxyHeaderTargetTcpProxyRequest,Operation,Operation> setProxyHeaderOperationCallable()
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();
}
public final com.google.api.gax.rpc.UnaryCallable<SetProxyHeaderTargetTcpProxyRequest,Operation> setProxyHeaderCallable()
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();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2024 Google LLC. All rights reserved.