Class AddressGroupServiceClient (0.78.0)
Stay organized with collections
Save and categorize content based on your preferences.
- 0.81.0 (latest)
- 0.79.0
- 0.78.0
- 0.77.0
- 0.76.0
- 0.75.0
- 0.73.0
- 0.71.0
- 0.70.0
- 0.67.0
- 0.66.0
- 0.65.0
- 0.63.0
- 0.62.0
- 0.61.0
- 0.60.0
- 0.59.0
- 0.58.0
- 0.57.0
- 0.56.0
- 0.55.0
- 0.54.0
- 0.52.0
- 0.51.0
- 0.50.0
- 0.49.0
- 0.48.0
- 0.47.0
- 0.46.0
- 0.45.0
- 0.44.0
- 0.43.0
- 0.42.0
- 0.40.0
- 0.39.0
- 0.38.0
- 0.37.0
- 0.36.0
- 0.35.0
- 0.34.0
- 0.33.0
- 0.32.0
- 0.31.0
- 0.30.0
- 0.27.0
- 0.26.0
- 0.25.0
- 0.24.0
- 0.23.0
- 0.22.0
- 0.21.0
- 0.20.0
- 0.19.0
- 0.18.0
- 0.17.0
- 0.16.0
- 0.15.0
- 0.14.0
- 0.12.0
- 0.11.0
- 0.10.0
- 0.9.0
- 0.8.0
- 0.7.0
- 0.6.4
- 0.5.1
- 0.4.4
Service Description: AddressGroup is a resource that manages a collection of IP or Domain Names, it can be used in Firewall Policy to represent allow or deny traffic from all the IP or Domain Names from the Address Group.
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(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
AddressGroupNamename=
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]");
AddressGroupresponse=addressGroupServiceClient.getAddressGroup(name);
}
Note: close() needs to be called on the AddressGroupServiceClient 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 |
|---|---|---|
ListAddressGroups |
Lists address groups 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.
|
GetAddressGroup |
Gets details of a single address group. |
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.
|
CreateAddressGroup |
Creates a new address group 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
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateAddressGroup |
Updates the parameters of a single address group. |
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
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
AddAddressGroupItems |
Adds items to an address group. |
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
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
RemoveAddressGroupItems |
Removes items from an address group. |
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
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CloneAddressGroupItems |
Clones items from one address group to another. |
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
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteAddressGroup |
Deletes a single address group. |
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
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListAddressGroupReferences |
Lists references of an address group. |
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.
|
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 |
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 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 AddressGroupServiceSettings 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
AddressGroupServiceSettingsaddressGroupServiceSettings=
AddressGroupServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
AddressGroupServiceClientaddressGroupServiceClient=
AddressGroupServiceClient.create(addressGroupServiceSettings);
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
AddressGroupServiceSettingsaddressGroupServiceSettings=
AddressGroupServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
AddressGroupServiceClientaddressGroupServiceClient=
AddressGroupServiceClient.create(addressGroupServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
publicstaticfinalAddressGroupServiceClientcreate()Constructs an instance of AddressGroupServiceClient with default settings.
| Returns | |
|---|---|
| Type | Description |
AddressGroupServiceClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(AddressGroupServiceSettings settings)
publicstaticfinalAddressGroupServiceClientcreate(AddressGroupServiceSettingssettings)Constructs an instance of AddressGroupServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
| Parameter | |
|---|---|
| Name | Description |
settings |
AddressGroupServiceSettings |
| Returns | |
|---|---|
| Type | Description |
AddressGroupServiceClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(AddressGroupServiceStub stub)
publicstaticfinalAddressGroupServiceClientcreate(AddressGroupServiceStubstub)Constructs an instance of AddressGroupServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(AddressGroupServiceSettings).
| Parameter | |
|---|---|
| Name | Description |
stub |
AddressGroupServiceStub |
| Returns | |
|---|---|
| Type | Description |
AddressGroupServiceClient |
|
Constructors
AddressGroupServiceClient(AddressGroupServiceSettings settings)
protectedAddressGroupServiceClient(AddressGroupServiceSettingssettings)Constructs an instance of AddressGroupServiceClient, 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.
| Parameter | |
|---|---|
| Name | Description |
settings |
AddressGroupServiceSettings |
AddressGroupServiceClient(AddressGroupServiceStub stub)
protectedAddressGroupServiceClient(AddressGroupServiceStubstub)| Parameter | |
|---|---|
| Name | Description |
stub |
AddressGroupServiceStub |
Methods
addAddressGroupItemsAsync(AddAddressGroupItemsRequest request)
publicfinalOperationFuture<AddressGroup,OperationMetadata>addAddressGroupItemsAsync(AddAddressGroupItemsRequestrequest)Adds items to an address group.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
AddAddressGroupItemsRequestrequest=
AddAddressGroupItemsRequest.newBuilder()
.setAddressGroup(
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString())
.addAllItems(newArrayList<String>())
.setRequestId("requestId693933066")
.build();
AddressGroupresponse=addressGroupServiceClient.addAddressGroupItemsAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
AddAddressGroupItemsRequest The request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AddressGroup,OperationMetadata> |
|
addAddressGroupItemsAsync(AddressGroupName addressGroup, List<String> items)
publicfinalOperationFuture<AddressGroup,OperationMetadata>addAddressGroupItemsAsync(AddressGroupNameaddressGroup,List<String>items)Adds items to an address group.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
AddressGroupNameaddressGroup=
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]");
List<String>items=newArrayList<>();
AddressGroupresponse=
addressGroupServiceClient.addAddressGroupItemsAsync(addressGroup,items).get();
}
| Parameters | |
|---|---|
| Name | Description |
addressGroup |
AddressGroupName Required. A name of the AddressGroup to add items to. Must be in the format
|
items |
List<String>Required. List of items to add. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AddressGroup,OperationMetadata> |
|
addAddressGroupItemsAsync(String addressGroup, List<String> items)
publicfinalOperationFuture<AddressGroup,OperationMetadata>addAddressGroupItemsAsync(StringaddressGroup,List<String>items)Adds items to an address group.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
StringaddressGroup=
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString();
List<String>items=newArrayList<>();
AddressGroupresponse=
addressGroupServiceClient.addAddressGroupItemsAsync(addressGroup,items).get();
}
| Parameters | |
|---|---|
| Name | Description |
addressGroup |
String Required. A name of the AddressGroup to add items to. Must be in the format
|
items |
List<String>Required. List of items to add. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AddressGroup,OperationMetadata> |
|
addAddressGroupItemsCallable()
publicfinalUnaryCallable<AddAddressGroupItemsRequest,Operation>addAddressGroupItemsCallable()Adds items to an address group.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
AddAddressGroupItemsRequestrequest=
AddAddressGroupItemsRequest.newBuilder()
.setAddressGroup(
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString())
.addAllItems(newArrayList<String>())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation>future=
addressGroupServiceClient.addAddressGroupItemsCallable().futureCall(request);
// Do something.
Operationresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<AddAddressGroupItemsRequest,Operation> |
|
addAddressGroupItemsOperationCallable()
publicfinalOperationCallable<AddAddressGroupItemsRequest,AddressGroup,OperationMetadata>addAddressGroupItemsOperationCallable()Adds items to an address group.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
AddAddressGroupItemsRequestrequest=
AddAddressGroupItemsRequest.newBuilder()
.setAddressGroup(
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString())
.addAllItems(newArrayList<String>())
.setRequestId("requestId693933066")
.build();
OperationFuture<AddressGroup,OperationMetadata>future=
addressGroupServiceClient.addAddressGroupItemsOperationCallable().futureCall(request);
// Do something.
AddressGroupresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<AddAddressGroupItemsRequest,AddressGroup,OperationMetadata> |
|
awaitTermination(long duration, TimeUnit unit)
publicbooleanawaitTermination(longduration,TimeUnitunit)| Parameters | |
|---|---|
| Name | Description |
duration |
long |
unit |
TimeUnit |
| Returns | |
|---|---|
| Type | Description |
boolean |
|
| Exceptions | |
|---|---|
| Type | Description |
InterruptedException |
|
cloneAddressGroupItemsAsync(AddressGroupName addressGroup, AddressGroupName sourceAddressGroup)
publicfinalOperationFuture<AddressGroup,OperationMetadata>cloneAddressGroupItemsAsync(AddressGroupNameaddressGroup,AddressGroupNamesourceAddressGroup)Clones items from one address group to another.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
AddressGroupNameaddressGroup=
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]");
AddressGroupNamesourceAddressGroup=
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]");
AddressGroupresponse=
addressGroupServiceClient
.cloneAddressGroupItemsAsync(addressGroup,sourceAddressGroup)
.get();
}
| Parameters | |
|---|---|
| Name | Description |
addressGroup |
AddressGroupName Required. A name of the AddressGroup to clone items to. Must be in the
format |
sourceAddressGroup |
AddressGroupName Required. Source address group to clone items from. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AddressGroup,OperationMetadata> |
|
cloneAddressGroupItemsAsync(AddressGroupName addressGroup, String sourceAddressGroup)
publicfinalOperationFuture<AddressGroup,OperationMetadata>cloneAddressGroupItemsAsync(AddressGroupNameaddressGroup,StringsourceAddressGroup)Clones items from one address group to another.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
AddressGroupNameaddressGroup=
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]");
StringsourceAddressGroup=
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString();
AddressGroupresponse=
addressGroupServiceClient
.cloneAddressGroupItemsAsync(addressGroup,sourceAddressGroup)
.get();
}
| Parameters | |
|---|---|
| Name | Description |
addressGroup |
AddressGroupName Required. A name of the AddressGroup to clone items to. Must be in the
format |
sourceAddressGroup |
String Required. Source address group to clone items from. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AddressGroup,OperationMetadata> |
|
cloneAddressGroupItemsAsync(CloneAddressGroupItemsRequest request)
publicfinalOperationFuture<AddressGroup,OperationMetadata>cloneAddressGroupItemsAsync(CloneAddressGroupItemsRequestrequest)Clones items from one address group to another.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
CloneAddressGroupItemsRequestrequest=
CloneAddressGroupItemsRequest.newBuilder()
.setAddressGroup(
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString())
.setSourceAddressGroup(
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString())
.setRequestId("requestId693933066")
.build();
AddressGroupresponse=addressGroupServiceClient.cloneAddressGroupItemsAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
CloneAddressGroupItemsRequest The request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AddressGroup,OperationMetadata> |
|
cloneAddressGroupItemsAsync(String addressGroup, AddressGroupName sourceAddressGroup)
publicfinalOperationFuture<AddressGroup,OperationMetadata>cloneAddressGroupItemsAsync(StringaddressGroup,AddressGroupNamesourceAddressGroup)Clones items from one address group to another.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
StringaddressGroup=
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString();
AddressGroupNamesourceAddressGroup=
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]");
AddressGroupresponse=
addressGroupServiceClient
.cloneAddressGroupItemsAsync(addressGroup,sourceAddressGroup)
.get();
}
| Parameters | |
|---|---|
| Name | Description |
addressGroup |
String Required. A name of the AddressGroup to clone items to. Must be in the
format |
sourceAddressGroup |
AddressGroupName Required. Source address group to clone items from. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AddressGroup,OperationMetadata> |
|
cloneAddressGroupItemsAsync(String addressGroup, String sourceAddressGroup)
publicfinalOperationFuture<AddressGroup,OperationMetadata>cloneAddressGroupItemsAsync(StringaddressGroup,StringsourceAddressGroup)Clones items from one address group to another.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
StringaddressGroup=
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString();
StringsourceAddressGroup=
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString();
AddressGroupresponse=
addressGroupServiceClient
.cloneAddressGroupItemsAsync(addressGroup,sourceAddressGroup)
.get();
}
| Parameters | |
|---|---|
| Name | Description |
addressGroup |
String Required. A name of the AddressGroup to clone items to. Must be in the
format |
sourceAddressGroup |
String Required. Source address group to clone items from. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AddressGroup,OperationMetadata> |
|
cloneAddressGroupItemsCallable()
publicfinalUnaryCallable<CloneAddressGroupItemsRequest,Operation>cloneAddressGroupItemsCallable()Clones items from one address group to another.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
CloneAddressGroupItemsRequestrequest=
CloneAddressGroupItemsRequest.newBuilder()
.setAddressGroup(
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString())
.setSourceAddressGroup(
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation>future=
addressGroupServiceClient.cloneAddressGroupItemsCallable().futureCall(request);
// Do something.
Operationresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<CloneAddressGroupItemsRequest,Operation> |
|
cloneAddressGroupItemsOperationCallable()
publicfinalOperationCallable<CloneAddressGroupItemsRequest,AddressGroup,OperationMetadata>cloneAddressGroupItemsOperationCallable()Clones items from one address group to another.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
CloneAddressGroupItemsRequestrequest=
CloneAddressGroupItemsRequest.newBuilder()
.setAddressGroup(
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString())
.setSourceAddressGroup(
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString())
.setRequestId("requestId693933066")
.build();
OperationFuture<AddressGroup,OperationMetadata>future=
addressGroupServiceClient.cloneAddressGroupItemsOperationCallable().futureCall(request);
// Do something.
AddressGroupresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<CloneAddressGroupItemsRequest,AddressGroup,OperationMetadata> |
|
close()
publicfinalvoidclose()createAddressGroupAsync(CreateAddressGroupRequest request)
publicfinalOperationFuture<AddressGroup,OperationMetadata>createAddressGroupAsync(CreateAddressGroupRequestrequest)Creates a new address group 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(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
CreateAddressGroupRequestrequest=
CreateAddressGroupRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setAddressGroupId("addressGroupId705215846")
.setAddressGroup(AddressGroup.newBuilder().build())
.setRequestId("requestId693933066")
.build();
AddressGroupresponse=addressGroupServiceClient.createAddressGroupAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
CreateAddressGroupRequest The request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AddressGroup,OperationMetadata> |
|
createAddressGroupAsync(LocationName parent, AddressGroup addressGroup, String addressGroupId)
publicfinalOperationFuture<AddressGroup,OperationMetadata>createAddressGroupAsync(LocationNameparent,AddressGroupaddressGroup,StringaddressGroupId)Creates a new address group 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(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
LocationNameparent=LocationName.of("[PROJECT]","[LOCATION]");
AddressGroupaddressGroup=AddressGroup.newBuilder().build();
StringaddressGroupId="addressGroupId705215846";
AddressGroupresponse=
addressGroupServiceClient
.createAddressGroupAsync(parent,addressGroup,addressGroupId)
.get();
}
| Parameters | |
|---|---|
| Name | Description |
parent |
LocationName Required. The parent resource of the AddressGroup. Must be in the format
|
addressGroup |
AddressGroup Required. AddressGroup resource to be created. |
addressGroupId |
String Required. Short name of the AddressGroup resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "authz_policy". |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AddressGroup,OperationMetadata> |
|
createAddressGroupAsync(OrganizationLocationName parent, AddressGroup addressGroup, String addressGroupId)
publicfinalOperationFuture<AddressGroup,OperationMetadata>createAddressGroupAsync(OrganizationLocationNameparent,AddressGroupaddressGroup,StringaddressGroupId)Creates a new address group 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(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
OrganizationLocationNameparent=OrganizationLocationName.of("[ORGANIZATION]","[LOCATION]");
AddressGroupaddressGroup=AddressGroup.newBuilder().build();
StringaddressGroupId="addressGroupId705215846";
AddressGroupresponse=
addressGroupServiceClient
.createAddressGroupAsync(parent,addressGroup,addressGroupId)
.get();
}
| Parameters | |
|---|---|
| Name | Description |
parent |
OrganizationLocationName Required. The parent resource of the AddressGroup. Must be in the format
|
addressGroup |
AddressGroup Required. AddressGroup resource to be created. |
addressGroupId |
String Required. Short name of the AddressGroup resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "authz_policy". |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AddressGroup,OperationMetadata> |
|
createAddressGroupAsync(String parent, AddressGroup addressGroup, String addressGroupId)
publicfinalOperationFuture<AddressGroup,OperationMetadata>createAddressGroupAsync(Stringparent,AddressGroupaddressGroup,StringaddressGroupId)Creates a new address group 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(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
Stringparent=LocationName.of("[PROJECT]","[LOCATION]").toString();
AddressGroupaddressGroup=AddressGroup.newBuilder().build();
StringaddressGroupId="addressGroupId705215846";
AddressGroupresponse=
addressGroupServiceClient
.createAddressGroupAsync(parent,addressGroup,addressGroupId)
.get();
}
| Parameters | |
|---|---|
| Name | Description |
parent |
String Required. The parent resource of the AddressGroup. Must be in the format
|
addressGroup |
AddressGroup Required. AddressGroup resource to be created. |
addressGroupId |
String Required. Short name of the AddressGroup resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "authz_policy". |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AddressGroup,OperationMetadata> |
|
createAddressGroupCallable()
publicfinalUnaryCallable<CreateAddressGroupRequest,Operation>createAddressGroupCallable()Creates a new address group 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(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
CreateAddressGroupRequestrequest=
CreateAddressGroupRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setAddressGroupId("addressGroupId705215846")
.setAddressGroup(AddressGroup.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation>future=
addressGroupServiceClient.createAddressGroupCallable().futureCall(request);
// Do something.
Operationresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<CreateAddressGroupRequest,Operation> |
|
createAddressGroupOperationCallable()
publicfinalOperationCallable<CreateAddressGroupRequest,AddressGroup,OperationMetadata>createAddressGroupOperationCallable()Creates a new address group 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(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
CreateAddressGroupRequestrequest=
CreateAddressGroupRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setAddressGroupId("addressGroupId705215846")
.setAddressGroup(AddressGroup.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<AddressGroup,OperationMetadata>future=
addressGroupServiceClient.createAddressGroupOperationCallable().futureCall(request);
// Do something.
AddressGroupresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<CreateAddressGroupRequest,AddressGroup,OperationMetadata> |
|
deleteAddressGroupAsync(AddressGroupName name)
publicfinalOperationFuture<Empty,OperationMetadata>deleteAddressGroupAsync(AddressGroupNamename)Deletes a single address group.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
AddressGroupNamename=
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]");
addressGroupServiceClient.deleteAddressGroupAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
AddressGroupName Required. A name of the AddressGroup to delete. Must be in the format
|
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteAddressGroupAsync(DeleteAddressGroupRequest request)
publicfinalOperationFuture<Empty,OperationMetadata>deleteAddressGroupAsync(DeleteAddressGroupRequestrequest)Deletes a single address group.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
DeleteAddressGroupRequestrequest=
DeleteAddressGroupRequest.newBuilder()
.setName(
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString())
.setRequestId("requestId693933066")
.build();
addressGroupServiceClient.deleteAddressGroupAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
DeleteAddressGroupRequest The request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteAddressGroupAsync(String name)
publicfinalOperationFuture<Empty,OperationMetadata>deleteAddressGroupAsync(Stringname)Deletes a single address group.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
Stringname=
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString();
addressGroupServiceClient.deleteAddressGroupAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
String Required. A name of the AddressGroup to delete. Must be in the format
|
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteAddressGroupCallable()
publicfinalUnaryCallable<DeleteAddressGroupRequest,Operation>deleteAddressGroupCallable()Deletes a single address group.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
DeleteAddressGroupRequestrequest=
DeleteAddressGroupRequest.newBuilder()
.setName(
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation>future=
addressGroupServiceClient.deleteAddressGroupCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<DeleteAddressGroupRequest,Operation> |
|
deleteAddressGroupOperationCallable()
publicfinalOperationCallable<DeleteAddressGroupRequest,Empty,OperationMetadata>deleteAddressGroupOperationCallable()Deletes a single address group.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
DeleteAddressGroupRequestrequest=
DeleteAddressGroupRequest.newBuilder()
.setName(
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString())
.setRequestId("requestId693933066")
.build();
OperationFuture<Empty,OperationMetadata>future=
addressGroupServiceClient.deleteAddressGroupOperationCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<DeleteAddressGroupRequest,Empty,OperationMetadata> |
|
getAddressGroup(AddressGroupName name)
publicfinalAddressGroupgetAddressGroup(AddressGroupNamename)Gets details of a single address group.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
AddressGroupNamename=
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]");
AddressGroupresponse=addressGroupServiceClient.getAddressGroup(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
AddressGroupName Required. A name of the AddressGroup to get. Must be in the format
|
| Returns | |
|---|---|
| Type | Description |
AddressGroup |
|
getAddressGroup(GetAddressGroupRequest request)
publicfinalAddressGroupgetAddressGroup(GetAddressGroupRequestrequest)Gets details of a single address group.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
GetAddressGroupRequestrequest=
GetAddressGroupRequest.newBuilder()
.setName(
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString())
.build();
AddressGroupresponse=addressGroupServiceClient.getAddressGroup(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetAddressGroupRequest The request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
AddressGroup |
|
getAddressGroup(String name)
publicfinalAddressGroupgetAddressGroup(Stringname)Gets details of a single address group.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
Stringname=
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString();
AddressGroupresponse=addressGroupServiceClient.getAddressGroup(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
String Required. A name of the AddressGroup to get. Must be in the format
|
| Returns | |
|---|---|
| Type | Description |
AddressGroup |
|
getAddressGroupCallable()
publicfinalUnaryCallable<GetAddressGroupRequest,AddressGroup>getAddressGroupCallable()Gets details of a single address group.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
GetAddressGroupRequestrequest=
GetAddressGroupRequest.newBuilder()
.setName(
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString())
.build();
ApiFuture<AddressGroup>future=
addressGroupServiceClient.getAddressGroupCallable().futureCall(request);
// Do something.
AddressGroupresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetAddressGroupRequest,AddressGroup> |
|
getIamPolicy(GetIamPolicyRequest request)
publicfinalPolicygetIamPolicy(GetIamPolicyRequestrequest)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(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
GetIamPolicyRequestrequest=
GetIamPolicyRequest.newBuilder()
.setResource(
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
Policyresponse=addressGroupServiceClient.getIamPolicy(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.iam.v1.GetIamPolicyRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
com.google.iam.v1.Policy |
|
getIamPolicyCallable()
publicfinalUnaryCallable<GetIamPolicyRequest,Policy>getIamPolicyCallable()Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
GetIamPolicyRequestrequest=
GetIamPolicyRequest.newBuilder()
.setResource(
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
ApiFuture<Policy>future=
addressGroupServiceClient.getIamPolicyCallable().futureCall(request);
// Do something.
Policyresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> |
|
getLocation(GetLocationRequest request)
publicfinalLocationgetLocation(GetLocationRequestrequest)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(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
GetLocationRequestrequest=GetLocationRequest.newBuilder().setName("name3373707").build();
Locationresponse=addressGroupServiceClient.getLocation(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.cloud.location.GetLocationRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
com.google.cloud.location.Location |
|
getLocationCallable()
publicfinalUnaryCallable<GetLocationRequest,Location>getLocationCallable()Gets information about a location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
GetLocationRequestrequest=GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location>future=
addressGroupServiceClient.getLocationCallable().futureCall(request);
// Do something.
Locationresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> |
|
getOperationsClient()
publicfinalOperationsClientgetOperationsClient()Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
| Returns | |
|---|---|
| Type | Description |
OperationsClient |
|
getSettings()
publicfinalAddressGroupServiceSettingsgetSettings()| Returns | |
|---|---|
| Type | Description |
AddressGroupServiceSettings |
|
getStub()
publicAddressGroupServiceStubgetStub()| Returns | |
|---|---|
| Type | Description |
AddressGroupServiceStub |
|
isShutdown()
publicbooleanisShutdown()| Returns | |
|---|---|
| Type | Description |
boolean |
|
isTerminated()
publicbooleanisTerminated()| Returns | |
|---|---|
| Type | Description |
boolean |
|
listAddressGroupReferences(AddressGroupName addressGroup)
publicfinalAddressGroupServiceClient.ListAddressGroupReferencesPagedResponselistAddressGroupReferences(AddressGroupNameaddressGroup)Lists references of an address group.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
AddressGroupNameaddressGroup=
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]");
for(ListAddressGroupReferencesResponse.AddressGroupReferenceelement:
addressGroupServiceClient.listAddressGroupReferences(addressGroup).iterateAll()){
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
addressGroup |
AddressGroupName Required. A name of the AddressGroup to clone items to. Must be in the
format |
| Returns | |
|---|---|
| Type | Description |
AddressGroupServiceClient.ListAddressGroupReferencesPagedResponse |
|
listAddressGroupReferences(ListAddressGroupReferencesRequest request)
publicfinalAddressGroupServiceClient.ListAddressGroupReferencesPagedResponselistAddressGroupReferences(ListAddressGroupReferencesRequestrequest)Lists references of an address group.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
ListAddressGroupReferencesRequestrequest=
ListAddressGroupReferencesRequest.newBuilder()
.setAddressGroup(
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for(ListAddressGroupReferencesResponse.AddressGroupReferenceelement:
addressGroupServiceClient.listAddressGroupReferences(request).iterateAll()){
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListAddressGroupReferencesRequest The request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
AddressGroupServiceClient.ListAddressGroupReferencesPagedResponse |
|
listAddressGroupReferences(String addressGroup)
publicfinalAddressGroupServiceClient.ListAddressGroupReferencesPagedResponselistAddressGroupReferences(StringaddressGroup)Lists references of an address group.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
StringaddressGroup=
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString();
for(ListAddressGroupReferencesResponse.AddressGroupReferenceelement:
addressGroupServiceClient.listAddressGroupReferences(addressGroup).iterateAll()){
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
addressGroup |
String Required. A name of the AddressGroup to clone items to. Must be in the
format |
| Returns | |
|---|---|
| Type | Description |
AddressGroupServiceClient.ListAddressGroupReferencesPagedResponse |
|
listAddressGroupReferencesCallable()
publicfinalUnaryCallable<ListAddressGroupReferencesRequest,ListAddressGroupReferencesResponse>listAddressGroupReferencesCallable()Lists references of an address group.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
ListAddressGroupReferencesRequestrequest=
ListAddressGroupReferencesRequest.newBuilder()
.setAddressGroup(
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while(true){
ListAddressGroupReferencesResponseresponse=
addressGroupServiceClient.listAddressGroupReferencesCallable().call(request);
for(ListAddressGroupReferencesResponse.AddressGroupReferenceelement:
response.getAddressGroupReferencesList()){
// doThingsWith(element);
}
StringnextPageToken=response.getNextPageToken();
if(!Strings.isNullOrEmpty(nextPageToken)){
request=request.toBuilder().setPageToken(nextPageToken).build();
}else{
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListAddressGroupReferencesRequest,ListAddressGroupReferencesResponse> |
|
listAddressGroupReferencesPagedCallable()
publicfinalUnaryCallable<ListAddressGroupReferencesRequest,AddressGroupServiceClient.ListAddressGroupReferencesPagedResponse>listAddressGroupReferencesPagedCallable()Lists references of an address group.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
ListAddressGroupReferencesRequestrequest=
ListAddressGroupReferencesRequest.newBuilder()
.setAddressGroup(
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<ListAddressGroupReferencesResponse.AddressGroupReference>future=
addressGroupServiceClient.listAddressGroupReferencesPagedCallable().futureCall(request);
// Do something.
for(ListAddressGroupReferencesResponse.AddressGroupReferenceelement:
future.get().iterateAll()){
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListAddressGroupReferencesRequest,ListAddressGroupReferencesPagedResponse> |
|
listAddressGroups(ListAddressGroupsRequest request)
publicfinalAddressGroupServiceClient.ListAddressGroupsPagedResponselistAddressGroups(ListAddressGroupsRequestrequest)Lists address groups 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(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
ListAddressGroupsRequestrequest=
ListAddressGroupsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReturnPartialSuccess(true)
.build();
for(AddressGroupelement:
addressGroupServiceClient.listAddressGroups(request).iterateAll()){
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListAddressGroupsRequest The request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
AddressGroupServiceClient.ListAddressGroupsPagedResponse |
|
listAddressGroups(LocationName parent)
publicfinalAddressGroupServiceClient.ListAddressGroupsPagedResponselistAddressGroups(LocationNameparent)Lists address groups 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(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
LocationNameparent=LocationName.of("[PROJECT]","[LOCATION]");
for(AddressGroupelement:
addressGroupServiceClient.listAddressGroups(parent).iterateAll()){
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
LocationName Required. The project and location from which the AddressGroups should be listed,
specified in the format |
| Returns | |
|---|---|
| Type | Description |
AddressGroupServiceClient.ListAddressGroupsPagedResponse |
|
listAddressGroups(String parent)
publicfinalAddressGroupServiceClient.ListAddressGroupsPagedResponselistAddressGroups(Stringparent)Lists address groups 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(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
Stringparent=LocationName.of("[PROJECT]","[LOCATION]").toString();
for(AddressGroupelement:
addressGroupServiceClient.listAddressGroups(parent).iterateAll()){
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
String Required. The project and location from which the AddressGroups should be listed,
specified in the format |
| Returns | |
|---|---|
| Type | Description |
AddressGroupServiceClient.ListAddressGroupsPagedResponse |
|
listAddressGroupsCallable()
publicfinalUnaryCallable<ListAddressGroupsRequest,ListAddressGroupsResponse>listAddressGroupsCallable()Lists address groups 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(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
ListAddressGroupsRequestrequest=
ListAddressGroupsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReturnPartialSuccess(true)
.build();
while(true){
ListAddressGroupsResponseresponse=
addressGroupServiceClient.listAddressGroupsCallable().call(request);
for(AddressGroupelement:response.getAddressGroupsList()){
// doThingsWith(element);
}
StringnextPageToken=response.getNextPageToken();
if(!Strings.isNullOrEmpty(nextPageToken)){
request=request.toBuilder().setPageToken(nextPageToken).build();
}else{
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListAddressGroupsRequest,ListAddressGroupsResponse> |
|
listAddressGroupsPagedCallable()
publicfinalUnaryCallable<ListAddressGroupsRequest,AddressGroupServiceClient.ListAddressGroupsPagedResponse>listAddressGroupsPagedCallable()Lists address groups 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(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
ListAddressGroupsRequestrequest=
ListAddressGroupsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReturnPartialSuccess(true)
.build();
ApiFuture<AddressGroup>future=
addressGroupServiceClient.listAddressGroupsPagedCallable().futureCall(request);
// Do something.
for(AddressGroupelement:future.get().iterateAll()){
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListAddressGroupsRequest,ListAddressGroupsPagedResponse> |
|
listLocations(ListLocationsRequest request)
publicfinalAddressGroupServiceClient.ListLocationsPagedResponselistLocations(ListLocationsRequestrequest)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(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
ListLocationsRequestrequest=
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for(Locationelement:addressGroupServiceClient.listLocations(request).iterateAll()){
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.cloud.location.ListLocationsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
AddressGroupServiceClient.ListLocationsPagedResponse |
|
listLocationsCallable()
publicfinalUnaryCallable<ListLocationsRequest,ListLocationsResponse>listLocationsCallable()Lists information about the supported locations for this service.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
ListLocationsRequestrequest=
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while(true){
ListLocationsResponseresponse=
addressGroupServiceClient.listLocationsCallable().call(request);
for(Locationelement:response.getLocationsList()){
// doThingsWith(element);
}
StringnextPageToken=response.getNextPageToken();
if(!Strings.isNullOrEmpty(nextPageToken)){
request=request.toBuilder().setPageToken(nextPageToken).build();
}else{
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> |
|
listLocationsPagedCallable()
publicfinalUnaryCallable<ListLocationsRequest,AddressGroupServiceClient.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(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
ListLocationsRequestrequest=
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Location>future=
addressGroupServiceClient.listLocationsPagedCallable().futureCall(request);
// Do something.
for(Locationelement:future.get().iterateAll()){
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse> |
|
removeAddressGroupItemsAsync(AddressGroupName addressGroup, List<String> items)
publicfinalOperationFuture<AddressGroup,OperationMetadata>removeAddressGroupItemsAsync(AddressGroupNameaddressGroup,List<String>items)Removes items from an address group.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
AddressGroupNameaddressGroup=
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]");
List<String>items=newArrayList<>();
AddressGroupresponse=
addressGroupServiceClient.removeAddressGroupItemsAsync(addressGroup,items).get();
}
| Parameters | |
|---|---|
| Name | Description |
addressGroup |
AddressGroupName Required. A name of the AddressGroup to remove items from. Must be in the
format |
items |
List<String>Required. List of items to remove. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AddressGroup,OperationMetadata> |
|
removeAddressGroupItemsAsync(RemoveAddressGroupItemsRequest request)
publicfinalOperationFuture<AddressGroup,OperationMetadata>removeAddressGroupItemsAsync(RemoveAddressGroupItemsRequestrequest)Removes items from an address group.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
RemoveAddressGroupItemsRequestrequest=
RemoveAddressGroupItemsRequest.newBuilder()
.setAddressGroup(
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString())
.addAllItems(newArrayList<String>())
.setRequestId("requestId693933066")
.build();
AddressGroupresponse=addressGroupServiceClient.removeAddressGroupItemsAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
RemoveAddressGroupItemsRequest The request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AddressGroup,OperationMetadata> |
|
removeAddressGroupItemsAsync(String addressGroup, List<String> items)
publicfinalOperationFuture<AddressGroup,OperationMetadata>removeAddressGroupItemsAsync(StringaddressGroup,List<String>items)Removes items from an address group.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
StringaddressGroup=
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString();
List<String>items=newArrayList<>();
AddressGroupresponse=
addressGroupServiceClient.removeAddressGroupItemsAsync(addressGroup,items).get();
}
| Parameters | |
|---|---|
| Name | Description |
addressGroup |
String Required. A name of the AddressGroup to remove items from. Must be in the
format |
items |
List<String>Required. List of items to remove. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AddressGroup,OperationMetadata> |
|
removeAddressGroupItemsCallable()
publicfinalUnaryCallable<RemoveAddressGroupItemsRequest,Operation>removeAddressGroupItemsCallable()Removes items from an address group.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
RemoveAddressGroupItemsRequestrequest=
RemoveAddressGroupItemsRequest.newBuilder()
.setAddressGroup(
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString())
.addAllItems(newArrayList<String>())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation>future=
addressGroupServiceClient.removeAddressGroupItemsCallable().futureCall(request);
// Do something.
Operationresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<RemoveAddressGroupItemsRequest,Operation> |
|
removeAddressGroupItemsOperationCallable()
publicfinalOperationCallable<RemoveAddressGroupItemsRequest,AddressGroup,OperationMetadata>removeAddressGroupItemsOperationCallable()Removes items from an address group.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
RemoveAddressGroupItemsRequestrequest=
RemoveAddressGroupItemsRequest.newBuilder()
.setAddressGroup(
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString())
.addAllItems(newArrayList<String>())
.setRequestId("requestId693933066")
.build();
OperationFuture<AddressGroup,OperationMetadata>future=
addressGroupServiceClient.removeAddressGroupItemsOperationCallable().futureCall(request);
// Do something.
AddressGroupresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<RemoveAddressGroupItemsRequest,AddressGroup,OperationMetadata> |
|
setIamPolicy(SetIamPolicyRequest request)
publicfinalPolicysetIamPolicy(SetIamPolicyRequestrequest)Sets the access control policy on the specified resource. Replacesany existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
SetIamPolicyRequestrequest=
SetIamPolicyRequest.newBuilder()
.setResource(
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Policyresponse=addressGroupServiceClient.setIamPolicy(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.iam.v1.SetIamPolicyRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
com.google.iam.v1.Policy |
|
setIamPolicyCallable()
publicfinalUnaryCallable<SetIamPolicyRequest,Policy>setIamPolicyCallable()Sets the access control policy on the specified resource. Replacesany existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
SetIamPolicyRequestrequest=
SetIamPolicyRequest.newBuilder()
.setResource(
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Policy>future=
addressGroupServiceClient.setIamPolicyCallable().futureCall(request);
// Do something.
Policyresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> |
|
shutdown()
publicvoidshutdown()shutdownNow()
publicvoidshutdownNow()testIamPermissions(TestIamPermissionsRequest request)
publicfinalTestIamPermissionsResponsetestIamPermissions(TestIamPermissionsRequestrequest)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(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
TestIamPermissionsRequestrequest=
TestIamPermissionsRequest.newBuilder()
.setResource(
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString())
.addAllPermissions(newArrayList<String>())
.build();
TestIamPermissionsResponseresponse=addressGroupServiceClient.testIamPermissions(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.iam.v1.TestIamPermissionsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
com.google.iam.v1.TestIamPermissionsResponse |
|
testIamPermissionsCallable()
publicfinalUnaryCallable<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(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
TestIamPermissionsRequestrequest=
TestIamPermissionsRequest.newBuilder()
.setResource(
AddressGroupName.ofProjectLocationAddressGroupName(
"[PROJECT]","[LOCATION]","[ADDRESS_GROUP]")
.toString())
.addAllPermissions(newArrayList<String>())
.build();
ApiFuture<TestIamPermissionsResponse>future=
addressGroupServiceClient.testIamPermissionsCallable().futureCall(request);
// Do something.
TestIamPermissionsResponseresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> |
|
updateAddressGroupAsync(AddressGroup addressGroup, FieldMask updateMask)
publicfinalOperationFuture<AddressGroup,OperationMetadata>updateAddressGroupAsync(AddressGroupaddressGroup,FieldMaskupdateMask)Updates the parameters of a single address group.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
AddressGroupaddressGroup=AddressGroup.newBuilder().build();
FieldMaskupdateMask=FieldMask.newBuilder().build();
AddressGroupresponse=
addressGroupServiceClient.updateAddressGroupAsync(addressGroup,updateMask).get();
}
| Parameters | |
|---|---|
| Name | Description |
addressGroup |
AddressGroup Required. Updated AddressGroup resource. |
updateMask |
FieldMask Optional. Field mask is used to specify the fields to be overwritten in the AddressGroup 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. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AddressGroup,OperationMetadata> |
|
updateAddressGroupAsync(UpdateAddressGroupRequest request)
publicfinalOperationFuture<AddressGroup,OperationMetadata>updateAddressGroupAsync(UpdateAddressGroupRequestrequest)Updates the parameters of a single address group.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
UpdateAddressGroupRequestrequest=
UpdateAddressGroupRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setAddressGroup(AddressGroup.newBuilder().build())
.setRequestId("requestId693933066")
.build();
AddressGroupresponse=addressGroupServiceClient.updateAddressGroupAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
UpdateAddressGroupRequest The request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AddressGroup,OperationMetadata> |
|
updateAddressGroupCallable()
publicfinalUnaryCallable<UpdateAddressGroupRequest,Operation>updateAddressGroupCallable()Updates the parameters of a single address group.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
UpdateAddressGroupRequestrequest=
UpdateAddressGroupRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setAddressGroup(AddressGroup.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation>future=
addressGroupServiceClient.updateAddressGroupCallable().futureCall(request);
// Do something.
Operationresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<UpdateAddressGroupRequest,Operation> |
|
updateAddressGroupOperationCallable()
publicfinalOperationCallable<UpdateAddressGroupRequest,AddressGroup,OperationMetadata>updateAddressGroupOperationCallable()Updates the parameters of a single address group.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(AddressGroupServiceClientaddressGroupServiceClient=AddressGroupServiceClient.create()){
UpdateAddressGroupRequestrequest=
UpdateAddressGroupRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setAddressGroup(AddressGroup.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<AddressGroup,OperationMetadata>future=
addressGroupServiceClient.updateAddressGroupOperationCallable().futureCall(request);
// Do something.
AddressGroupresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<UpdateAddressGroupRequest,AddressGroup,OperationMetadata> |
|