Class TargetTcpProxiesClient

  • All Implemented Interfaces:
    com.google.api.gax.core.BackgroundResource, AutoCloseable

    @Generated("by gapic-generator-java")
    public class TargetTcpProxiesClient
    extends Object
    implements com.google.api.gax.core.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.

    • Constructor Detail

      • TargetTcpProxiesClient

        protected TargetTcpProxiesClient​(TargetTcpProxiesSettings settings)
                                  throws IOException
        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.
        Throws:
        IOException
    • Method Detail

      • create

        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).
      • aggregatedList

        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);
           }
         }
         
        Parameters:
        project - Name of the project scoping this request.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • aggregatedList

        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);
           }
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • aggregatedListPagedCallable

        public final 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.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying 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);
           }
         }
         
      • aggregatedListCallable

        public final com.google.api.gax.rpc.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;
             }
           }
         }
         
      • deleteAsync

        public final com.google.api.gax.longrunning.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:
        project - Project ID for this request.
        targetTcpProxy - Name of the TargetTcpProxy resource to delete.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteAsync

        @BetaApi("The surface for long-running operations is not stable yet and may change in the future.")
        public final com.google.api.gax.longrunning.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();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteOperationCallable

        public final com.google.api.gax.rpc.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();
         }
         
      • deleteCallable

        public final com.google.api.gax.rpc.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();
         }
         
      • get

        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:
        project - Project ID for this request.
        targetTcpProxy - Name of the TargetTcpProxy resource to return.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • get

        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);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getCallable

        public final com.google.api.gax.rpc.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();
         }
         
      • insertAsync

        public final 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.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying 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:
        project - Project ID for this request.
        targetTcpProxyResource - The body resource for this request
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • insertAsync

        @BetaApi("The surface for long-running operations is not stable yet and may change in the future.")
        public final 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.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying 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();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • insertOperationCallable

        public final 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.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying 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();
         }
         
      • insertCallable

        public final com.google.api.gax.rpc.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();
         }
         
      • list

        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);
           }
         }
         
        Parameters:
        project - Project ID for this request.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • list

        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);
           }
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listPagedCallable

        public final com.google.api.gax.rpc.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);
           }
         }
         
      • listCallable

        public final com.google.api.gax.rpc.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;
             }
           }
         }
         
      • setBackendServiceAsync

        public final com.google.api.gax.longrunning.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:
        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 request
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • setBackendServiceAsync

        @BetaApi("The surface for long-running operations is not stable yet and may change in the future.")
        public final com.google.api.gax.longrunning.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();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • setBackendServiceOperationCallable

        public final com.google.api.gax.rpc.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();
         }
         
      • setBackendServiceCallable

        public final com.google.api.gax.rpc.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();
         }
         
      • setProxyHeaderAsync

        public final com.google.api.gax.longrunning.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:
        project - Project ID for this request.
        targetTcpProxy - Name of the TargetTcpProxy resource whose ProxyHeader is to be set.
        targetTcpProxiesSetProxyHeaderRequestResource - The body resource for this request
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • setProxyHeaderAsync

        @BetaApi("The surface for long-running operations is not stable yet and may change in the future.")
        public final com.google.api.gax.longrunning.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();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • setProxyHeaderOperationCallable

        public final com.google.api.gax.rpc.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();
         }
         
      • setProxyHeaderCallable

        public final com.google.api.gax.rpc.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();
         }
         
      • shutdown

        public void shutdown()
        Specified by:
        shutdown in interface com.google.api.gax.core.BackgroundResource
      • isShutdown

        public boolean isShutdown()
        Specified by:
        isShutdown in interface com.google.api.gax.core.BackgroundResource
      • isTerminated

        public boolean isTerminated()
        Specified by:
        isTerminated in interface com.google.api.gax.core.BackgroundResource
      • shutdownNow

        public void shutdownNow()
        Specified by:
        shutdownNow in interface com.google.api.gax.core.BackgroundResource