GitHub Repository | Product Reference | RPC Documentation |
Service Description: This API allows customers to manage temporary, request based privileged access to their resources.
It defines the following resource model:
- A collection of
Entitlement
resources. An entitlement allows configuring (among other things):
* Some kind of privileged access that users can request. * A set of users called requesters who can request this access. * A maximum duration for which the access can be requested. * An optional approval workflow which must be satisfied before access is granted.
- A collection of
Grant
resources. A grant is a request by a requester to get the privileged access specified in an entitlement for some duration.
After the approval workflow as specified in the entitlement is satisfied, the specified access is given to the requester. The access is automatically taken back after the requested duration is over.
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 (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
CheckOnboardingStatusRequest request =
CheckOnboardingStatusRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.build();
CheckOnboardingStatusResponse response =
privilegedAccessManagerClient.checkOnboardingStatus(request);
}
Note: close() needs to be called on the PrivilegedAccessManagerClient 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 |
---|---|---|
CheckOnboardingStatus |
CheckOnboardingStatus reports the onboarding status for a project/folder/organization. Any findings reported by this API need to be fixed before PAM can be used on the resource. |
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.
|
ListEntitlements |
Lists entitlements in a given project/folder/organization 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.
|
SearchEntitlements |
|
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.
|
GetEntitlement |
Gets details of a single entitlement. |
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.
|
CreateEntitlement |
Creates a new entitlement in a given project/folder/organization 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.
|
DeleteEntitlement |
Deletes a single entitlement. This method can only be called when there are no in-progress (ACTIVE/ACTIVATING/REVOKING) grants under the entitlement. |
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.
|
UpdateEntitlement |
Updates the entitlement specified in the request. Updated fields in the entitlement need to be specified in an update mask. The changes made to an entitlement are applicable only on future grants of the entitlement. However, if new approvers are added or existing approvers are removed from the approval workflow, the changes are effective on existing grants. The following fields are not supported for updates: * All immutable fields * Entitlement name * Resource name * Resource type * Adding an approval workflow in an entitlement which previously had no approval workflow. * Deleting the approval workflow from an entitlement. * Adding or deleting a step in the approval workflow (only one step is supported) Note that updates are allowed on the list of approvers in an approval workflow step. |
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.
|
ListGrants |
Lists grants for a given entitlement. |
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.
|
SearchGrants |
|
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.
|
GetGrant |
Get details of a single grant. |
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.
|
CreateGrant |
Creates a new grant 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.
|
ApproveGrant |
|
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.
|
DenyGrant |
|
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.
|
RevokeGrant |
|
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.
|
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.
|
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 PrivilegedAccessManagerSettings 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
PrivilegedAccessManagerSettings privilegedAccessManagerSettings =
PrivilegedAccessManagerSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create(privilegedAccessManagerSettings);
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
PrivilegedAccessManagerSettings privilegedAccessManagerSettings =
PrivilegedAccessManagerSettings.newBuilder().setEndpoint(myEndpoint).build();
PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create(privilegedAccessManagerSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
PrivilegedAccessManagerSettings privilegedAccessManagerSettings =
PrivilegedAccessManagerSettings.newHttpJsonBuilder().build();
PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create(privilegedAccessManagerSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
public static final PrivilegedAccessManagerClient create()
Constructs an instance of PrivilegedAccessManagerClient with default settings.
Returns | |
---|---|
Type | Description |
PrivilegedAccessManagerClient |
Exceptions | |
---|---|
Type | Description |
IOException |
create(PrivilegedAccessManagerSettings settings)
public static final PrivilegedAccessManagerClient create(PrivilegedAccessManagerSettings settings)
Constructs an instance of PrivilegedAccessManagerClient, 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 |
PrivilegedAccessManagerSettings |
Returns | |
---|---|
Type | Description |
PrivilegedAccessManagerClient |
Exceptions | |
---|---|
Type | Description |
IOException |
create(PrivilegedAccessManagerStub stub)
public static final PrivilegedAccessManagerClient create(PrivilegedAccessManagerStub stub)
Constructs an instance of PrivilegedAccessManagerClient, using the given stub for making calls. This is for advanced usage - prefer using create(PrivilegedAccessManagerSettings).
Parameter | |
---|---|
Name | Description |
stub |
PrivilegedAccessManagerStub |
Returns | |
---|---|
Type | Description |
PrivilegedAccessManagerClient |
Constructors
PrivilegedAccessManagerClient(PrivilegedAccessManagerSettings settings)
protected PrivilegedAccessManagerClient(PrivilegedAccessManagerSettings settings)
Constructs an instance of PrivilegedAccessManagerClient, 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 |
PrivilegedAccessManagerSettings |
PrivilegedAccessManagerClient(PrivilegedAccessManagerStub stub)
protected PrivilegedAccessManagerClient(PrivilegedAccessManagerStub stub)
Parameter | |
---|---|
Name | Description |
stub |
PrivilegedAccessManagerStub |
Methods
approveGrant(ApproveGrantRequest request)
public final Grant approveGrant(ApproveGrantRequest request)
ApproveGrant
is used to approve a grant. This method can only be called on a grant when it's
in the APPROVAL_AWAITED
state. This operation can't be undone.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
ApproveGrantRequest request =
ApproveGrantRequest.newBuilder()
.setName(
GrantName.ofProjectLocationEntitlementGrantName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]", "[GRANT]")
.toString())
.setReason("reason-934964668")
.build();
Grant response = privilegedAccessManagerClient.approveGrant(request);
}
Parameter | |
---|---|
Name | Description |
request |
ApproveGrantRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
Grant |
approveGrantCallable()
public final UnaryCallable<ApproveGrantRequest,Grant> approveGrantCallable()
ApproveGrant
is used to approve a grant. This method can only be called on a grant when it's
in the APPROVAL_AWAITED
state. This operation can't be undone.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
ApproveGrantRequest request =
ApproveGrantRequest.newBuilder()
.setName(
GrantName.ofProjectLocationEntitlementGrantName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]", "[GRANT]")
.toString())
.setReason("reason-934964668")
.build();
ApiFuture<Grant> future =
privilegedAccessManagerClient.approveGrantCallable().futureCall(request);
// Do something.
Grant response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ApproveGrantRequest,Grant> |
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Parameters | |
---|---|
Name | Description |
duration |
long |
unit |
TimeUnit |
Returns | |
---|---|
Type | Description |
boolean |
Exceptions | |
---|---|
Type | Description |
InterruptedException |
checkOnboardingStatus(CheckOnboardingStatusRequest request)
public final CheckOnboardingStatusResponse checkOnboardingStatus(CheckOnboardingStatusRequest request)
CheckOnboardingStatus reports the onboarding status for a project/folder/organization. Any findings reported by this API need to be fixed before PAM can be used on the resource.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
CheckOnboardingStatusRequest request =
CheckOnboardingStatusRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.build();
CheckOnboardingStatusResponse response =
privilegedAccessManagerClient.checkOnboardingStatus(request);
}
Parameter | |
---|---|
Name | Description |
request |
CheckOnboardingStatusRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
CheckOnboardingStatusResponse |
checkOnboardingStatusCallable()
public final UnaryCallable<CheckOnboardingStatusRequest,CheckOnboardingStatusResponse> checkOnboardingStatusCallable()
CheckOnboardingStatus reports the onboarding status for a project/folder/organization. Any findings reported by this API need to be fixed before PAM can be used on the resource.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
CheckOnboardingStatusRequest request =
CheckOnboardingStatusRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.build();
ApiFuture<CheckOnboardingStatusResponse> future =
privilegedAccessManagerClient.checkOnboardingStatusCallable().futureCall(request);
// Do something.
CheckOnboardingStatusResponse response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<CheckOnboardingStatusRequest,CheckOnboardingStatusResponse> |
close()
public final void close()
createEntitlementAsync(CreateEntitlementRequest request)
public final OperationFuture<Entitlement,OperationMetadata> createEntitlementAsync(CreateEntitlementRequest request)
Creates a new entitlement in a given project/folder/organization 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 (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
CreateEntitlementRequest request =
CreateEntitlementRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setEntitlementId("entitlementId-1302274264")
.setEntitlement(Entitlement.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Entitlement response = privilegedAccessManagerClient.createEntitlementAsync(request).get();
}
Parameter | |
---|---|
Name | Description |
request |
CreateEntitlementRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Entitlement,OperationMetadata> |
createEntitlementAsync(FolderLocationName parent, Entitlement entitlement, String entitlementId)
public final OperationFuture<Entitlement,OperationMetadata> createEntitlementAsync(FolderLocationName parent, Entitlement entitlement, String entitlementId)
Creates a new entitlement in a given project/folder/organization 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 (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
FolderLocationName parent = FolderLocationName.of("[FOLDER]", "[LOCATION]");
Entitlement entitlement = Entitlement.newBuilder().build();
String entitlementId = "entitlementId-1302274264";
Entitlement response =
privilegedAccessManagerClient
.createEntitlementAsync(parent, entitlement, entitlementId)
.get();
}
Parameters | |
---|---|
Name | Description |
parent |
FolderLocationName Required. Name of the parent resource for the entitlement. Possible formats:
|
entitlement |
Entitlement Required. The resource being created |
entitlementId |
String Required. The ID to use for this entitlement. This becomes the last part of the resource name. This value should be 4-63 characters in length, and valid characters are "[a-z]", "[0-9]", and "-". The first character should be from [a-z]. This value should be unique among all other entitlements under the specified |
Returns | |
---|---|
Type | Description |
OperationFuture<Entitlement,OperationMetadata> |
createEntitlementAsync(LocationName parent, Entitlement entitlement, String entitlementId)
public final OperationFuture<Entitlement,OperationMetadata> createEntitlementAsync(LocationName parent, Entitlement entitlement, String entitlementId)
Creates a new entitlement in a given project/folder/organization 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 (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Entitlement entitlement = Entitlement.newBuilder().build();
String entitlementId = "entitlementId-1302274264";
Entitlement response =
privilegedAccessManagerClient
.createEntitlementAsync(parent, entitlement, entitlementId)
.get();
}
Parameters | |
---|---|
Name | Description |
parent |
LocationName Required. Name of the parent resource for the entitlement. Possible formats:
|
entitlement |
Entitlement Required. The resource being created |
entitlementId |
String Required. The ID to use for this entitlement. This becomes the last part of the resource name. This value should be 4-63 characters in length, and valid characters are "[a-z]", "[0-9]", and "-". The first character should be from [a-z]. This value should be unique among all other entitlements under the specified |
Returns | |
---|---|
Type | Description |
OperationFuture<Entitlement,OperationMetadata> |
createEntitlementAsync(OrganizationLocationName parent, Entitlement entitlement, String entitlementId)
public final OperationFuture<Entitlement,OperationMetadata> createEntitlementAsync(OrganizationLocationName parent, Entitlement entitlement, String entitlementId)
Creates a new entitlement in a given project/folder/organization 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 (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
Entitlement entitlement = Entitlement.newBuilder().build();
String entitlementId = "entitlementId-1302274264";
Entitlement response =
privilegedAccessManagerClient
.createEntitlementAsync(parent, entitlement, entitlementId)
.get();
}
Parameters | |
---|---|
Name | Description |
parent |
OrganizationLocationName Required. Name of the parent resource for the entitlement. Possible formats:
|
entitlement |
Entitlement Required. The resource being created |
entitlementId |
String Required. The ID to use for this entitlement. This becomes the last part of the resource name. This value should be 4-63 characters in length, and valid characters are "[a-z]", "[0-9]", and "-". The first character should be from [a-z]. This value should be unique among all other entitlements under the specified |
Returns | |
---|---|
Type | Description |
OperationFuture<Entitlement,OperationMetadata> |
createEntitlementAsync(String parent, Entitlement entitlement, String entitlementId)
public final OperationFuture<Entitlement,OperationMetadata> createEntitlementAsync(String parent, Entitlement entitlement, String entitlementId)
Creates a new entitlement in a given project/folder/organization 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 (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
Entitlement entitlement = Entitlement.newBuilder().build();
String entitlementId = "entitlementId-1302274264";
Entitlement response =
privilegedAccessManagerClient
.createEntitlementAsync(parent, entitlement, entitlementId)
.get();
}
Parameters | |
---|---|
Name | Description |
parent |
String Required. Name of the parent resource for the entitlement. Possible formats:
|
entitlement |
Entitlement Required. The resource being created |
entitlementId |
String Required. The ID to use for this entitlement. This becomes the last part of the resource name. This value should be 4-63 characters in length, and valid characters are "[a-z]", "[0-9]", and "-". The first character should be from [a-z]. This value should be unique among all other entitlements under the specified |
Returns | |
---|---|
Type | Description |
OperationFuture<Entitlement,OperationMetadata> |
createEntitlementCallable()
public final UnaryCallable<CreateEntitlementRequest,Operation> createEntitlementCallable()
Creates a new entitlement in a given project/folder/organization 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 (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
CreateEntitlementRequest request =
CreateEntitlementRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setEntitlementId("entitlementId-1302274264")
.setEntitlement(Entitlement.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
privilegedAccessManagerClient.createEntitlementCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<CreateEntitlementRequest,Operation> |
createEntitlementOperationCallable()
public final OperationCallable<CreateEntitlementRequest,Entitlement,OperationMetadata> createEntitlementOperationCallable()
Creates a new entitlement in a given project/folder/organization 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 (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
CreateEntitlementRequest request =
CreateEntitlementRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setEntitlementId("entitlementId-1302274264")
.setEntitlement(Entitlement.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Entitlement, OperationMetadata> future =
privilegedAccessManagerClient.createEntitlementOperationCallable().futureCall(request);
// Do something.
Entitlement response = future.get();
}
Returns | |
---|---|
Type | Description |
OperationCallable<CreateEntitlementRequest,Entitlement,OperationMetadata> |
createGrant(CreateGrantRequest request)
public final Grant createGrant(CreateGrantRequest request)
Creates a new grant 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 (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
CreateGrantRequest request =
CreateGrantRequest.newBuilder()
.setParent(
EntitlementName.ofProjectLocationEntitlementName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]")
.toString())
.setGrant(Grant.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Grant response = privilegedAccessManagerClient.createGrant(request);
}
Parameter | |
---|---|
Name | Description |
request |
CreateGrantRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
Grant |
createGrant(EntitlementName parent, Grant grant)
public final Grant createGrant(EntitlementName parent, Grant grant)
Creates a new grant 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 (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
EntitlementName parent =
EntitlementName.ofProjectLocationEntitlementName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]");
Grant grant = Grant.newBuilder().build();
Grant response = privilegedAccessManagerClient.createGrant(parent, grant);
}
Parameters | |
---|---|
Name | Description |
parent |
EntitlementName Required. Name of the parent entitlement for which this grant is being requested. |
grant |
Grant Required. The resource being created. |
Returns | |
---|---|
Type | Description |
Grant |
createGrant(String parent, Grant grant)
public final Grant createGrant(String parent, Grant grant)
Creates a new grant 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 (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
String parent =
EntitlementName.ofProjectLocationEntitlementName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]")
.toString();
Grant grant = Grant.newBuilder().build();
Grant response = privilegedAccessManagerClient.createGrant(parent, grant);
}
Parameters | |
---|---|
Name | Description |
parent |
String Required. Name of the parent entitlement for which this grant is being requested. |
grant |
Grant Required. The resource being created. |
Returns | |
---|---|
Type | Description |
Grant |
createGrantCallable()
public final UnaryCallable<CreateGrantRequest,Grant> createGrantCallable()
Creates a new grant 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 (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
CreateGrantRequest request =
CreateGrantRequest.newBuilder()
.setParent(
EntitlementName.ofProjectLocationEntitlementName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]")
.toString())
.setGrant(Grant.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Grant> future =
privilegedAccessManagerClient.createGrantCallable().futureCall(request);
// Do something.
Grant response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<CreateGrantRequest,Grant> |
deleteEntitlementAsync(DeleteEntitlementRequest request)
public final OperationFuture<Entitlement,OperationMetadata> deleteEntitlementAsync(DeleteEntitlementRequest request)
Deletes a single entitlement. This method can only be called when there are no in-progress (ACTIVE/ACTIVATING/REVOKING) grants under the entitlement.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
DeleteEntitlementRequest request =
DeleteEntitlementRequest.newBuilder()
.setName(
EntitlementName.ofProjectLocationEntitlementName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]")
.toString())
.setRequestId("requestId693933066")
.setForce(true)
.build();
Entitlement response = privilegedAccessManagerClient.deleteEntitlementAsync(request).get();
}
Parameter | |
---|---|
Name | Description |
request |
DeleteEntitlementRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Entitlement,OperationMetadata> |
deleteEntitlementAsync(EntitlementName name)
public final OperationFuture<Entitlement,OperationMetadata> deleteEntitlementAsync(EntitlementName name)
Deletes a single entitlement. This method can only be called when there are no in-progress (ACTIVE/ACTIVATING/REVOKING) grants under the entitlement.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
EntitlementName name =
EntitlementName.ofProjectLocationEntitlementName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]");
Entitlement response = privilegedAccessManagerClient.deleteEntitlementAsync(name).get();
}
Parameter | |
---|---|
Name | Description |
name |
EntitlementName Required. Name of the resource. |
Returns | |
---|---|
Type | Description |
OperationFuture<Entitlement,OperationMetadata> |
deleteEntitlementAsync(String name)
public final OperationFuture<Entitlement,OperationMetadata> deleteEntitlementAsync(String name)
Deletes a single entitlement. This method can only be called when there are no in-progress (ACTIVE/ACTIVATING/REVOKING) grants under the entitlement.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
String name =
EntitlementName.ofProjectLocationEntitlementName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]")
.toString();
Entitlement response = privilegedAccessManagerClient.deleteEntitlementAsync(name).get();
}
Parameter | |
---|---|
Name | Description |
name |
String Required. Name of the resource. |
Returns | |
---|---|
Type | Description |
OperationFuture<Entitlement,OperationMetadata> |
deleteEntitlementCallable()
public final UnaryCallable<DeleteEntitlementRequest,Operation> deleteEntitlementCallable()
Deletes a single entitlement. This method can only be called when there are no in-progress (ACTIVE/ACTIVATING/REVOKING) grants under the entitlement.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
DeleteEntitlementRequest request =
DeleteEntitlementRequest.newBuilder()
.setName(
EntitlementName.ofProjectLocationEntitlementName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]")
.toString())
.setRequestId("requestId693933066")
.setForce(true)
.build();
ApiFuture<Operation> future =
privilegedAccessManagerClient.deleteEntitlementCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<DeleteEntitlementRequest,Operation> |
deleteEntitlementOperationCallable()
public final OperationCallable<DeleteEntitlementRequest,Entitlement,OperationMetadata> deleteEntitlementOperationCallable()
Deletes a single entitlement. This method can only be called when there are no in-progress (ACTIVE/ACTIVATING/REVOKING) grants under the entitlement.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
DeleteEntitlementRequest request =
DeleteEntitlementRequest.newBuilder()
.setName(
EntitlementName.ofProjectLocationEntitlementName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]")
.toString())
.setRequestId("requestId693933066")
.setForce(true)
.build();
OperationFuture<Entitlement, OperationMetadata> future =
privilegedAccessManagerClient.deleteEntitlementOperationCallable().futureCall(request);
// Do something.
Entitlement response = future.get();
}
Returns | |
---|---|
Type | Description |
OperationCallable<DeleteEntitlementRequest,Entitlement,OperationMetadata> |
denyGrant(DenyGrantRequest request)
public final Grant denyGrant(DenyGrantRequest request)
DenyGrant
is used to deny a grant. This method can only be called on a grant when it's in the
APPROVAL_AWAITED
state. This operation can't be undone.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
DenyGrantRequest request =
DenyGrantRequest.newBuilder()
.setName(
GrantName.ofProjectLocationEntitlementGrantName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]", "[GRANT]")
.toString())
.setReason("reason-934964668")
.build();
Grant response = privilegedAccessManagerClient.denyGrant(request);
}
Parameter | |
---|---|
Name | Description |
request |
DenyGrantRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
Grant |
denyGrantCallable()
public final UnaryCallable<DenyGrantRequest,Grant> denyGrantCallable()
DenyGrant
is used to deny a grant. This method can only be called on a grant when it's in the
APPROVAL_AWAITED
state. This operation can't be undone.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
DenyGrantRequest request =
DenyGrantRequest.newBuilder()
.setName(
GrantName.ofProjectLocationEntitlementGrantName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]", "[GRANT]")
.toString())
.setReason("reason-934964668")
.build();
ApiFuture<Grant> future =
privilegedAccessManagerClient.denyGrantCallable().futureCall(request);
// Do something.
Grant response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<DenyGrantRequest,Grant> |
getEntitlement(EntitlementName name)
public final Entitlement getEntitlement(EntitlementName name)
Gets details of a single entitlement.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
EntitlementName name =
EntitlementName.ofProjectLocationEntitlementName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]");
Entitlement response = privilegedAccessManagerClient.getEntitlement(name);
}
Parameter | |
---|---|
Name | Description |
name |
EntitlementName Required. Name of the resource. |
Returns | |
---|---|
Type | Description |
Entitlement |
getEntitlement(GetEntitlementRequest request)
public final Entitlement getEntitlement(GetEntitlementRequest request)
Gets details of a single entitlement.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
GetEntitlementRequest request =
GetEntitlementRequest.newBuilder()
.setName(
EntitlementName.ofProjectLocationEntitlementName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]")
.toString())
.build();
Entitlement response = privilegedAccessManagerClient.getEntitlement(request);
}
Parameter | |
---|---|
Name | Description |
request |
GetEntitlementRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
Entitlement |
getEntitlement(String name)
public final Entitlement getEntitlement(String name)
Gets details of a single entitlement.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
String name =
EntitlementName.ofProjectLocationEntitlementName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]")
.toString();
Entitlement response = privilegedAccessManagerClient.getEntitlement(name);
}
Parameter | |
---|---|
Name | Description |
name |
String Required. Name of the resource. |
Returns | |
---|---|
Type | Description |
Entitlement |
getEntitlementCallable()
public final UnaryCallable<GetEntitlementRequest,Entitlement> getEntitlementCallable()
Gets details of a single entitlement.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
GetEntitlementRequest request =
GetEntitlementRequest.newBuilder()
.setName(
EntitlementName.ofProjectLocationEntitlementName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]")
.toString())
.build();
ApiFuture<Entitlement> future =
privilegedAccessManagerClient.getEntitlementCallable().futureCall(request);
// Do something.
Entitlement response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetEntitlementRequest,Entitlement> |
getGrant(GetGrantRequest request)
public final Grant getGrant(GetGrantRequest request)
Get details of a single grant.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
GetGrantRequest request =
GetGrantRequest.newBuilder()
.setName(
GrantName.ofProjectLocationEntitlementGrantName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]", "[GRANT]")
.toString())
.build();
Grant response = privilegedAccessManagerClient.getGrant(request);
}
Parameter | |
---|---|
Name | Description |
request |
GetGrantRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
Grant |
getGrant(GrantName name)
public final Grant getGrant(GrantName name)
Get details of a single grant.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
GrantName name =
GrantName.ofProjectLocationEntitlementGrantName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]", "[GRANT]");
Grant response = privilegedAccessManagerClient.getGrant(name);
}
Parameter | |
---|---|
Name | Description |
name |
GrantName Required. Name of the resource. |
Returns | |
---|---|
Type | Description |
Grant |
getGrant(String name)
public final Grant getGrant(String name)
Get details of a single grant.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
String name =
GrantName.ofProjectLocationEntitlementGrantName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]", "[GRANT]")
.toString();
Grant response = privilegedAccessManagerClient.getGrant(name);
}
Parameter | |
---|---|
Name | Description |
name |
String Required. Name of the resource. |
Returns | |
---|---|
Type | Description |
Grant |
getGrantCallable()
public final UnaryCallable<GetGrantRequest,Grant> getGrantCallable()
Get details of a single grant.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
GetGrantRequest request =
GetGrantRequest.newBuilder()
.setName(
GrantName.ofProjectLocationEntitlementGrantName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]", "[GRANT]")
.toString())
.build();
ApiFuture<Grant> future =
privilegedAccessManagerClient.getGrantCallable().futureCall(request);
// Do something.
Grant response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetGrantRequest,Grant> |
getHttpJsonOperationsClient()
public final OperationsClient getHttpJsonOperationsClient()
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 |
getLocation(GetLocationRequest request)
public final Location getLocation(GetLocationRequest request)
Gets information about a location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
Location response = privilegedAccessManagerClient.getLocation(request);
}
Parameter | |
---|---|
Name | Description |
request |
com.google.cloud.location.GetLocationRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
com.google.cloud.location.Location |
getLocationCallable()
public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()
Gets information about a location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location> future =
privilegedAccessManagerClient.getLocationCallable().futureCall(request);
// Do something.
Location response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> |
getOperationsClient()
public final OperationsClient getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
Returns | |
---|---|
Type | Description |
OperationsClient |
getSettings()
public final PrivilegedAccessManagerSettings getSettings()
Returns | |
---|---|
Type | Description |
PrivilegedAccessManagerSettings |
getStub()
public PrivilegedAccessManagerStub getStub()
Returns | |
---|---|
Type | Description |
PrivilegedAccessManagerStub |
isShutdown()
public boolean isShutdown()
Returns | |
---|---|
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Returns | |
---|---|
Type | Description |
boolean |
listEntitlements(FolderLocationName parent)
public final PrivilegedAccessManagerClient.ListEntitlementsPagedResponse listEntitlements(FolderLocationName parent)
Lists entitlements in a given project/folder/organization 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 (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
FolderLocationName parent = FolderLocationName.of("[FOLDER]", "[LOCATION]");
for (Entitlement element :
privilegedAccessManagerClient.listEntitlements(parent).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
parent |
FolderLocationName Required. The parent which owns the entitlement resources. |
Returns | |
---|---|
Type | Description |
PrivilegedAccessManagerClient.ListEntitlementsPagedResponse |
listEntitlements(ListEntitlementsRequest request)
public final PrivilegedAccessManagerClient.ListEntitlementsPagedResponse listEntitlements(ListEntitlementsRequest request)
Lists entitlements in a given project/folder/organization 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 (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
ListEntitlementsRequest request =
ListEntitlementsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (Entitlement element :
privilegedAccessManagerClient.listEntitlements(request).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
request |
ListEntitlementsRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
PrivilegedAccessManagerClient.ListEntitlementsPagedResponse |
listEntitlements(LocationName parent)
public final PrivilegedAccessManagerClient.ListEntitlementsPagedResponse listEntitlements(LocationName parent)
Lists entitlements in a given project/folder/organization 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 (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Entitlement element :
privilegedAccessManagerClient.listEntitlements(parent).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
parent |
LocationName Required. The parent which owns the entitlement resources. |
Returns | |
---|---|
Type | Description |
PrivilegedAccessManagerClient.ListEntitlementsPagedResponse |
listEntitlements(OrganizationLocationName parent)
public final PrivilegedAccessManagerClient.ListEntitlementsPagedResponse listEntitlements(OrganizationLocationName parent)
Lists entitlements in a given project/folder/organization 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 (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
for (Entitlement element :
privilegedAccessManagerClient.listEntitlements(parent).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
parent |
OrganizationLocationName Required. The parent which owns the entitlement resources. |
Returns | |
---|---|
Type | Description |
PrivilegedAccessManagerClient.ListEntitlementsPagedResponse |
listEntitlements(String parent)
public final PrivilegedAccessManagerClient.ListEntitlementsPagedResponse listEntitlements(String parent)
Lists entitlements in a given project/folder/organization 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 (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (Entitlement element :
privilegedAccessManagerClient.listEntitlements(parent).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
parent |
String Required. The parent which owns the entitlement resources. |
Returns | |
---|---|
Type | Description |
PrivilegedAccessManagerClient.ListEntitlementsPagedResponse |
listEntitlementsCallable()
public final UnaryCallable<ListEntitlementsRequest,ListEntitlementsResponse> listEntitlementsCallable()
Lists entitlements in a given project/folder/organization 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 (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
ListEntitlementsRequest request =
ListEntitlementsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListEntitlementsResponse response =
privilegedAccessManagerClient.listEntitlementsCallable().call(request);
for (Entitlement element : response.getEntitlementsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ListEntitlementsRequest,ListEntitlementsResponse> |
listEntitlementsPagedCallable()
public final UnaryCallable<ListEntitlementsRequest,PrivilegedAccessManagerClient.ListEntitlementsPagedResponse> listEntitlementsPagedCallable()
Lists entitlements in a given project/folder/organization 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 (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
ListEntitlementsRequest request =
ListEntitlementsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<Entitlement> future =
privilegedAccessManagerClient.listEntitlementsPagedCallable().futureCall(request);
// Do something.
for (Entitlement element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ListEntitlementsRequest,ListEntitlementsPagedResponse> |
listGrants(EntitlementName parent)
public final PrivilegedAccessManagerClient.ListGrantsPagedResponse listGrants(EntitlementName parent)
Lists grants for a given entitlement.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
EntitlementName parent =
EntitlementName.ofProjectLocationEntitlementName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]");
for (Grant element : privilegedAccessManagerClient.listGrants(parent).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
parent |
EntitlementName Required. The parent resource which owns the grants. |
Returns | |
---|---|
Type | Description |
PrivilegedAccessManagerClient.ListGrantsPagedResponse |
listGrants(ListGrantsRequest request)
public final PrivilegedAccessManagerClient.ListGrantsPagedResponse listGrants(ListGrantsRequest request)
Lists grants for a given entitlement.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
ListGrantsRequest request =
ListGrantsRequest.newBuilder()
.setParent(
EntitlementName.ofProjectLocationEntitlementName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (Grant element : privilegedAccessManagerClient.listGrants(request).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
request |
ListGrantsRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
PrivilegedAccessManagerClient.ListGrantsPagedResponse |
listGrants(String parent)
public final PrivilegedAccessManagerClient.ListGrantsPagedResponse listGrants(String parent)
Lists grants for a given entitlement.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
String parent =
EntitlementName.ofProjectLocationEntitlementName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]")
.toString();
for (Grant element : privilegedAccessManagerClient.listGrants(parent).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
parent |
String Required. The parent resource which owns the grants. |
Returns | |
---|---|
Type | Description |
PrivilegedAccessManagerClient.ListGrantsPagedResponse |
listGrantsCallable()
public final UnaryCallable<ListGrantsRequest,ListGrantsResponse> listGrantsCallable()
Lists grants for a given entitlement.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
ListGrantsRequest request =
ListGrantsRequest.newBuilder()
.setParent(
EntitlementName.ofProjectLocationEntitlementName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListGrantsResponse response =
privilegedAccessManagerClient.listGrantsCallable().call(request);
for (Grant element : response.getGrantsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ListGrantsRequest,ListGrantsResponse> |
listGrantsPagedCallable()
public final UnaryCallable<ListGrantsRequest,PrivilegedAccessManagerClient.ListGrantsPagedResponse> listGrantsPagedCallable()
Lists grants for a given entitlement.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
ListGrantsRequest request =
ListGrantsRequest.newBuilder()
.setParent(
EntitlementName.ofProjectLocationEntitlementName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<Grant> future =
privilegedAccessManagerClient.listGrantsPagedCallable().futureCall(request);
// Do something.
for (Grant element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ListGrantsRequest,ListGrantsPagedResponse> |
listLocations(ListLocationsRequest request)
public final PrivilegedAccessManagerClient.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 (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Location element : privilegedAccessManagerClient.listLocations(request).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
request |
com.google.cloud.location.ListLocationsRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
PrivilegedAccessManagerClient.ListLocationsPagedResponse |
listLocationsCallable()
public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()
Lists information about the supported locations for this service.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListLocationsResponse response =
privilegedAccessManagerClient.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;
}
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> |
listLocationsPagedCallable()
public final UnaryCallable<ListLocationsRequest,PrivilegedAccessManagerClient.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 (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Location> future =
privilegedAccessManagerClient.listLocationsPagedCallable().futureCall(request);
// Do something.
for (Location element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse> |
revokeGrantAsync(RevokeGrantRequest request)
public final OperationFuture<Grant,OperationMetadata> revokeGrantAsync(RevokeGrantRequest request)
RevokeGrant
is used to immediately revoke access for a grant. This method can be called when
the grant is in a non-terminal state.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
RevokeGrantRequest request =
RevokeGrantRequest.newBuilder()
.setName(
GrantName.ofProjectLocationEntitlementGrantName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]", "[GRANT]")
.toString())
.setReason("reason-934964668")
.build();
Grant response = privilegedAccessManagerClient.revokeGrantAsync(request).get();
}
Parameter | |
---|---|
Name | Description |
request |
RevokeGrantRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Grant,OperationMetadata> |
revokeGrantCallable()
public final UnaryCallable<RevokeGrantRequest,Operation> revokeGrantCallable()
RevokeGrant
is used to immediately revoke access for a grant. This method can be called when
the grant is in a non-terminal state.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
RevokeGrantRequest request =
RevokeGrantRequest.newBuilder()
.setName(
GrantName.ofProjectLocationEntitlementGrantName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]", "[GRANT]")
.toString())
.setReason("reason-934964668")
.build();
ApiFuture<Operation> future =
privilegedAccessManagerClient.revokeGrantCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<RevokeGrantRequest,Operation> |
revokeGrantOperationCallable()
public final OperationCallable<RevokeGrantRequest,Grant,OperationMetadata> revokeGrantOperationCallable()
RevokeGrant
is used to immediately revoke access for a grant. This method can be called when
the grant is in a non-terminal state.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
RevokeGrantRequest request =
RevokeGrantRequest.newBuilder()
.setName(
GrantName.ofProjectLocationEntitlementGrantName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]", "[GRANT]")
.toString())
.setReason("reason-934964668")
.build();
OperationFuture<Grant, OperationMetadata> future =
privilegedAccessManagerClient.revokeGrantOperationCallable().futureCall(request);
// Do something.
Grant response = future.get();
}
Returns | |
---|---|
Type | Description |
OperationCallable<RevokeGrantRequest,Grant,OperationMetadata> |
searchEntitlements(SearchEntitlementsRequest request)
public final PrivilegedAccessManagerClient.SearchEntitlementsPagedResponse searchEntitlements(SearchEntitlementsRequest request)
SearchEntitlements
returns entitlements on which the caller has the specified access.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
SearchEntitlementsRequest request =
SearchEntitlementsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Entitlement element :
privilegedAccessManagerClient.searchEntitlements(request).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
request |
SearchEntitlementsRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
PrivilegedAccessManagerClient.SearchEntitlementsPagedResponse |
searchEntitlementsCallable()
public final UnaryCallable<SearchEntitlementsRequest,SearchEntitlementsResponse> searchEntitlementsCallable()
SearchEntitlements
returns entitlements on which the caller has the specified access.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
SearchEntitlementsRequest request =
SearchEntitlementsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
SearchEntitlementsResponse response =
privilegedAccessManagerClient.searchEntitlementsCallable().call(request);
for (Entitlement element : response.getEntitlementsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<SearchEntitlementsRequest,SearchEntitlementsResponse> |
searchEntitlementsPagedCallable()
public final UnaryCallable<SearchEntitlementsRequest,PrivilegedAccessManagerClient.SearchEntitlementsPagedResponse> searchEntitlementsPagedCallable()
SearchEntitlements
returns entitlements on which the caller has the specified access.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
SearchEntitlementsRequest request =
SearchEntitlementsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Entitlement> future =
privilegedAccessManagerClient.searchEntitlementsPagedCallable().futureCall(request);
// Do something.
for (Entitlement element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<SearchEntitlementsRequest,SearchEntitlementsPagedResponse> |
searchGrants(SearchGrantsRequest request)
public final PrivilegedAccessManagerClient.SearchGrantsPagedResponse searchGrants(SearchGrantsRequest request)
SearchGrants
returns grants that are related to the calling user in the specified way.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
SearchGrantsRequest request =
SearchGrantsRequest.newBuilder()
.setParent(
EntitlementName.ofProjectLocationEntitlementName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]")
.toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Grant element : privilegedAccessManagerClient.searchGrants(request).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
request |
SearchGrantsRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
PrivilegedAccessManagerClient.SearchGrantsPagedResponse |
searchGrantsCallable()
public final UnaryCallable<SearchGrantsRequest,SearchGrantsResponse> searchGrantsCallable()
SearchGrants
returns grants that are related to the calling user in the specified way.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
SearchGrantsRequest request =
SearchGrantsRequest.newBuilder()
.setParent(
EntitlementName.ofProjectLocationEntitlementName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]")
.toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
SearchGrantsResponse response =
privilegedAccessManagerClient.searchGrantsCallable().call(request);
for (Grant element : response.getGrantsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<SearchGrantsRequest,SearchGrantsResponse> |
searchGrantsPagedCallable()
public final UnaryCallable<SearchGrantsRequest,PrivilegedAccessManagerClient.SearchGrantsPagedResponse> searchGrantsPagedCallable()
SearchGrants
returns grants that are related to the calling user in the specified way.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
SearchGrantsRequest request =
SearchGrantsRequest.newBuilder()
.setParent(
EntitlementName.ofProjectLocationEntitlementName(
"[PROJECT]", "[LOCATION]", "[ENTITLEMENT]")
.toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Grant> future =
privilegedAccessManagerClient.searchGrantsPagedCallable().futureCall(request);
// Do something.
for (Grant element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<SearchGrantsRequest,SearchGrantsPagedResponse> |
shutdown()
public void shutdown()
shutdownNow()
public void shutdownNow()
updateEntitlementAsync(Entitlement entitlement, FieldMask updateMask)
public final OperationFuture<Entitlement,OperationMetadata> updateEntitlementAsync(Entitlement entitlement, FieldMask updateMask)
Updates the entitlement specified in the request. Updated fields in the entitlement need to be specified in an update mask. The changes made to an entitlement are applicable only on future grants of the entitlement. However, if new approvers are added or existing approvers are removed from the approval workflow, the changes are effective on existing grants.
The following fields are not supported for updates:
* All immutable fields * Entitlement name * Resource name * Resource type * Adding an approval workflow in an entitlement which previously had no approval workflow. * Deleting the approval workflow from an entitlement. * Adding or deleting a step in the approval workflow (only one step is supported)
Note that updates are allowed on the list of approvers in an approval workflow step.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
Entitlement entitlement = Entitlement.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Entitlement response =
privilegedAccessManagerClient.updateEntitlementAsync(entitlement, updateMask).get();
}
Parameters | |
---|---|
Name | Description |
entitlement |
Entitlement Required. The entitlement resource that is updated. |
updateMask |
FieldMask Required. The list of fields to update. A field is overwritten if, and only
if, it is in the mask. Any immutable fields set in the mask are ignored by the server.
Repeated fields and map fields are only allowed in the last position of a |
Returns | |
---|---|
Type | Description |
OperationFuture<Entitlement,OperationMetadata> |
updateEntitlementAsync(UpdateEntitlementRequest request)
public final OperationFuture<Entitlement,OperationMetadata> updateEntitlementAsync(UpdateEntitlementRequest request)
Updates the entitlement specified in the request. Updated fields in the entitlement need to be specified in an update mask. The changes made to an entitlement are applicable only on future grants of the entitlement. However, if new approvers are added or existing approvers are removed from the approval workflow, the changes are effective on existing grants.
The following fields are not supported for updates:
* All immutable fields * Entitlement name * Resource name * Resource type * Adding an approval workflow in an entitlement which previously had no approval workflow. * Deleting the approval workflow from an entitlement. * Adding or deleting a step in the approval workflow (only one step is supported)
Note that updates are allowed on the list of approvers in an approval workflow step.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
UpdateEntitlementRequest request =
UpdateEntitlementRequest.newBuilder()
.setEntitlement(Entitlement.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Entitlement response = privilegedAccessManagerClient.updateEntitlementAsync(request).get();
}
Parameter | |
---|---|
Name | Description |
request |
UpdateEntitlementRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Entitlement,OperationMetadata> |
updateEntitlementCallable()
public final UnaryCallable<UpdateEntitlementRequest,Operation> updateEntitlementCallable()
Updates the entitlement specified in the request. Updated fields in the entitlement need to be specified in an update mask. The changes made to an entitlement are applicable only on future grants of the entitlement. However, if new approvers are added or existing approvers are removed from the approval workflow, the changes are effective on existing grants.
The following fields are not supported for updates:
* All immutable fields * Entitlement name * Resource name * Resource type * Adding an approval workflow in an entitlement which previously had no approval workflow. * Deleting the approval workflow from an entitlement. * Adding or deleting a step in the approval workflow (only one step is supported)
Note that updates are allowed on the list of approvers in an approval workflow step.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
UpdateEntitlementRequest request =
UpdateEntitlementRequest.newBuilder()
.setEntitlement(Entitlement.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Operation> future =
privilegedAccessManagerClient.updateEntitlementCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<UpdateEntitlementRequest,Operation> |
updateEntitlementOperationCallable()
public final OperationCallable<UpdateEntitlementRequest,Entitlement,OperationMetadata> updateEntitlementOperationCallable()
Updates the entitlement specified in the request. Updated fields in the entitlement need to be specified in an update mask. The changes made to an entitlement are applicable only on future grants of the entitlement. However, if new approvers are added or existing approvers are removed from the approval workflow, the changes are effective on existing grants.
The following fields are not supported for updates:
* All immutable fields * Entitlement name * Resource name * Resource type * Adding an approval workflow in an entitlement which previously had no approval workflow. * Deleting the approval workflow from an entitlement. * Adding or deleting a step in the approval workflow (only one step is supported)
Note that updates are allowed on the list of approvers in an approval workflow step.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (PrivilegedAccessManagerClient privilegedAccessManagerClient =
PrivilegedAccessManagerClient.create()) {
UpdateEntitlementRequest request =
UpdateEntitlementRequest.newBuilder()
.setEntitlement(Entitlement.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
OperationFuture<Entitlement, OperationMetadata> future =
privilegedAccessManagerClient.updateEntitlementOperationCallable().futureCall(request);
// Do something.
Entitlement response = future.get();
}
Returns | |
---|---|
Type | Description |
OperationCallable<UpdateEntitlementRequest,Entitlement,OperationMetadata> |