Class InterconnectsClient

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

    @Generated("by gapic-generator-java")
    public class InterconnectsClient
    extends Object
    implements com.google.api.gax.core.BackgroundResource
    Service Description: The Interconnects 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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
       String project = "project-309310695";
       String interconnect = "interconnect-849140594";
       Interconnect response = interconnectsClient.get(project, interconnect);
     }
     

    Note: close() needs to be called on the InterconnectsClient 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 InterconnectsSettings 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
     InterconnectsSettings interconnectsSettings =
         InterconnectsSettings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
             .build();
     InterconnectsClient interconnectsClient = InterconnectsClient.create(interconnectsSettings);
     

    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
     InterconnectsSettings interconnectsSettings =
         InterconnectsSettings.newBuilder().setEndpoint(myEndpoint).build();
     InterconnectsClient interconnectsClient = InterconnectsClient.create(interconnectsSettings);
     

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

    • Constructor Detail

      • InterconnectsClient

        protected InterconnectsClient​(InterconnectsSettings settings)
                               throws IOException
        Constructs an instance of InterconnectsClient, 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 InterconnectsClient create​(InterconnectsSettings settings)
                                                throws IOException
        Constructs an instance of InterconnectsClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
        Throws:
        IOException
      • create

        public static final InterconnectsClient create​(InterconnectsStub stub)
        Constructs an instance of InterconnectsClient, using the given stub for making calls. This is for advanced usage - prefer using create(InterconnectsSettings).
      • deleteAsync

        public final com.google.api.gax.longrunning.OperationFuture<Operation,​Operation> deleteAsync​(String project,
                                                                                                           String interconnect)
        Deletes the specified Interconnect.

        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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
           String project = "project-309310695";
           String interconnect = "interconnect-849140594";
           Operation response = interconnectsClient.deleteAsync(project, interconnect).get();
         }
         
        Parameters:
        project - Project ID for this request.
        interconnect - Name of the interconnect 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​(DeleteInterconnectRequest request)
        Deletes the specified Interconnect.

        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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
           DeleteInterconnectRequest request =
               DeleteInterconnectRequest.newBuilder()
                   .setInterconnect("interconnect-849140594")
                   .setProject("project-309310695")
                   .setRequestId("requestId693933066")
                   .build();
           Operation response = interconnectsClient.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<DeleteInterconnectRequest,​Operation,​Operation> deleteOperationCallable()
        Deletes the specified Interconnect.

        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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
           DeleteInterconnectRequest request =
               DeleteInterconnectRequest.newBuilder()
                   .setInterconnect("interconnect-849140594")
                   .setProject("project-309310695")
                   .setRequestId("requestId693933066")
                   .build();
           OperationFuture<Operation, Operation> future =
               interconnectsClient.deleteOperationCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • deleteCallable

        public final com.google.api.gax.rpc.UnaryCallable<DeleteInterconnectRequest,​Operation> deleteCallable()
        Deletes the specified Interconnect.

        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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
           DeleteInterconnectRequest request =
               DeleteInterconnectRequest.newBuilder()
                   .setInterconnect("interconnect-849140594")
                   .setProject("project-309310695")
                   .setRequestId("requestId693933066")
                   .build();
           ApiFuture<Operation> future = interconnectsClient.deleteCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • get

        public final Interconnect get​(String project,
                                      String interconnect)
        Returns the specified Interconnect. Get a list of available Interconnects by making a list() 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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
           String project = "project-309310695";
           String interconnect = "interconnect-849140594";
           Interconnect response = interconnectsClient.get(project, interconnect);
         }
         
        Parameters:
        project - Project ID for this request.
        interconnect - Name of the interconnect to return.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • get

        public final Interconnect get​(GetInterconnectRequest request)
        Returns the specified Interconnect. Get a list of available Interconnects by making a list() 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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
           GetInterconnectRequest request =
               GetInterconnectRequest.newBuilder()
                   .setInterconnect("interconnect-849140594")
                   .setProject("project-309310695")
                   .build();
           Interconnect response = interconnectsClient.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<GetInterconnectRequest,​Interconnect> getCallable()
        Returns the specified Interconnect. Get a list of available Interconnects by making a list() 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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
           GetInterconnectRequest request =
               GetInterconnectRequest.newBuilder()
                   .setInterconnect("interconnect-849140594")
                   .setProject("project-309310695")
                   .build();
           ApiFuture<Interconnect> future = interconnectsClient.getCallable().futureCall(request);
           // Do something.
           Interconnect response = future.get();
         }
         
      • getDiagnostics

        public final InterconnectsGetDiagnosticsResponse getDiagnostics​(String project,
                                                                        String interconnect)
        Returns the interconnectDiagnostics for the specified Interconnect.

        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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
           String project = "project-309310695";
           String interconnect = "interconnect-849140594";
           InterconnectsGetDiagnosticsResponse response =
               interconnectsClient.getDiagnostics(project, interconnect);
         }
         
        Parameters:
        project - Project ID for this request.
        interconnect - Name of the interconnect resource to query.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getDiagnostics

        public final InterconnectsGetDiagnosticsResponse getDiagnostics​(GetDiagnosticsInterconnectRequest request)
        Returns the interconnectDiagnostics for the specified Interconnect.

        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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
           GetDiagnosticsInterconnectRequest request =
               GetDiagnosticsInterconnectRequest.newBuilder()
                   .setInterconnect("interconnect-849140594")
                   .setProject("project-309310695")
                   .build();
           InterconnectsGetDiagnosticsResponse response = interconnectsClient.getDiagnostics(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
      • getDiagnosticsCallable

        public final com.google.api.gax.rpc.UnaryCallable<GetDiagnosticsInterconnectRequest,​InterconnectsGetDiagnosticsResponse> getDiagnosticsCallable()
        Returns the interconnectDiagnostics for the specified Interconnect.

        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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
           GetDiagnosticsInterconnectRequest request =
               GetDiagnosticsInterconnectRequest.newBuilder()
                   .setInterconnect("interconnect-849140594")
                   .setProject("project-309310695")
                   .build();
           ApiFuture<InterconnectsGetDiagnosticsResponse> future =
               interconnectsClient.getDiagnosticsCallable().futureCall(request);
           // Do something.
           InterconnectsGetDiagnosticsResponse response = future.get();
         }
         
      • insertAsync

        public final com.google.api.gax.longrunning.OperationFuture<Operation,​Operation> insertAsync​(String project,
                                                                                                           Interconnect interconnectResource)
        Creates an Interconnect 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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
           String project = "project-309310695";
           Interconnect interconnectResource = Interconnect.newBuilder().build();
           Operation response = interconnectsClient.insertAsync(project, interconnectResource).get();
         }
         
        Parameters:
        project - Project ID for this request.
        interconnectResource - 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​(InsertInterconnectRequest request)
        Creates an Interconnect 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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
           InsertInterconnectRequest request =
               InsertInterconnectRequest.newBuilder()
                   .setInterconnectResource(Interconnect.newBuilder().build())
                   .setProject("project-309310695")
                   .setRequestId("requestId693933066")
                   .build();
           Operation response = interconnectsClient.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<InsertInterconnectRequest,​Operation,​Operation> insertOperationCallable()
        Creates an Interconnect 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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
           InsertInterconnectRequest request =
               InsertInterconnectRequest.newBuilder()
                   .setInterconnectResource(Interconnect.newBuilder().build())
                   .setProject("project-309310695")
                   .setRequestId("requestId693933066")
                   .build();
           OperationFuture<Operation, Operation> future =
               interconnectsClient.insertOperationCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • insertCallable

        public final com.google.api.gax.rpc.UnaryCallable<InsertInterconnectRequest,​Operation> insertCallable()
        Creates an Interconnect 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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
           InsertInterconnectRequest request =
               InsertInterconnectRequest.newBuilder()
                   .setInterconnectResource(Interconnect.newBuilder().build())
                   .setProject("project-309310695")
                   .setRequestId("requestId693933066")
                   .build();
           ApiFuture<Operation> future = interconnectsClient.insertCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • list

        public final InterconnectsClient.ListPagedResponse list​(String project)
        Retrieves the list of Interconnects 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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
           String project = "project-309310695";
           for (Interconnect element : interconnectsClient.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 InterconnectsClient.ListPagedResponse list​(ListInterconnectsRequest request)
        Retrieves the list of Interconnects 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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
           ListInterconnectsRequest request =
               ListInterconnectsRequest.newBuilder()
                   .setFilter("filter-1274492040")
                   .setMaxResults(1128457243)
                   .setOrderBy("orderBy-1207110587")
                   .setPageToken("pageToken873572522")
                   .setProject("project-309310695")
                   .setReturnPartialSuccess(true)
                   .build();
           for (Interconnect element : interconnectsClient.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<ListInterconnectsRequest,​InterconnectsClient.ListPagedResponse> listPagedCallable()
        Retrieves the list of Interconnects 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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
           ListInterconnectsRequest request =
               ListInterconnectsRequest.newBuilder()
                   .setFilter("filter-1274492040")
                   .setMaxResults(1128457243)
                   .setOrderBy("orderBy-1207110587")
                   .setPageToken("pageToken873572522")
                   .setProject("project-309310695")
                   .setReturnPartialSuccess(true)
                   .build();
           ApiFuture<Interconnect> future = interconnectsClient.listPagedCallable().futureCall(request);
           // Do something.
           for (Interconnect element : future.get().iterateAll()) {
             // doThingsWith(element);
           }
         }
         
      • listCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListInterconnectsRequest,​InterconnectList> listCallable()
        Retrieves the list of Interconnects 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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
           ListInterconnectsRequest request =
               ListInterconnectsRequest.newBuilder()
                   .setFilter("filter-1274492040")
                   .setMaxResults(1128457243)
                   .setOrderBy("orderBy-1207110587")
                   .setPageToken("pageToken873572522")
                   .setProject("project-309310695")
                   .setReturnPartialSuccess(true)
                   .build();
           while (true) {
             InterconnectList response = interconnectsClient.listCallable().call(request);
             for (Interconnect element : response.getItemsList()) {
               // doThingsWith(element);
             }
             String nextPageToken = response.getNextPageToken();
             if (!Strings.isNullOrEmpty(nextPageToken)) {
               request = request.toBuilder().setPageToken(nextPageToken).build();
             } else {
               break;
             }
           }
         }
         
      • patchAsync

        public final com.google.api.gax.longrunning.OperationFuture<Operation,​Operation> patchAsync​(String project,
                                                                                                          String interconnect,
                                                                                                          Interconnect interconnectResource)
        Updates the specified Interconnect with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.

        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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
           String project = "project-309310695";
           String interconnect = "interconnect-849140594";
           Interconnect interconnectResource = Interconnect.newBuilder().build();
           Operation response =
               interconnectsClient.patchAsync(project, interconnect, interconnectResource).get();
         }
         
        Parameters:
        project - Project ID for this request.
        interconnect - Name of the interconnect to update.
        interconnectResource - The body resource for this request
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • patchAsync

        @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> patchAsync​(PatchInterconnectRequest request)
        Updates the specified Interconnect with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.

        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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
           PatchInterconnectRequest request =
               PatchInterconnectRequest.newBuilder()
                   .setInterconnect("interconnect-849140594")
                   .setInterconnectResource(Interconnect.newBuilder().build())
                   .setProject("project-309310695")
                   .setRequestId("requestId693933066")
                   .build();
           Operation response = interconnectsClient.patchAsync(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
      • patchOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<PatchInterconnectRequest,​Operation,​Operation> patchOperationCallable()
        Updates the specified Interconnect with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.

        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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
           PatchInterconnectRequest request =
               PatchInterconnectRequest.newBuilder()
                   .setInterconnect("interconnect-849140594")
                   .setInterconnectResource(Interconnect.newBuilder().build())
                   .setProject("project-309310695")
                   .setRequestId("requestId693933066")
                   .build();
           OperationFuture<Operation, Operation> future =
               interconnectsClient.patchOperationCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • patchCallable

        public final com.google.api.gax.rpc.UnaryCallable<PatchInterconnectRequest,​Operation> patchCallable()
        Updates the specified Interconnect with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.

        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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
           PatchInterconnectRequest request =
               PatchInterconnectRequest.newBuilder()
                   .setInterconnect("interconnect-849140594")
                   .setInterconnectResource(Interconnect.newBuilder().build())
                   .setProject("project-309310695")
                   .setRequestId("requestId693933066")
                   .build();
           ApiFuture<Operation> future = interconnectsClient.patchCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • setLabelsAsync

        public final com.google.api.gax.longrunning.OperationFuture<Operation,​Operation> setLabelsAsync​(String project,
                                                                                                              String resource,
                                                                                                              GlobalSetLabelsRequest globalSetLabelsRequestResource)
        Sets the labels on an Interconnect. To learn more about labels, read the Labeling Resources documentation.

        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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
           String project = "project-309310695";
           String resource = "resource-341064690";
           GlobalSetLabelsRequest globalSetLabelsRequestResource =
               GlobalSetLabelsRequest.newBuilder().build();
           Operation response =
               interconnectsClient
                   .setLabelsAsync(project, resource, globalSetLabelsRequestResource)
                   .get();
         }
         
        Parameters:
        project - Project ID for this request.
        resource - Name or id of the resource for this request.
        globalSetLabelsRequestResource - The body resource for this request
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • setLabelsAsync

        @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> setLabelsAsync​(SetLabelsInterconnectRequest request)
        Sets the labels on an Interconnect. To learn more about labels, read the Labeling Resources documentation.

        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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
           SetLabelsInterconnectRequest request =
               SetLabelsInterconnectRequest.newBuilder()
                   .setGlobalSetLabelsRequestResource(GlobalSetLabelsRequest.newBuilder().build())
                   .setProject("project-309310695")
                   .setResource("resource-341064690")
                   .build();
           Operation response = interconnectsClient.setLabelsAsync(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
      • setLabelsOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<SetLabelsInterconnectRequest,​Operation,​Operation> setLabelsOperationCallable()
        Sets the labels on an Interconnect. To learn more about labels, read the Labeling Resources documentation.

        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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
           SetLabelsInterconnectRequest request =
               SetLabelsInterconnectRequest.newBuilder()
                   .setGlobalSetLabelsRequestResource(GlobalSetLabelsRequest.newBuilder().build())
                   .setProject("project-309310695")
                   .setResource("resource-341064690")
                   .build();
           OperationFuture<Operation, Operation> future =
               interconnectsClient.setLabelsOperationCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • setLabelsCallable

        public final com.google.api.gax.rpc.UnaryCallable<SetLabelsInterconnectRequest,​Operation> setLabelsCallable()
        Sets the labels on an Interconnect. To learn more about labels, read the Labeling Resources documentation.

        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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
           SetLabelsInterconnectRequest request =
               SetLabelsInterconnectRequest.newBuilder()
                   .setGlobalSetLabelsRequestResource(GlobalSetLabelsRequest.newBuilder().build())
                   .setProject("project-309310695")
                   .setResource("resource-341064690")
                   .build();
           ApiFuture<Operation> future = interconnectsClient.setLabelsCallable().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