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: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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 destinations = new ArrayList<>();
+ * Enrollment response = auditManagerClient.enrollResource(scope, destinations);
+ * }
+ * }
+ *
+ * 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(). + * + *
| Method | + *Description | + *Method Variants | + *
|---|---|---|
EnrollResource |
+ * Enrolls the customer resource(folder/project/organization) to the audit manager service by creating the audit managers Service Agent in customers workload and granting required permissions to the Service Agent. Please note that if enrollment request is made on the already enrolled workload then enrollment is executed overriding the existing set of destinations. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GenerateAuditScopeReport |
+ * Generates a demo report highlighting different responsibilities (Google/Customer/ shared) required to be fulfilled for the customer's workload to be compliant with the given standard. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GenerateAuditReport |
+ * Register the Audit Report generation requests and returns the OperationId using which the customer can track the report generation progress. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
ListAuditReports |
+ * Lists audit reports in the selected parent scope |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GetAuditReport |
+ * Get the overall audit report |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GetResourceEnrollmentStatus |
+ * Get a resource along with its enrollment status. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
ListResourceEnrollmentStatuses |
+ * Fetches all resources under the parent along with their enrollment. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
ListControls |
+ * Gets controls needed to be implemented to be compliant to a standard. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
ListLocations |
+ * Lists information about the supported locations for this service.This method can be called in two ways: + * * **List all public locations:** Use the path `GET /v1/locations`.* **List project-visible locations:** Use the path`GET /v1/projects/{project_id}/locations`. This may include publiclocations as well as private or other locations specifically visibleto the project. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GetLocation |
+ * Gets information about a location. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
See the individual methods for example code. + * + *
Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *
This class can be customized by passing in a custom instance of AuditManagerSettings to + * create(). For example: + * + *
To customize credentials: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require 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: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require 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: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require 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. + */ +@Generated("by gapic-generator-java") +public class AuditManagerClient implements BackgroundResource { + private final AuditManagerSettings settings; + private final AuditManagerStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of AuditManagerClient with default settings. */ + public static final AuditManagerClient create() throws IOException { + return create(AuditManagerSettings.newBuilder().build()); + } + + /** + * 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. + */ + public static final AuditManagerClient create(AuditManagerSettings settings) throws IOException { + return new AuditManagerClient(settings); + } + + /** + * Constructs an instance of AuditManagerClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(AuditManagerSettings). + */ + public static final AuditManagerClient create(AuditManagerStub stub) { + return new AuditManagerClient(stub); + } + + /** + * 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. + */ + protected AuditManagerClient(AuditManagerSettings settings) throws IOException { + this.settings = settings; + this.stub = ((AuditManagerStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected AuditManagerClient(AuditManagerStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final AuditManagerSettings getSettings() { + return settings; + } + + public AuditManagerStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Enrolls the customer resource(folder/project/organization) to the audit manager service by + * creating the audit managers Service Agent in customers workload and granting required + * permissions to the Service Agent. Please note that if enrollment request is made on the already + * enrolled workload then enrollment is executed overriding the existing set of destinations. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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 destinations = new ArrayList<>();
+ * Enrollment response = auditManagerClient.enrollResource(scope, destinations);
+ * }
+ * }
+ *
+ * @param scope Required. The resource to be enrolled to the audit manager. Scope format should be
+ * resource_type/resource_identifier Eg: projects/{project}/locations/{location},
+ * folders/{folder}/locations/{location} organizations/{organization}/locations/{location}
+ * @param destinations Required. List of destination among which customer can choose to upload
+ * their reports during the audit process. While enrolling at a organization/folder level,
+ * customer can choose Cloud storage bucket in any project. If the audit is triggered at
+ * project level using the service agent at organization/folder level, all the destination
+ * options associated with respective organization/folder level service agent will be
+ * available to auditing projects.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Enrollment enrollResource(
+ String scope, ListSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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())
+ * .build();
+ * Enrollment response = auditManagerClient.enrollResource(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Enrollment enrollResource(EnrollResourceRequest request) {
+ return enrollResourceCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Enrolls the customer resource(folder/project/organization) to the audit manager service by
+ * creating the audit managers Service Agent in customers workload and granting required
+ * permissions to the Service Agent. Please note that if enrollment request is made on the already
+ * enrolled workload then enrollment is executed overriding the existing set of destinations.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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())
+ * .build();
+ * ApiFuture future =
+ * auditManagerClient.enrollResourceCallable().futureCall(request);
+ * // Do something.
+ * Enrollment response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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);
+ * }
+ * }
+ *
+ * @param scope Required. Scope for which the AuditScopeReport is required. Must be of format
+ * resource_type/resource_identifier Eg: projects/{project}/locations/{location},
+ * folders/{folder}/locations/{location}
+ * @param complianceStandard Required. Compliance Standard against which the Scope Report must be
+ * generated. Eg: FEDRAMP_MODERATE
+ * @param reportFormat Required. The format in which the Scope report bytes should be returned.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final AuditScopeReport generateAuditScopeReport(
+ String scope,
+ String complianceStandard,
+ GenerateAuditScopeReportRequest.AuditScopeReportFormat reportFormat) {
+ GenerateAuditScopeReportRequest request =
+ GenerateAuditScopeReportRequest.newBuilder()
+ .setScope(scope)
+ .setComplianceStandard(complianceStandard)
+ .setReportFormat(reportFormat)
+ .build();
+ return generateAuditScopeReport(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Generates a demo report highlighting different responsibilities (Google/Customer/ shared)
+ * required to be fulfilled for the customer's workload to be compliant with the given standard.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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")
+ * .build();
+ * AuditScopeReport response = auditManagerClient.generateAuditScopeReport(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final AuditScopeReport generateAuditScopeReport(GenerateAuditScopeReportRequest request) {
+ return generateAuditScopeReportCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Generates a demo report highlighting different responsibilities (Google/Customer/ shared)
+ * required to be fulfilled for the customer's workload to be compliant with the given standard.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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")
+ * .build();
+ * ApiFuture future =
+ * auditManagerClient.generateAuditScopeReportCallable().futureCall(request);
+ * // Do something.
+ * AuditScopeReport response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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();
+ * }
+ * }
+ *
+ * @param scope Required. Scope for which the AuditScopeReport is required. Must be of format
+ * resource_type/resource_identifier Eg: projects/{project}/locations/{location},
+ * folders/{folder}/locations/{location}
+ * @param gcsUri Destination Cloud storage bucket where report and evidence must be uploaded. The
+ * Cloud storage bucket provided here must be selected among the buckets entered during the
+ * enrollment process.
+ * @param complianceStandard Required. Compliance Standard against which the Scope Report must be
+ * generated. Eg: FEDRAMP_MODERATE
+ * @param reportFormat Required. The format in which the audit report should be created.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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")
+ * .build();
+ * AuditReport response = auditManagerClient.generateAuditReportAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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")
+ * .build();
+ * OperationFuture future =
+ * auditManagerClient.generateAuditReportOperationCallable().futureCall(request);
+ * // Do something.
+ * AuditReport response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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")
+ * .build();
+ * ApiFuture future =
+ * auditManagerClient.generateAuditReportCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent scope for which to list the reports.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListAuditReportsPagedResponse listAuditReports(EnrollmentStatusScopeName parent) {
+ ListAuditReportsRequest request =
+ ListAuditReportsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listAuditReports(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists audit reports in the selected parent scope
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent scope for which to list the reports.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListAuditReportsPagedResponse listAuditReports(LocationName parent) {
+ ListAuditReportsRequest request =
+ ListAuditReportsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listAuditReports(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists audit reports in the selected parent scope
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent scope for which to list the reports.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListAuditReportsPagedResponse listAuditReports(String parent) {
+ ListAuditReportsRequest request =
+ ListAuditReportsRequest.newBuilder().setParent(parent).build();
+ return listAuditReports(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists audit reports in the selected parent scope
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListAuditReportsPagedResponse listAuditReports(ListAuditReportsRequest request) {
+ return listAuditReportsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists audit reports in the selected parent scope
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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 future =
+ * auditManagerClient.listAuditReportsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (AuditReport element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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);
+ * }
+ * }
+ *
+ * @param name Required. Format
+ * projects/{project}/locations/{location}/auditReports/{audit_report},
+ * folders/{folder}/locations/{location}/auditReports/{audit_report}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final AuditReport getAuditReport(AuditReportName name) {
+ GetAuditReportRequest request =
+ GetAuditReportRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getAuditReport(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Get the overall audit report
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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);
+ * }
+ * }
+ *
+ * @param name Required. Format
+ * projects/{project}/locations/{location}/auditReports/{audit_report},
+ * folders/{folder}/locations/{location}/auditReports/{audit_report}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final AuditReport getAuditReport(String name) {
+ GetAuditReportRequest request = GetAuditReportRequest.newBuilder().setName(name).build();
+ return getAuditReport(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Get the overall audit report
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final AuditReport getAuditReport(GetAuditReportRequest request) {
+ return getAuditReportCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Get the overall audit report
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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 future =
+ * auditManagerClient.getAuditReportCallable().futureCall(request);
+ * // Do something.
+ * AuditReport response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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);
+ * }
+ * }
+ *
+ * @param name Required. Format
+ * folders/{folder}/locations/{location}/resourceEnrollmentStatuses/{resource_enrollment_status},
+ * projects/{project}/locations/{location}/resourceEnrollmentStatuses/{resource_enrollment_status},
+ * organizations/{organization}/locations/{location}/resourceEnrollmentStatuses/{resource_enrollment_status}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ResourceEnrollmentStatus getResourceEnrollmentStatus(
+ ResourceEnrollmentStatusName name) {
+ GetResourceEnrollmentStatusRequest request =
+ GetResourceEnrollmentStatusRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return getResourceEnrollmentStatus(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Get a resource along with its enrollment status.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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);
+ * }
+ * }
+ *
+ * @param name Required. Format
+ * folders/{folder}/locations/{location}/resourceEnrollmentStatuses/{resource_enrollment_status},
+ * projects/{project}/locations/{location}/resourceEnrollmentStatuses/{resource_enrollment_status},
+ * organizations/{organization}/locations/{location}/resourceEnrollmentStatuses/{resource_enrollment_status}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ResourceEnrollmentStatus getResourceEnrollmentStatus(String name) {
+ GetResourceEnrollmentStatusRequest request =
+ GetResourceEnrollmentStatusRequest.newBuilder().setName(name).build();
+ return getResourceEnrollmentStatus(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Get a resource along with its enrollment status.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ResourceEnrollmentStatus getResourceEnrollmentStatus(
+ GetResourceEnrollmentStatusRequest request) {
+ return getResourceEnrollmentStatusCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Get a resource along with its enrollment status.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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 future =
+ * auditManagerClient.getResourceEnrollmentStatusCallable().futureCall(request);
+ * // Do something.
+ * ResourceEnrollmentStatus response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent scope for which the list of resources with enrollments are
+ * required.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListResourceEnrollmentStatusesPagedResponse listResourceEnrollmentStatuses(
+ EnrollmentStatusScopeName parent) {
+ ListResourceEnrollmentStatusesRequest request =
+ ListResourceEnrollmentStatusesRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listResourceEnrollmentStatuses(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Fetches all resources under the parent along with their enrollment.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent scope for which the list of resources with enrollments are
+ * required.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListResourceEnrollmentStatusesPagedResponse listResourceEnrollmentStatuses(
+ String parent) {
+ ListResourceEnrollmentStatusesRequest request =
+ ListResourceEnrollmentStatusesRequest.newBuilder().setParent(parent).build();
+ return listResourceEnrollmentStatuses(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Fetches all resources under the parent along with their enrollment.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListResourceEnrollmentStatusesPagedResponse listResourceEnrollmentStatuses(
+ ListResourceEnrollmentStatusesRequest request) {
+ return listResourceEnrollmentStatusesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Fetches all resources under the parent along with their enrollment.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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 future =
+ * auditManagerClient.listResourceEnrollmentStatusesPagedCallable().futureCall(request);
+ * // Do something.
+ * for (ResourceEnrollmentStatus element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable<
+ ListResourceEnrollmentStatusesRequest, ListResourceEnrollmentStatusesPagedResponse>
+ listResourceEnrollmentStatusesPagedCallable() {
+ return stub.listResourceEnrollmentStatusesPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Fetches all resources under the parent along with their enrollment.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable<
+ ListResourceEnrollmentStatusesRequest, ListResourceEnrollmentStatusesResponse>
+ listResourceEnrollmentStatusesCallable() {
+ return stub.listResourceEnrollmentStatusesCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets controls needed to be implemented to be compliant to a standard.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Format projects/{project}/locations/{location}/standards/{standard},
+ * folders/{folder}/locations/{location}/standards/{standard}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListControlsPagedResponse listControls(StandardName parent) {
+ ListControlsRequest request =
+ ListControlsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listControls(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets controls needed to be implemented to be compliant to a standard.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Format projects/{project}/locations/{location}/standards/{standard},
+ * folders/{folder}/locations/{location}/standards/{standard}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListControlsPagedResponse listControls(String parent) {
+ ListControlsRequest request = ListControlsRequest.newBuilder().setParent(parent).build();
+ return listControls(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets controls needed to be implemented to be compliant to a standard.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListControlsPagedResponse listControls(ListControlsRequest request) {
+ return listControlsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets controls needed to be implemented to be compliant to a standard.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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 future =
+ * auditManagerClient.listControlsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (Control element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable* **List all public locations:** Use the path `GET /v1/locations`.* + * **List project-visible locations:** Use the path`GET + * /v1/projects/{project_id}/locations`. This may include publiclocations as well as private or + * other locations specifically visibleto the project. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) {
+ return listLocationsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about the supported locations for this service.This method can be called in
+ * two ways:
+ *
+ * * **List all public locations:** Use the path `GET /v1/locations`.* + * **List project-visible locations:** Use the path`GET + * /v1/projects/{project_id}/locations`. This may include publiclocations as well as private or + * other locations specifically visibleto the project. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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 future =
+ * auditManagerClient.listLocationsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (Location element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable* **List all public locations:** Use the path `GET /v1/locations`.* + * **List project-visible locations:** Use the path`GET + * /v1/projects/{project_id}/locations`. This may include publiclocations as well as private or + * other locations specifically visibleto the project. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Location getLocation(GetLocationRequest request) {
+ return getLocationCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a location.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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 future = auditManagerClient.getLocationCallable().futureCall(request);
+ * // Do something.
+ * Location response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableThe default instance has everything set to sensible defaults: + * + *
The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *
For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of enrollResource: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require 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.Builder auditManagerSettingsBuilder = AuditManagerSettings.newBuilder();
+ * auditManagerSettingsBuilder
+ * .enrollResourceSettings()
+ * .setRetrySettings(
+ * auditManagerSettingsBuilder
+ * .enrollResourceSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ * .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ * .setMaxAttempts(5)
+ * .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ * .setRetryDelayMultiplier(1.3)
+ * .setRpcTimeoutMultiplier(1.5)
+ * .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ * .build());
+ * AuditManagerSettings auditManagerSettings = auditManagerSettingsBuilder.build();
+ * }
+ *
+ * Please refer to the [Client Side Retry
+ * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting
+ * retries.
+ *
+ * To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for generateAuditReport: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require 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.Builder auditManagerSettingsBuilder = AuditManagerSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ * OperationalTimedPollAlgorithm.create(
+ * RetrySettings.newBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ * .setRetryDelayMultiplier(1.5)
+ * .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ * .setTotalTimeoutDuration(Duration.ofHours(24))
+ * .build());
+ * auditManagerSettingsBuilder
+ * .createClusterOperationSettings()
+ * .setPollingAlgorithm(timedRetryAlgorithm)
+ * .build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class AuditManagerSettings extends ClientSettingsNote: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction The interfaces provided are listed below, along with usage samples.
+ *
+ * ======================= AuditManagerClient =======================
+ *
+ * Service Description: Service describing handlers for resources
+ *
+ * Sample for AuditManagerClient:
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public abstract class AuditManagerStub implements BackgroundResource {
+
+ public OperationsStub getOperationsStub() {
+ return null;
+ }
+
+ public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() {
+ return null;
+ }
+
+ public UnaryCallable The default instance has everything set to sensible defaults:
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ * For example, to set the
+ * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings)
+ * of enrollResource:
+ *
+ * To configure the RetrySettings of a Long Running Operation method, create an
+ * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to
+ * configure the RetrySettings for generateAuditReport:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcAuditManagerCallableFactory implements GrpcStubCallableFactory {
+
+ @Override
+ public This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcAuditManagerStub extends AuditManagerStub {
+ private static final MethodDescriptor{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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
+ */
+@Generated("by gapic-generator-java")
+package com.google.cloud.auditmanager.v1;
+
+import javax.annotation.Generated;
diff --git a/java-auditmanager/google-cloud-auditmanager/src/main/java/com/google/cloud/auditmanager/v1/stub/AuditManagerStub.java b/java-auditmanager/google-cloud-auditmanager/src/main/java/com/google/cloud/auditmanager/v1/stub/AuditManagerStub.java
new file mode 100644
index 000000000000..5123463d4f1b
--- /dev/null
+++ b/java-auditmanager/google-cloud-auditmanager/src/main/java/com/google/cloud/auditmanager/v1/stub/AuditManagerStub.java
@@ -0,0 +1,144 @@
+/*
+ * Copyright 2026 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.auditmanager.v1.stub;
+
+import static com.google.cloud.auditmanager.v1.AuditManagerClient.ListAuditReportsPagedResponse;
+import static com.google.cloud.auditmanager.v1.AuditManagerClient.ListControlsPagedResponse;
+import static com.google.cloud.auditmanager.v1.AuditManagerClient.ListLocationsPagedResponse;
+import static com.google.cloud.auditmanager.v1.AuditManagerClient.ListResourceEnrollmentStatusesPagedResponse;
+
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.auditmanager.v1.AuditReport;
+import com.google.cloud.auditmanager.v1.AuditScopeReport;
+import com.google.cloud.auditmanager.v1.EnrollResourceRequest;
+import com.google.cloud.auditmanager.v1.Enrollment;
+import com.google.cloud.auditmanager.v1.GenerateAuditReportRequest;
+import com.google.cloud.auditmanager.v1.GenerateAuditScopeReportRequest;
+import com.google.cloud.auditmanager.v1.GetAuditReportRequest;
+import com.google.cloud.auditmanager.v1.GetResourceEnrollmentStatusRequest;
+import com.google.cloud.auditmanager.v1.ListAuditReportsRequest;
+import com.google.cloud.auditmanager.v1.ListAuditReportsResponse;
+import com.google.cloud.auditmanager.v1.ListControlsRequest;
+import com.google.cloud.auditmanager.v1.ListControlsResponse;
+import com.google.cloud.auditmanager.v1.ListResourceEnrollmentStatusesRequest;
+import com.google.cloud.auditmanager.v1.ListResourceEnrollmentStatusesResponse;
+import com.google.cloud.auditmanager.v1.OperationMetadata;
+import com.google.cloud.auditmanager.v1.ResourceEnrollmentStatus;
+import com.google.cloud.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
+import com.google.longrunning.Operation;
+import com.google.longrunning.stub.OperationsStub;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Base stub class for the AuditManager service API.
+ *
+ *
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AuditManagerStubSettings.Builder auditManagerSettingsBuilder =
+ * AuditManagerStubSettings.newBuilder();
+ * auditManagerSettingsBuilder
+ * .enrollResourceSettings()
+ * .setRetrySettings(
+ * auditManagerSettingsBuilder
+ * .enrollResourceSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ * .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ * .setMaxAttempts(5)
+ * .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ * .setRetryDelayMultiplier(1.3)
+ * .setRpcTimeoutMultiplier(1.5)
+ * .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ * .build());
+ * AuditManagerStubSettings auditManagerSettings = auditManagerSettingsBuilder.build();
+ * }
+ *
+ * Please refer to the [Client Side Retry
+ * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting
+ * retries.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AuditManagerStubSettings.Builder auditManagerSettingsBuilder =
+ * AuditManagerStubSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ * OperationalTimedPollAlgorithm.create(
+ * RetrySettings.newBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ * .setRetryDelayMultiplier(1.5)
+ * .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ * .setTotalTimeoutDuration(Duration.ofHours(24))
+ * .build());
+ * auditManagerSettingsBuilder
+ * .createClusterOperationSettings()
+ * .setPollingAlgorithm(timedRetryAlgorithm)
+ * .build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class AuditManagerStubSettings extends StubSettings