Class AuditManagerClient (0.17.0)

GitHub RepositoryProduct Reference

Service Description: Service describing handlers for resources

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


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   EnrollmentStatusScopeName parent =
       EnrollmentStatusScopeName.ofFolderLocationName("[FOLDER]", "[LOCATION]");
   AuditSchedule auditSchedule = AuditSchedule.newBuilder().build();
   String auditScheduleId = "auditScheduleId1594553421";
   AuditSchedule response =
       auditManagerClient.createAuditSchedule(parent, auditSchedule, auditScheduleId);
 }
 

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

Methods
Method Description Method Variants

CreateAuditSchedule

Creates a new audit schedule in a given project and location.

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

  • createAuditSchedule(CreateAuditScheduleRequest request)

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

  • createAuditSchedule(EnrollmentStatusScopeName parent, AuditSchedule auditSchedule, String auditScheduleId)

  • createAuditSchedule(LocationName parent, AuditSchedule auditSchedule, String auditScheduleId)

  • createAuditSchedule(String parent, AuditSchedule auditSchedule, String auditScheduleId)

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

  • createAuditScheduleCallable()

UpdateAuditSchedule

Updates an existing audit schedule.

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

  • updateAuditSchedule(UpdateAuditScheduleRequest request)

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

  • updateAuditSchedule(AuditSchedule auditSchedule, FieldMask updateMask)

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

  • updateAuditScheduleCallable()

GetAuditSchedule

Gets details of a single audit schedule.

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

  • getAuditSchedule(GetAuditScheduleRequest request)

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

  • getAuditSchedule(AuditScheduleName name)

  • getAuditSchedule(String name)

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

  • getAuditScheduleCallable()

ListAuditSchedules

Lists audit schedules in a given project and location.

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

  • listAuditSchedules(ListAuditSchedulesRequest request)

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

  • listAuditSchedules(EnrollmentStatusScopeName parent)

  • listAuditSchedules(LocationName parent)

  • listAuditSchedules(String parent)

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

  • listAuditSchedulesPagedCallable()

  • listAuditSchedulesCallable()

EnrollResource

Adds your project, folder, or organization to Audit Manager. This method creates the Audit Manager service agent in your workload and grants required permissions to the service agent. If you make this request on a workload that's already enrolled, then this method overrides the existing set of destinations.

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

  • enrollResource(EnrollResourceRequest request)

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

  • enrollResource(String scope, List<EnrollResourceRequest.EligibleDestination> destinations)

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

  • enrollResourceCallable()

GenerateAuditScopeReport

Generates an audit scope report for the given standard.

The report includes the following:

  • The technical attributes and constraints that Audit Manager uses to verify your compliance with a framework.
  • A list of Google Cloud services and resources that are within the scope of the framework.

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

  • generateAuditScopeReport(GenerateAuditScopeReportRequest request)

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

  • generateAuditScopeReport(String scope, String complianceStandard, GenerateAuditScopeReportRequest.AuditScopeReportFormat reportFormat)

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

  • generateAuditScopeReportCallable()

GenerateAuditReport

Registers audit report generation requests. This method returns the operation identifier that you can use to track the report generation progress.

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

  • generateAuditReportAsync(GenerateAuditReportRequest request)

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

  • generateAuditReportAsync(String scope, String gcsUri, String complianceStandard, GenerateAuditReportRequest.AuditReportFormat reportFormat)

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

  • generateAuditReportOperationCallable()

  • generateAuditReportCallable()

ListAuditReports

Lists the audit reports for the organization, folder, or project that you specify as the parent scope.

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

  • listAuditReports(ListAuditReportsRequest request)

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

  • listAuditReports(EnrollmentStatusScopeName parent)

  • listAuditReports(LocationName parent)

  • listAuditReports(String parent)

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

  • listAuditReportsPagedCallable()

  • listAuditReportsCallable()

GetAuditReport

Gets the full metadata and findings for an audit report.

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

  • getAuditReport(GetAuditReportRequest request)

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

  • getAuditReport(AuditReportName name)

  • getAuditReport(String name)

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

  • getAuditReportCallable()

GetResourceEnrollmentStatus

Gets a resource and its enrollment status.

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

  • getResourceEnrollmentStatus(GetResourceEnrollmentStatusRequest request)

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

  • getResourceEnrollmentStatus(ResourceEnrollmentStatusName name)

  • getResourceEnrollmentStatus(String name)

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

  • getResourceEnrollmentStatusCallable()

ListResourceEnrollmentStatuses

Lists all the folders and projects in an organization or folder, along with their enrollments.

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

  • listResourceEnrollmentStatuses(ListResourceEnrollmentStatusesRequest request)

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

  • listResourceEnrollmentStatuses(EnrollmentStatusScopeName parent)

  • listResourceEnrollmentStatuses(String parent)

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

  • listResourceEnrollmentStatusesPagedCallable()

  • listResourceEnrollmentStatusesCallable()

ListControls

Lists the controls that you must implement to become compliant to a regulatory standard.

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

  • listControls(ListControlsRequest request)

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

  • listControls(StandardName parent)

  • listControls(String parent)

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

  • listControlsPagedCallable()

  • listControlsCallable()

ListLocations

Lists information about the supported locations for this service.

This method lists locations based on the resource scope provided inthe ListLocationsRequest.name field: ***Global locations**: If name is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If name follows the formatprojects/{project}, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.

For gRPC and client library implementations, the resource name ispassed as the name field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version.

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

  • listLocations(ListLocationsRequest request)

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

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Gets information about a location.

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

  • getLocation(GetLocationRequest request)

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

  • getLocationCallable()

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 AuditManagerSettings 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
 AuditManagerSettings auditManagerSettings =
     AuditManagerSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 AuditManagerClient auditManagerClient = AuditManagerClient.create(auditManagerSettings);
 

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
 AuditManagerSettings auditManagerSettings =
     AuditManagerSettings.newBuilder().setEndpoint(myEndpoint).build();
 AuditManagerClient auditManagerClient = AuditManagerClient.create(auditManagerSettings);
 

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
 AuditManagerSettings auditManagerSettings = AuditManagerSettings.newHttpJsonBuilder().build();
 AuditManagerClient auditManagerClient = AuditManagerClient.create(auditManagerSettings);
 

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

Inheritance

java.lang.Object > AuditManagerClient

Static Methods

create()

public static final AuditManagerClient create()

Constructs an instance of AuditManagerClient with default settings.

Returns
Type Description
AuditManagerClient
Exceptions
Type Description
IOException

create(AuditManagerSettings settings)

public static final AuditManagerClient create(AuditManagerSettings settings)

Constructs an instance of AuditManagerClient, 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 AuditManagerSettings
Returns
Type Description
AuditManagerClient
Exceptions
Type Description
IOException

create(AuditManagerStub stub)

public static final AuditManagerClient create(AuditManagerStub stub)

Constructs an instance of AuditManagerClient, using the given stub for making calls. This is for advanced usage - prefer using create(AuditManagerSettings).

Parameter
Name Description
stub AuditManagerStub
Returns
Type Description
AuditManagerClient

Constructors

AuditManagerClient(AuditManagerSettings settings)

protected AuditManagerClient(AuditManagerSettings settings)

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

AuditManagerClient(AuditManagerStub stub)

protected AuditManagerClient(AuditManagerStub stub)
Parameter
Name Description
stub AuditManagerStub

Methods

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

close()

public final void close()

createAuditSchedule(@Nullable EnrollmentStatusScopeName parent, AuditSchedule auditSchedule, String auditScheduleId)

public final AuditSchedule createAuditSchedule(@Nullable EnrollmentStatusScopeName parent, AuditSchedule auditSchedule, String auditScheduleId)

Creates a new audit schedule 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 (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   EnrollmentStatusScopeName parent =
       EnrollmentStatusScopeName.ofFolderLocationName("[FOLDER]", "[LOCATION]");
   AuditSchedule auditSchedule = AuditSchedule.newBuilder().build();
   String auditScheduleId = "auditScheduleId1594553421";
   AuditSchedule response =
       auditManagerClient.createAuditSchedule(parent, auditSchedule, auditScheduleId);
 }
 
Parameters
Name Description
parent @org.jspecify.annotations.Nullable com.google.cloud.auditmanager.v1.EnrollmentStatusScopeName

Required. Project or folder that this audit schedule is for, in one of the following formats:

  • projects/{project}/locations/{location}
  • folders/{folder}/locations/{location}

auditSchedule AuditSchedule

Required. Audit schedule to create.

auditScheduleId String

Required. ID to use for the audit schedule, which becomes the final component of the audit schedule's resource name.

Returns
Type Description
AuditSchedule

createAuditSchedule(@Nullable LocationName parent, AuditSchedule auditSchedule, String auditScheduleId)

public final AuditSchedule createAuditSchedule(@Nullable LocationName parent, AuditSchedule auditSchedule, String auditScheduleId)

Creates a new audit schedule 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 (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   AuditSchedule auditSchedule = AuditSchedule.newBuilder().build();
   String auditScheduleId = "auditScheduleId1594553421";
   AuditSchedule response =
       auditManagerClient.createAuditSchedule(parent, auditSchedule, auditScheduleId);
 }
 
Parameters
Name Description
parent @org.jspecify.annotations.Nullable com.google.cloud.auditmanager.v1.LocationName

Required. Project or folder that this audit schedule is for, in one of the following formats:

  • projects/{project}/locations/{location}
  • folders/{folder}/locations/{location}

auditSchedule AuditSchedule

Required. Audit schedule to create.

auditScheduleId String

Required. ID to use for the audit schedule, which becomes the final component of the audit schedule's resource name.

Returns
Type Description
AuditSchedule

createAuditSchedule(CreateAuditScheduleRequest request)

public final AuditSchedule createAuditSchedule(CreateAuditScheduleRequest request)

Creates a new audit schedule 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 (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   CreateAuditScheduleRequest request =
       CreateAuditScheduleRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setAuditSchedule(AuditSchedule.newBuilder().build())
           .setAuditScheduleId("auditScheduleId1594553421")
           .setValidateOnly(true)
           .build();
   AuditSchedule response = auditManagerClient.createAuditSchedule(request);
 }
 
Parameter
Name Description
request CreateAuditScheduleRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
AuditSchedule

createAuditSchedule(String parent, AuditSchedule auditSchedule, String auditScheduleId)

public final AuditSchedule createAuditSchedule(String parent, AuditSchedule auditSchedule, String auditScheduleId)

Creates a new audit schedule 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 (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   AuditSchedule auditSchedule = AuditSchedule.newBuilder().build();
   String auditScheduleId = "auditScheduleId1594553421";
   AuditSchedule response =
       auditManagerClient.createAuditSchedule(parent, auditSchedule, auditScheduleId);
 }
 
Parameters
Name Description
parent String

Required. Project or folder that this audit schedule is for, in one of the following formats:

  • projects/{project}/locations/{location}
  • folders/{folder}/locations/{location}

auditSchedule AuditSchedule

Required. Audit schedule to create.

auditScheduleId String

Required. ID to use for the audit schedule, which becomes the final component of the audit schedule's resource name.

Returns
Type Description
AuditSchedule

createAuditScheduleCallable()

public final UnaryCallable<CreateAuditScheduleRequest,AuditSchedule> createAuditScheduleCallable()

Creates a new audit schedule 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 (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   CreateAuditScheduleRequest request =
       CreateAuditScheduleRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setAuditSchedule(AuditSchedule.newBuilder().build())
           .setAuditScheduleId("auditScheduleId1594553421")
           .setValidateOnly(true)
           .build();
   ApiFuture<AuditSchedule> future =
       auditManagerClient.createAuditScheduleCallable().futureCall(request);
   // Do something.
   AuditSchedule response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateAuditScheduleRequest,AuditSchedule>

enrollResource(EnrollResourceRequest request)

public final Enrollment enrollResource(EnrollResourceRequest request)

Adds your project, folder, or organization to Audit Manager. This method creates the Audit Manager service agent in your workload and grants required permissions to the service agent. If you make this request on a workload that's already enrolled, then this method overrides the existing set of destinations.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   EnrollResourceRequest request =
       EnrollResourceRequest.newBuilder()
           .setScope("scope109264468")
           .addAllDestinations(new ArrayList<EnrollResourceRequest.EligibleDestination>())
           .setValidateOnly(true)
           .build();
   Enrollment response = auditManagerClient.enrollResource(request);
 }
 
Parameter
Name Description
request EnrollResourceRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Enrollment

enrollResource(String scope, List<EnrollResourceRequest.EligibleDestination> destinations)

public final Enrollment enrollResource(String scope, List<EnrollResourceRequest.EligibleDestination> destinations)

Adds your project, folder, or organization to Audit Manager. This method creates the Audit Manager service agent in your workload and grants required permissions to the service agent. If you make this request on a workload that's already enrolled, then this method overrides the existing set of destinations.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   String scope = "scope109264468";
   List<EnrollResourceRequest.EligibleDestination> destinations = new ArrayList<>();
   Enrollment response = auditManagerClient.enrollResource(scope, destinations);
 }
 
Parameters
Name Description
scope String

Required. Organization, folder, or project to enroll in Audit Manager, in one of the following formats:

  • projects/{project}/locations/{location}
  • folders/{folder}/locations/{location}
  • organizations/{organization}/locations/{location}

destinations List<EligibleDestination>

Required. Cloud Storage buckets that you can upload your audit reports to during the audit process.

When you enroll an organization or folder, you can choose a Cloud Storage bucket from any project in the organization or folder. If you run an audit at the project level using the service agent at the organization or folder level, all the buckets that are associated with the service agent are available.

Returns
Type Description
Enrollment

enrollResourceCallable()

public final UnaryCallable<EnrollResourceRequest,Enrollment> enrollResourceCallable()

Adds your project, folder, or organization to Audit Manager. This method creates the Audit Manager service agent in your workload and grants required permissions to the service agent. If you make this request on a workload that's already enrolled, then this method overrides the existing set of destinations.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   EnrollResourceRequest request =
       EnrollResourceRequest.newBuilder()
           .setScope("scope109264468")
           .addAllDestinations(new ArrayList<EnrollResourceRequest.EligibleDestination>())
           .setValidateOnly(true)
           .build();
   ApiFuture<Enrollment> future =
       auditManagerClient.enrollResourceCallable().futureCall(request);
   // Do something.
   Enrollment response = future.get();
 }
 
Returns
Type Description
UnaryCallable<EnrollResourceRequest,Enrollment>

generateAuditReportAsync(GenerateAuditReportRequest request)

public final OperationFuture<AuditReport,OperationMetadata> generateAuditReportAsync(GenerateAuditReportRequest request)

Registers audit report generation requests. This method returns the operation identifier that you can use to track the report generation progress.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   GenerateAuditReportRequest request =
       GenerateAuditReportRequest.newBuilder()
           .setScope("scope109264468")
           .setComplianceStandard("complianceStandard-1534269448")
           .setComplianceFramework("complianceFramework-1808314333")
           .setValidateOnly(true)
           .build();
   AuditReport response = auditManagerClient.generateAuditReportAsync(request).get();
 }
 
Parameter
Name Description
request GenerateAuditReportRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<AuditReport,OperationMetadata>

generateAuditReportAsync(String scope, String gcsUri, String complianceStandard, GenerateAuditReportRequest.AuditReportFormat reportFormat)

public final OperationFuture<AuditReport,OperationMetadata> generateAuditReportAsync(String scope, String gcsUri, String complianceStandard, GenerateAuditReportRequest.AuditReportFormat reportFormat)

Registers audit report generation requests. This method returns the operation identifier that you can use to track the report generation progress.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   String scope = "scope109264468";
   String gcsUri = "gcsUri-1251224875";
   String complianceStandard = "complianceStandard-1534269448";
   GenerateAuditReportRequest.AuditReportFormat reportFormat =
       GenerateAuditReportRequest.AuditReportFormat.forNumber(0);
   AuditReport response =
       auditManagerClient
           .generateAuditReportAsync(scope, gcsUri, complianceStandard, reportFormat)
           .get();
 }
 
Parameters
Name Description
scope String

Required. Organization, folder, or project that the audit applies to, in one of the following formats:

  • projects/{project}/locations/{location}
  • folders/{folder}/locations/{location}
  • organizations/{organization}/locations/{location}

gcsUri String

URL for the Cloud Storage bucket where the report and evidence is uploaded. You must select a bucket that was provided during the enrollment process.

complianceStandard String

Optional. Deprecated. Compliance standard for the audit report.

Use the compliance_framework field instead.

reportFormat GenerateAuditReportRequest.AuditReportFormat

Required. Format for the audit report.

Returns
Type Description
OperationFuture<AuditReport,OperationMetadata>

generateAuditReportCallable()

public final UnaryCallable<GenerateAuditReportRequest,Operation> generateAuditReportCallable()

Registers audit report generation requests. This method returns the operation identifier that you can use to track the report generation progress.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   GenerateAuditReportRequest request =
       GenerateAuditReportRequest.newBuilder()
           .setScope("scope109264468")
           .setComplianceStandard("complianceStandard-1534269448")
           .setComplianceFramework("complianceFramework-1808314333")
           .setValidateOnly(true)
           .build();
   ApiFuture<Operation> future =
       auditManagerClient.generateAuditReportCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GenerateAuditReportRequest,Operation>

generateAuditReportOperationCallable()

public final OperationCallable<GenerateAuditReportRequest,AuditReport,OperationMetadata> generateAuditReportOperationCallable()

Registers audit report generation requests. This method returns the operation identifier that you can use to track the report generation progress.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   GenerateAuditReportRequest request =
       GenerateAuditReportRequest.newBuilder()
           .setScope("scope109264468")
           .setComplianceStandard("complianceStandard-1534269448")
           .setComplianceFramework("complianceFramework-1808314333")
           .setValidateOnly(true)
           .build();
   OperationFuture<AuditReport, OperationMetadata> future =
       auditManagerClient.generateAuditReportOperationCallable().futureCall(request);
   // Do something.
   AuditReport response = future.get();
 }
 
Returns
Type Description
OperationCallable<GenerateAuditReportRequest,AuditReport,OperationMetadata>

generateAuditScopeReport(GenerateAuditScopeReportRequest request)

public final AuditScopeReport generateAuditScopeReport(GenerateAuditScopeReportRequest request)

Generates an audit scope report for the given standard.

The report includes the following:

  • The technical attributes and constraints that Audit Manager uses to verify your compliance with a framework.
  • A list of Google Cloud services and resources that are within the scope of the framework.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   GenerateAuditScopeReportRequest request =
       GenerateAuditScopeReportRequest.newBuilder()
           .setScope("scope109264468")
           .setComplianceStandard("complianceStandard-1534269448")
           .setComplianceFramework("complianceFramework-1808314333")
           .setValidateOnly(true)
           .build();
   AuditScopeReport response = auditManagerClient.generateAuditScopeReport(request);
 }
 
Parameter
Name Description
request GenerateAuditScopeReportRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
AuditScopeReport

generateAuditScopeReport(String scope, String complianceStandard, GenerateAuditScopeReportRequest.AuditScopeReportFormat reportFormat)

public final AuditScopeReport generateAuditScopeReport(String scope, String complianceStandard, GenerateAuditScopeReportRequest.AuditScopeReportFormat reportFormat)

Generates an audit scope report for the given standard.

The report includes the following:

  • The technical attributes and constraints that Audit Manager uses to verify your compliance with a framework.
  • A list of Google Cloud services and resources that are within the scope of the framework.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   String scope = "scope109264468";
   String complianceStandard = "complianceStandard-1534269448";
   GenerateAuditScopeReportRequest.AuditScopeReportFormat reportFormat =
       GenerateAuditScopeReportRequest.AuditScopeReportFormat.forNumber(0);
   AuditScopeReport response =
       auditManagerClient.generateAuditScopeReport(scope, complianceStandard, reportFormat);
 }
 
Parameters
Name Description
scope String

Required. Project or folder that the audit scope report is generated for, in one of the following formats:

  • projects/{project}/locations/{location}
  • folders/{folder}/locations/{location}
  • organizations/{organization}/locations/{location}

complianceStandard String

Optional. Deprecated. The standard (industry or regulatory requirements) that the audit scope report is run against.

Use the compliance_framework field instead.

reportFormat GenerateAuditScopeReportRequest.AuditScopeReportFormat

Required. Format for the audit scope report.

Returns
Type Description
AuditScopeReport

generateAuditScopeReportCallable()

public final UnaryCallable<GenerateAuditScopeReportRequest,AuditScopeReport> generateAuditScopeReportCallable()

Generates an audit scope report for the given standard.

The report includes the following:

  • The technical attributes and constraints that Audit Manager uses to verify your compliance with a framework.
  • A list of Google Cloud services and resources that are within the scope of the framework.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   GenerateAuditScopeReportRequest request =
       GenerateAuditScopeReportRequest.newBuilder()
           .setScope("scope109264468")
           .setComplianceStandard("complianceStandard-1534269448")
           .setComplianceFramework("complianceFramework-1808314333")
           .setValidateOnly(true)
           .build();
   ApiFuture<AuditScopeReport> future =
       auditManagerClient.generateAuditScopeReportCallable().futureCall(request);
   // Do something.
   AuditScopeReport response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GenerateAuditScopeReportRequest,AuditScopeReport>

getAuditReport(@Nullable AuditReportName name)

public final AuditReport getAuditReport(@Nullable AuditReportName name)

Gets the full metadata and findings for an audit report.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   AuditReportName name =
       AuditReportName.ofFolderLocationAuditReportName(
           "[FOLDER]", "[LOCATION]", "[AUDIT_REPORT]");
   AuditReport response = auditManagerClient.getAuditReport(name);
 }
 
Parameter
Name Description
name @org.jspecify.annotations.Nullable com.google.cloud.auditmanager.v1.AuditReportName

Required. Name of the audit report, in one of the following formats:

  • projects/{project}/locations/{location}/auditReports/{audit_report}
  • folders/{folder}/locations/{location}/auditReports/{audit_report}
  • organizations/{organization}/locations/{location}/auditReports/{audit_report}

Returns
Type Description
AuditReport

getAuditReport(GetAuditReportRequest request)

public final AuditReport getAuditReport(GetAuditReportRequest request)

Gets the full metadata and findings for an audit report.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   GetAuditReportRequest request =
       GetAuditReportRequest.newBuilder()
           .setName(
               AuditReportName.ofFolderLocationAuditReportName(
                       "[FOLDER]", "[LOCATION]", "[AUDIT_REPORT]")
                   .toString())
           .build();
   AuditReport response = auditManagerClient.getAuditReport(request);
 }
 
Parameter
Name Description
request GetAuditReportRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
AuditReport

getAuditReport(String name)

public final AuditReport getAuditReport(String name)

Gets the full metadata and findings for an audit report.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   String name =
       AuditReportName.ofProjectLocationAuditReportName(
               "[PROJECT]", "[LOCATION]", "[AUDIT_REPORT]")
           .toString();
   AuditReport response = auditManagerClient.getAuditReport(name);
 }
 
Parameter
Name Description
name String

Required. Name of the audit report, in one of the following formats:

  • projects/{project}/locations/{location}/auditReports/{audit_report}
  • folders/{folder}/locations/{location}/auditReports/{audit_report}
  • organizations/{organization}/locations/{location}/auditReports/{audit_report}

Returns
Type Description
AuditReport

getAuditReportCallable()

public final UnaryCallable<GetAuditReportRequest,AuditReport> getAuditReportCallable()

Gets the full metadata and findings for an audit report.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   GetAuditReportRequest request =
       GetAuditReportRequest.newBuilder()
           .setName(
               AuditReportName.ofFolderLocationAuditReportName(
                       "[FOLDER]", "[LOCATION]", "[AUDIT_REPORT]")
                   .toString())
           .build();
   ApiFuture<AuditReport> future =
       auditManagerClient.getAuditReportCallable().futureCall(request);
   // Do something.
   AuditReport response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetAuditReportRequest,AuditReport>

getAuditSchedule(@Nullable AuditScheduleName name)

public final AuditSchedule getAuditSchedule(@Nullable AuditScheduleName name)

Gets details of a single audit schedule.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   AuditScheduleName name =
       AuditScheduleName.ofProjectLocationAuditScheduleName(
           "[PROJECT]", "[LOCATION]", "[AUDIT_SCHEDULE]");
   AuditSchedule response = auditManagerClient.getAuditSchedule(name);
 }
 
Parameter
Name Description
name @org.jspecify.annotations.Nullable com.google.cloud.auditmanager.v1.AuditScheduleName

Required. Name of the audit schedule to retrieve, in one of the following formats:

  • projects/{project}/locations/{location}/auditSchedules/{audit_schedule}
  • folders/{folder}/locations/{location}/auditSchedules/{audit_schedule}
  • organizations/{organization}/locations/{location}/auditSchedules/{audit_schedule}

Returns
Type Description
AuditSchedule

getAuditSchedule(GetAuditScheduleRequest request)

public final AuditSchedule getAuditSchedule(GetAuditScheduleRequest request)

Gets details of a single audit schedule.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   GetAuditScheduleRequest request =
       GetAuditScheduleRequest.newBuilder()
           .setName(
               AuditScheduleName.ofProjectLocationAuditScheduleName(
                       "[PROJECT]", "[LOCATION]", "[AUDIT_SCHEDULE]")
                   .toString())
           .build();
   AuditSchedule response = auditManagerClient.getAuditSchedule(request);
 }
 
Parameter
Name Description
request GetAuditScheduleRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
AuditSchedule

getAuditSchedule(String name)

public final AuditSchedule getAuditSchedule(String name)

Gets details of a single audit schedule.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   String name =
       AuditScheduleName.ofProjectLocationAuditScheduleName(
               "[PROJECT]", "[LOCATION]", "[AUDIT_SCHEDULE]")
           .toString();
   AuditSchedule response = auditManagerClient.getAuditSchedule(name);
 }
 
Parameter
Name Description
name String

Required. Name of the audit schedule to retrieve, in one of the following formats:

  • projects/{project}/locations/{location}/auditSchedules/{audit_schedule}
  • folders/{folder}/locations/{location}/auditSchedules/{audit_schedule}
  • organizations/{organization}/locations/{location}/auditSchedules/{audit_schedule}

Returns
Type Description
AuditSchedule

getAuditScheduleCallable()

public final UnaryCallable<GetAuditScheduleRequest,AuditSchedule> getAuditScheduleCallable()

Gets details of a single audit schedule.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   GetAuditScheduleRequest request =
       GetAuditScheduleRequest.newBuilder()
           .setName(
               AuditScheduleName.ofProjectLocationAuditScheduleName(
                       "[PROJECT]", "[LOCATION]", "[AUDIT_SCHEDULE]")
                   .toString())
           .build();
   ApiFuture<AuditSchedule> future =
       auditManagerClient.getAuditScheduleCallable().futureCall(request);
   // Do something.
   AuditSchedule response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetAuditScheduleRequest,AuditSchedule>

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 (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   Location response = auditManagerClient.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 (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   ApiFuture<Location> future = auditManagerClient.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

getResourceEnrollmentStatus(@Nullable ResourceEnrollmentStatusName name)

public final ResourceEnrollmentStatus getResourceEnrollmentStatus(@Nullable ResourceEnrollmentStatusName name)

Gets a resource and its enrollment status.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   ResourceEnrollmentStatusName name =
       ResourceEnrollmentStatusName.ofProjectLocationResourceEnrollmentStatusName(
           "[PROJECT]", "[LOCATION]", "[RESOURCE_ENROLLMENT_STATUS]");
   ResourceEnrollmentStatus response = auditManagerClient.getResourceEnrollmentStatus(name);
 }
 
Parameter
Name Description
name @org.jspecify.annotations.Nullable com.google.cloud.auditmanager.v1.ResourceEnrollmentStatusName

Required. Name of the resource enrollment status, in one of the following formats:

  • folders/{folder}/locations/{location}/resourceEnrollmentStatuses/{resource_enrollment_status}
  • projects/{project}/locations/{location}/resourceEnrollmentStatuses/{resource_enrollment_status}
  • organizations/{organization}/locations/{location}/resourceEnrollmentStatuses/{resource_enrollment_status}

Returns
Type Description
ResourceEnrollmentStatus

getResourceEnrollmentStatus(GetResourceEnrollmentStatusRequest request)

public final ResourceEnrollmentStatus getResourceEnrollmentStatus(GetResourceEnrollmentStatusRequest request)

Gets a resource and its enrollment status.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   GetResourceEnrollmentStatusRequest request =
       GetResourceEnrollmentStatusRequest.newBuilder()
           .setName(
               ResourceEnrollmentStatusName.ofProjectLocationResourceEnrollmentStatusName(
                       "[PROJECT]", "[LOCATION]", "[RESOURCE_ENROLLMENT_STATUS]")
                   .toString())
           .build();
   ResourceEnrollmentStatus response = auditManagerClient.getResourceEnrollmentStatus(request);
 }
 
Parameter
Name Description
request GetResourceEnrollmentStatusRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
ResourceEnrollmentStatus

getResourceEnrollmentStatus(String name)

public final ResourceEnrollmentStatus getResourceEnrollmentStatus(String name)

Gets a resource and its enrollment status.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   String name =
       ResourceEnrollmentStatusName.ofFolderLocationResourceEnrollmentStatusName(
               "[FOLDER]", "[LOCATION]", "[RESOURCE_ENROLLMENT_STATUS]")
           .toString();
   ResourceEnrollmentStatus response = auditManagerClient.getResourceEnrollmentStatus(name);
 }
 
Parameter
Name Description
name String

Required. Name of the resource enrollment status, in one of the following formats:

  • folders/{folder}/locations/{location}/resourceEnrollmentStatuses/{resource_enrollment_status}
  • projects/{project}/locations/{location}/resourceEnrollmentStatuses/{resource_enrollment_status}
  • organizations/{organization}/locations/{location}/resourceEnrollmentStatuses/{resource_enrollment_status}

Returns
Type Description
ResourceEnrollmentStatus

getResourceEnrollmentStatusCallable()

public final UnaryCallable<GetResourceEnrollmentStatusRequest,ResourceEnrollmentStatus> getResourceEnrollmentStatusCallable()

Gets a resource and its enrollment status.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   GetResourceEnrollmentStatusRequest request =
       GetResourceEnrollmentStatusRequest.newBuilder()
           .setName(
               ResourceEnrollmentStatusName.ofProjectLocationResourceEnrollmentStatusName(
                       "[PROJECT]", "[LOCATION]", "[RESOURCE_ENROLLMENT_STATUS]")
                   .toString())
           .build();
   ApiFuture<ResourceEnrollmentStatus> future =
       auditManagerClient.getResourceEnrollmentStatusCallable().futureCall(request);
   // Do something.
   ResourceEnrollmentStatus response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetResourceEnrollmentStatusRequest,ResourceEnrollmentStatus>

getSettings()

public final @Nullable AuditManagerSettings getSettings()
Returns
Type Description
@org.jspecify.annotations.Nullable com.google.cloud.auditmanager.v1.AuditManagerSettings

getStub()

public AuditManagerStub getStub()
Returns
Type Description
AuditManagerStub

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listAuditReports(@Nullable EnrollmentStatusScopeName parent)

public final AuditManagerClient.ListAuditReportsPagedResponse listAuditReports(@Nullable EnrollmentStatusScopeName parent)

Lists the audit reports for the organization, folder, or project that you specify as the parent scope.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   EnrollmentStatusScopeName parent =
       EnrollmentStatusScopeName.ofOrganizationLocationName("[ORGANIZATION]", "[LOCATION]");
   for (AuditReport element : auditManagerClient.listAuditReports(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent @org.jspecify.annotations.Nullable com.google.cloud.auditmanager.v1.EnrollmentStatusScopeName

Required. Parent organization, folder, or project to list reports for, in one of the following formats:

  • projects/{project}/locations/{location}
  • folders/{folder}/locations/{location}
  • organizations/{organization}/locations/{location}

Returns
Type Description
AuditManagerClient.ListAuditReportsPagedResponse

listAuditReports(@Nullable LocationName parent)

public final AuditManagerClient.ListAuditReportsPagedResponse listAuditReports(@Nullable LocationName parent)

Lists the audit reports for the organization, folder, or project that you specify as the parent scope.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (AuditReport element : auditManagerClient.listAuditReports(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent @org.jspecify.annotations.Nullable com.google.cloud.auditmanager.v1.LocationName

Required. Parent organization, folder, or project to list reports for, in one of the following formats:

  • projects/{project}/locations/{location}
  • folders/{folder}/locations/{location}
  • organizations/{organization}/locations/{location}

Returns
Type Description
AuditManagerClient.ListAuditReportsPagedResponse

listAuditReports(ListAuditReportsRequest request)

public final AuditManagerClient.ListAuditReportsPagedResponse listAuditReports(ListAuditReportsRequest request)

Lists the audit reports for the organization, folder, or project that you specify as the parent scope.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   ListAuditReportsRequest request =
       ListAuditReportsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (AuditReport element : auditManagerClient.listAuditReports(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListAuditReportsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
AuditManagerClient.ListAuditReportsPagedResponse

listAuditReports(String parent)

public final AuditManagerClient.ListAuditReportsPagedResponse listAuditReports(String parent)

Lists the audit reports for the organization, folder, or project that you specify as the parent scope.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (AuditReport element : auditManagerClient.listAuditReports(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. Parent organization, folder, or project to list reports for, in one of the following formats:

  • projects/{project}/locations/{location}
  • folders/{folder}/locations/{location}
  • organizations/{organization}/locations/{location}

Returns
Type Description
AuditManagerClient.ListAuditReportsPagedResponse

listAuditReportsCallable()

public final UnaryCallable<ListAuditReportsRequest,ListAuditReportsResponse> listAuditReportsCallable()

Lists the audit reports for the organization, folder, or project that you specify as the parent scope.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   ListAuditReportsRequest request =
       ListAuditReportsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListAuditReportsResponse response =
         auditManagerClient.listAuditReportsCallable().call(request);
     for (AuditReport element : response.getAuditReportsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListAuditReportsRequest,ListAuditReportsResponse>

listAuditReportsPagedCallable()

public final UnaryCallable<ListAuditReportsRequest,AuditManagerClient.ListAuditReportsPagedResponse> listAuditReportsPagedCallable()

Lists the audit reports for the organization, folder, or project that you specify as the parent scope.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   ListAuditReportsRequest request =
       ListAuditReportsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<AuditReport> future =
       auditManagerClient.listAuditReportsPagedCallable().futureCall(request);
   // Do something.
   for (AuditReport element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListAuditReportsRequest,ListAuditReportsPagedResponse>

listAuditSchedules(@Nullable EnrollmentStatusScopeName parent)

public final AuditManagerClient.ListAuditSchedulesPagedResponse listAuditSchedules(@Nullable EnrollmentStatusScopeName parent)

Lists audit schedules 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 (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   EnrollmentStatusScopeName parent =
       EnrollmentStatusScopeName.ofFolderLocationName("[FOLDER]", "[LOCATION]");
   for (AuditSchedule element : auditManagerClient.listAuditSchedules(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent @org.jspecify.annotations.Nullable com.google.cloud.auditmanager.v1.EnrollmentStatusScopeName

Required. Parent for the audit schedule, in one of the following formats:

  • projects/{project}/locations/{location}
  • folders/{folder}/locations/{location}
  • organizations/{organization}/locations/{location}

Returns
Type Description
AuditManagerClient.ListAuditSchedulesPagedResponse

listAuditSchedules(@Nullable LocationName parent)

public final AuditManagerClient.ListAuditSchedulesPagedResponse listAuditSchedules(@Nullable LocationName parent)

Lists audit schedules 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 (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (AuditSchedule element : auditManagerClient.listAuditSchedules(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent @org.jspecify.annotations.Nullable com.google.cloud.auditmanager.v1.LocationName

Required. Parent for the audit schedule, in one of the following formats:

  • projects/{project}/locations/{location}
  • folders/{folder}/locations/{location}
  • organizations/{organization}/locations/{location}

Returns
Type Description
AuditManagerClient.ListAuditSchedulesPagedResponse

listAuditSchedules(ListAuditSchedulesRequest request)

public final AuditManagerClient.ListAuditSchedulesPagedResponse listAuditSchedules(ListAuditSchedulesRequest request)

Lists audit schedules 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 (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   ListAuditSchedulesRequest request =
       ListAuditSchedulesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (AuditSchedule element : auditManagerClient.listAuditSchedules(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListAuditSchedulesRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
AuditManagerClient.ListAuditSchedulesPagedResponse

listAuditSchedules(String parent)

public final AuditManagerClient.ListAuditSchedulesPagedResponse listAuditSchedules(String parent)

Lists audit schedules 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 (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (AuditSchedule element : auditManagerClient.listAuditSchedules(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. Parent for the audit schedule, in one of the following formats:

  • projects/{project}/locations/{location}
  • folders/{folder}/locations/{location}
  • organizations/{organization}/locations/{location}

Returns
Type Description
AuditManagerClient.ListAuditSchedulesPagedResponse

listAuditSchedulesCallable()

public final UnaryCallable<ListAuditSchedulesRequest,ListAuditSchedulesResponse> listAuditSchedulesCallable()

Lists audit schedules 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 (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   ListAuditSchedulesRequest request =
       ListAuditSchedulesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListAuditSchedulesResponse response =
         auditManagerClient.listAuditSchedulesCallable().call(request);
     for (AuditSchedule element : response.getAuditSchedulesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListAuditSchedulesRequest,ListAuditSchedulesResponse>

listAuditSchedulesPagedCallable()

public final UnaryCallable<ListAuditSchedulesRequest,AuditManagerClient.ListAuditSchedulesPagedResponse> listAuditSchedulesPagedCallable()

Lists audit schedules 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 (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   ListAuditSchedulesRequest request =
       ListAuditSchedulesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<AuditSchedule> future =
       auditManagerClient.listAuditSchedulesPagedCallable().futureCall(request);
   // Do something.
   for (AuditSchedule element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListAuditSchedulesRequest,ListAuditSchedulesPagedResponse>

listControls(@Nullable StandardName parent)

public final AuditManagerClient.ListControlsPagedResponse listControls(@Nullable StandardName parent)

Lists the controls that you must implement to become compliant to a regulatory standard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   StandardName parent =
       StandardName.ofOrganizationLocationStandardName(
           "[ORGANIZATION]", "[LOCATION]", "[STANDARD]");
   for (Control element : auditManagerClient.listControls(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent @org.jspecify.annotations.Nullable com.google.cloud.auditmanager.v1.StandardName

Required. Standard to list controls for, in one of the following formats:

  • projects/{project}/locations/{location}/standards/{standard}
  • folders/{folder}/locations/{location}/standards/{standard}
  • organizations/{organization}/locations/{location}/standards/{standard}

Returns
Type Description
AuditManagerClient.ListControlsPagedResponse

listControls(ListControlsRequest request)

public final AuditManagerClient.ListControlsPagedResponse listControls(ListControlsRequest request)

Lists the controls that you must implement to become compliant to a regulatory standard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   ListControlsRequest request =
       ListControlsRequest.newBuilder()
           .setParent(
               StandardName.ofOrganizationLocationStandardName(
                       "[ORGANIZATION]", "[LOCATION]", "[STANDARD]")
                   .toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Control element : auditManagerClient.listControls(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListControlsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
AuditManagerClient.ListControlsPagedResponse

listControls(String parent)

public final AuditManagerClient.ListControlsPagedResponse listControls(String parent)

Lists the controls that you must implement to become compliant to a regulatory standard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   String parent =
       StandardName.ofProjectLocationStandardName("[PROJECT]", "[LOCATION]", "[STANDARD]")
           .toString();
   for (Control element : auditManagerClient.listControls(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. Standard to list controls for, in one of the following formats:

  • projects/{project}/locations/{location}/standards/{standard}
  • folders/{folder}/locations/{location}/standards/{standard}
  • organizations/{organization}/locations/{location}/standards/{standard}

Returns
Type Description
AuditManagerClient.ListControlsPagedResponse

listControlsCallable()

public final UnaryCallable<ListControlsRequest,ListControlsResponse> listControlsCallable()

Lists the controls that you must implement to become compliant to a regulatory standard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   ListControlsRequest request =
       ListControlsRequest.newBuilder()
           .setParent(
               StandardName.ofOrganizationLocationStandardName(
                       "[ORGANIZATION]", "[LOCATION]", "[STANDARD]")
                   .toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListControlsResponse response = auditManagerClient.listControlsCallable().call(request);
     for (Control element : response.getControlsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListControlsRequest,ListControlsResponse>

listControlsPagedCallable()

public final UnaryCallable<ListControlsRequest,AuditManagerClient.ListControlsPagedResponse> listControlsPagedCallable()

Lists the controls that you must implement to become compliant to a regulatory standard.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   ListControlsRequest request =
       ListControlsRequest.newBuilder()
           .setParent(
               StandardName.ofOrganizationLocationStandardName(
                       "[ORGANIZATION]", "[LOCATION]", "[STANDARD]")
                   .toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Control> future =
       auditManagerClient.listControlsPagedCallable().futureCall(request);
   // Do something.
   for (Control element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListControlsRequest,ListControlsPagedResponse>

listLocations(ListLocationsRequest request)

public final AuditManagerClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request)

Lists information about the supported locations for this service.

This method lists locations based on the resource scope provided inthe ListLocationsRequest.name field: ***Global locations**: If name is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If name follows the formatprojects/{project}, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.

For gRPC and client library implementations, the resource name ispassed as the name field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Location element : auditManagerClient.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
AuditManagerClient.ListLocationsPagedResponse

listLocationsCallable()

public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()

Lists information about the supported locations for this service.

This method lists locations based on the resource scope provided inthe ListLocationsRequest.name field: ***Global locations**: If name is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If name follows the formatprojects/{project}, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.

For gRPC and client library implementations, the resource name ispassed as the name field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListLocationsResponse response = auditManagerClient.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,AuditManagerClient.ListLocationsPagedResponse> listLocationsPagedCallable()

Lists information about the supported locations for this service.

This method lists locations based on the resource scope provided inthe ListLocationsRequest.name field: ***Global locations**: If name is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If name follows the formatprojects/{project}, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.

For gRPC and client library implementations, the resource name ispassed as the name field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version.

Sample code:


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

listResourceEnrollmentStatuses(@Nullable EnrollmentStatusScopeName parent)

public final AuditManagerClient.ListResourceEnrollmentStatusesPagedResponse listResourceEnrollmentStatuses(@Nullable EnrollmentStatusScopeName parent)

Lists all the folders and projects in an organization or folder, along with their enrollments.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   EnrollmentStatusScopeName parent =
       EnrollmentStatusScopeName.ofOrganizationLocationName("[ORGANIZATION]", "[LOCATION]");
   for (ResourceEnrollmentStatus element :
       auditManagerClient.listResourceEnrollmentStatuses(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent @org.jspecify.annotations.Nullable com.google.cloud.auditmanager.v1.EnrollmentStatusScopeName

Required. Parent organization or folder to list enrollment statuses for, in one of the following formats:

  • folders/{folder}/locations/{location}
  • organizations/{organization}/locations/{location}

Returns
Type Description
AuditManagerClient.ListResourceEnrollmentStatusesPagedResponse

listResourceEnrollmentStatuses(ListResourceEnrollmentStatusesRequest request)

public final AuditManagerClient.ListResourceEnrollmentStatusesPagedResponse listResourceEnrollmentStatuses(ListResourceEnrollmentStatusesRequest request)

Lists all the folders and projects in an organization or folder, along with their enrollments.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   ListResourceEnrollmentStatusesRequest request =
       ListResourceEnrollmentStatusesRequest.newBuilder()
           .setParent(
               EnrollmentStatusScopeName.ofOrganizationLocationName(
                       "[ORGANIZATION]", "[LOCATION]")
                   .toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (ResourceEnrollmentStatus element :
       auditManagerClient.listResourceEnrollmentStatuses(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListResourceEnrollmentStatusesRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
AuditManagerClient.ListResourceEnrollmentStatusesPagedResponse

listResourceEnrollmentStatuses(String parent)

public final AuditManagerClient.ListResourceEnrollmentStatusesPagedResponse listResourceEnrollmentStatuses(String parent)

Lists all the folders and projects in an organization or folder, along with their enrollments.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   String parent =
       EnrollmentStatusScopeName.ofFolderLocationName("[FOLDER]", "[LOCATION]").toString();
   for (ResourceEnrollmentStatus element :
       auditManagerClient.listResourceEnrollmentStatuses(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. Parent organization or folder to list enrollment statuses for, in one of the following formats:

  • folders/{folder}/locations/{location}
  • organizations/{organization}/locations/{location}

Returns
Type Description
AuditManagerClient.ListResourceEnrollmentStatusesPagedResponse

listResourceEnrollmentStatusesCallable()

public final UnaryCallable<ListResourceEnrollmentStatusesRequest,ListResourceEnrollmentStatusesResponse> listResourceEnrollmentStatusesCallable()

Lists all the folders and projects in an organization or folder, along with their enrollments.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   ListResourceEnrollmentStatusesRequest request =
       ListResourceEnrollmentStatusesRequest.newBuilder()
           .setParent(
               EnrollmentStatusScopeName.ofOrganizationLocationName(
                       "[ORGANIZATION]", "[LOCATION]")
                   .toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListResourceEnrollmentStatusesResponse response =
         auditManagerClient.listResourceEnrollmentStatusesCallable().call(request);
     for (ResourceEnrollmentStatus element : response.getResourceEnrollmentStatusesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListResourceEnrollmentStatusesRequest,ListResourceEnrollmentStatusesResponse>

listResourceEnrollmentStatusesPagedCallable()

public final UnaryCallable<ListResourceEnrollmentStatusesRequest,AuditManagerClient.ListResourceEnrollmentStatusesPagedResponse> listResourceEnrollmentStatusesPagedCallable()

Lists all the folders and projects in an organization or folder, along with their enrollments.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   ListResourceEnrollmentStatusesRequest request =
       ListResourceEnrollmentStatusesRequest.newBuilder()
           .setParent(
               EnrollmentStatusScopeName.ofOrganizationLocationName(
                       "[ORGANIZATION]", "[LOCATION]")
                   .toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<ResourceEnrollmentStatus> future =
       auditManagerClient.listResourceEnrollmentStatusesPagedCallable().futureCall(request);
   // Do something.
   for (ResourceEnrollmentStatus element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListResourceEnrollmentStatusesRequest,ListResourceEnrollmentStatusesPagedResponse>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updateAuditSchedule(AuditSchedule auditSchedule, FieldMask updateMask)

public final AuditSchedule updateAuditSchedule(AuditSchedule auditSchedule, FieldMask updateMask)

Updates an existing audit schedule.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   AuditSchedule auditSchedule = AuditSchedule.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   AuditSchedule response = auditManagerClient.updateAuditSchedule(auditSchedule, updateMask);
 }
 
Parameters
Name Description
auditSchedule AuditSchedule

Required. Audit schedule to update.

updateMask FieldMask

Optional. List of fields to update.

Returns
Type Description
AuditSchedule

updateAuditSchedule(UpdateAuditScheduleRequest request)

public final AuditSchedule updateAuditSchedule(UpdateAuditScheduleRequest request)

Updates an existing audit schedule.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   UpdateAuditScheduleRequest request =
       UpdateAuditScheduleRequest.newBuilder()
           .setAuditSchedule(AuditSchedule.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .setValidateOnly(true)
           .build();
   AuditSchedule response = auditManagerClient.updateAuditSchedule(request);
 }
 
Parameter
Name Description
request UpdateAuditScheduleRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
AuditSchedule

updateAuditScheduleCallable()

public final UnaryCallable<UpdateAuditScheduleRequest,AuditSchedule> updateAuditScheduleCallable()

Updates an existing audit schedule.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (AuditManagerClient auditManagerClient = AuditManagerClient.create()) {
   UpdateAuditScheduleRequest request =
       UpdateAuditScheduleRequest.newBuilder()
           .setAuditSchedule(AuditSchedule.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .setValidateOnly(true)
           .build();
   ApiFuture<AuditSchedule> future =
       auditManagerClient.updateAuditScheduleCallable().futureCall(request);
   // Do something.
   AuditSchedule response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateAuditScheduleRequest,AuditSchedule>