Class CrossNetworkAutomationServiceClient

java.lang.Object
com.google.cloud.networkconnectivity.v1.CrossNetworkAutomationServiceClient
All Implemented Interfaces:
BackgroundResource, AutoCloseable

@Generated("by gapic-generator-java") public class CrossNetworkAutomationServiceClient extends Object implements BackgroundResource
Service Description: The service for CrossNetworkAutomation resources.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
     CrossNetworkAutomationServiceClient.create()) {
   ServiceConnectionMapName name =
       ServiceConnectionMapName.of("[PROJECT]", "[LOCATION]", "[SERVICE_CONNECTION_MAP]");
   ServiceConnectionMap response =
       crossNetworkAutomationServiceClient.getServiceConnectionMap(name);
 }
 

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

Methods
Method Description Method Variants

ListServiceConnectionMaps

Lists ServiceConnectionMaps in a given project and location.

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

  • listServiceConnectionMaps(ListServiceConnectionMapsRequest request)

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

  • listServiceConnectionMaps(LocationName parent)

  • listServiceConnectionMaps(String parent)

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

  • listServiceConnectionMapsPagedCallable()

  • listServiceConnectionMapsCallable()

GetServiceConnectionMap

Gets details of a single ServiceConnectionMap.

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

  • getServiceConnectionMap(GetServiceConnectionMapRequest request)

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

  • getServiceConnectionMap(ServiceConnectionMapName name)

  • getServiceConnectionMap(String name)

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

  • getServiceConnectionMapCallable()

CreateServiceConnectionMap

Creates a new ServiceConnectionMap in a given project and location.

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

  • createServiceConnectionMapAsync(CreateServiceConnectionMapRequest request)

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

  • createServiceConnectionMapAsync(LocationName parent, ServiceConnectionMap serviceConnectionMap, String serviceConnectionMapId)

  • createServiceConnectionMapAsync(String parent, ServiceConnectionMap serviceConnectionMap, String serviceConnectionMapId)

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

  • createServiceConnectionMapOperationCallable()

  • createServiceConnectionMapCallable()

UpdateServiceConnectionMap

Updates the parameters of a single ServiceConnectionMap.

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

  • updateServiceConnectionMapAsync(UpdateServiceConnectionMapRequest request)

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

  • updateServiceConnectionMapAsync(ServiceConnectionMap serviceConnectionMap, FieldMask updateMask)

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

  • updateServiceConnectionMapOperationCallable()

  • updateServiceConnectionMapCallable()

DeleteServiceConnectionMap

Deletes a single ServiceConnectionMap.

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

  • deleteServiceConnectionMapAsync(DeleteServiceConnectionMapRequest request)

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

  • deleteServiceConnectionMapAsync(ServiceConnectionMapName name)

  • deleteServiceConnectionMapAsync(String name)

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

  • deleteServiceConnectionMapOperationCallable()

  • deleteServiceConnectionMapCallable()

ListServiceConnectionPolicies

Lists ServiceConnectionPolicies in a given project and location.

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

  • listServiceConnectionPolicies(ListServiceConnectionPoliciesRequest request)

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

  • listServiceConnectionPolicies(LocationName parent)

  • listServiceConnectionPolicies(String parent)

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

  • listServiceConnectionPoliciesPagedCallable()

  • listServiceConnectionPoliciesCallable()

GetServiceConnectionPolicy

Gets details of a single ServiceConnectionPolicy.

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

  • getServiceConnectionPolicy(GetServiceConnectionPolicyRequest request)

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

  • getServiceConnectionPolicy(ServiceConnectionPolicyName name)

  • getServiceConnectionPolicy(String name)

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

  • getServiceConnectionPolicyCallable()

CreateServiceConnectionPolicy

Creates a new ServiceConnectionPolicy in a given project and location.

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

  • createServiceConnectionPolicyAsync(CreateServiceConnectionPolicyRequest request)

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

  • createServiceConnectionPolicyAsync(LocationName parent, ServiceConnectionPolicy serviceConnectionPolicy, String serviceConnectionPolicyId)

  • createServiceConnectionPolicyAsync(String parent, ServiceConnectionPolicy serviceConnectionPolicy, String serviceConnectionPolicyId)

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

  • createServiceConnectionPolicyOperationCallable()

  • createServiceConnectionPolicyCallable()

UpdateServiceConnectionPolicy

Updates the parameters of a single ServiceConnectionPolicy.

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

  • updateServiceConnectionPolicyAsync(UpdateServiceConnectionPolicyRequest request)

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

  • updateServiceConnectionPolicyAsync(ServiceConnectionPolicy serviceConnectionPolicy, FieldMask updateMask)

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

  • updateServiceConnectionPolicyOperationCallable()

  • updateServiceConnectionPolicyCallable()

DeleteServiceConnectionPolicy

Deletes a single ServiceConnectionPolicy.

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

  • deleteServiceConnectionPolicyAsync(DeleteServiceConnectionPolicyRequest request)

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

  • deleteServiceConnectionPolicyAsync(ServiceConnectionPolicyName name)

  • deleteServiceConnectionPolicyAsync(String name)

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

  • deleteServiceConnectionPolicyOperationCallable()

  • deleteServiceConnectionPolicyCallable()

ListServiceClasses

Lists ServiceClasses in a given project and location.

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

  • listServiceClasses(ListServiceClassesRequest request)

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

  • listServiceClasses(LocationName parent)

  • listServiceClasses(String parent)

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

  • listServiceClassesPagedCallable()

  • listServiceClassesCallable()

GetServiceClass

Gets details of a single ServiceClass.

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

  • getServiceClass(GetServiceClassRequest request)

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

  • getServiceClass(ServiceClassName name)

  • getServiceClass(String name)

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

  • getServiceClassCallable()

UpdateServiceClass

Updates the parameters of a single ServiceClass.

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

  • updateServiceClassAsync(UpdateServiceClassRequest request)

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

  • updateServiceClassAsync(ServiceClass serviceClass, FieldMask updateMask)

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

  • updateServiceClassOperationCallable()

  • updateServiceClassCallable()

DeleteServiceClass

Deletes a single ServiceClass.

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

  • deleteServiceClassAsync(DeleteServiceClassRequest request)

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

  • deleteServiceClassAsync(ServiceClassName name)

  • deleteServiceClassAsync(String name)

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

  • deleteServiceClassOperationCallable()

  • deleteServiceClassCallable()

GetServiceConnectionToken

Gets details of a single ServiceConnectionToken.

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

  • getServiceConnectionToken(GetServiceConnectionTokenRequest request)

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

  • getServiceConnectionToken(ServiceConnectionTokenName name)

  • getServiceConnectionToken(String name)

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

  • getServiceConnectionTokenCallable()

ListServiceConnectionTokens

Lists ServiceConnectionTokens in a given project and location.

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

  • listServiceConnectionTokens(ListServiceConnectionTokensRequest request)

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

  • listServiceConnectionTokens(LocationName parent)

  • listServiceConnectionTokens(String parent)

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

  • listServiceConnectionTokensPagedCallable()

  • listServiceConnectionTokensCallable()

CreateServiceConnectionToken

Creates a new ServiceConnectionToken in a given project and location.

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

  • createServiceConnectionTokenAsync(CreateServiceConnectionTokenRequest request)

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

  • createServiceConnectionTokenAsync(LocationName parent, ServiceConnectionToken serviceConnectionToken, String serviceConnectionTokenId)

  • createServiceConnectionTokenAsync(String parent, ServiceConnectionToken serviceConnectionToken, String serviceConnectionTokenId)

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

  • createServiceConnectionTokenOperationCallable()

  • createServiceConnectionTokenCallable()

DeleteServiceConnectionToken

Deletes a single ServiceConnectionToken.

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

  • deleteServiceConnectionTokenAsync(DeleteServiceConnectionTokenRequest request)

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

  • deleteServiceConnectionTokenAsync(ServiceConnectionTokenName name)

  • deleteServiceConnectionTokenAsync(String name)

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

  • deleteServiceConnectionTokenOperationCallable()

  • deleteServiceConnectionTokenCallable()

ListLocations

Lists information about the supported locations for this service.

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

  • listLocations(ListLocationsRequest request)

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

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Gets information about a location.

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

  • getLocation(GetLocationRequest request)

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

  • getLocationCallable()

SetIamPolicy

Sets the access control policy on the specified resource. Replacesany existing policy.

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

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

  • setIamPolicy(SetIamPolicyRequest request)

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

  • setIamPolicyCallable()

GetIamPolicy

Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

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

  • getIamPolicy(GetIamPolicyRequest request)

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

  • getIamPolicyCallable()

TestIamPermissions

Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.

Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

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

  • testIamPermissions(TestIamPermissionsRequest request)

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

  • testIamPermissionsCallable()

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 CrossNetworkAutomationServiceSettings 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
 CrossNetworkAutomationServiceSettings crossNetworkAutomationServiceSettings =
     CrossNetworkAutomationServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
     CrossNetworkAutomationServiceClient.create(crossNetworkAutomationServiceSettings);
 

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
 CrossNetworkAutomationServiceSettings crossNetworkAutomationServiceSettings =
     CrossNetworkAutomationServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
     CrossNetworkAutomationServiceClient.create(crossNetworkAutomationServiceSettings);
 

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

  • Constructor Details

    • CrossNetworkAutomationServiceClient

      protected CrossNetworkAutomationServiceClient(CrossNetworkAutomationServiceSettings settings) throws IOException
      Constructs an instance of CrossNetworkAutomationServiceClient, 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
    • CrossNetworkAutomationServiceClient

      protected CrossNetworkAutomationServiceClient(CrossNetworkAutomationServiceStub stub)
  • Method Details

    • create

      public static final CrossNetworkAutomationServiceClient create() throws IOException
      Constructs an instance of CrossNetworkAutomationServiceClient with default settings.
      Throws:
      IOException
    • create

      Constructs an instance of CrossNetworkAutomationServiceClient, 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

      Constructs an instance of CrossNetworkAutomationServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(CrossNetworkAutomationServiceSettings).
    • getSettings

      public final CrossNetworkAutomationServiceSettings getSettings()
    • getStub

    • getOperationsClient

      public final OperationsClient getOperationsClient()
      Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
    • listServiceConnectionMaps

      Lists ServiceConnectionMaps in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (ServiceConnectionMap element :
             crossNetworkAutomationServiceClient.listServiceConnectionMaps(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The parent resource's name. ex. projects/123/locations/us-east1
      Throws:
      ApiException - if the remote call fails
    • listServiceConnectionMaps

      Lists ServiceConnectionMaps in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (ServiceConnectionMap element :
             crossNetworkAutomationServiceClient.listServiceConnectionMaps(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The parent resource's name. ex. projects/123/locations/us-east1
      Throws:
      ApiException - if the remote call fails
    • listServiceConnectionMaps

      Lists ServiceConnectionMaps in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         ListServiceConnectionMapsRequest request =
             ListServiceConnectionMapsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (ServiceConnectionMap element :
             crossNetworkAutomationServiceClient.listServiceConnectionMaps(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listServiceConnectionMapsPagedCallable

      Lists ServiceConnectionMaps in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         ListServiceConnectionMapsRequest request =
             ListServiceConnectionMapsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<ServiceConnectionMap> future =
             crossNetworkAutomationServiceClient
                 .listServiceConnectionMapsPagedCallable()
                 .futureCall(request);
         // Do something.
         for (ServiceConnectionMap element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listServiceConnectionMapsCallable

      public final UnaryCallable<ListServiceConnectionMapsRequest,ListServiceConnectionMapsResponse> listServiceConnectionMapsCallable()
      Lists ServiceConnectionMaps in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         ListServiceConnectionMapsRequest request =
             ListServiceConnectionMapsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           ListServiceConnectionMapsResponse response =
               crossNetworkAutomationServiceClient.listServiceConnectionMapsCallable().call(request);
           for (ServiceConnectionMap element : response.getServiceConnectionMapsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getServiceConnectionMap

      public final ServiceConnectionMap getServiceConnectionMap(ServiceConnectionMapName name)
      Gets details of a single ServiceConnectionMap.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         ServiceConnectionMapName name =
             ServiceConnectionMapName.of("[PROJECT]", "[LOCATION]", "[SERVICE_CONNECTION_MAP]");
         ServiceConnectionMap response =
             crossNetworkAutomationServiceClient.getServiceConnectionMap(name);
       }
       
      Parameters:
      name - Required. Name of the ServiceConnectionMap to get.
      Throws:
      ApiException - if the remote call fails
    • getServiceConnectionMap

      public final ServiceConnectionMap getServiceConnectionMap(String name)
      Gets details of a single ServiceConnectionMap.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         String name =
             ServiceConnectionMapName.of("[PROJECT]", "[LOCATION]", "[SERVICE_CONNECTION_MAP]")
                 .toString();
         ServiceConnectionMap response =
             crossNetworkAutomationServiceClient.getServiceConnectionMap(name);
       }
       
      Parameters:
      name - Required. Name of the ServiceConnectionMap to get.
      Throws:
      ApiException - if the remote call fails
    • getServiceConnectionMap

      public final ServiceConnectionMap getServiceConnectionMap(GetServiceConnectionMapRequest request)
      Gets details of a single ServiceConnectionMap.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         GetServiceConnectionMapRequest request =
             GetServiceConnectionMapRequest.newBuilder()
                 .setName(
                     ServiceConnectionMapName.of("[PROJECT]", "[LOCATION]", "[SERVICE_CONNECTION_MAP]")
                         .toString())
                 .build();
         ServiceConnectionMap response =
             crossNetworkAutomationServiceClient.getServiceConnectionMap(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getServiceConnectionMapCallable

      public final UnaryCallable<GetServiceConnectionMapRequest,ServiceConnectionMap> getServiceConnectionMapCallable()
      Gets details of a single ServiceConnectionMap.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         GetServiceConnectionMapRequest request =
             GetServiceConnectionMapRequest.newBuilder()
                 .setName(
                     ServiceConnectionMapName.of("[PROJECT]", "[LOCATION]", "[SERVICE_CONNECTION_MAP]")
                         .toString())
                 .build();
         ApiFuture<ServiceConnectionMap> future =
             crossNetworkAutomationServiceClient.getServiceConnectionMapCallable().futureCall(request);
         // Do something.
         ServiceConnectionMap response = future.get();
       }
       
    • createServiceConnectionMapAsync

      public final OperationFuture<ServiceConnectionMap,OperationMetadata> createServiceConnectionMapAsync(LocationName parent, ServiceConnectionMap serviceConnectionMap, String serviceConnectionMapId)
      Creates a new ServiceConnectionMap in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         ServiceConnectionMap serviceConnectionMap = ServiceConnectionMap.newBuilder().build();
         String serviceConnectionMapId = "serviceConnectionMapId407176164";
         ServiceConnectionMap response =
             crossNetworkAutomationServiceClient
                 .createServiceConnectionMapAsync(parent, serviceConnectionMap, serviceConnectionMapId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent resource's name of the ServiceConnectionMap. ex. projects/123/locations/us-east1
      serviceConnectionMap - Required. Initial values for a new ServiceConnectionMaps
      serviceConnectionMapId - Optional. Resource ID (i.e. 'foo' in '[...]/projects/p/locations/l/serviceConnectionMaps/foo') See https://google.aip.dev/122#resource-id-segments Unique per location. If one is not provided, one will be generated.
      Throws:
      ApiException - if the remote call fails
    • createServiceConnectionMapAsync

      public final OperationFuture<ServiceConnectionMap,OperationMetadata> createServiceConnectionMapAsync(String parent, ServiceConnectionMap serviceConnectionMap, String serviceConnectionMapId)
      Creates a new ServiceConnectionMap in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         ServiceConnectionMap serviceConnectionMap = ServiceConnectionMap.newBuilder().build();
         String serviceConnectionMapId = "serviceConnectionMapId407176164";
         ServiceConnectionMap response =
             crossNetworkAutomationServiceClient
                 .createServiceConnectionMapAsync(parent, serviceConnectionMap, serviceConnectionMapId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent resource's name of the ServiceConnectionMap. ex. projects/123/locations/us-east1
      serviceConnectionMap - Required. Initial values for a new ServiceConnectionMaps
      serviceConnectionMapId - Optional. Resource ID (i.e. 'foo' in '[...]/projects/p/locations/l/serviceConnectionMaps/foo') See https://google.aip.dev/122#resource-id-segments Unique per location. If one is not provided, one will be generated.
      Throws:
      ApiException - if the remote call fails
    • createServiceConnectionMapAsync

      public final OperationFuture<ServiceConnectionMap,OperationMetadata> createServiceConnectionMapAsync(CreateServiceConnectionMapRequest request)
      Creates a new ServiceConnectionMap in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         CreateServiceConnectionMapRequest request =
             CreateServiceConnectionMapRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setServiceConnectionMapId("serviceConnectionMapId407176164")
                 .setServiceConnectionMap(ServiceConnectionMap.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ServiceConnectionMap response =
             crossNetworkAutomationServiceClient.createServiceConnectionMapAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createServiceConnectionMapOperationCallable

      public final OperationCallable<CreateServiceConnectionMapRequest,ServiceConnectionMap,OperationMetadata> createServiceConnectionMapOperationCallable()
      Creates a new ServiceConnectionMap in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         CreateServiceConnectionMapRequest request =
             CreateServiceConnectionMapRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setServiceConnectionMapId("serviceConnectionMapId407176164")
                 .setServiceConnectionMap(ServiceConnectionMap.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<ServiceConnectionMap, OperationMetadata> future =
             crossNetworkAutomationServiceClient
                 .createServiceConnectionMapOperationCallable()
                 .futureCall(request);
         // Do something.
         ServiceConnectionMap response = future.get();
       }
       
    • createServiceConnectionMapCallable

      public final UnaryCallable<CreateServiceConnectionMapRequest,Operation> createServiceConnectionMapCallable()
      Creates a new ServiceConnectionMap in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         CreateServiceConnectionMapRequest request =
             CreateServiceConnectionMapRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setServiceConnectionMapId("serviceConnectionMapId407176164")
                 .setServiceConnectionMap(ServiceConnectionMap.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             crossNetworkAutomationServiceClient
                 .createServiceConnectionMapCallable()
                 .futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • updateServiceConnectionMapAsync

      public final OperationFuture<ServiceConnectionMap,OperationMetadata> updateServiceConnectionMapAsync(ServiceConnectionMap serviceConnectionMap, com.google.protobuf.FieldMask updateMask)
      Updates the parameters of a single ServiceConnectionMap.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         ServiceConnectionMap serviceConnectionMap = ServiceConnectionMap.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         ServiceConnectionMap response =
             crossNetworkAutomationServiceClient
                 .updateServiceConnectionMapAsync(serviceConnectionMap, updateMask)
                 .get();
       }
       
      Parameters:
      serviceConnectionMap - Required. New values to be patched into the resource.
      updateMask - Optional. Field mask is used to specify the fields to be overwritten in the ServiceConnectionMap resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.
      Throws:
      ApiException - if the remote call fails
    • updateServiceConnectionMapAsync

      public final OperationFuture<ServiceConnectionMap,OperationMetadata> updateServiceConnectionMapAsync(UpdateServiceConnectionMapRequest request)
      Updates the parameters of a single ServiceConnectionMap.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         UpdateServiceConnectionMapRequest request =
             UpdateServiceConnectionMapRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setServiceConnectionMap(ServiceConnectionMap.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ServiceConnectionMap response =
             crossNetworkAutomationServiceClient.updateServiceConnectionMapAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateServiceConnectionMapOperationCallable

      public final OperationCallable<UpdateServiceConnectionMapRequest,ServiceConnectionMap,OperationMetadata> updateServiceConnectionMapOperationCallable()
      Updates the parameters of a single ServiceConnectionMap.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         UpdateServiceConnectionMapRequest request =
             UpdateServiceConnectionMapRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setServiceConnectionMap(ServiceConnectionMap.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<ServiceConnectionMap, OperationMetadata> future =
             crossNetworkAutomationServiceClient
                 .updateServiceConnectionMapOperationCallable()
                 .futureCall(request);
         // Do something.
         ServiceConnectionMap response = future.get();
       }
       
    • updateServiceConnectionMapCallable

      public final UnaryCallable<UpdateServiceConnectionMapRequest,Operation> updateServiceConnectionMapCallable()
      Updates the parameters of a single ServiceConnectionMap.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         UpdateServiceConnectionMapRequest request =
             UpdateServiceConnectionMapRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setServiceConnectionMap(ServiceConnectionMap.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             crossNetworkAutomationServiceClient
                 .updateServiceConnectionMapCallable()
                 .futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • deleteServiceConnectionMapAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceConnectionMapAsync(ServiceConnectionMapName name)
      Deletes a single ServiceConnectionMap.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         ServiceConnectionMapName name =
             ServiceConnectionMapName.of("[PROJECT]", "[LOCATION]", "[SERVICE_CONNECTION_MAP]");
         crossNetworkAutomationServiceClient.deleteServiceConnectionMapAsync(name).get();
       }
       
      Parameters:
      name - Required. The name of the ServiceConnectionMap to delete.
      Throws:
      ApiException - if the remote call fails
    • deleteServiceConnectionMapAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceConnectionMapAsync(String name)
      Deletes a single ServiceConnectionMap.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         String name =
             ServiceConnectionMapName.of("[PROJECT]", "[LOCATION]", "[SERVICE_CONNECTION_MAP]")
                 .toString();
         crossNetworkAutomationServiceClient.deleteServiceConnectionMapAsync(name).get();
       }
       
      Parameters:
      name - Required. The name of the ServiceConnectionMap to delete.
      Throws:
      ApiException - if the remote call fails
    • deleteServiceConnectionMapAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceConnectionMapAsync(DeleteServiceConnectionMapRequest request)
      Deletes a single ServiceConnectionMap.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         DeleteServiceConnectionMapRequest request =
             DeleteServiceConnectionMapRequest.newBuilder()
                 .setName(
                     ServiceConnectionMapName.of("[PROJECT]", "[LOCATION]", "[SERVICE_CONNECTION_MAP]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .setEtag("etag3123477")
                 .build();
         crossNetworkAutomationServiceClient.deleteServiceConnectionMapAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteServiceConnectionMapOperationCallable

      public final OperationCallable<DeleteServiceConnectionMapRequest,com.google.protobuf.Empty,OperationMetadata> deleteServiceConnectionMapOperationCallable()
      Deletes a single ServiceConnectionMap.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         DeleteServiceConnectionMapRequest request =
             DeleteServiceConnectionMapRequest.newBuilder()
                 .setName(
                     ServiceConnectionMapName.of("[PROJECT]", "[LOCATION]", "[SERVICE_CONNECTION_MAP]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .setEtag("etag3123477")
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             crossNetworkAutomationServiceClient
                 .deleteServiceConnectionMapOperationCallable()
                 .futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteServiceConnectionMapCallable

      public final UnaryCallable<DeleteServiceConnectionMapRequest,Operation> deleteServiceConnectionMapCallable()
      Deletes a single ServiceConnectionMap.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         DeleteServiceConnectionMapRequest request =
             DeleteServiceConnectionMapRequest.newBuilder()
                 .setName(
                     ServiceConnectionMapName.of("[PROJECT]", "[LOCATION]", "[SERVICE_CONNECTION_MAP]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .setEtag("etag3123477")
                 .build();
         ApiFuture<Operation> future =
             crossNetworkAutomationServiceClient
                 .deleteServiceConnectionMapCallable()
                 .futureCall(request);
         // Do something.
         future.get();
       }
       
    • listServiceConnectionPolicies

      Lists ServiceConnectionPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (ServiceConnectionPolicy element :
             crossNetworkAutomationServiceClient.listServiceConnectionPolicies(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The parent resource's name. ex. projects/123/locations/us-east1
      Throws:
      ApiException - if the remote call fails
    • listServiceConnectionPolicies

      Lists ServiceConnectionPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (ServiceConnectionPolicy element :
             crossNetworkAutomationServiceClient.listServiceConnectionPolicies(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The parent resource's name. ex. projects/123/locations/us-east1
      Throws:
      ApiException - if the remote call fails
    • listServiceConnectionPolicies

      Lists ServiceConnectionPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         ListServiceConnectionPoliciesRequest request =
             ListServiceConnectionPoliciesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (ServiceConnectionPolicy element :
             crossNetworkAutomationServiceClient.listServiceConnectionPolicies(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listServiceConnectionPoliciesPagedCallable

      Lists ServiceConnectionPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         ListServiceConnectionPoliciesRequest request =
             ListServiceConnectionPoliciesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<ServiceConnectionPolicy> future =
             crossNetworkAutomationServiceClient
                 .listServiceConnectionPoliciesPagedCallable()
                 .futureCall(request);
         // Do something.
         for (ServiceConnectionPolicy element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listServiceConnectionPoliciesCallable

      public final UnaryCallable<ListServiceConnectionPoliciesRequest,ListServiceConnectionPoliciesResponse> listServiceConnectionPoliciesCallable()
      Lists ServiceConnectionPolicies in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         ListServiceConnectionPoliciesRequest request =
             ListServiceConnectionPoliciesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           ListServiceConnectionPoliciesResponse response =
               crossNetworkAutomationServiceClient
                   .listServiceConnectionPoliciesCallable()
                   .call(request);
           for (ServiceConnectionPolicy element : response.getServiceConnectionPoliciesList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getServiceConnectionPolicy

      public final ServiceConnectionPolicy getServiceConnectionPolicy(ServiceConnectionPolicyName name)
      Gets details of a single ServiceConnectionPolicy.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         ServiceConnectionPolicyName name =
             ServiceConnectionPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVICE_CONNECTION_POLICY]");
         ServiceConnectionPolicy response =
             crossNetworkAutomationServiceClient.getServiceConnectionPolicy(name);
       }
       
      Parameters:
      name - Required. Name of the ServiceConnectionPolicy to get.
      Throws:
      ApiException - if the remote call fails
    • getServiceConnectionPolicy

      public final ServiceConnectionPolicy getServiceConnectionPolicy(String name)
      Gets details of a single ServiceConnectionPolicy.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         String name =
             ServiceConnectionPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVICE_CONNECTION_POLICY]")
                 .toString();
         ServiceConnectionPolicy response =
             crossNetworkAutomationServiceClient.getServiceConnectionPolicy(name);
       }
       
      Parameters:
      name - Required. Name of the ServiceConnectionPolicy to get.
      Throws:
      ApiException - if the remote call fails
    • getServiceConnectionPolicy

      public final ServiceConnectionPolicy getServiceConnectionPolicy(GetServiceConnectionPolicyRequest request)
      Gets details of a single ServiceConnectionPolicy.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         GetServiceConnectionPolicyRequest request =
             GetServiceConnectionPolicyRequest.newBuilder()
                 .setName(
                     ServiceConnectionPolicyName.of(
                             "[PROJECT]", "[LOCATION]", "[SERVICE_CONNECTION_POLICY]")
                         .toString())
                 .build();
         ServiceConnectionPolicy response =
             crossNetworkAutomationServiceClient.getServiceConnectionPolicy(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getServiceConnectionPolicyCallable

      public final UnaryCallable<GetServiceConnectionPolicyRequest,ServiceConnectionPolicy> getServiceConnectionPolicyCallable()
      Gets details of a single ServiceConnectionPolicy.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         GetServiceConnectionPolicyRequest request =
             GetServiceConnectionPolicyRequest.newBuilder()
                 .setName(
                     ServiceConnectionPolicyName.of(
                             "[PROJECT]", "[LOCATION]", "[SERVICE_CONNECTION_POLICY]")
                         .toString())
                 .build();
         ApiFuture<ServiceConnectionPolicy> future =
             crossNetworkAutomationServiceClient
                 .getServiceConnectionPolicyCallable()
                 .futureCall(request);
         // Do something.
         ServiceConnectionPolicy response = future.get();
       }
       
    • createServiceConnectionPolicyAsync

      public final OperationFuture<ServiceConnectionPolicy,OperationMetadata> createServiceConnectionPolicyAsync(LocationName parent, ServiceConnectionPolicy serviceConnectionPolicy, String serviceConnectionPolicyId)
      Creates a new ServiceConnectionPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         ServiceConnectionPolicy serviceConnectionPolicy =
             ServiceConnectionPolicy.newBuilder().build();
         String serviceConnectionPolicyId = "serviceConnectionPolicyId1586196096";
         ServiceConnectionPolicy response =
             crossNetworkAutomationServiceClient
                 .createServiceConnectionPolicyAsync(
                     parent, serviceConnectionPolicy, serviceConnectionPolicyId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent resource's name of the ServiceConnectionPolicy. ex. projects/123/locations/us-east1
      serviceConnectionPolicy - Required. Initial values for a new ServiceConnectionPolicies
      serviceConnectionPolicyId - Optional. Resource ID (i.e. 'foo' in '[...]/projects/p/locations/l/serviceConnectionPolicies/foo') See https://google.aip.dev/122#resource-id-segments Unique per location.
      Throws:
      ApiException - if the remote call fails
    • createServiceConnectionPolicyAsync

      public final OperationFuture<ServiceConnectionPolicy,OperationMetadata> createServiceConnectionPolicyAsync(String parent, ServiceConnectionPolicy serviceConnectionPolicy, String serviceConnectionPolicyId)
      Creates a new ServiceConnectionPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         ServiceConnectionPolicy serviceConnectionPolicy =
             ServiceConnectionPolicy.newBuilder().build();
         String serviceConnectionPolicyId = "serviceConnectionPolicyId1586196096";
         ServiceConnectionPolicy response =
             crossNetworkAutomationServiceClient
                 .createServiceConnectionPolicyAsync(
                     parent, serviceConnectionPolicy, serviceConnectionPolicyId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent resource's name of the ServiceConnectionPolicy. ex. projects/123/locations/us-east1
      serviceConnectionPolicy - Required. Initial values for a new ServiceConnectionPolicies
      serviceConnectionPolicyId - Optional. Resource ID (i.e. 'foo' in '[...]/projects/p/locations/l/serviceConnectionPolicies/foo') See https://google.aip.dev/122#resource-id-segments Unique per location.
      Throws:
      ApiException - if the remote call fails
    • createServiceConnectionPolicyAsync

      public final OperationFuture<ServiceConnectionPolicy,OperationMetadata> createServiceConnectionPolicyAsync(CreateServiceConnectionPolicyRequest request)
      Creates a new ServiceConnectionPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         CreateServiceConnectionPolicyRequest request =
             CreateServiceConnectionPolicyRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setServiceConnectionPolicyId("serviceConnectionPolicyId1586196096")
                 .setServiceConnectionPolicy(ServiceConnectionPolicy.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ServiceConnectionPolicy response =
             crossNetworkAutomationServiceClient.createServiceConnectionPolicyAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createServiceConnectionPolicyOperationCallable

      public final OperationCallable<CreateServiceConnectionPolicyRequest,ServiceConnectionPolicy,OperationMetadata> createServiceConnectionPolicyOperationCallable()
      Creates a new ServiceConnectionPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         CreateServiceConnectionPolicyRequest request =
             CreateServiceConnectionPolicyRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setServiceConnectionPolicyId("serviceConnectionPolicyId1586196096")
                 .setServiceConnectionPolicy(ServiceConnectionPolicy.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<ServiceConnectionPolicy, OperationMetadata> future =
             crossNetworkAutomationServiceClient
                 .createServiceConnectionPolicyOperationCallable()
                 .futureCall(request);
         // Do something.
         ServiceConnectionPolicy response = future.get();
       }
       
    • createServiceConnectionPolicyCallable

      public final UnaryCallable<CreateServiceConnectionPolicyRequest,Operation> createServiceConnectionPolicyCallable()
      Creates a new ServiceConnectionPolicy in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         CreateServiceConnectionPolicyRequest request =
             CreateServiceConnectionPolicyRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setServiceConnectionPolicyId("serviceConnectionPolicyId1586196096")
                 .setServiceConnectionPolicy(ServiceConnectionPolicy.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             crossNetworkAutomationServiceClient
                 .createServiceConnectionPolicyCallable()
                 .futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • updateServiceConnectionPolicyAsync

      public final OperationFuture<ServiceConnectionPolicy,OperationMetadata> updateServiceConnectionPolicyAsync(ServiceConnectionPolicy serviceConnectionPolicy, com.google.protobuf.FieldMask updateMask)
      Updates the parameters of a single ServiceConnectionPolicy.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         ServiceConnectionPolicy serviceConnectionPolicy =
             ServiceConnectionPolicy.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         ServiceConnectionPolicy response =
             crossNetworkAutomationServiceClient
                 .updateServiceConnectionPolicyAsync(serviceConnectionPolicy, updateMask)
                 .get();
       }
       
      Parameters:
      serviceConnectionPolicy - Required. New values to be patched into the resource.
      updateMask - Optional. Field mask is used to specify the fields to be overwritten in the ServiceConnectionPolicy resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.
      Throws:
      ApiException - if the remote call fails
    • updateServiceConnectionPolicyAsync

      public final OperationFuture<ServiceConnectionPolicy,OperationMetadata> updateServiceConnectionPolicyAsync(UpdateServiceConnectionPolicyRequest request)
      Updates the parameters of a single ServiceConnectionPolicy.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         UpdateServiceConnectionPolicyRequest request =
             UpdateServiceConnectionPolicyRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setServiceConnectionPolicy(ServiceConnectionPolicy.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ServiceConnectionPolicy response =
             crossNetworkAutomationServiceClient.updateServiceConnectionPolicyAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateServiceConnectionPolicyOperationCallable

      public final OperationCallable<UpdateServiceConnectionPolicyRequest,ServiceConnectionPolicy,OperationMetadata> updateServiceConnectionPolicyOperationCallable()
      Updates the parameters of a single ServiceConnectionPolicy.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         UpdateServiceConnectionPolicyRequest request =
             UpdateServiceConnectionPolicyRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setServiceConnectionPolicy(ServiceConnectionPolicy.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<ServiceConnectionPolicy, OperationMetadata> future =
             crossNetworkAutomationServiceClient
                 .updateServiceConnectionPolicyOperationCallable()
                 .futureCall(request);
         // Do something.
         ServiceConnectionPolicy response = future.get();
       }
       
    • updateServiceConnectionPolicyCallable

      public final UnaryCallable<UpdateServiceConnectionPolicyRequest,Operation> updateServiceConnectionPolicyCallable()
      Updates the parameters of a single ServiceConnectionPolicy.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         UpdateServiceConnectionPolicyRequest request =
             UpdateServiceConnectionPolicyRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setServiceConnectionPolicy(ServiceConnectionPolicy.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             crossNetworkAutomationServiceClient
                 .updateServiceConnectionPolicyCallable()
                 .futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • deleteServiceConnectionPolicyAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceConnectionPolicyAsync(ServiceConnectionPolicyName name)
      Deletes a single ServiceConnectionPolicy.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         ServiceConnectionPolicyName name =
             ServiceConnectionPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVICE_CONNECTION_POLICY]");
         crossNetworkAutomationServiceClient.deleteServiceConnectionPolicyAsync(name).get();
       }
       
      Parameters:
      name - Required. The name of the ServiceConnectionPolicy to delete.
      Throws:
      ApiException - if the remote call fails
    • deleteServiceConnectionPolicyAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceConnectionPolicyAsync(String name)
      Deletes a single ServiceConnectionPolicy.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         String name =
             ServiceConnectionPolicyName.of("[PROJECT]", "[LOCATION]", "[SERVICE_CONNECTION_POLICY]")
                 .toString();
         crossNetworkAutomationServiceClient.deleteServiceConnectionPolicyAsync(name).get();
       }
       
      Parameters:
      name - Required. The name of the ServiceConnectionPolicy to delete.
      Throws:
      ApiException - if the remote call fails
    • deleteServiceConnectionPolicyAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceConnectionPolicyAsync(DeleteServiceConnectionPolicyRequest request)
      Deletes a single ServiceConnectionPolicy.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         DeleteServiceConnectionPolicyRequest request =
             DeleteServiceConnectionPolicyRequest.newBuilder()
                 .setName(
                     ServiceConnectionPolicyName.of(
                             "[PROJECT]", "[LOCATION]", "[SERVICE_CONNECTION_POLICY]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .setEtag("etag3123477")
                 .build();
         crossNetworkAutomationServiceClient.deleteServiceConnectionPolicyAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteServiceConnectionPolicyOperationCallable

      public final OperationCallable<DeleteServiceConnectionPolicyRequest,com.google.protobuf.Empty,OperationMetadata> deleteServiceConnectionPolicyOperationCallable()
      Deletes a single ServiceConnectionPolicy.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         DeleteServiceConnectionPolicyRequest request =
             DeleteServiceConnectionPolicyRequest.newBuilder()
                 .setName(
                     ServiceConnectionPolicyName.of(
                             "[PROJECT]", "[LOCATION]", "[SERVICE_CONNECTION_POLICY]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .setEtag("etag3123477")
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             crossNetworkAutomationServiceClient
                 .deleteServiceConnectionPolicyOperationCallable()
                 .futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteServiceConnectionPolicyCallable

      public final UnaryCallable<DeleteServiceConnectionPolicyRequest,Operation> deleteServiceConnectionPolicyCallable()
      Deletes a single ServiceConnectionPolicy.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         DeleteServiceConnectionPolicyRequest request =
             DeleteServiceConnectionPolicyRequest.newBuilder()
                 .setName(
                     ServiceConnectionPolicyName.of(
                             "[PROJECT]", "[LOCATION]", "[SERVICE_CONNECTION_POLICY]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .setEtag("etag3123477")
                 .build();
         ApiFuture<Operation> future =
             crossNetworkAutomationServiceClient
                 .deleteServiceConnectionPolicyCallable()
                 .futureCall(request);
         // Do something.
         future.get();
       }
       
    • listServiceClasses

      Lists ServiceClasses in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (ServiceClass element :
             crossNetworkAutomationServiceClient.listServiceClasses(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The parent resource's name. ex. projects/123/locations/us-east1
      Throws:
      ApiException - if the remote call fails
    • listServiceClasses

      Lists ServiceClasses in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (ServiceClass element :
             crossNetworkAutomationServiceClient.listServiceClasses(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The parent resource's name. ex. projects/123/locations/us-east1
      Throws:
      ApiException - if the remote call fails
    • listServiceClasses

      Lists ServiceClasses in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         ListServiceClassesRequest request =
             ListServiceClassesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (ServiceClass element :
             crossNetworkAutomationServiceClient.listServiceClasses(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listServiceClassesPagedCallable

      Lists ServiceClasses in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         ListServiceClassesRequest request =
             ListServiceClassesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<ServiceClass> future =
             crossNetworkAutomationServiceClient.listServiceClassesPagedCallable().futureCall(request);
         // Do something.
         for (ServiceClass element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listServiceClassesCallable

      public final UnaryCallable<ListServiceClassesRequest,ListServiceClassesResponse> listServiceClassesCallable()
      Lists ServiceClasses in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         ListServiceClassesRequest request =
             ListServiceClassesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           ListServiceClassesResponse response =
               crossNetworkAutomationServiceClient.listServiceClassesCallable().call(request);
           for (ServiceClass element : response.getServiceClassesList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getServiceClass

      public final ServiceClass getServiceClass(ServiceClassName name)
      Gets details of a single ServiceClass.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         ServiceClassName name = ServiceClassName.of("[PROJECT]", "[LOCATION]", "[SERVICE_CLASS]");
         ServiceClass response = crossNetworkAutomationServiceClient.getServiceClass(name);
       }
       
      Parameters:
      name - Required. Name of the ServiceClass to get.
      Throws:
      ApiException - if the remote call fails
    • getServiceClass

      public final ServiceClass getServiceClass(String name)
      Gets details of a single ServiceClass.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         String name = ServiceClassName.of("[PROJECT]", "[LOCATION]", "[SERVICE_CLASS]").toString();
         ServiceClass response = crossNetworkAutomationServiceClient.getServiceClass(name);
       }
       
      Parameters:
      name - Required. Name of the ServiceClass to get.
      Throws:
      ApiException - if the remote call fails
    • getServiceClass

      public final ServiceClass getServiceClass(GetServiceClassRequest request)
      Gets details of a single ServiceClass.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         GetServiceClassRequest request =
             GetServiceClassRequest.newBuilder()
                 .setName(ServiceClassName.of("[PROJECT]", "[LOCATION]", "[SERVICE_CLASS]").toString())
                 .build();
         ServiceClass response = crossNetworkAutomationServiceClient.getServiceClass(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getServiceClassCallable

      public final UnaryCallable<GetServiceClassRequest,ServiceClass> getServiceClassCallable()
      Gets details of a single ServiceClass.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         GetServiceClassRequest request =
             GetServiceClassRequest.newBuilder()
                 .setName(ServiceClassName.of("[PROJECT]", "[LOCATION]", "[SERVICE_CLASS]").toString())
                 .build();
         ApiFuture<ServiceClass> future =
             crossNetworkAutomationServiceClient.getServiceClassCallable().futureCall(request);
         // Do something.
         ServiceClass response = future.get();
       }
       
    • updateServiceClassAsync

      public final OperationFuture<ServiceClass,OperationMetadata> updateServiceClassAsync(ServiceClass serviceClass, com.google.protobuf.FieldMask updateMask)
      Updates the parameters of a single ServiceClass.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         ServiceClass serviceClass = ServiceClass.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         ServiceClass response =
             crossNetworkAutomationServiceClient
                 .updateServiceClassAsync(serviceClass, updateMask)
                 .get();
       }
       
      Parameters:
      serviceClass - Required. New values to be patched into the resource.
      updateMask - Optional. Field mask is used to specify the fields to be overwritten in the ServiceClass resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.
      Throws:
      ApiException - if the remote call fails
    • updateServiceClassAsync

      public final OperationFuture<ServiceClass,OperationMetadata> updateServiceClassAsync(UpdateServiceClassRequest request)
      Updates the parameters of a single ServiceClass.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         UpdateServiceClassRequest request =
             UpdateServiceClassRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setServiceClass(ServiceClass.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ServiceClass response =
             crossNetworkAutomationServiceClient.updateServiceClassAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateServiceClassOperationCallable

      public final OperationCallable<UpdateServiceClassRequest,ServiceClass,OperationMetadata> updateServiceClassOperationCallable()
      Updates the parameters of a single ServiceClass.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         UpdateServiceClassRequest request =
             UpdateServiceClassRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setServiceClass(ServiceClass.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<ServiceClass, OperationMetadata> future =
             crossNetworkAutomationServiceClient
                 .updateServiceClassOperationCallable()
                 .futureCall(request);
         // Do something.
         ServiceClass response = future.get();
       }
       
    • updateServiceClassCallable

      public final UnaryCallable<UpdateServiceClassRequest,Operation> updateServiceClassCallable()
      Updates the parameters of a single ServiceClass.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         UpdateServiceClassRequest request =
             UpdateServiceClassRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setServiceClass(ServiceClass.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             crossNetworkAutomationServiceClient.updateServiceClassCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • deleteServiceClassAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceClassAsync(ServiceClassName name)
      Deletes a single ServiceClass.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         ServiceClassName name = ServiceClassName.of("[PROJECT]", "[LOCATION]", "[SERVICE_CLASS]");
         crossNetworkAutomationServiceClient.deleteServiceClassAsync(name).get();
       }
       
      Parameters:
      name - Required. The name of the ServiceClass to delete.
      Throws:
      ApiException - if the remote call fails
    • deleteServiceClassAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceClassAsync(String name)
      Deletes a single ServiceClass.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         String name = ServiceClassName.of("[PROJECT]", "[LOCATION]", "[SERVICE_CLASS]").toString();
         crossNetworkAutomationServiceClient.deleteServiceClassAsync(name).get();
       }
       
      Parameters:
      name - Required. The name of the ServiceClass to delete.
      Throws:
      ApiException - if the remote call fails
    • deleteServiceClassAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceClassAsync(DeleteServiceClassRequest request)
      Deletes a single ServiceClass.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         DeleteServiceClassRequest request =
             DeleteServiceClassRequest.newBuilder()
                 .setName(ServiceClassName.of("[PROJECT]", "[LOCATION]", "[SERVICE_CLASS]").toString())
                 .setRequestId("requestId693933066")
                 .setEtag("etag3123477")
                 .build();
         crossNetworkAutomationServiceClient.deleteServiceClassAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteServiceClassOperationCallable

      public final OperationCallable<DeleteServiceClassRequest,com.google.protobuf.Empty,OperationMetadata> deleteServiceClassOperationCallable()
      Deletes a single ServiceClass.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         DeleteServiceClassRequest request =
             DeleteServiceClassRequest.newBuilder()
                 .setName(ServiceClassName.of("[PROJECT]", "[LOCATION]", "[SERVICE_CLASS]").toString())
                 .setRequestId("requestId693933066")
                 .setEtag("etag3123477")
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             crossNetworkAutomationServiceClient
                 .deleteServiceClassOperationCallable()
                 .futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteServiceClassCallable

      public final UnaryCallable<DeleteServiceClassRequest,Operation> deleteServiceClassCallable()
      Deletes a single ServiceClass.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         DeleteServiceClassRequest request =
             DeleteServiceClassRequest.newBuilder()
                 .setName(ServiceClassName.of("[PROJECT]", "[LOCATION]", "[SERVICE_CLASS]").toString())
                 .setRequestId("requestId693933066")
                 .setEtag("etag3123477")
                 .build();
         ApiFuture<Operation> future =
             crossNetworkAutomationServiceClient.deleteServiceClassCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • getServiceConnectionToken

      public final ServiceConnectionToken getServiceConnectionToken(ServiceConnectionTokenName name)
      Gets details of a single ServiceConnectionToken.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         ServiceConnectionTokenName name =
             ServiceConnectionTokenName.of("[PROJECT]", "[LOCATION]", "[SERVICE_CONNECTION_TOKEN]");
         ServiceConnectionToken response =
             crossNetworkAutomationServiceClient.getServiceConnectionToken(name);
       }
       
      Parameters:
      name - Required. Name of the ServiceConnectionToken to get.
      Throws:
      ApiException - if the remote call fails
    • getServiceConnectionToken

      public final ServiceConnectionToken getServiceConnectionToken(String name)
      Gets details of a single ServiceConnectionToken.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         String name =
             ServiceConnectionTokenName.of("[PROJECT]", "[LOCATION]", "[SERVICE_CONNECTION_TOKEN]")
                 .toString();
         ServiceConnectionToken response =
             crossNetworkAutomationServiceClient.getServiceConnectionToken(name);
       }
       
      Parameters:
      name - Required. Name of the ServiceConnectionToken to get.
      Throws:
      ApiException - if the remote call fails
    • getServiceConnectionToken

      public final ServiceConnectionToken getServiceConnectionToken(GetServiceConnectionTokenRequest request)
      Gets details of a single ServiceConnectionToken.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         GetServiceConnectionTokenRequest request =
             GetServiceConnectionTokenRequest.newBuilder()
                 .setName(
                     ServiceConnectionTokenName.of(
                             "[PROJECT]", "[LOCATION]", "[SERVICE_CONNECTION_TOKEN]")
                         .toString())
                 .build();
         ServiceConnectionToken response =
             crossNetworkAutomationServiceClient.getServiceConnectionToken(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getServiceConnectionTokenCallable

      public final UnaryCallable<GetServiceConnectionTokenRequest,ServiceConnectionToken> getServiceConnectionTokenCallable()
      Gets details of a single ServiceConnectionToken.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         GetServiceConnectionTokenRequest request =
             GetServiceConnectionTokenRequest.newBuilder()
                 .setName(
                     ServiceConnectionTokenName.of(
                             "[PROJECT]", "[LOCATION]", "[SERVICE_CONNECTION_TOKEN]")
                         .toString())
                 .build();
         ApiFuture<ServiceConnectionToken> future =
             crossNetworkAutomationServiceClient
                 .getServiceConnectionTokenCallable()
                 .futureCall(request);
         // Do something.
         ServiceConnectionToken response = future.get();
       }
       
    • listServiceConnectionTokens

      Lists ServiceConnectionTokens in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (ServiceConnectionToken element :
             crossNetworkAutomationServiceClient.listServiceConnectionTokens(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The parent resource's name. ex. projects/123/locations/us-east1
      Throws:
      ApiException - if the remote call fails
    • listServiceConnectionTokens

      Lists ServiceConnectionTokens in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (ServiceConnectionToken element :
             crossNetworkAutomationServiceClient.listServiceConnectionTokens(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The parent resource's name. ex. projects/123/locations/us-east1
      Throws:
      ApiException - if the remote call fails
    • listServiceConnectionTokens

      Lists ServiceConnectionTokens in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         ListServiceConnectionTokensRequest request =
             ListServiceConnectionTokensRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (ServiceConnectionToken element :
             crossNetworkAutomationServiceClient.listServiceConnectionTokens(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listServiceConnectionTokensPagedCallable

      Lists ServiceConnectionTokens in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         ListServiceConnectionTokensRequest request =
             ListServiceConnectionTokensRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<ServiceConnectionToken> future =
             crossNetworkAutomationServiceClient
                 .listServiceConnectionTokensPagedCallable()
                 .futureCall(request);
         // Do something.
         for (ServiceConnectionToken element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listServiceConnectionTokensCallable

      public final UnaryCallable<ListServiceConnectionTokensRequest,ListServiceConnectionTokensResponse> listServiceConnectionTokensCallable()
      Lists ServiceConnectionTokens in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         ListServiceConnectionTokensRequest request =
             ListServiceConnectionTokensRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           ListServiceConnectionTokensResponse response =
               crossNetworkAutomationServiceClient.listServiceConnectionTokensCallable().call(request);
           for (ServiceConnectionToken element : response.getServiceConnectionTokensList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • createServiceConnectionTokenAsync

      public final OperationFuture<ServiceConnectionToken,OperationMetadata> createServiceConnectionTokenAsync(LocationName parent, ServiceConnectionToken serviceConnectionToken, String serviceConnectionTokenId)
      Creates a new ServiceConnectionToken in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         ServiceConnectionToken serviceConnectionToken = ServiceConnectionToken.newBuilder().build();
         String serviceConnectionTokenId = "serviceConnectionTokenId-1526102527";
         ServiceConnectionToken response =
             crossNetworkAutomationServiceClient
                 .createServiceConnectionTokenAsync(
                     parent, serviceConnectionToken, serviceConnectionTokenId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent resource's name of the ServiceConnectionToken. ex. projects/123/locations/us-east1
      serviceConnectionToken - Required. Initial values for a new ServiceConnectionTokens
      serviceConnectionTokenId - Optional. Resource ID (i.e. 'foo' in '[...]/projects/p/locations/l/ServiceConnectionTokens/foo') See https://google.aip.dev/122#resource-id-segments Unique per location. If one is not provided, one will be generated.
      Throws:
      ApiException - if the remote call fails
    • createServiceConnectionTokenAsync

      public final OperationFuture<ServiceConnectionToken,OperationMetadata> createServiceConnectionTokenAsync(String parent, ServiceConnectionToken serviceConnectionToken, String serviceConnectionTokenId)
      Creates a new ServiceConnectionToken in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         ServiceConnectionToken serviceConnectionToken = ServiceConnectionToken.newBuilder().build();
         String serviceConnectionTokenId = "serviceConnectionTokenId-1526102527";
         ServiceConnectionToken response =
             crossNetworkAutomationServiceClient
                 .createServiceConnectionTokenAsync(
                     parent, serviceConnectionToken, serviceConnectionTokenId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent resource's name of the ServiceConnectionToken. ex. projects/123/locations/us-east1
      serviceConnectionToken - Required. Initial values for a new ServiceConnectionTokens
      serviceConnectionTokenId - Optional. Resource ID (i.e. 'foo' in '[...]/projects/p/locations/l/ServiceConnectionTokens/foo') See https://google.aip.dev/122#resource-id-segments Unique per location. If one is not provided, one will be generated.
      Throws:
      ApiException - if the remote call fails
    • createServiceConnectionTokenAsync

      public final OperationFuture<ServiceConnectionToken,OperationMetadata> createServiceConnectionTokenAsync(CreateServiceConnectionTokenRequest request)
      Creates a new ServiceConnectionToken in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         CreateServiceConnectionTokenRequest request =
             CreateServiceConnectionTokenRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setServiceConnectionTokenId("serviceConnectionTokenId-1526102527")
                 .setServiceConnectionToken(ServiceConnectionToken.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ServiceConnectionToken response =
             crossNetworkAutomationServiceClient.createServiceConnectionTokenAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createServiceConnectionTokenOperationCallable

      public final OperationCallable<CreateServiceConnectionTokenRequest,ServiceConnectionToken,OperationMetadata> createServiceConnectionTokenOperationCallable()
      Creates a new ServiceConnectionToken in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         CreateServiceConnectionTokenRequest request =
             CreateServiceConnectionTokenRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setServiceConnectionTokenId("serviceConnectionTokenId-1526102527")
                 .setServiceConnectionToken(ServiceConnectionToken.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<ServiceConnectionToken, OperationMetadata> future =
             crossNetworkAutomationServiceClient
                 .createServiceConnectionTokenOperationCallable()
                 .futureCall(request);
         // Do something.
         ServiceConnectionToken response = future.get();
       }
       
    • createServiceConnectionTokenCallable

      public final UnaryCallable<CreateServiceConnectionTokenRequest,Operation> createServiceConnectionTokenCallable()
      Creates a new ServiceConnectionToken in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         CreateServiceConnectionTokenRequest request =
             CreateServiceConnectionTokenRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setServiceConnectionTokenId("serviceConnectionTokenId-1526102527")
                 .setServiceConnectionToken(ServiceConnectionToken.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             crossNetworkAutomationServiceClient
                 .createServiceConnectionTokenCallable()
                 .futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • deleteServiceConnectionTokenAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceConnectionTokenAsync(ServiceConnectionTokenName name)
      Deletes a single ServiceConnectionToken.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         ServiceConnectionTokenName name =
             ServiceConnectionTokenName.of("[PROJECT]", "[LOCATION]", "[SERVICE_CONNECTION_TOKEN]");
         crossNetworkAutomationServiceClient.deleteServiceConnectionTokenAsync(name).get();
       }
       
      Parameters:
      name - Required. The name of the ServiceConnectionToken to delete.
      Throws:
      ApiException - if the remote call fails
    • deleteServiceConnectionTokenAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceConnectionTokenAsync(String name)
      Deletes a single ServiceConnectionToken.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         String name =
             ServiceConnectionTokenName.of("[PROJECT]", "[LOCATION]", "[SERVICE_CONNECTION_TOKEN]")
                 .toString();
         crossNetworkAutomationServiceClient.deleteServiceConnectionTokenAsync(name).get();
       }
       
      Parameters:
      name - Required. The name of the ServiceConnectionToken to delete.
      Throws:
      ApiException - if the remote call fails
    • deleteServiceConnectionTokenAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceConnectionTokenAsync(DeleteServiceConnectionTokenRequest request)
      Deletes a single ServiceConnectionToken.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         DeleteServiceConnectionTokenRequest request =
             DeleteServiceConnectionTokenRequest.newBuilder()
                 .setName(
                     ServiceConnectionTokenName.of(
                             "[PROJECT]", "[LOCATION]", "[SERVICE_CONNECTION_TOKEN]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .setEtag("etag3123477")
                 .build();
         crossNetworkAutomationServiceClient.deleteServiceConnectionTokenAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteServiceConnectionTokenOperationCallable

      public final OperationCallable<DeleteServiceConnectionTokenRequest,com.google.protobuf.Empty,OperationMetadata> deleteServiceConnectionTokenOperationCallable()
      Deletes a single ServiceConnectionToken.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         DeleteServiceConnectionTokenRequest request =
             DeleteServiceConnectionTokenRequest.newBuilder()
                 .setName(
                     ServiceConnectionTokenName.of(
                             "[PROJECT]", "[LOCATION]", "[SERVICE_CONNECTION_TOKEN]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .setEtag("etag3123477")
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             crossNetworkAutomationServiceClient
                 .deleteServiceConnectionTokenOperationCallable()
                 .futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteServiceConnectionTokenCallable

      public final UnaryCallable<DeleteServiceConnectionTokenRequest,Operation> deleteServiceConnectionTokenCallable()
      Deletes a single ServiceConnectionToken.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         DeleteServiceConnectionTokenRequest request =
             DeleteServiceConnectionTokenRequest.newBuilder()
                 .setName(
                     ServiceConnectionTokenName.of(
                             "[PROJECT]", "[LOCATION]", "[SERVICE_CONNECTION_TOKEN]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .setEtag("etag3123477")
                 .build();
         ApiFuture<Operation> future =
             crossNetworkAutomationServiceClient
                 .deleteServiceConnectionTokenCallable()
                 .futureCall(request);
         // Do something.
         future.get();
       }
       
    • listLocations

      Lists information about the supported locations for this service.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (Location element :
             crossNetworkAutomationServiceClient.listLocations(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listLocationsPagedCallable

      Lists information about the supported locations for this service.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<Location> future =
             crossNetworkAutomationServiceClient.listLocationsPagedCallable().futureCall(request);
         // Do something.
         for (Location element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listLocationsCallable

      public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()
      Lists information about the supported locations for this service.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ListLocationsResponse response =
               crossNetworkAutomationServiceClient.listLocationsCallable().call(request);
           for (Location element : response.getLocationsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getLocation

      public final Location getLocation(GetLocationRequest request)
      Gets information about a location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
         Location response = crossNetworkAutomationServiceClient.getLocation(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getLocationCallable

      public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()
      Gets information about a location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
         ApiFuture<Location> future =
             crossNetworkAutomationServiceClient.getLocationCallable().futureCall(request);
         // Do something.
         Location response = future.get();
       }
       
    • setIamPolicy

      public final Policy setIamPolicy(SetIamPolicyRequest request)
      Sets the access control policy on the specified resource. Replacesany existing policy.

      Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         SetIamPolicyRequest request =
             SetIamPolicyRequest.newBuilder()
                 .setResource(GroupName.of("[PROJECT]", "[HUB]", "[GROUP]").toString())
                 .setPolicy(Policy.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         Policy response = crossNetworkAutomationServiceClient.setIamPolicy(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • setIamPolicyCallable

      public final UnaryCallable<SetIamPolicyRequest,Policy> setIamPolicyCallable()
      Sets the access control policy on the specified resource. Replacesany existing policy.

      Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         SetIamPolicyRequest request =
             SetIamPolicyRequest.newBuilder()
                 .setResource(GroupName.of("[PROJECT]", "[HUB]", "[GROUP]").toString())
                 .setPolicy(Policy.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         ApiFuture<Policy> future =
             crossNetworkAutomationServiceClient.setIamPolicyCallable().futureCall(request);
         // Do something.
         Policy response = future.get();
       }
       
    • getIamPolicy

      public final Policy getIamPolicy(GetIamPolicyRequest request)
      Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         GetIamPolicyRequest request =
             GetIamPolicyRequest.newBuilder()
                 .setResource(GroupName.of("[PROJECT]", "[HUB]", "[GROUP]").toString())
                 .setOptions(GetPolicyOptions.newBuilder().build())
                 .build();
         Policy response = crossNetworkAutomationServiceClient.getIamPolicy(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getIamPolicyCallable

      public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()
      Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         GetIamPolicyRequest request =
             GetIamPolicyRequest.newBuilder()
                 .setResource(GroupName.of("[PROJECT]", "[HUB]", "[GROUP]").toString())
                 .setOptions(GetPolicyOptions.newBuilder().build())
                 .build();
         ApiFuture<Policy> future =
             crossNetworkAutomationServiceClient.getIamPolicyCallable().futureCall(request);
         // Do something.
         Policy response = future.get();
       }
       
    • testIamPermissions

      public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request)
      Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.

      Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         TestIamPermissionsRequest request =
             TestIamPermissionsRequest.newBuilder()
                 .setResource(GroupName.of("[PROJECT]", "[HUB]", "[GROUP]").toString())
                 .addAllPermissions(new ArrayList<String>())
                 .build();
         TestIamPermissionsResponse response =
             crossNetworkAutomationServiceClient.testIamPermissions(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • testIamPermissionsCallable

      public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()
      Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.

      Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

      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 (CrossNetworkAutomationServiceClient crossNetworkAutomationServiceClient =
           CrossNetworkAutomationServiceClient.create()) {
         TestIamPermissionsRequest request =
             TestIamPermissionsRequest.newBuilder()
                 .setResource(GroupName.of("[PROJECT]", "[HUB]", "[GROUP]").toString())
                 .addAllPermissions(new ArrayList<String>())
                 .build();
         ApiFuture<TestIamPermissionsResponse> future =
             crossNetworkAutomationServiceClient.testIamPermissionsCallable().futureCall(request);
         // Do something.
         TestIamPermissionsResponse response = future.get();
       }
       
    • close

      public final void close()
      Specified by:
      close in interface AutoCloseable
    • shutdown

      public void shutdown()
      Specified by:
      shutdown in interface BackgroundResource
    • isShutdown

      public boolean isShutdown()
      Specified by:
      isShutdown in interface BackgroundResource
    • isTerminated

      public boolean isTerminated()
      Specified by:
      isTerminated in interface BackgroundResource
    • shutdownNow

      public void shutdownNow()
      Specified by:
      shutdownNow in interface BackgroundResource
    • awaitTermination

      public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
      Specified by:
      awaitTermination in interface BackgroundResource
      Throws:
      InterruptedException