Class CrossNetworkAutomationServiceClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
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().
| 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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteServiceConnectionMap |
Deletes a single ServiceConnectionMap. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteServiceConnectionPolicy |
Deletes a single ServiceConnectionPolicy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteServiceClass |
Deletes a single ServiceClass. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteServiceConnectionToken |
Deletes a single ServiceConnectionToken. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of 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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructs an instance of CrossNetworkAutomationServiceClient, using the given settings.protected -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final CrossNetworkAutomationServiceClientcreate()Constructs an instance of CrossNetworkAutomationServiceClient with default settings.static final CrossNetworkAutomationServiceClientcreate(CrossNetworkAutomationServiceSettings settings) Constructs an instance of CrossNetworkAutomationServiceClient, using the given settings.static final CrossNetworkAutomationServiceClientConstructs an instance of CrossNetworkAutomationServiceClient, using the given stub for making calls.Creates a new ServiceConnectionMap in a given project and location.createServiceConnectionMapAsync(LocationName parent, ServiceConnectionMap serviceConnectionMap, String serviceConnectionMapId) Creates a new ServiceConnectionMap in a given project and location.createServiceConnectionMapAsync(String parent, ServiceConnectionMap serviceConnectionMap, String serviceConnectionMapId) Creates a new ServiceConnectionMap in a given project and location.Creates a new ServiceConnectionMap in a given project and location.Creates a new ServiceConnectionMap in a given project and location.Creates a new ServiceConnectionPolicy in a given project and location.createServiceConnectionPolicyAsync(LocationName parent, ServiceConnectionPolicy serviceConnectionPolicy, String serviceConnectionPolicyId) Creates a new ServiceConnectionPolicy in a given project and location.createServiceConnectionPolicyAsync(String parent, ServiceConnectionPolicy serviceConnectionPolicy, String serviceConnectionPolicyId) Creates a new ServiceConnectionPolicy in a given project and location.Creates a new ServiceConnectionPolicy in a given project and location.final OperationCallable<CreateServiceConnectionPolicyRequest,ServiceConnectionPolicy, OperationMetadata> Creates a new ServiceConnectionPolicy in a given project and location.Creates a new ServiceConnectionToken in a given project and location.createServiceConnectionTokenAsync(LocationName parent, ServiceConnectionToken serviceConnectionToken, String serviceConnectionTokenId) Creates a new ServiceConnectionToken in a given project and location.createServiceConnectionTokenAsync(String parent, ServiceConnectionToken serviceConnectionToken, String serviceConnectionTokenId) Creates a new ServiceConnectionToken in a given project and location.Creates a new ServiceConnectionToken in a given project and location.final OperationCallable<CreateServiceConnectionTokenRequest,ServiceConnectionToken, OperationMetadata> Creates a new ServiceConnectionToken in a given project and location.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single ServiceClass.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single ServiceClass.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single ServiceClass.Deletes a single ServiceClass.final OperationCallable<DeleteServiceClassRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single ServiceClass.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single ServiceConnectionMap.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single ServiceConnectionMap.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single ServiceConnectionMap.Deletes a single ServiceConnectionMap.final OperationCallable<DeleteServiceConnectionMapRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single ServiceConnectionMap.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single ServiceConnectionPolicy.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single ServiceConnectionPolicy.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single ServiceConnectionPolicy.Deletes a single ServiceConnectionPolicy.final OperationCallable<DeleteServiceConnectionPolicyRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single ServiceConnectionPolicy.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single ServiceConnectionToken.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single ServiceConnectionToken.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single ServiceConnectionToken.Deletes a single ServiceConnectionToken.final OperationCallable<DeleteServiceConnectionTokenRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single ServiceConnectionToken.final PolicygetIamPolicy(GetIamPolicyRequest request) Gets the access control policy for a resource.Gets the access control policy for a resource.final LocationgetLocation(GetLocationRequest request) Gets information about a location.Gets information about a location.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final ServiceClassgetServiceClass(GetServiceClassRequest request) Gets details of a single ServiceClass.final ServiceClassGets details of a single ServiceClass.final ServiceClassgetServiceClass(String name) Gets details of a single ServiceClass.Gets details of a single ServiceClass.final ServiceConnectionMapGets details of a single ServiceConnectionMap.final ServiceConnectionMapGets details of a single ServiceConnectionMap.final ServiceConnectionMapGets details of a single ServiceConnectionMap.Gets details of a single ServiceConnectionMap.final ServiceConnectionPolicyGets details of a single ServiceConnectionPolicy.final ServiceConnectionPolicyGets details of a single ServiceConnectionPolicy.final ServiceConnectionPolicyGets details of a single ServiceConnectionPolicy.Gets details of a single ServiceConnectionPolicy.final ServiceConnectionTokenGets details of a single ServiceConnectionToken.final ServiceConnectionTokenGets details of a single ServiceConnectionToken.final ServiceConnectionTokenGets details of a single ServiceConnectionToken.Gets details of a single ServiceConnectionToken.getStub()booleanbooleanlistLocations(ListLocationsRequest request) Lists information about the supported locations for this service.Lists information about the supported locations for this service.final UnaryCallable<ListLocationsRequest,CrossNetworkAutomationServiceClient.ListLocationsPagedResponse> Lists information about the supported locations for this service.Lists ServiceClasses in a given project and location.listServiceClasses(LocationName parent) Lists ServiceClasses in a given project and location.listServiceClasses(String parent) Lists ServiceClasses in a given project and location.Lists ServiceClasses in a given project and location.final UnaryCallable<ListServiceClassesRequest,CrossNetworkAutomationServiceClient.ListServiceClassesPagedResponse> Lists ServiceClasses in a given project and location.Lists ServiceConnectionMaps in a given project and location.Lists ServiceConnectionMaps in a given project and location.listServiceConnectionMaps(String parent) Lists ServiceConnectionMaps in a given project and location.Lists ServiceConnectionMaps in a given project and location.final UnaryCallable<ListServiceConnectionMapsRequest,CrossNetworkAutomationServiceClient.ListServiceConnectionMapsPagedResponse> Lists ServiceConnectionMaps in a given project and location.Lists ServiceConnectionPolicies in a given project and location.Lists ServiceConnectionPolicies in a given project and location.listServiceConnectionPolicies(String parent) Lists ServiceConnectionPolicies in a given project and location.Lists ServiceConnectionPolicies in a given project and location.final UnaryCallable<ListServiceConnectionPoliciesRequest,CrossNetworkAutomationServiceClient.ListServiceConnectionPoliciesPagedResponse> Lists ServiceConnectionPolicies in a given project and location.Lists ServiceConnectionTokens in a given project and location.Lists ServiceConnectionTokens in a given project and location.listServiceConnectionTokens(String parent) Lists ServiceConnectionTokens in a given project and location.Lists ServiceConnectionTokens in a given project and location.final UnaryCallable<ListServiceConnectionTokensRequest,CrossNetworkAutomationServiceClient.ListServiceConnectionTokensPagedResponse> Lists ServiceConnectionTokens in a given project and location.final PolicysetIamPolicy(SetIamPolicyRequest request) Sets the access control policy on the specified resource.Sets the access control policy on the specified resource.voidshutdown()voidReturns permissions that a caller has on the specified resource.Returns permissions that a caller has on the specified resource.updateServiceClassAsync(ServiceClass serviceClass, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single ServiceClass.Updates the parameters of a single ServiceClass.Updates the parameters of a single ServiceClass.Updates the parameters of a single ServiceClass.updateServiceConnectionMapAsync(ServiceConnectionMap serviceConnectionMap, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single ServiceConnectionMap.Updates the parameters of a single ServiceConnectionMap.Updates the parameters of a single ServiceConnectionMap.Updates the parameters of a single ServiceConnectionMap.updateServiceConnectionPolicyAsync(ServiceConnectionPolicy serviceConnectionPolicy, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single ServiceConnectionPolicy.Updates the parameters of a single ServiceConnectionPolicy.Updates the parameters of a single ServiceConnectionPolicy.final OperationCallable<UpdateServiceConnectionPolicyRequest,ServiceConnectionPolicy, OperationMetadata> Updates the parameters of a single ServiceConnectionPolicy.
-
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
-
-
Method Details
-
create
Constructs an instance of CrossNetworkAutomationServiceClient with default settings.- Throws:
IOException
-
create
public static final CrossNetworkAutomationServiceClient create(CrossNetworkAutomationServiceSettings settings) throws IOException 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
public static final CrossNetworkAutomationServiceClient create(CrossNetworkAutomationServiceStub stub) Constructs an instance of CrossNetworkAutomationServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(CrossNetworkAutomationServiceSettings). -
getSettings
-
getStub
-
getOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
listServiceConnectionMaps
public final CrossNetworkAutomationServiceClient.ListServiceConnectionMapsPagedResponse listServiceConnectionMaps(LocationName parent) 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
public final CrossNetworkAutomationServiceClient.ListServiceConnectionMapsPagedResponse listServiceConnectionMaps(String parent) 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
public final CrossNetworkAutomationServiceClient.ListServiceConnectionMapsPagedResponse listServiceConnectionMaps(ListServiceConnectionMapsRequest request) 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
public final UnaryCallable<ListServiceConnectionMapsRequest,CrossNetworkAutomationServiceClient.ListServiceConnectionMapsPagedResponse> 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
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
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
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-east1serviceConnectionMap- Required. Initial values for a new ServiceConnectionMapsserviceConnectionMapId- 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-east1serviceConnectionMap- Required. Initial values for a new ServiceConnectionMapsserviceConnectionMapId- 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, createServiceConnectionMapOperationCallable()OperationMetadata> 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, updateServiceConnectionMapOperationCallable()OperationMetadata> 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, deleteServiceConnectionMapOperationCallable()OperationMetadata> 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
public final CrossNetworkAutomationServiceClient.ListServiceConnectionPoliciesPagedResponse listServiceConnectionPolicies(LocationName parent) 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
public final CrossNetworkAutomationServiceClient.ListServiceConnectionPoliciesPagedResponse listServiceConnectionPolicies(String parent) 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
public final CrossNetworkAutomationServiceClient.ListServiceConnectionPoliciesPagedResponse listServiceConnectionPolicies(ListServiceConnectionPoliciesRequest request) 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
public final UnaryCallable<ListServiceConnectionPoliciesRequest,CrossNetworkAutomationServiceClient.ListServiceConnectionPoliciesPagedResponse> 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
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
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-east1serviceConnectionPolicy- Required. Initial values for a new ServiceConnectionPoliciesserviceConnectionPolicyId- 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-east1serviceConnectionPolicy- Required. Initial values for a new ServiceConnectionPoliciesserviceConnectionPolicyId- 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, createServiceConnectionPolicyOperationCallable()OperationMetadata> 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, updateServiceConnectionPolicyOperationCallable()OperationMetadata> 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, deleteServiceConnectionPolicyOperationCallable()OperationMetadata> 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
public final CrossNetworkAutomationServiceClient.ListServiceClassesPagedResponse listServiceClasses(LocationName parent) 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
public final CrossNetworkAutomationServiceClient.ListServiceClassesPagedResponse listServiceClasses(String parent) 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
public final CrossNetworkAutomationServiceClient.ListServiceClassesPagedResponse listServiceClasses(ListServiceClassesRequest request) 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
public final UnaryCallable<ListServiceClassesRequest,CrossNetworkAutomationServiceClient.ListServiceClassesPagedResponse> 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
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
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
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
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, updateServiceClassOperationCallable()OperationMetadata> 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
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, deleteServiceClassOperationCallable()OperationMetadata> 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
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
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
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
public final CrossNetworkAutomationServiceClient.ListServiceConnectionTokensPagedResponse listServiceConnectionTokens(LocationName parent) 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
public final CrossNetworkAutomationServiceClient.ListServiceConnectionTokensPagedResponse listServiceConnectionTokens(String parent) 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
public final CrossNetworkAutomationServiceClient.ListServiceConnectionTokensPagedResponse listServiceConnectionTokens(ListServiceConnectionTokensRequest request) 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
public final UnaryCallable<ListServiceConnectionTokensRequest,CrossNetworkAutomationServiceClient.ListServiceConnectionTokensPagedResponse> 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-east1serviceConnectionToken- Required. Initial values for a new ServiceConnectionTokensserviceConnectionTokenId- 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-east1serviceConnectionToken- Required. Initial values for a new ServiceConnectionTokensserviceConnectionTokenId- 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, createServiceConnectionTokenOperationCallable()OperationMetadata> 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, deleteServiceConnectionTokenOperationCallable()OperationMetadata> 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
public final CrossNetworkAutomationServiceClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request) 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
public final UnaryCallable<ListLocationsRequest,CrossNetworkAutomationServiceClient.ListLocationsPagedResponse> 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
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
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
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
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
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
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
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
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:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-