diff --git a/java-assured-workloads/README.md b/java-assured-workloads/README.md index bcba054fb7e5..01166ae2cb98 100644 --- a/java-assured-workloads/README.md +++ b/java-assured-workloads/README.md @@ -19,20 +19,20 @@ If you are using Maven, add this to your pom.xml file: com.google.cloud google-cloud-assured-workloads - 2.2.0 + 2.2.1 ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-assured-workloads:2.2.0' +implementation 'com.google.cloud:google-cloud-assured-workloads:2.2.1' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-assured-workloads" % "2.2.0" +libraryDependencies += "com.google.cloud" % "google-cloud-assured-workloads" % "2.2.1" ``` ## Authentication diff --git a/java-assured-workloads/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1/AssuredWorkloadsServiceClient.java b/java-assured-workloads/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1/AssuredWorkloadsServiceClient.java index 2c60e65a4355..f09c74592ace 100644 --- a/java-assured-workloads/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1/AssuredWorkloadsServiceClient.java +++ b/java-assured-workloads/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1/AssuredWorkloadsServiceClient.java @@ -397,7 +397,7 @@ public final UnaryCallable createWorkloadCalla * } * } * - * @param workload Required. The workload to update. The workload’s `name` field is used to + * @param workload Required. The workload to update. The workload's `name` field is used to * identify the workload to be updated. Format: * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} * @param updateMask Required. The list of fields to be updated. @@ -473,6 +473,69 @@ public final UnaryCallable updateWorkloadCallab return stub.updateWorkloadCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restrict the list of resources allowed in the Workload environment. The current list of allowed + * products can be found at https://cloud.google.com/assured-workloads/docs/supported-products In + * addition to assuredworkloads.workload.update permission, the user should also have + * orgpolicy.policy.set permission on the folder resource to use this functionality. + * + *

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 (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient =
+   *     AssuredWorkloadsServiceClient.create()) {
+   *   RestrictAllowedResourcesRequest request =
+   *       RestrictAllowedResourcesRequest.newBuilder().setName("name3373707").build();
+   *   RestrictAllowedResourcesResponse response =
+   *       assuredWorkloadsServiceClient.restrictAllowedResources(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 RestrictAllowedResourcesResponse restrictAllowedResources( + RestrictAllowedResourcesRequest request) { + return restrictAllowedResourcesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Restrict the list of resources allowed in the Workload environment. The current list of allowed + * products can be found at https://cloud.google.com/assured-workloads/docs/supported-products In + * addition to assuredworkloads.workload.update permission, the user should also have + * orgpolicy.policy.set permission on the folder resource to use this functionality. + * + *

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 (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient =
+   *     AssuredWorkloadsServiceClient.create()) {
+   *   RestrictAllowedResourcesRequest request =
+   *       RestrictAllowedResourcesRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future =
+   *       assuredWorkloadsServiceClient.restrictAllowedResourcesCallable().futureCall(request);
+   *   // Do something.
+   *   RestrictAllowedResourcesResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + restrictAllowedResourcesCallable() { + return stub.restrictAllowedResourcesCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the workload. Make sure that workload's direct children are already in a deleted state, @@ -886,6 +949,388 @@ public final UnaryCallable listWork return stub.listWorkloadsCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the Violations in the AssuredWorkload Environment. Callers may also choose to read across + * multiple Workloads as per [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or + * dash character) as a wildcard character instead of workload-id in the parent. Format + * `organizations/{org_id}/locations/{location}/workloads/-` + * + *

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 (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient =
+   *     AssuredWorkloadsServiceClient.create()) {
+   *   WorkloadName parent = WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]");
+   *   for (Violation element : assuredWorkloadsServiceClient.listViolations(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The Workload name. Format + * `organizations/{org_id}/locations/{location}/workloads/{workload}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListViolationsPagedResponse listViolations(WorkloadName parent) { + ListViolationsRequest request = + ListViolationsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listViolations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the Violations in the AssuredWorkload Environment. Callers may also choose to read across + * multiple Workloads as per [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or + * dash character) as a wildcard character instead of workload-id in the parent. Format + * `organizations/{org_id}/locations/{location}/workloads/-` + * + *

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 (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient =
+   *     AssuredWorkloadsServiceClient.create()) {
+   *   String parent = WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]").toString();
+   *   for (Violation element : assuredWorkloadsServiceClient.listViolations(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The Workload name. Format + * `organizations/{org_id}/locations/{location}/workloads/{workload}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListViolationsPagedResponse listViolations(String parent) { + ListViolationsRequest request = ListViolationsRequest.newBuilder().setParent(parent).build(); + return listViolations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the Violations in the AssuredWorkload Environment. Callers may also choose to read across + * multiple Workloads as per [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or + * dash character) as a wildcard character instead of workload-id in the parent. Format + * `organizations/{org_id}/locations/{location}/workloads/-` + * + *

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 (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient =
+   *     AssuredWorkloadsServiceClient.create()) {
+   *   ListViolationsRequest request =
+   *       ListViolationsRequest.newBuilder()
+   *           .setParent(WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]").toString())
+   *           .setInterval(TimeWindow.newBuilder().build())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   for (Violation element : assuredWorkloadsServiceClient.listViolations(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 ListViolationsPagedResponse listViolations(ListViolationsRequest request) { + return listViolationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the Violations in the AssuredWorkload Environment. Callers may also choose to read across + * multiple Workloads as per [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or + * dash character) as a wildcard character instead of workload-id in the parent. Format + * `organizations/{org_id}/locations/{location}/workloads/-` + * + *

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 (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient =
+   *     AssuredWorkloadsServiceClient.create()) {
+   *   ListViolationsRequest request =
+   *       ListViolationsRequest.newBuilder()
+   *           .setParent(WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]").toString())
+   *           .setInterval(TimeWindow.newBuilder().build())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   ApiFuture future =
+   *       assuredWorkloadsServiceClient.listViolationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Violation element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listViolationsPagedCallable() { + return stub.listViolationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the Violations in the AssuredWorkload Environment. Callers may also choose to read across + * multiple Workloads as per [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or + * dash character) as a wildcard character instead of workload-id in the parent. Format + * `organizations/{org_id}/locations/{location}/workloads/-` + * + *

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 (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient =
+   *     AssuredWorkloadsServiceClient.create()) {
+   *   ListViolationsRequest request =
+   *       ListViolationsRequest.newBuilder()
+   *           .setParent(WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]").toString())
+   *           .setInterval(TimeWindow.newBuilder().build())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   while (true) {
+   *     ListViolationsResponse response =
+   *         assuredWorkloadsServiceClient.listViolationsCallable().call(request);
+   *     for (Violation element : response.getViolationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listViolationsCallable() { + return stub.listViolationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves Assured Workload Violation based on ID. + * + *

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 (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient =
+   *     AssuredWorkloadsServiceClient.create()) {
+   *   ViolationName name =
+   *       ViolationName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]", "[VIOLATION]");
+   *   Violation response = assuredWorkloadsServiceClient.getViolation(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the Violation to fetch (ie. Violation.name). Format: + * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Violation getViolation(ViolationName name) { + GetViolationRequest request = + GetViolationRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getViolation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves Assured Workload Violation based on ID. + * + *

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 (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient =
+   *     AssuredWorkloadsServiceClient.create()) {
+   *   String name =
+   *       ViolationName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]", "[VIOLATION]").toString();
+   *   Violation response = assuredWorkloadsServiceClient.getViolation(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the Violation to fetch (ie. Violation.name). Format: + * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Violation getViolation(String name) { + GetViolationRequest request = GetViolationRequest.newBuilder().setName(name).build(); + return getViolation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves Assured Workload Violation based on ID. + * + *

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 (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient =
+   *     AssuredWorkloadsServiceClient.create()) {
+   *   GetViolationRequest request =
+   *       GetViolationRequest.newBuilder()
+   *           .setName(
+   *               ViolationName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]", "[VIOLATION]")
+   *                   .toString())
+   *           .build();
+   *   Violation response = assuredWorkloadsServiceClient.getViolation(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 Violation getViolation(GetViolationRequest request) { + return getViolationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves Assured Workload Violation based on ID. + * + *

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 (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient =
+   *     AssuredWorkloadsServiceClient.create()) {
+   *   GetViolationRequest request =
+   *       GetViolationRequest.newBuilder()
+   *           .setName(
+   *               ViolationName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]", "[VIOLATION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       assuredWorkloadsServiceClient.getViolationCallable().futureCall(request);
+   *   // Do something.
+   *   Violation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getViolationCallable() { + return stub.getViolationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Acknowledges an existing violation. By acknowledging a violation, users acknowledge the + * existence of a compliance violation in their workload and decide to ignore it due to a valid + * business justification. Acknowledgement is a permanent operation and it cannot be reverted. + * + *

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 (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient =
+   *     AssuredWorkloadsServiceClient.create()) {
+   *   AcknowledgeViolationRequest request =
+   *       AcknowledgeViolationRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setComment("comment950398559")
+   *           .setNonCompliantOrgPolicy("nonCompliantOrgPolicy-1928466552")
+   *           .build();
+   *   AcknowledgeViolationResponse response =
+   *       assuredWorkloadsServiceClient.acknowledgeViolation(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 AcknowledgeViolationResponse acknowledgeViolation( + AcknowledgeViolationRequest request) { + return acknowledgeViolationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Acknowledges an existing violation. By acknowledging a violation, users acknowledge the + * existence of a compliance violation in their workload and decide to ignore it due to a valid + * business justification. Acknowledgement is a permanent operation and it cannot be reverted. + * + *

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 (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient =
+   *     AssuredWorkloadsServiceClient.create()) {
+   *   AcknowledgeViolationRequest request =
+   *       AcknowledgeViolationRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setComment("comment950398559")
+   *           .setNonCompliantOrgPolicy("nonCompliantOrgPolicy-1928466552")
+   *           .build();
+   *   ApiFuture future =
+   *       assuredWorkloadsServiceClient.acknowledgeViolationCallable().futureCall(request);
+   *   // Do something.
+   *   AcknowledgeViolationResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + acknowledgeViolationCallable() { + return stub.acknowledgeViolationCallable(); + } + @Override public final void close() { stub.close(); @@ -991,4 +1436,80 @@ protected ListWorkloadsFixedSizeCollection createCollection( return new ListWorkloadsFixedSizeCollection(pages, collectionSize); } } + + public static class ListViolationsPagedResponse + extends AbstractPagedListResponse< + ListViolationsRequest, + ListViolationsResponse, + Violation, + ListViolationsPage, + ListViolationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListViolationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListViolationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListViolationsPagedResponse(ListViolationsPage page) { + super(page, ListViolationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListViolationsPage + extends AbstractPage< + ListViolationsRequest, ListViolationsResponse, Violation, ListViolationsPage> { + + private ListViolationsPage( + PageContext context, + ListViolationsResponse response) { + super(context, response); + } + + private static ListViolationsPage createEmptyPage() { + return new ListViolationsPage(null, null); + } + + @Override + protected ListViolationsPage createPage( + PageContext context, + ListViolationsResponse response) { + return new ListViolationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListViolationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListViolationsRequest, + ListViolationsResponse, + Violation, + ListViolationsPage, + ListViolationsFixedSizeCollection> { + + private ListViolationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListViolationsFixedSizeCollection createEmptyCollection() { + return new ListViolationsFixedSizeCollection(null, 0); + } + + @Override + protected ListViolationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListViolationsFixedSizeCollection(pages, collectionSize); + } + } } diff --git a/java-assured-workloads/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1/AssuredWorkloadsServiceSettings.java b/java-assured-workloads/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1/AssuredWorkloadsServiceSettings.java index 4dcabf6e280f..0ad206459b64 100644 --- a/java-assured-workloads/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1/AssuredWorkloadsServiceSettings.java +++ b/java-assured-workloads/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1/AssuredWorkloadsServiceSettings.java @@ -16,6 +16,7 @@ package com.google.cloud.assuredworkloads.v1; +import static com.google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient.ListViolationsPagedResponse; import static com.google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient.ListWorkloadsPagedResponse; import com.google.api.core.ApiFunction; @@ -98,6 +99,13 @@ public UnaryCallSettings updateWorkloadSettings return ((AssuredWorkloadsServiceStubSettings) getStubSettings()).updateWorkloadSettings(); } + /** Returns the object with the settings used for calls to restrictAllowedResources. */ + public UnaryCallSettings + restrictAllowedResourcesSettings() { + return ((AssuredWorkloadsServiceStubSettings) getStubSettings()) + .restrictAllowedResourcesSettings(); + } + /** Returns the object with the settings used for calls to deleteWorkload. */ public UnaryCallSettings deleteWorkloadSettings() { return ((AssuredWorkloadsServiceStubSettings) getStubSettings()).deleteWorkloadSettings(); @@ -114,6 +122,24 @@ public UnaryCallSettings getWorkloadSettings() { return ((AssuredWorkloadsServiceStubSettings) getStubSettings()).listWorkloadsSettings(); } + /** Returns the object with the settings used for calls to listViolations. */ + public PagedCallSettings< + ListViolationsRequest, ListViolationsResponse, ListViolationsPagedResponse> + listViolationsSettings() { + return ((AssuredWorkloadsServiceStubSettings) getStubSettings()).listViolationsSettings(); + } + + /** Returns the object with the settings used for calls to getViolation. */ + public UnaryCallSettings getViolationSettings() { + return ((AssuredWorkloadsServiceStubSettings) getStubSettings()).getViolationSettings(); + } + + /** Returns the object with the settings used for calls to acknowledgeViolation. */ + public UnaryCallSettings + acknowledgeViolationSettings() { + return ((AssuredWorkloadsServiceStubSettings) getStubSettings()).acknowledgeViolationSettings(); + } + public static final AssuredWorkloadsServiceSettings create( AssuredWorkloadsServiceStubSettings stub) throws IOException { return new AssuredWorkloadsServiceSettings.Builder(stub.toBuilder()).build(); @@ -247,6 +273,13 @@ public UnaryCallSettings.Builder updateWorkload return getStubSettingsBuilder().updateWorkloadSettings(); } + /** Returns the builder for the settings used for calls to restrictAllowedResources. */ + public UnaryCallSettings.Builder< + RestrictAllowedResourcesRequest, RestrictAllowedResourcesResponse> + restrictAllowedResourcesSettings() { + return getStubSettingsBuilder().restrictAllowedResourcesSettings(); + } + /** Returns the builder for the settings used for calls to deleteWorkload. */ public UnaryCallSettings.Builder deleteWorkloadSettings() { return getStubSettingsBuilder().deleteWorkloadSettings(); @@ -264,6 +297,24 @@ public UnaryCallSettings.Builder getWorkloadSettin return getStubSettingsBuilder().listWorkloadsSettings(); } + /** Returns the builder for the settings used for calls to listViolations. */ + public PagedCallSettings.Builder< + ListViolationsRequest, ListViolationsResponse, ListViolationsPagedResponse> + listViolationsSettings() { + return getStubSettingsBuilder().listViolationsSettings(); + } + + /** Returns the builder for the settings used for calls to getViolation. */ + public UnaryCallSettings.Builder getViolationSettings() { + return getStubSettingsBuilder().getViolationSettings(); + } + + /** Returns the builder for the settings used for calls to acknowledgeViolation. */ + public UnaryCallSettings.Builder + acknowledgeViolationSettings() { + return getStubSettingsBuilder().acknowledgeViolationSettings(); + } + @Override public AssuredWorkloadsServiceSettings build() throws IOException { return new AssuredWorkloadsServiceSettings(this); diff --git a/java-assured-workloads/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1/gapic_metadata.json b/java-assured-workloads/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1/gapic_metadata.json index 62502d5c31cf..7c78ed4a1569 100644 --- a/java-assured-workloads/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1/gapic_metadata.json +++ b/java-assured-workloads/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1/gapic_metadata.json @@ -10,18 +10,30 @@ "grpc": { "libraryClient": "AssuredWorkloadsServiceClient", "rpcs": { + "AcknowledgeViolation": { + "methods": ["acknowledgeViolation", "acknowledgeViolationCallable"] + }, "CreateWorkload": { "methods": ["createWorkloadAsync", "createWorkloadAsync", "createWorkloadAsync", "createWorkloadOperationCallable", "createWorkloadCallable"] }, "DeleteWorkload": { "methods": ["deleteWorkload", "deleteWorkload", "deleteWorkload", "deleteWorkloadCallable"] }, + "GetViolation": { + "methods": ["getViolation", "getViolation", "getViolation", "getViolationCallable"] + }, "GetWorkload": { "methods": ["getWorkload", "getWorkload", "getWorkload", "getWorkloadCallable"] }, + "ListViolations": { + "methods": ["listViolations", "listViolations", "listViolations", "listViolationsPagedCallable", "listViolationsCallable"] + }, "ListWorkloads": { "methods": ["listWorkloads", "listWorkloads", "listWorkloads", "listWorkloadsPagedCallable", "listWorkloadsCallable"] }, + "RestrictAllowedResources": { + "methods": ["restrictAllowedResources", "restrictAllowedResourcesCallable"] + }, "UpdateWorkload": { "methods": ["updateWorkload", "updateWorkload", "updateWorkloadCallable"] } diff --git a/java-assured-workloads/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1/stub/AssuredWorkloadsServiceStub.java b/java-assured-workloads/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1/stub/AssuredWorkloadsServiceStub.java index 5515cbfc507d..63b51bce9c5d 100644 --- a/java-assured-workloads/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1/stub/AssuredWorkloadsServiceStub.java +++ b/java-assured-workloads/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1/stub/AssuredWorkloadsServiceStub.java @@ -16,18 +16,27 @@ package com.google.cloud.assuredworkloads.v1.stub; +import static com.google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient.ListViolationsPagedResponse; import static com.google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient.ListWorkloadsPagedResponse; 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.assuredworkloads.v1.AcknowledgeViolationRequest; +import com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse; import com.google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata; import com.google.cloud.assuredworkloads.v1.CreateWorkloadRequest; import com.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest; +import com.google.cloud.assuredworkloads.v1.GetViolationRequest; import com.google.cloud.assuredworkloads.v1.GetWorkloadRequest; +import com.google.cloud.assuredworkloads.v1.ListViolationsRequest; +import com.google.cloud.assuredworkloads.v1.ListViolationsResponse; import com.google.cloud.assuredworkloads.v1.ListWorkloadsRequest; import com.google.cloud.assuredworkloads.v1.ListWorkloadsResponse; +import com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest; +import com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse; import com.google.cloud.assuredworkloads.v1.UpdateWorkloadRequest; +import com.google.cloud.assuredworkloads.v1.Violation; import com.google.cloud.assuredworkloads.v1.Workload; import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; @@ -64,6 +73,11 @@ public UnaryCallable updateWorkloadCallable() { throw new UnsupportedOperationException("Not implemented: updateWorkloadCallable()"); } + public UnaryCallable + restrictAllowedResourcesCallable() { + throw new UnsupportedOperationException("Not implemented: restrictAllowedResourcesCallable()"); + } + public UnaryCallable deleteWorkloadCallable() { throw new UnsupportedOperationException("Not implemented: deleteWorkloadCallable()"); } @@ -81,6 +95,24 @@ public UnaryCallable listWorkloadsC throw new UnsupportedOperationException("Not implemented: listWorkloadsCallable()"); } + public UnaryCallable + listViolationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listViolationsPagedCallable()"); + } + + public UnaryCallable listViolationsCallable() { + throw new UnsupportedOperationException("Not implemented: listViolationsCallable()"); + } + + public UnaryCallable getViolationCallable() { + throw new UnsupportedOperationException("Not implemented: getViolationCallable()"); + } + + public UnaryCallable + acknowledgeViolationCallable() { + throw new UnsupportedOperationException("Not implemented: acknowledgeViolationCallable()"); + } + @Override public abstract void close(); } diff --git a/java-assured-workloads/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1/stub/AssuredWorkloadsServiceStubSettings.java b/java-assured-workloads/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1/stub/AssuredWorkloadsServiceStubSettings.java index fe6c45899327..4a0c818b1999 100644 --- a/java-assured-workloads/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1/stub/AssuredWorkloadsServiceStubSettings.java +++ b/java-assured-workloads/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1/stub/AssuredWorkloadsServiceStubSettings.java @@ -16,6 +16,7 @@ package com.google.cloud.assuredworkloads.v1.stub; +import static com.google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient.ListViolationsPagedResponse; import static com.google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient.ListWorkloadsPagedResponse; import com.google.api.core.ApiFunction; @@ -47,13 +48,21 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest; +import com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse; import com.google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata; import com.google.cloud.assuredworkloads.v1.CreateWorkloadRequest; import com.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest; +import com.google.cloud.assuredworkloads.v1.GetViolationRequest; import com.google.cloud.assuredworkloads.v1.GetWorkloadRequest; +import com.google.cloud.assuredworkloads.v1.ListViolationsRequest; +import com.google.cloud.assuredworkloads.v1.ListViolationsResponse; import com.google.cloud.assuredworkloads.v1.ListWorkloadsRequest; import com.google.cloud.assuredworkloads.v1.ListWorkloadsResponse; +import com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest; +import com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse; import com.google.cloud.assuredworkloads.v1.UpdateWorkloadRequest; +import com.google.cloud.assuredworkloads.v1.Violation; import com.google.cloud.assuredworkloads.v1.Workload; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; @@ -117,11 +126,19 @@ public class AssuredWorkloadsServiceStubSettings CreateWorkloadRequest, Workload, CreateWorkloadOperationMetadata> createWorkloadOperationSettings; private final UnaryCallSettings updateWorkloadSettings; + private final UnaryCallSettings + restrictAllowedResourcesSettings; private final UnaryCallSettings deleteWorkloadSettings; private final UnaryCallSettings getWorkloadSettings; private final PagedCallSettings< ListWorkloadsRequest, ListWorkloadsResponse, ListWorkloadsPagedResponse> listWorkloadsSettings; + private final PagedCallSettings< + ListViolationsRequest, ListViolationsResponse, ListViolationsPagedResponse> + listViolationsSettings; + private final UnaryCallSettings getViolationSettings; + private final UnaryCallSettings + acknowledgeViolationSettings; private static final PagedListDescriptor LIST_WORKLOADS_PAGE_STR_DESC = @@ -159,6 +176,43 @@ public Iterable extractResources(ListWorkloadsResponse payload) { } }; + private static final PagedListDescriptor + LIST_VIOLATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListViolationsRequest injectToken(ListViolationsRequest payload, String token) { + return ListViolationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListViolationsRequest injectPageSize( + ListViolationsRequest payload, int pageSize) { + return ListViolationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListViolationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListViolationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListViolationsResponse payload) { + return payload.getViolationsList() == null + ? ImmutableList.of() + : payload.getViolationsList(); + } + }; + private static final PagedListResponseFactory< ListWorkloadsRequest, ListWorkloadsResponse, ListWorkloadsPagedResponse> LIST_WORKLOADS_PAGE_STR_FACT = @@ -176,6 +230,23 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory< + ListViolationsRequest, ListViolationsResponse, ListViolationsPagedResponse> + LIST_VIOLATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListViolationsRequest, ListViolationsResponse, ListViolationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListViolationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_VIOLATIONS_PAGE_STR_DESC, request, context); + return ListViolationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to createWorkload. */ public UnaryCallSettings createWorkloadSettings() { return createWorkloadSettings; @@ -192,6 +263,12 @@ public UnaryCallSettings updateWorkloadSettings return updateWorkloadSettings; } + /** Returns the object with the settings used for calls to restrictAllowedResources. */ + public UnaryCallSettings + restrictAllowedResourcesSettings() { + return restrictAllowedResourcesSettings; + } + /** Returns the object with the settings used for calls to deleteWorkload. */ public UnaryCallSettings deleteWorkloadSettings() { return deleteWorkloadSettings; @@ -208,6 +285,24 @@ public UnaryCallSettings getWorkloadSettings() { return listWorkloadsSettings; } + /** Returns the object with the settings used for calls to listViolations. */ + public PagedCallSettings< + ListViolationsRequest, ListViolationsResponse, ListViolationsPagedResponse> + listViolationsSettings() { + return listViolationsSettings; + } + + /** Returns the object with the settings used for calls to getViolation. */ + public UnaryCallSettings getViolationSettings() { + return getViolationSettings; + } + + /** Returns the object with the settings used for calls to acknowledgeViolation. */ + public UnaryCallSettings + acknowledgeViolationSettings() { + return acknowledgeViolationSettings; + } + public AssuredWorkloadsServiceStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() @@ -317,9 +412,13 @@ protected AssuredWorkloadsServiceStubSettings(Builder settingsBuilder) throws IO createWorkloadSettings = settingsBuilder.createWorkloadSettings().build(); createWorkloadOperationSettings = settingsBuilder.createWorkloadOperationSettings().build(); updateWorkloadSettings = settingsBuilder.updateWorkloadSettings().build(); + restrictAllowedResourcesSettings = settingsBuilder.restrictAllowedResourcesSettings().build(); deleteWorkloadSettings = settingsBuilder.deleteWorkloadSettings().build(); getWorkloadSettings = settingsBuilder.getWorkloadSettings().build(); listWorkloadsSettings = settingsBuilder.listWorkloadsSettings().build(); + listViolationsSettings = settingsBuilder.listViolationsSettings().build(); + getViolationSettings = settingsBuilder.getViolationSettings().build(); + acknowledgeViolationSettings = settingsBuilder.acknowledgeViolationSettings().build(); } /** Builder for AssuredWorkloadsServiceStubSettings. */ @@ -332,11 +431,21 @@ public static class Builder CreateWorkloadRequest, Workload, CreateWorkloadOperationMetadata> createWorkloadOperationSettings; private final UnaryCallSettings.Builder updateWorkloadSettings; + private final UnaryCallSettings.Builder< + RestrictAllowedResourcesRequest, RestrictAllowedResourcesResponse> + restrictAllowedResourcesSettings; private final UnaryCallSettings.Builder deleteWorkloadSettings; private final UnaryCallSettings.Builder getWorkloadSettings; private final PagedCallSettings.Builder< ListWorkloadsRequest, ListWorkloadsResponse, ListWorkloadsPagedResponse> listWorkloadsSettings; + private final PagedCallSettings.Builder< + ListViolationsRequest, ListViolationsResponse, ListViolationsPagedResponse> + listViolationsSettings; + private final UnaryCallSettings.Builder getViolationSettings; + private final UnaryCallSettings.Builder< + AcknowledgeViolationRequest, AcknowledgeViolationResponse> + acknowledgeViolationSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -374,17 +483,25 @@ protected Builder(ClientContext clientContext) { createWorkloadSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); createWorkloadOperationSettings = OperationCallSettings.newBuilder(); updateWorkloadSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + restrictAllowedResourcesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); deleteWorkloadSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); getWorkloadSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listWorkloadsSettings = PagedCallSettings.newBuilder(LIST_WORKLOADS_PAGE_STR_FACT); + listViolationsSettings = PagedCallSettings.newBuilder(LIST_VIOLATIONS_PAGE_STR_FACT); + getViolationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + acknowledgeViolationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( createWorkloadSettings, updateWorkloadSettings, + restrictAllowedResourcesSettings, deleteWorkloadSettings, getWorkloadSettings, - listWorkloadsSettings); + listWorkloadsSettings, + listViolationsSettings, + getViolationSettings, + acknowledgeViolationSettings); initDefaults(this); } @@ -394,17 +511,25 @@ protected Builder(AssuredWorkloadsServiceStubSettings settings) { createWorkloadSettings = settings.createWorkloadSettings.toBuilder(); createWorkloadOperationSettings = settings.createWorkloadOperationSettings.toBuilder(); updateWorkloadSettings = settings.updateWorkloadSettings.toBuilder(); + restrictAllowedResourcesSettings = settings.restrictAllowedResourcesSettings.toBuilder(); deleteWorkloadSettings = settings.deleteWorkloadSettings.toBuilder(); getWorkloadSettings = settings.getWorkloadSettings.toBuilder(); listWorkloadsSettings = settings.listWorkloadsSettings.toBuilder(); + listViolationsSettings = settings.listViolationsSettings.toBuilder(); + getViolationSettings = settings.getViolationSettings.toBuilder(); + acknowledgeViolationSettings = settings.acknowledgeViolationSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( createWorkloadSettings, updateWorkloadSettings, + restrictAllowedResourcesSettings, deleteWorkloadSettings, getWorkloadSettings, - listWorkloadsSettings); + listWorkloadsSettings, + listViolationsSettings, + getViolationSettings, + acknowledgeViolationSettings); } private static Builder createDefault() { @@ -444,6 +569,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + builder + .restrictAllowedResourcesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + builder .deleteWorkloadSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) @@ -459,6 +589,21 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + builder + .listViolationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getViolationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .acknowledgeViolationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + builder .createWorkloadOperationSettings() .setInitialCallSettings( @@ -521,6 +666,13 @@ public UnaryCallSettings.Builder updateWorkload return updateWorkloadSettings; } + /** Returns the builder for the settings used for calls to restrictAllowedResources. */ + public UnaryCallSettings.Builder< + RestrictAllowedResourcesRequest, RestrictAllowedResourcesResponse> + restrictAllowedResourcesSettings() { + return restrictAllowedResourcesSettings; + } + /** Returns the builder for the settings used for calls to deleteWorkload. */ public UnaryCallSettings.Builder deleteWorkloadSettings() { return deleteWorkloadSettings; @@ -538,6 +690,24 @@ public UnaryCallSettings.Builder getWorkloadSettin return listWorkloadsSettings; } + /** Returns the builder for the settings used for calls to listViolations. */ + public PagedCallSettings.Builder< + ListViolationsRequest, ListViolationsResponse, ListViolationsPagedResponse> + listViolationsSettings() { + return listViolationsSettings; + } + + /** Returns the builder for the settings used for calls to getViolation. */ + public UnaryCallSettings.Builder getViolationSettings() { + return getViolationSettings; + } + + /** Returns the builder for the settings used for calls to acknowledgeViolation. */ + public UnaryCallSettings.Builder + acknowledgeViolationSettings() { + return acknowledgeViolationSettings; + } + @Override public AssuredWorkloadsServiceStubSettings build() throws IOException { return new AssuredWorkloadsServiceStubSettings(this); diff --git a/java-assured-workloads/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1/stub/GrpcAssuredWorkloadsServiceStub.java b/java-assured-workloads/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1/stub/GrpcAssuredWorkloadsServiceStub.java index 155974fd75a2..0f0e8693d28d 100644 --- a/java-assured-workloads/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1/stub/GrpcAssuredWorkloadsServiceStub.java +++ b/java-assured-workloads/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1/stub/GrpcAssuredWorkloadsServiceStub.java @@ -16,6 +16,7 @@ package com.google.cloud.assuredworkloads.v1.stub; +import static com.google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient.ListViolationsPagedResponse; import static com.google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient.ListWorkloadsPagedResponse; import com.google.api.gax.core.BackgroundResource; @@ -25,13 +26,21 @@ import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest; +import com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse; import com.google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata; import com.google.cloud.assuredworkloads.v1.CreateWorkloadRequest; import com.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest; +import com.google.cloud.assuredworkloads.v1.GetViolationRequest; import com.google.cloud.assuredworkloads.v1.GetWorkloadRequest; +import com.google.cloud.assuredworkloads.v1.ListViolationsRequest; +import com.google.cloud.assuredworkloads.v1.ListViolationsResponse; import com.google.cloud.assuredworkloads.v1.ListWorkloadsRequest; import com.google.cloud.assuredworkloads.v1.ListWorkloadsResponse; +import com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest; +import com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse; import com.google.cloud.assuredworkloads.v1.UpdateWorkloadRequest; +import com.google.cloud.assuredworkloads.v1.Violation; import com.google.cloud.assuredworkloads.v1.Workload; import com.google.common.collect.ImmutableMap; import com.google.longrunning.Operation; @@ -73,6 +82,20 @@ public class GrpcAssuredWorkloadsServiceStub extends AssuredWorkloadsServiceStub .setResponseMarshaller(ProtoUtils.marshaller(Workload.getDefaultInstance())) .build(); + private static final MethodDescriptor< + RestrictAllowedResourcesRequest, RestrictAllowedResourcesResponse> + restrictAllowedResourcesMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.assuredworkloads.v1.AssuredWorkloadsService/RestrictAllowedResources") + .setRequestMarshaller( + ProtoUtils.marshaller(RestrictAllowedResourcesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(RestrictAllowedResourcesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor deleteWorkloadMethodDescriptor = MethodDescriptor.newBuilder() @@ -104,15 +127,57 @@ public class GrpcAssuredWorkloadsServiceStub extends AssuredWorkloadsServiceStub ProtoUtils.marshaller(ListWorkloadsResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor + listViolationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.assuredworkloads.v1.AssuredWorkloadsService/ListViolations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListViolationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListViolationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getViolationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.assuredworkloads.v1.AssuredWorkloadsService/GetViolation") + .setRequestMarshaller(ProtoUtils.marshaller(GetViolationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Violation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + acknowledgeViolationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.assuredworkloads.v1.AssuredWorkloadsService/AcknowledgeViolation") + .setRequestMarshaller( + ProtoUtils.marshaller(AcknowledgeViolationRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(AcknowledgeViolationResponse.getDefaultInstance())) + .build(); + private final UnaryCallable createWorkloadCallable; private final OperationCallable createWorkloadOperationCallable; private final UnaryCallable updateWorkloadCallable; + private final UnaryCallable + restrictAllowedResourcesCallable; private final UnaryCallable deleteWorkloadCallable; private final UnaryCallable getWorkloadCallable; private final UnaryCallable listWorkloadsCallable; private final UnaryCallable listWorkloadsPagedCallable; + private final UnaryCallable listViolationsCallable; + private final UnaryCallable + listViolationsPagedCallable; + private final UnaryCallable getViolationCallable; + private final UnaryCallable + acknowledgeViolationCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -179,6 +244,18 @@ protected GrpcAssuredWorkloadsServiceStub( return params.build(); }) .build(); + GrpcCallSettings + restrictAllowedResourcesTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(restrictAllowedResourcesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); GrpcCallSettings deleteWorkloadTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteWorkloadMethodDescriptor) @@ -209,6 +286,20 @@ protected GrpcAssuredWorkloadsServiceStub( return params.build(); }) .build(); + GrpcCallSettings + listViolationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listViolationsMethodDescriptor) + .build(); + GrpcCallSettings getViolationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getViolationMethodDescriptor) + .build(); + GrpcCallSettings + acknowledgeViolationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(acknowledgeViolationMethodDescriptor) + .build(); this.createWorkloadCallable = callableFactory.createUnaryCallable( @@ -222,6 +313,11 @@ protected GrpcAssuredWorkloadsServiceStub( this.updateWorkloadCallable = callableFactory.createUnaryCallable( updateWorkloadTransportSettings, settings.updateWorkloadSettings(), clientContext); + this.restrictAllowedResourcesCallable = + callableFactory.createUnaryCallable( + restrictAllowedResourcesTransportSettings, + settings.restrictAllowedResourcesSettings(), + clientContext); this.deleteWorkloadCallable = callableFactory.createUnaryCallable( deleteWorkloadTransportSettings, settings.deleteWorkloadSettings(), clientContext); @@ -234,6 +330,20 @@ protected GrpcAssuredWorkloadsServiceStub( this.listWorkloadsPagedCallable = callableFactory.createPagedCallable( listWorkloadsTransportSettings, settings.listWorkloadsSettings(), clientContext); + this.listViolationsCallable = + callableFactory.createUnaryCallable( + listViolationsTransportSettings, settings.listViolationsSettings(), clientContext); + this.listViolationsPagedCallable = + callableFactory.createPagedCallable( + listViolationsTransportSettings, settings.listViolationsSettings(), clientContext); + this.getViolationCallable = + callableFactory.createUnaryCallable( + getViolationTransportSettings, settings.getViolationSettings(), clientContext); + this.acknowledgeViolationCallable = + callableFactory.createUnaryCallable( + acknowledgeViolationTransportSettings, + settings.acknowledgeViolationSettings(), + clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -259,6 +369,12 @@ public UnaryCallable updateWorkloadCallable() { return updateWorkloadCallable; } + @Override + public UnaryCallable + restrictAllowedResourcesCallable() { + return restrictAllowedResourcesCallable; + } + @Override public UnaryCallable deleteWorkloadCallable() { return deleteWorkloadCallable; @@ -280,6 +396,28 @@ public UnaryCallable listWorkloadsC return listWorkloadsPagedCallable; } + @Override + public UnaryCallable listViolationsCallable() { + return listViolationsCallable; + } + + @Override + public UnaryCallable + listViolationsPagedCallable() { + return listViolationsPagedCallable; + } + + @Override + public UnaryCallable getViolationCallable() { + return getViolationCallable; + } + + @Override + public UnaryCallable + acknowledgeViolationCallable() { + return acknowledgeViolationCallable; + } + @Override public final void close() { try { diff --git a/java-assured-workloads/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1/stub/HttpJsonAssuredWorkloadsServiceStub.java b/java-assured-workloads/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1/stub/HttpJsonAssuredWorkloadsServiceStub.java index 79035edb7df5..962eee236b58 100644 --- a/java-assured-workloads/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1/stub/HttpJsonAssuredWorkloadsServiceStub.java +++ b/java-assured-workloads/google-cloud-assured-workloads/src/main/java/com/google/cloud/assuredworkloads/v1/stub/HttpJsonAssuredWorkloadsServiceStub.java @@ -39,6 +39,8 @@ import com.google.cloud.assuredworkloads.v1.GetWorkloadRequest; import com.google.cloud.assuredworkloads.v1.ListWorkloadsRequest; import com.google.cloud.assuredworkloads.v1.ListWorkloadsResponse; +import com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest; +import com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse; import com.google.cloud.assuredworkloads.v1.UpdateWorkloadRequest; import com.google.cloud.assuredworkloads.v1.Workload; import com.google.longrunning.Operation; @@ -147,6 +149,45 @@ public class HttpJsonAssuredWorkloadsServiceStub extends AssuredWorkloadsService .build()) .build(); + private static final ApiMethodDescriptor< + RestrictAllowedResourcesRequest, RestrictAllowedResourcesResponse> + restrictAllowedResourcesMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.assuredworkloads.v1.AssuredWorkloadsService/RestrictAllowedResources") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=organizations/*/locations/*/workloads/*}:restrictAllowedResources", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RestrictAllowedResourcesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + private static final ApiMethodDescriptor deleteWorkloadMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -257,6 +298,8 @@ public class HttpJsonAssuredWorkloadsServiceStub extends AssuredWorkloadsService private final OperationCallable createWorkloadOperationCallable; private final UnaryCallable updateWorkloadCallable; + private final UnaryCallable + restrictAllowedResourcesCallable; private final UnaryCallable deleteWorkloadCallable; private final UnaryCallable getWorkloadCallable; private final UnaryCallable listWorkloadsCallable; @@ -321,6 +364,13 @@ protected HttpJsonAssuredWorkloadsServiceStub( .setMethodDescriptor(updateWorkloadMethodDescriptor) .setTypeRegistry(typeRegistry) .build(); + HttpJsonCallSettings + restrictAllowedResourcesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(restrictAllowedResourcesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); HttpJsonCallSettings deleteWorkloadTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteWorkloadMethodDescriptor) @@ -350,6 +400,11 @@ protected HttpJsonAssuredWorkloadsServiceStub( this.updateWorkloadCallable = callableFactory.createUnaryCallable( updateWorkloadTransportSettings, settings.updateWorkloadSettings(), clientContext); + this.restrictAllowedResourcesCallable = + callableFactory.createUnaryCallable( + restrictAllowedResourcesTransportSettings, + settings.restrictAllowedResourcesSettings(), + clientContext); this.deleteWorkloadCallable = callableFactory.createUnaryCallable( deleteWorkloadTransportSettings, settings.deleteWorkloadSettings(), clientContext); @@ -372,6 +427,7 @@ public static List getMethodDescriptors() { List methodDescriptors = new ArrayList<>(); methodDescriptors.add(createWorkloadMethodDescriptor); methodDescriptors.add(updateWorkloadMethodDescriptor); + methodDescriptors.add(restrictAllowedResourcesMethodDescriptor); methodDescriptors.add(deleteWorkloadMethodDescriptor); methodDescriptors.add(getWorkloadMethodDescriptor); methodDescriptors.add(listWorkloadsMethodDescriptor); @@ -398,6 +454,12 @@ public UnaryCallable updateWorkloadCallable() { return updateWorkloadCallable; } + @Override + public UnaryCallable + restrictAllowedResourcesCallable() { + return restrictAllowedResourcesCallable; + } + @Override public UnaryCallable deleteWorkloadCallable() { return deleteWorkloadCallable; diff --git a/java-assured-workloads/google-cloud-assured-workloads/src/test/java/com/google/cloud/assuredworkloads/v1/AssuredWorkloadsServiceClientHttpJsonTest.java b/java-assured-workloads/google-cloud-assured-workloads/src/test/java/com/google/cloud/assuredworkloads/v1/AssuredWorkloadsServiceClientHttpJsonTest.java index bc56604ba296..d4eab5bb5db8 100644 --- a/java-assured-workloads/google-cloud-assured-workloads/src/test/java/com/google/cloud/assuredworkloads/v1/AssuredWorkloadsServiceClientHttpJsonTest.java +++ b/java-assured-workloads/google-cloud-assured-workloads/src/test/java/com/google/cloud/assuredworkloads/v1/AssuredWorkloadsServiceClientHttpJsonTest.java @@ -99,6 +99,7 @@ public void createWorkloadTest() throws Exception { .addAllResourceSettings(new ArrayList()) .setEnableSovereignControls(true) .setSaaEnrollmentResponse(Workload.SaaEnrollmentResponse.newBuilder().build()) + .addAllCompliantButDisallowedServices(new ArrayList()) .build(); Operation resultOperation = Operation.newBuilder() @@ -161,6 +162,7 @@ public void createWorkloadTest2() throws Exception { .addAllResourceSettings(new ArrayList()) .setEnableSovereignControls(true) .setSaaEnrollmentResponse(Workload.SaaEnrollmentResponse.newBuilder().build()) + .addAllCompliantButDisallowedServices(new ArrayList()) .build(); Operation resultOperation = Operation.newBuilder() @@ -223,6 +225,7 @@ public void updateWorkloadTest() throws Exception { .addAllResourceSettings(new ArrayList()) .setEnableSovereignControls(true) .setSaaEnrollmentResponse(Workload.SaaEnrollmentResponse.newBuilder().build()) + .addAllCompliantButDisallowedServices(new ArrayList()) .build(); mockService.addResponse(expectedResponse); @@ -240,6 +243,7 @@ public void updateWorkloadTest() throws Exception { .addAllResourceSettings(new ArrayList()) .setEnableSovereignControls(true) .setSaaEnrollmentResponse(Workload.SaaEnrollmentResponse.newBuilder().build()) + .addAllCompliantButDisallowedServices(new ArrayList()) .build(); FieldMask updateMask = FieldMask.newBuilder().build(); @@ -283,6 +287,7 @@ public void updateWorkloadExceptionTest() throws Exception { .addAllResourceSettings(new ArrayList()) .setEnableSovereignControls(true) .setSaaEnrollmentResponse(Workload.SaaEnrollmentResponse.newBuilder().build()) + .addAllCompliantButDisallowedServices(new ArrayList()) .build(); FieldMask updateMask = FieldMask.newBuilder().build(); client.updateWorkload(workload, updateMask); @@ -292,6 +297,56 @@ public void updateWorkloadExceptionTest() throws Exception { } } + @Test + public void restrictAllowedResourcesTest() throws Exception { + RestrictAllowedResourcesResponse expectedResponse = + RestrictAllowedResourcesResponse.newBuilder().build(); + mockService.addResponse(expectedResponse); + + RestrictAllowedResourcesRequest request = + RestrictAllowedResourcesRequest.newBuilder() + .setName( + "organizations/organization-4962/locations/location-4962/workloads/workload-4962") + .build(); + + RestrictAllowedResourcesResponse actualResponse = client.restrictAllowedResources(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void restrictAllowedResourcesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RestrictAllowedResourcesRequest request = + RestrictAllowedResourcesRequest.newBuilder() + .setName( + "organizations/organization-4962/locations/location-4962/workloads/workload-4962") + .build(); + client.restrictAllowedResources(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test public void deleteWorkloadTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); @@ -389,6 +444,7 @@ public void getWorkloadTest() throws Exception { .addAllResourceSettings(new ArrayList()) .setEnableSovereignControls(true) .setSaaEnrollmentResponse(Workload.SaaEnrollmentResponse.newBuilder().build()) + .addAllCompliantButDisallowedServices(new ArrayList()) .build(); mockService.addResponse(expectedResponse); @@ -444,6 +500,7 @@ public void getWorkloadTest2() throws Exception { .addAllResourceSettings(new ArrayList()) .setEnableSovereignControls(true) .setSaaEnrollmentResponse(Workload.SaaEnrollmentResponse.newBuilder().build()) + .addAllCompliantButDisallowedServices(new ArrayList()) .build(); mockService.addResponse(expectedResponse); @@ -583,4 +640,22 @@ public void listWorkloadsExceptionTest2() throws Exception { // Expected exception. } } + + @Test + public void listViolationsUnsupportedMethodTest() throws Exception { + // The listViolations() method is not supported in REST transport. + // This empty test is generated for technical reasons. + } + + @Test + public void getViolationUnsupportedMethodTest() throws Exception { + // The getViolation() method is not supported in REST transport. + // This empty test is generated for technical reasons. + } + + @Test + public void acknowledgeViolationUnsupportedMethodTest() throws Exception { + // The acknowledgeViolation() method is not supported in REST transport. + // This empty test is generated for technical reasons. + } } diff --git a/java-assured-workloads/google-cloud-assured-workloads/src/test/java/com/google/cloud/assuredworkloads/v1/AssuredWorkloadsServiceClientTest.java b/java-assured-workloads/google-cloud-assured-workloads/src/test/java/com/google/cloud/assuredworkloads/v1/AssuredWorkloadsServiceClientTest.java index b7de9df3f328..d1bd0228aeb6 100644 --- a/java-assured-workloads/google-cloud-assured-workloads/src/test/java/com/google/cloud/assuredworkloads/v1/AssuredWorkloadsServiceClientTest.java +++ b/java-assured-workloads/google-cloud-assured-workloads/src/test/java/com/google/cloud/assuredworkloads/v1/AssuredWorkloadsServiceClientTest.java @@ -16,6 +16,7 @@ package com.google.cloud.assuredworkloads.v1; +import static com.google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient.ListViolationsPagedResponse; import static com.google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient.ListWorkloadsPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; @@ -104,6 +105,7 @@ public void createWorkloadTest() throws Exception { .addAllResourceSettings(new ArrayList()) .setEnableSovereignControls(true) .setSaaEnrollmentResponse(Workload.SaaEnrollmentResponse.newBuilder().build()) + .addAllCompliantButDisallowedServices(new ArrayList()) .build(); Operation resultOperation = Operation.newBuilder() @@ -164,6 +166,7 @@ public void createWorkloadTest2() throws Exception { .addAllResourceSettings(new ArrayList()) .setEnableSovereignControls(true) .setSaaEnrollmentResponse(Workload.SaaEnrollmentResponse.newBuilder().build()) + .addAllCompliantButDisallowedServices(new ArrayList()) .build(); Operation resultOperation = Operation.newBuilder() @@ -224,6 +227,7 @@ public void updateWorkloadTest() throws Exception { .addAllResourceSettings(new ArrayList()) .setEnableSovereignControls(true) .setSaaEnrollmentResponse(Workload.SaaEnrollmentResponse.newBuilder().build()) + .addAllCompliantButDisallowedServices(new ArrayList()) .build(); mockAssuredWorkloadsService.addResponse(expectedResponse); @@ -260,6 +264,46 @@ public void updateWorkloadExceptionTest() throws Exception { } } + @Test + public void restrictAllowedResourcesTest() throws Exception { + RestrictAllowedResourcesResponse expectedResponse = + RestrictAllowedResourcesResponse.newBuilder().build(); + mockAssuredWorkloadsService.addResponse(expectedResponse); + + RestrictAllowedResourcesRequest request = + RestrictAllowedResourcesRequest.newBuilder().setName("name3373707").build(); + + RestrictAllowedResourcesResponse actualResponse = client.restrictAllowedResources(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAssuredWorkloadsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RestrictAllowedResourcesRequest actualRequest = + ((RestrictAllowedResourcesRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getRestrictionType(), actualRequest.getRestrictionType()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void restrictAllowedResourcesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAssuredWorkloadsService.addException(exception); + + try { + RestrictAllowedResourcesRequest request = + RestrictAllowedResourcesRequest.newBuilder().setName("name3373707").build(); + client.restrictAllowedResources(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test public void deleteWorkloadTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); @@ -344,6 +388,7 @@ public void getWorkloadTest() throws Exception { .addAllResourceSettings(new ArrayList()) .setEnableSovereignControls(true) .setSaaEnrollmentResponse(Workload.SaaEnrollmentResponse.newBuilder().build()) + .addAllCompliantButDisallowedServices(new ArrayList()) .build(); mockAssuredWorkloadsService.addResponse(expectedResponse); @@ -393,6 +438,7 @@ public void getWorkloadTest2() throws Exception { .addAllResourceSettings(new ArrayList()) .setEnableSovereignControls(true) .setSaaEnrollmentResponse(Workload.SaaEnrollmentResponse.newBuilder().build()) + .addAllCompliantButDisallowedServices(new ArrayList()) .build(); mockAssuredWorkloadsService.addResponse(expectedResponse); @@ -513,4 +559,246 @@ public void listWorkloadsExceptionTest2() throws Exception { // Expected exception. } } + + @Test + public void listViolationsTest() throws Exception { + Violation responsesElement = Violation.newBuilder().build(); + ListViolationsResponse expectedResponse = + ListViolationsResponse.newBuilder() + .setNextPageToken("") + .addAllViolations(Arrays.asList(responsesElement)) + .build(); + mockAssuredWorkloadsService.addResponse(expectedResponse); + + WorkloadName parent = WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"); + + ListViolationsPagedResponse pagedListResponse = client.listViolations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getViolationsList().get(0), resources.get(0)); + + List actualRequests = mockAssuredWorkloadsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListViolationsRequest actualRequest = ((ListViolationsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listViolationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAssuredWorkloadsService.addException(exception); + + try { + WorkloadName parent = WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"); + client.listViolations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listViolationsTest2() throws Exception { + Violation responsesElement = Violation.newBuilder().build(); + ListViolationsResponse expectedResponse = + ListViolationsResponse.newBuilder() + .setNextPageToken("") + .addAllViolations(Arrays.asList(responsesElement)) + .build(); + mockAssuredWorkloadsService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListViolationsPagedResponse pagedListResponse = client.listViolations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getViolationsList().get(0), resources.get(0)); + + List actualRequests = mockAssuredWorkloadsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListViolationsRequest actualRequest = ((ListViolationsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listViolationsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAssuredWorkloadsService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listViolations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getViolationTest() throws Exception { + Violation expectedResponse = + Violation.newBuilder() + .setName( + ViolationName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]", "[VIOLATION]") + .toString()) + .setDescription("description-1724546052") + .setBeginTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setResolveTime(Timestamp.newBuilder().build()) + .setCategory("category50511102") + .setOrgPolicyConstraint("orgPolicyConstraint-2139427917") + .setAuditLogLink("auditLogLink-1120762621") + .setNonCompliantOrgPolicy("nonCompliantOrgPolicy-1928466552") + .setRemediation(Violation.Remediation.newBuilder().build()) + .setAcknowledged(true) + .setAcknowledgementTime(Timestamp.newBuilder().build()) + .build(); + mockAssuredWorkloadsService.addResponse(expectedResponse); + + ViolationName name = + ViolationName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]", "[VIOLATION]"); + + Violation actualResponse = client.getViolation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAssuredWorkloadsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetViolationRequest actualRequest = ((GetViolationRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getViolationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAssuredWorkloadsService.addException(exception); + + try { + ViolationName name = + ViolationName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]", "[VIOLATION]"); + client.getViolation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getViolationTest2() throws Exception { + Violation expectedResponse = + Violation.newBuilder() + .setName( + ViolationName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]", "[VIOLATION]") + .toString()) + .setDescription("description-1724546052") + .setBeginTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setResolveTime(Timestamp.newBuilder().build()) + .setCategory("category50511102") + .setOrgPolicyConstraint("orgPolicyConstraint-2139427917") + .setAuditLogLink("auditLogLink-1120762621") + .setNonCompliantOrgPolicy("nonCompliantOrgPolicy-1928466552") + .setRemediation(Violation.Remediation.newBuilder().build()) + .setAcknowledged(true) + .setAcknowledgementTime(Timestamp.newBuilder().build()) + .build(); + mockAssuredWorkloadsService.addResponse(expectedResponse); + + String name = "name3373707"; + + Violation actualResponse = client.getViolation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAssuredWorkloadsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetViolationRequest actualRequest = ((GetViolationRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getViolationExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAssuredWorkloadsService.addException(exception); + + try { + String name = "name3373707"; + client.getViolation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void acknowledgeViolationTest() throws Exception { + AcknowledgeViolationResponse expectedResponse = + AcknowledgeViolationResponse.newBuilder().build(); + mockAssuredWorkloadsService.addResponse(expectedResponse); + + AcknowledgeViolationRequest request = + AcknowledgeViolationRequest.newBuilder() + .setName("name3373707") + .setComment("comment950398559") + .setNonCompliantOrgPolicy("nonCompliantOrgPolicy-1928466552") + .build(); + + AcknowledgeViolationResponse actualResponse = client.acknowledgeViolation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAssuredWorkloadsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AcknowledgeViolationRequest actualRequest = + ((AcknowledgeViolationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getComment(), actualRequest.getComment()); + Assert.assertEquals( + request.getNonCompliantOrgPolicy(), actualRequest.getNonCompliantOrgPolicy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void acknowledgeViolationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAssuredWorkloadsService.addException(exception); + + try { + AcknowledgeViolationRequest request = + AcknowledgeViolationRequest.newBuilder() + .setName("name3373707") + .setComment("comment950398559") + .setNonCompliantOrgPolicy("nonCompliantOrgPolicy-1928466552") + .build(); + client.acknowledgeViolation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/java-assured-workloads/google-cloud-assured-workloads/src/test/java/com/google/cloud/assuredworkloads/v1/MockAssuredWorkloadsServiceImpl.java b/java-assured-workloads/google-cloud-assured-workloads/src/test/java/com/google/cloud/assuredworkloads/v1/MockAssuredWorkloadsServiceImpl.java index ab2cec1c1889..1b34807a7db1 100644 --- a/java-assured-workloads/google-cloud-assured-workloads/src/test/java/com/google/cloud/assuredworkloads/v1/MockAssuredWorkloadsServiceImpl.java +++ b/java-assured-workloads/google-cloud-assured-workloads/src/test/java/com/google/cloud/assuredworkloads/v1/MockAssuredWorkloadsServiceImpl.java @@ -102,6 +102,28 @@ public void updateWorkload( } } + @Override + public void restrictAllowedResources( + RestrictAllowedResourcesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RestrictAllowedResourcesResponse) { + requests.add(request); + responseObserver.onNext(((RestrictAllowedResourcesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RestrictAllowedResources, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RestrictAllowedResourcesResponse.class.getName(), + Exception.class.getName()))); + } + } + @Override public void deleteWorkload( DeleteWorkloadRequest request, StreamObserver responseObserver) { @@ -163,4 +185,68 @@ public void listWorkloads( Exception.class.getName()))); } } + + @Override + public void listViolations( + ListViolationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListViolationsResponse) { + requests.add(request); + responseObserver.onNext(((ListViolationsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListViolations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListViolationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getViolation( + GetViolationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Violation) { + requests.add(request); + responseObserver.onNext(((Violation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetViolation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Violation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void acknowledgeViolation( + AcknowledgeViolationRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AcknowledgeViolationResponse) { + requests.add(request); + responseObserver.onNext(((AcknowledgeViolationResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method AcknowledgeViolation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + AcknowledgeViolationResponse.class.getName(), + Exception.class.getName()))); + } + } } diff --git a/java-assured-workloads/grpc-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/AssuredWorkloadsServiceGrpc.java b/java-assured-workloads/grpc-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/AssuredWorkloadsServiceGrpc.java index 5b8312b07258..1a491aede14d 100644 --- a/java-assured-workloads/grpc-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/AssuredWorkloadsServiceGrpc.java +++ b/java-assured-workloads/grpc-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/AssuredWorkloadsServiceGrpc.java @@ -130,6 +130,59 @@ private AssuredWorkloadsServiceGrpc() {} return getUpdateWorkloadMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest, + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse> + getRestrictAllowedResourcesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RestrictAllowedResources", + requestType = com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.class, + responseType = com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest, + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse> + getRestrictAllowedResourcesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest, + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse> + getRestrictAllowedResourcesMethod; + if ((getRestrictAllowedResourcesMethod = + AssuredWorkloadsServiceGrpc.getRestrictAllowedResourcesMethod) + == null) { + synchronized (AssuredWorkloadsServiceGrpc.class) { + if ((getRestrictAllowedResourcesMethod = + AssuredWorkloadsServiceGrpc.getRestrictAllowedResourcesMethod) + == null) { + AssuredWorkloadsServiceGrpc.getRestrictAllowedResourcesMethod = + getRestrictAllowedResourcesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RestrictAllowedResources")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new AssuredWorkloadsServiceMethodDescriptorSupplier( + "RestrictAllowedResources")) + .build(); + } + } + } + return getRestrictAllowedResourcesMethod; + } + private static volatile io.grpc.MethodDescriptor< com.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest, com.google.protobuf.Empty> getDeleteWorkloadMethod; @@ -267,6 +320,152 @@ private AssuredWorkloadsServiceGrpc() {} return getListWorkloadsMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.assuredworkloads.v1.ListViolationsRequest, + com.google.cloud.assuredworkloads.v1.ListViolationsResponse> + getListViolationsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListViolations", + requestType = com.google.cloud.assuredworkloads.v1.ListViolationsRequest.class, + responseType = com.google.cloud.assuredworkloads.v1.ListViolationsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.assuredworkloads.v1.ListViolationsRequest, + com.google.cloud.assuredworkloads.v1.ListViolationsResponse> + getListViolationsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.assuredworkloads.v1.ListViolationsRequest, + com.google.cloud.assuredworkloads.v1.ListViolationsResponse> + getListViolationsMethod; + if ((getListViolationsMethod = AssuredWorkloadsServiceGrpc.getListViolationsMethod) == null) { + synchronized (AssuredWorkloadsServiceGrpc.class) { + if ((getListViolationsMethod = AssuredWorkloadsServiceGrpc.getListViolationsMethod) + == null) { + AssuredWorkloadsServiceGrpc.getListViolationsMethod = + getListViolationsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListViolations")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.assuredworkloads.v1.ListViolationsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.assuredworkloads.v1.ListViolationsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new AssuredWorkloadsServiceMethodDescriptorSupplier("ListViolations")) + .build(); + } + } + } + return getListViolationsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.assuredworkloads.v1.GetViolationRequest, + com.google.cloud.assuredworkloads.v1.Violation> + getGetViolationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetViolation", + requestType = com.google.cloud.assuredworkloads.v1.GetViolationRequest.class, + responseType = com.google.cloud.assuredworkloads.v1.Violation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.assuredworkloads.v1.GetViolationRequest, + com.google.cloud.assuredworkloads.v1.Violation> + getGetViolationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.assuredworkloads.v1.GetViolationRequest, + com.google.cloud.assuredworkloads.v1.Violation> + getGetViolationMethod; + if ((getGetViolationMethod = AssuredWorkloadsServiceGrpc.getGetViolationMethod) == null) { + synchronized (AssuredWorkloadsServiceGrpc.class) { + if ((getGetViolationMethod = AssuredWorkloadsServiceGrpc.getGetViolationMethod) == null) { + AssuredWorkloadsServiceGrpc.getGetViolationMethod = + getGetViolationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetViolation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.assuredworkloads.v1.GetViolationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.assuredworkloads.v1.Violation.getDefaultInstance())) + .setSchemaDescriptor( + new AssuredWorkloadsServiceMethodDescriptorSupplier("GetViolation")) + .build(); + } + } + } + return getGetViolationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest, + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse> + getAcknowledgeViolationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AcknowledgeViolation", + requestType = com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest.class, + responseType = com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest, + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse> + getAcknowledgeViolationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest, + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse> + getAcknowledgeViolationMethod; + if ((getAcknowledgeViolationMethod = AssuredWorkloadsServiceGrpc.getAcknowledgeViolationMethod) + == null) { + synchronized (AssuredWorkloadsServiceGrpc.class) { + if ((getAcknowledgeViolationMethod = + AssuredWorkloadsServiceGrpc.getAcknowledgeViolationMethod) + == null) { + AssuredWorkloadsServiceGrpc.getAcknowledgeViolationMethod = + getAcknowledgeViolationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "AcknowledgeViolation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new AssuredWorkloadsServiceMethodDescriptorSupplier( + "AcknowledgeViolation")) + .build(); + } + } + } + return getAcknowledgeViolationMethod; + } + /** Creates a new async stub that supports all call types for the service */ public static AssuredWorkloadsServiceStub newStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory factory = @@ -349,6 +548,27 @@ public void updateWorkload( getUpdateWorkloadMethod(), responseObserver); } + /** + * + * + *
+     * Restrict the list of resources allowed in the Workload environment.
+     * The current list of allowed products can be found at
+     * https://cloud.google.com/assured-workloads/docs/supported-products
+     * In addition to assuredworkloads.workload.update permission, the user should
+     * also have orgpolicy.policy.set permission on the folder resource
+     * to use this functionality.
+     * 
+ */ + public void restrictAllowedResources( + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRestrictAllowedResourcesMethod(), responseObserver); + } + /** * * @@ -395,6 +615,59 @@ public void listWorkloads( getListWorkloadsMethod(), responseObserver); } + /** + * + * + *
+     * Lists the Violations in the AssuredWorkload Environment.
+     * Callers may also choose to read across multiple Workloads as per
+     * [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash
+     * character) as a wildcard character instead of workload-id in the parent.
+     * Format `organizations/{org_id}/locations/{location}/workloads/-`
+     * 
+ */ + public void listViolations( + com.google.cloud.assuredworkloads.v1.ListViolationsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListViolationsMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves Assured Workload Violation based on ID.
+     * 
+ */ + public void getViolation( + com.google.cloud.assuredworkloads.v1.GetViolationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetViolationMethod(), responseObserver); + } + + /** + * + * + *
+     * Acknowledges an existing violation. By acknowledging a violation, users
+     * acknowledge the existence of a compliance violation in their workload and
+     * decide to ignore it due to a valid business justification. Acknowledgement
+     * is a permanent operation and it cannot be reverted.
+     * 
+ */ + public void acknowledgeViolation( + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAcknowledgeViolationMethod(), responseObserver); + } + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) @@ -411,6 +684,13 @@ public final io.grpc.ServerServiceDefinition bindService() { com.google.cloud.assuredworkloads.v1.UpdateWorkloadRequest, com.google.cloud.assuredworkloads.v1.Workload>( this, METHODID_UPDATE_WORKLOAD))) + .addMethod( + getRestrictAllowedResourcesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest, + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse>( + this, METHODID_RESTRICT_ALLOWED_RESOURCES))) .addMethod( getDeleteWorkloadMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -430,6 +710,27 @@ public final io.grpc.ServerServiceDefinition bindService() { com.google.cloud.assuredworkloads.v1.ListWorkloadsRequest, com.google.cloud.assuredworkloads.v1.ListWorkloadsResponse>( this, METHODID_LIST_WORKLOADS))) + .addMethod( + getListViolationsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.assuredworkloads.v1.ListViolationsRequest, + com.google.cloud.assuredworkloads.v1.ListViolationsResponse>( + this, METHODID_LIST_VIOLATIONS))) + .addMethod( + getGetViolationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.assuredworkloads.v1.GetViolationRequest, + com.google.cloud.assuredworkloads.v1.Violation>( + this, METHODID_GET_VIOLATION))) + .addMethod( + getAcknowledgeViolationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest, + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse>( + this, METHODID_ACKNOWLEDGE_VIOLATION))) .build(); } } @@ -489,6 +790,29 @@ public void updateWorkload( responseObserver); } + /** + * + * + *
+     * Restrict the list of resources allowed in the Workload environment.
+     * The current list of allowed products can be found at
+     * https://cloud.google.com/assured-workloads/docs/supported-products
+     * In addition to assuredworkloads.workload.update permission, the user should
+     * also have orgpolicy.policy.set permission on the folder resource
+     * to use this functionality.
+     * 
+ */ + public void restrictAllowedResources( + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRestrictAllowedResourcesMethod(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -540,6 +864,65 @@ public void listWorkloads( request, responseObserver); } + + /** + * + * + *
+     * Lists the Violations in the AssuredWorkload Environment.
+     * Callers may also choose to read across multiple Workloads as per
+     * [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash
+     * character) as a wildcard character instead of workload-id in the parent.
+     * Format `organizations/{org_id}/locations/{location}/workloads/-`
+     * 
+ */ + public void listViolations( + com.google.cloud.assuredworkloads.v1.ListViolationsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListViolationsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves Assured Workload Violation based on ID.
+     * 
+ */ + public void getViolation( + com.google.cloud.assuredworkloads.v1.GetViolationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetViolationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Acknowledges an existing violation. By acknowledging a violation, users
+     * acknowledge the existence of a compliance violation in their workload and
+     * decide to ignore it due to a valid business justification. Acknowledgement
+     * is a permanent operation and it cannot be reverted.
+     * 
+ */ + public void acknowledgeViolation( + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getAcknowledgeViolationMethod(), getCallOptions()), + request, + responseObserver); + } } /** @@ -591,6 +974,25 @@ public com.google.cloud.assuredworkloads.v1.Workload updateWorkload( getChannel(), getUpdateWorkloadMethod(), getCallOptions(), request); } + /** + * + * + *
+     * Restrict the list of resources allowed in the Workload environment.
+     * The current list of allowed products can be found at
+     * https://cloud.google.com/assured-workloads/docs/supported-products
+     * In addition to assuredworkloads.workload.update permission, the user should
+     * also have orgpolicy.policy.set permission on the folder resource
+     * to use this functionality.
+     * 
+ */ + public com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse + restrictAllowedResources( + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRestrictAllowedResourcesMethod(), getCallOptions(), request); + } + /** * * @@ -631,6 +1033,52 @@ public com.google.cloud.assuredworkloads.v1.ListWorkloadsResponse listWorkloads( return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getListWorkloadsMethod(), getCallOptions(), request); } + + /** + * + * + *
+     * Lists the Violations in the AssuredWorkload Environment.
+     * Callers may also choose to read across multiple Workloads as per
+     * [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash
+     * character) as a wildcard character instead of workload-id in the parent.
+     * Format `organizations/{org_id}/locations/{location}/workloads/-`
+     * 
+ */ + public com.google.cloud.assuredworkloads.v1.ListViolationsResponse listViolations( + com.google.cloud.assuredworkloads.v1.ListViolationsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListViolationsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves Assured Workload Violation based on ID.
+     * 
+ */ + public com.google.cloud.assuredworkloads.v1.Violation getViolation( + com.google.cloud.assuredworkloads.v1.GetViolationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetViolationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Acknowledges an existing violation. By acknowledging a violation, users
+     * acknowledge the existence of a compliance violation in their workload and
+     * decide to ignore it due to a valid business justification. Acknowledgement
+     * is a permanent operation and it cannot be reverted.
+     * 
+ */ + public com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse acknowledgeViolation( + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAcknowledgeViolationMethod(), getCallOptions(), request); + } } /** @@ -683,6 +1131,26 @@ protected AssuredWorkloadsServiceFutureStub build( getChannel().newCall(getUpdateWorkloadMethod(), getCallOptions()), request); } + /** + * + * + *
+     * Restrict the list of resources allowed in the Workload environment.
+     * The current list of allowed products can be found at
+     * https://cloud.google.com/assured-workloads/docs/supported-products
+     * In addition to assuredworkloads.workload.update permission, the user should
+     * also have orgpolicy.policy.set permission on the folder resource
+     * to use this functionality.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse> + restrictAllowedResources( + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRestrictAllowedResourcesMethod(), getCallOptions()), request); + } + /** * * @@ -725,13 +1193,67 @@ protected AssuredWorkloadsServiceFutureStub build( return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getListWorkloadsMethod(), getCallOptions()), request); } + + /** + * + * + *
+     * Lists the Violations in the AssuredWorkload Environment.
+     * Callers may also choose to read across multiple Workloads as per
+     * [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash
+     * character) as a wildcard character instead of workload-id in the parent.
+     * Format `organizations/{org_id}/locations/{location}/workloads/-`
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.assuredworkloads.v1.ListViolationsResponse> + listViolations(com.google.cloud.assuredworkloads.v1.ListViolationsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListViolationsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves Assured Workload Violation based on ID.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.assuredworkloads.v1.Violation> + getViolation(com.google.cloud.assuredworkloads.v1.GetViolationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetViolationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Acknowledges an existing violation. By acknowledging a violation, users
+     * acknowledge the existence of a compliance violation in their workload and
+     * decide to ignore it due to a valid business justification. Acknowledgement
+     * is a permanent operation and it cannot be reverted.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse> + acknowledgeViolation( + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getAcknowledgeViolationMethod(), getCallOptions()), request); + } } private static final int METHODID_CREATE_WORKLOAD = 0; private static final int METHODID_UPDATE_WORKLOAD = 1; - private static final int METHODID_DELETE_WORKLOAD = 2; - private static final int METHODID_GET_WORKLOAD = 3; - private static final int METHODID_LIST_WORKLOADS = 4; + private static final int METHODID_RESTRICT_ALLOWED_RESOURCES = 2; + private static final int METHODID_DELETE_WORKLOAD = 3; + private static final int METHODID_GET_WORKLOAD = 4; + private static final int METHODID_LIST_WORKLOADS = 5; + private static final int METHODID_LIST_VIOLATIONS = 6; + private static final int METHODID_GET_VIOLATION = 7; + private static final int METHODID_ACKNOWLEDGE_VIOLATION = 8; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -761,6 +1283,13 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_RESTRICT_ALLOWED_RESOURCES: + serviceImpl.restrictAllowedResources( + (com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse>) + responseObserver); + break; case METHODID_DELETE_WORKLOAD: serviceImpl.deleteWorkload( (com.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest) request, @@ -779,6 +1308,26 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv com.google.cloud.assuredworkloads.v1.ListWorkloadsResponse>) responseObserver); break; + case METHODID_LIST_VIOLATIONS: + serviceImpl.listViolations( + (com.google.cloud.assuredworkloads.v1.ListViolationsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.assuredworkloads.v1.ListViolationsResponse>) + responseObserver); + break; + case METHODID_GET_VIOLATION: + serviceImpl.getViolation( + (com.google.cloud.assuredworkloads.v1.GetViolationRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_ACKNOWLEDGE_VIOLATION: + serviceImpl.acknowledgeViolation( + (com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse>) + responseObserver); + break; default: throw new AssertionError(); } @@ -845,9 +1394,13 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .setSchemaDescriptor(new AssuredWorkloadsServiceFileDescriptorSupplier()) .addMethod(getCreateWorkloadMethod()) .addMethod(getUpdateWorkloadMethod()) + .addMethod(getRestrictAllowedResourcesMethod()) .addMethod(getDeleteWorkloadMethod()) .addMethod(getGetWorkloadMethod()) .addMethod(getListWorkloadsMethod()) + .addMethod(getListViolationsMethod()) + .addMethod(getGetViolationMethod()) + .addMethod(getAcknowledgeViolationMethod()) .build(); } } diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/AcknowledgeViolationRequest.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/AcknowledgeViolationRequest.java new file mode 100644 index 000000000000..3312aaa0d542 --- /dev/null +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/AcknowledgeViolationRequest.java @@ -0,0 +1,1029 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/assuredworkloads/v1/assuredworkloads.proto + +package com.google.cloud.assuredworkloads.v1; + +/** + * + * + *
+ * Request for acknowledging the violation
+ * Next Id: 4
+ * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest} + */ +public final class AcknowledgeViolationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest) + AcknowledgeViolationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use AcknowledgeViolationRequest.newBuilder() to construct. + private AcknowledgeViolationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AcknowledgeViolationRequest() { + name_ = ""; + comment_ = ""; + nonCompliantOrgPolicy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AcknowledgeViolationRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_AcknowledgeViolationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_AcknowledgeViolationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest.class, + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the Violation to acknowledge.
+   * Format:
+   * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the Violation to acknowledge.
+   * Format:
+   * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COMMENT_FIELD_NUMBER = 2; + private volatile java.lang.Object comment_; + /** + * + * + *
+   * Required. Business justification explaining the need for violation acknowledgement
+   * 
+ * + * string comment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The comment. + */ + @java.lang.Override + public java.lang.String getComment() { + java.lang.Object ref = comment_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + comment_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Business justification explaining the need for violation acknowledgement
+   * 
+ * + * string comment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for comment. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCommentBytes() { + java.lang.Object ref = comment_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + comment_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NON_COMPLIANT_ORG_POLICY_FIELD_NUMBER = 3; + private volatile java.lang.Object nonCompliantOrgPolicy_; + /** + * + * + *
+   * Optional. Name of the OrgPolicy which was modified with non-compliant change and
+   * resulted in this violation.
+   * Format:
+   * projects/{project_number}/policies/{constraint_name}
+   * folders/{folder_id}/policies/{constraint_name}
+   * organizations/{organization_id}/policies/{constraint_name}
+   * 
+ * + * string non_compliant_org_policy = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The nonCompliantOrgPolicy. + */ + @java.lang.Override + public java.lang.String getNonCompliantOrgPolicy() { + java.lang.Object ref = nonCompliantOrgPolicy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nonCompliantOrgPolicy_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Name of the OrgPolicy which was modified with non-compliant change and
+   * resulted in this violation.
+   * Format:
+   * projects/{project_number}/policies/{constraint_name}
+   * folders/{folder_id}/policies/{constraint_name}
+   * organizations/{organization_id}/policies/{constraint_name}
+   * 
+ * + * string non_compliant_org_policy = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for nonCompliantOrgPolicy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNonCompliantOrgPolicyBytes() { + java.lang.Object ref = nonCompliantOrgPolicy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nonCompliantOrgPolicy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(comment_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, comment_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nonCompliantOrgPolicy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, nonCompliantOrgPolicy_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(comment_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, comment_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nonCompliantOrgPolicy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, nonCompliantOrgPolicy_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest)) { + return super.equals(obj); + } + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest other = + (com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getComment().equals(other.getComment())) return false; + if (!getNonCompliantOrgPolicy().equals(other.getNonCompliantOrgPolicy())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + COMMENT_FIELD_NUMBER; + hash = (53 * hash) + getComment().hashCode(); + hash = (37 * hash) + NON_COMPLIANT_ORG_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getNonCompliantOrgPolicy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for acknowledging the violation
+   * Next Id: 4
+   * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest) + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_AcknowledgeViolationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_AcknowledgeViolationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest.class, + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest.Builder.class); + } + + // Construct using com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + comment_ = ""; + + nonCompliantOrgPolicy_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_AcknowledgeViolationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest + getDefaultInstanceForType() { + return com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest build() { + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest buildPartial() { + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest result = + new com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest(this); + result.name_ = name_; + result.comment_ = comment_; + result.nonCompliantOrgPolicy_ = nonCompliantOrgPolicy_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest) { + return mergeFrom((com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest other) { + if (other + == com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getComment().isEmpty()) { + comment_ = other.comment_; + onChanged(); + } + if (!other.getNonCompliantOrgPolicy().isEmpty()) { + nonCompliantOrgPolicy_ = other.nonCompliantOrgPolicy_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + comment_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + nonCompliantOrgPolicy_ = input.readStringRequireUtf8(); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the Violation to acknowledge.
+     * Format:
+     * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Violation to acknowledge.
+     * Format:
+     * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Violation to acknowledge.
+     * Format:
+     * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Violation to acknowledge.
+     * Format:
+     * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Violation to acknowledge.
+     * Format:
+     * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object comment_ = ""; + /** + * + * + *
+     * Required. Business justification explaining the need for violation acknowledgement
+     * 
+ * + * string comment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The comment. + */ + public java.lang.String getComment() { + java.lang.Object ref = comment_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + comment_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Business justification explaining the need for violation acknowledgement
+     * 
+ * + * string comment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for comment. + */ + public com.google.protobuf.ByteString getCommentBytes() { + java.lang.Object ref = comment_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + comment_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Business justification explaining the need for violation acknowledgement
+     * 
+ * + * string comment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The comment to set. + * @return This builder for chaining. + */ + public Builder setComment(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + comment_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Business justification explaining the need for violation acknowledgement
+     * 
+ * + * string comment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearComment() { + + comment_ = getDefaultInstance().getComment(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Business justification explaining the need for violation acknowledgement
+     * 
+ * + * string comment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for comment to set. + * @return This builder for chaining. + */ + public Builder setCommentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + comment_ = value; + onChanged(); + return this; + } + + private java.lang.Object nonCompliantOrgPolicy_ = ""; + /** + * + * + *
+     * Optional. Name of the OrgPolicy which was modified with non-compliant change and
+     * resulted in this violation.
+     * Format:
+     * projects/{project_number}/policies/{constraint_name}
+     * folders/{folder_id}/policies/{constraint_name}
+     * organizations/{organization_id}/policies/{constraint_name}
+     * 
+ * + * string non_compliant_org_policy = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The nonCompliantOrgPolicy. + */ + public java.lang.String getNonCompliantOrgPolicy() { + java.lang.Object ref = nonCompliantOrgPolicy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nonCompliantOrgPolicy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Name of the OrgPolicy which was modified with non-compliant change and
+     * resulted in this violation.
+     * Format:
+     * projects/{project_number}/policies/{constraint_name}
+     * folders/{folder_id}/policies/{constraint_name}
+     * organizations/{organization_id}/policies/{constraint_name}
+     * 
+ * + * string non_compliant_org_policy = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for nonCompliantOrgPolicy. + */ + public com.google.protobuf.ByteString getNonCompliantOrgPolicyBytes() { + java.lang.Object ref = nonCompliantOrgPolicy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nonCompliantOrgPolicy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Name of the OrgPolicy which was modified with non-compliant change and
+     * resulted in this violation.
+     * Format:
+     * projects/{project_number}/policies/{constraint_name}
+     * folders/{folder_id}/policies/{constraint_name}
+     * organizations/{organization_id}/policies/{constraint_name}
+     * 
+ * + * string non_compliant_org_policy = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The nonCompliantOrgPolicy to set. + * @return This builder for chaining. + */ + public Builder setNonCompliantOrgPolicy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nonCompliantOrgPolicy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Name of the OrgPolicy which was modified with non-compliant change and
+     * resulted in this violation.
+     * Format:
+     * projects/{project_number}/policies/{constraint_name}
+     * folders/{folder_id}/policies/{constraint_name}
+     * organizations/{organization_id}/policies/{constraint_name}
+     * 
+ * + * string non_compliant_org_policy = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearNonCompliantOrgPolicy() { + + nonCompliantOrgPolicy_ = getDefaultInstance().getNonCompliantOrgPolicy(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Name of the OrgPolicy which was modified with non-compliant change and
+     * resulted in this violation.
+     * Format:
+     * projects/{project_number}/policies/{constraint_name}
+     * folders/{folder_id}/policies/{constraint_name}
+     * organizations/{organization_id}/policies/{constraint_name}
+     * 
+ * + * string non_compliant_org_policy = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for nonCompliantOrgPolicy to set. + * @return This builder for chaining. + */ + public Builder setNonCompliantOrgPolicyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nonCompliantOrgPolicy_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest) + private static final com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest(); + } + + public static com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AcknowledgeViolationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/AcknowledgeViolationRequestOrBuilder.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/AcknowledgeViolationRequestOrBuilder.java new file mode 100644 index 000000000000..f0e88fa08268 --- /dev/null +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/AcknowledgeViolationRequestOrBuilder.java @@ -0,0 +1,114 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/assuredworkloads/v1/assuredworkloads.proto + +package com.google.cloud.assuredworkloads.v1; + +public interface AcknowledgeViolationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the Violation to acknowledge.
+   * Format:
+   * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the Violation to acknowledge.
+   * Format:
+   * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. Business justification explaining the need for violation acknowledgement
+   * 
+ * + * string comment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The comment. + */ + java.lang.String getComment(); + /** + * + * + *
+   * Required. Business justification explaining the need for violation acknowledgement
+   * 
+ * + * string comment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for comment. + */ + com.google.protobuf.ByteString getCommentBytes(); + + /** + * + * + *
+   * Optional. Name of the OrgPolicy which was modified with non-compliant change and
+   * resulted in this violation.
+   * Format:
+   * projects/{project_number}/policies/{constraint_name}
+   * folders/{folder_id}/policies/{constraint_name}
+   * organizations/{organization_id}/policies/{constraint_name}
+   * 
+ * + * string non_compliant_org_policy = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The nonCompliantOrgPolicy. + */ + java.lang.String getNonCompliantOrgPolicy(); + /** + * + * + *
+   * Optional. Name of the OrgPolicy which was modified with non-compliant change and
+   * resulted in this violation.
+   * Format:
+   * projects/{project_number}/policies/{constraint_name}
+   * folders/{folder_id}/policies/{constraint_name}
+   * organizations/{organization_id}/policies/{constraint_name}
+   * 
+ * + * string non_compliant_org_policy = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for nonCompliantOrgPolicy. + */ + com.google.protobuf.ByteString getNonCompliantOrgPolicyBytes(); +} diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/AcknowledgeViolationResponse.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/AcknowledgeViolationResponse.java new file mode 100644 index 000000000000..a66ab1d8d30d --- /dev/null +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/AcknowledgeViolationResponse.java @@ -0,0 +1,445 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/assuredworkloads/v1/assuredworkloads.proto + +package com.google.cloud.assuredworkloads.v1; + +/** + * + * + *
+ * Response for violation acknowledgement
+ * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse} + */ +public final class AcknowledgeViolationResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse) + AcknowledgeViolationResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use AcknowledgeViolationResponse.newBuilder() to construct. + private AcknowledgeViolationResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AcknowledgeViolationResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AcknowledgeViolationResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_AcknowledgeViolationResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_AcknowledgeViolationResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse.class, + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse)) { + return super.equals(obj); + } + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse other = + (com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response for violation acknowledgement
+   * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse) + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_AcknowledgeViolationResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_AcknowledgeViolationResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse.class, + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse.Builder.class); + } + + // Construct using + // com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_AcknowledgeViolationResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse + getDefaultInstanceForType() { + return com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse build() { + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse buildPartial() { + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse result = + new com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse) { + return mergeFrom((com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse other) { + if (other + == com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse) + private static final com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse(); + } + + public static com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AcknowledgeViolationResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/AcknowledgeViolationResponseOrBuilder.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/AcknowledgeViolationResponseOrBuilder.java new file mode 100644 index 000000000000..b0ba82012740 --- /dev/null +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/AcknowledgeViolationResponseOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/assuredworkloads/v1/assuredworkloads.proto + +package com.google.cloud.assuredworkloads.v1; + +public interface AcknowledgeViolationResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/AssuredworkloadsProto.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/AssuredworkloadsProto.java index 42fb9f03a034..d376132b655c 100644 --- a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/AssuredworkloadsProto.java +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/AssuredworkloadsProto.java @@ -79,6 +79,58 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_assuredworkloads_v1_CreateWorkloadOperationMetadata_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_assuredworkloads_v1_CreateWorkloadOperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_assuredworkloads_v1_RestrictAllowedResourcesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_assuredworkloads_v1_RestrictAllowedResourcesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_assuredworkloads_v1_RestrictAllowedResourcesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_assuredworkloads_v1_RestrictAllowedResourcesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_assuredworkloads_v1_AcknowledgeViolationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_assuredworkloads_v1_AcknowledgeViolationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_assuredworkloads_v1_AcknowledgeViolationResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_assuredworkloads_v1_AcknowledgeViolationResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_assuredworkloads_v1_TimeWindow_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_assuredworkloads_v1_TimeWindow_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_assuredworkloads_v1_ListViolationsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_assuredworkloads_v1_ListViolationsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_assuredworkloads_v1_ListViolationsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_assuredworkloads_v1_ListViolationsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_assuredworkloads_v1_GetViolationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_assuredworkloads_v1_GetViolationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_assuredworkloads_v1_Violation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_assuredworkloads_v1_Violation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_Gcloud_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_Gcloud_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_Console_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_Console_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -116,7 +168,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "e\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\016\n\006filter\030\004 " + "\001(\t\"o\n\025ListWorkloadsResponse\022=\n\tworkload" + "s\030\001 \003(\0132*.google.cloud.assuredworkloads." - + "v1.Workload\022\027\n\017next_page_token\030\002 \001(\t\"\234\023\n" + + "v1.Workload\022\027\n\017next_page_token\030\002 \001(\t\"\227\025\n" + "\010Workload\022\021\n\004name\030\001 \001(\tB\003\340A\001\022\031\n\014display_" + "name\030\002 \001(\tB\003\340A\002\022O\n\tresources\030\003 \003(\01327.goo" + "gle.cloud.assuredworkloads.v1.Workload.R" @@ -124,104 +176,196 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\001(\0162;.google.cloud.assuredworkloads.v1.W" + "orkload.ComplianceRegimeB\006\340A\002\340A\005\0227\n\013crea" + "te_time\030\005 \001(\0132\032.google.protobuf.Timestam" - + "pB\006\340A\003\340A\005\022\037\n\017billing_account\030\006 \001(\tB\006\340A\002\340" - + "A\004\022\021\n\004etag\030\t \001(\tB\003\340A\001\022K\n\006labels\030\n \003(\01326." - + "google.cloud.assuredworkloads.v1.Workloa" - + "d.LabelsEntryB\003\340A\001\022)\n\034provisioned_resour" - + "ces_parent\030\r \001(\tB\003\340A\004\022Q\n\014kms_settings\030\016 " - + "\001(\01326.google.cloud.assuredworkloads.v1.W" - + "orkload.KMSSettingsB\003\340A\004\022[\n\021resource_set" - + "tings\030\017 \003(\0132;.google.cloud.assuredworklo" - + "ads.v1.Workload.ResourceSettingsB\003\340A\004\022`\n" - + "\024kaj_enrollment_state\030\021 \001(\0162=.google.clo" - + "ud.assuredworkloads.v1.Workload.KajEnrol" - + "lmentStateB\003\340A\003\022&\n\031enable_sovereign_cont" - + "rols\030\022 \001(\010B\003\340A\001\022f\n\027saa_enrollment_respon" - + "se\030\024 \001(\0132@.google.cloud.assuredworkloads" - + ".v1.Workload.SaaEnrollmentResponseB\003\340A\003\032" - + "\357\001\n\014ResourceInfo\022\023\n\013resource_id\030\001 \001(\003\022[\n" - + "\rresource_type\030\002 \001(\0162D.google.cloud.assu" - + "redworkloads.v1.Workload.ResourceInfo.Re" - + "sourceType\"m\n\014ResourceType\022\035\n\031RESOURCE_T" - + "YPE_UNSPECIFIED\020\000\022\024\n\020CONSUMER_PROJECT\020\001\022" - + "\033\n\027ENCRYPTION_KEYS_PROJECT\020\002\022\013\n\007KEYRING\020" - + "\003\032\217\001\n\013KMSSettings\022A\n\022next_rotation_time\030" - + "\001 \001(\0132\032.google.protobuf.TimestampB\t\340A\002\340A" - + "\004\340A\005\022=\n\017rotation_period\030\002 \001(\0132\031.google.p" - + "rotobuf.DurationB\t\340A\002\340A\004\340A\005\032\232\001\n\020Resource" - + "Settings\022\023\n\013resource_id\030\001 \001(\t\022[\n\rresourc" - + "e_type\030\002 \001(\0162D.google.cloud.assuredworkl" - + "oads.v1.Workload.ResourceInfo.ResourceTy" - + "pe\022\024\n\014display_name\030\003 \001(\t\032\374\003\n\025SaaEnrollme" - + "ntResponse\022f\n\014setup_status\030\001 \001(\0162K.googl" - + "e.cloud.assuredworkloads.v1.Workload.Saa" - + "EnrollmentResponse.SetupStateH\000\210\001\001\022a\n\014se" - + "tup_errors\030\002 \003(\0162K.google.cloud.assuredw" - + "orkloads.v1.Workload.SaaEnrollmentRespon" - + "se.SetupError\"R\n\nSetupState\022\033\n\027SETUP_STA" - + "TE_UNSPECIFIED\020\000\022\022\n\016STATUS_PENDING\020\001\022\023\n\017" - + "STATUS_COMPLETE\020\002\"\262\001\n\nSetupError\022\033\n\027SETU" - + "P_ERROR_UNSPECIFIED\020\000\022\034\n\030ERROR_INVALID_B" - + "ASE_SETUP\020\001\022&\n\"ERROR_MISSING_EXTERNAL_SI" - + "GNING_KEY\020\002\022#\n\037ERROR_NOT_ALL_SERVICES_EN" - + "ROLLED\020\003\022\034\n\030ERROR_SETUP_CHECK_FAILED\020\004B\017" - + "\n\r_setup_status\032-\n\013LabelsEntry\022\013\n\003key\030\001 " - + "\001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\342\001\n\020ComplianceReg" - + "ime\022!\n\035COMPLIANCE_REGIME_UNSPECIFIED\020\000\022\007" - + "\n\003IL4\020\001\022\010\n\004CJIS\020\002\022\020\n\014FEDRAMP_HIGH\020\003\022\024\n\020F" - + "EDRAMP_MODERATE\020\004\022\026\n\022US_REGIONAL_ACCESS\020" - + "\005\022\t\n\005HIPAA\020\006\022\013\n\007HITRUST\020\007\022\032\n\026EU_REGIONS_" - + "AND_SUPPORT\020\010\022\032\n\026CA_REGIONS_AND_SUPPORT\020" - + "\t\022\010\n\004ITAR\020\n\"\177\n\022KajEnrollmentState\022$\n KAJ" - + "_ENROLLMENT_STATE_UNSPECIFIED\020\000\022 \n\034KAJ_E" - + "NROLLMENT_STATE_PENDING\020\001\022!\n\035KAJ_ENROLLM" - + "ENT_STATE_COMPLETE\020\002:u\352Ar\n(assuredworklo" - + "ads.googleapis.com/Workload\022Forganizatio" - + "ns/{organization}/locations/{location}/w" - + "orkloads/{workload}\"\344\001\n\037CreateWorkloadOp" - + "erationMetadata\0224\n\013create_time\030\001 \001(\0132\032.g" - + "oogle.protobuf.TimestampB\003\340A\001\022\031\n\014display" - + "_name\030\002 \001(\tB\003\340A\001\022\023\n\006parent\030\003 \001(\tB\003\340A\001\022[\n" - + "\021compliance_regime\030\004 \001(\0162;.google.cloud." - + "assuredworkloads.v1.Workload.ComplianceR" - + "egimeB\003\340A\0012\342\010\n\027AssuredWorkloadsService\022\357" - + "\001\n\016CreateWorkload\0227.google.cloud.assured" - + "workloads.v1.CreateWorkloadRequest\032\035.goo" - + "gle.longrunning.Operation\"\204\001\202\323\344\223\002>\"2/v1/" - + "{parent=organizations/*/locations/*}/wor" - + "kloads:\010workload\332A\017parent,workload\312A+\n\010W" - + "orkload\022\037CreateWorkloadOperationMetadata" - + "\022\333\001\n\016UpdateWorkload\0227.google.cloud.assur" - + "edworkloads.v1.UpdateWorkloadRequest\032*.g" - + "oogle.cloud.assuredworkloads.v1.Workload" - + "\"d\202\323\344\223\002G2;/v1/{workload.name=organizatio" - + "ns/*/locations/*/workloads/*}:\010workload\332" - + "A\024workload,update_mask\022\244\001\n\016DeleteWorkloa" - + "d\0227.google.cloud.assuredworkloads.v1.Del" - + "eteWorkloadRequest\032\026.google.protobuf.Emp" - + "ty\"A\202\323\344\223\0024*2/v1/{name=organizations/*/lo" - + "cations/*/workloads/*}\332A\004name\022\262\001\n\013GetWor" - + "kload\0224.google.cloud.assuredworkloads.v1" - + ".GetWorkloadRequest\032*.google.cloud.assur" - + "edworkloads.v1.Workload\"A\202\323\344\223\0024\0222/v1/{na" - + "me=organizations/*/locations/*/workloads" - + "/*}\332A\004name\022\305\001\n\rListWorkloads\0226.google.cl" - + "oud.assuredworkloads.v1.ListWorkloadsReq" - + "uest\0327.google.cloud.assuredworkloads.v1." - + "ListWorkloadsResponse\"C\202\323\344\223\0024\0222/v1/{pare" - + "nt=organizations/*/locations/*}/workload" - + "s\332A\006parent\032S\312A\037assuredworkloads.googleap" - + "is.com\322A.https://www.googleapis.com/auth" - + "/cloud-platformB\335\002\n$com.google.cloud.ass" - + "uredworkloads.v1B\025AssuredworkloadsProtoP" - + "\001ZPgoogle.golang.org/genproto/googleapis" - + "/cloud/assuredworkloads/v1;assuredworklo" - + "ads\252\002 Google.Cloud.AssuredWorkloads.V1\312\002" - + " Google\\Cloud\\AssuredWorkloads\\V1\352\002#Goog" - + "le::Cloud::AssuredWorkloads::V1\352A]\n(assu" - + "redworkloads.googleapis.com/Location\0221or" - + "ganizations/{organization}/locations/{lo" - + "cation}b\006proto3" + + "pB\006\340A\003\340A\005\022\034\n\017billing_account\030\006 \001(\tB\003\340A\001\022" + + "\021\n\004etag\030\t \001(\tB\003\340A\001\022K\n\006labels\030\n \003(\01326.goo" + + "gle.cloud.assuredworkloads.v1.Workload.L" + + "abelsEntryB\003\340A\001\022)\n\034provisioned_resources" + + "_parent\030\r \001(\tB\003\340A\004\022S\n\014kms_settings\030\016 \001(\013" + + "26.google.cloud.assuredworkloads.v1.Work" + + "load.KMSSettingsB\005\030\001\340A\004\022[\n\021resource_sett" + + "ings\030\017 \003(\0132;.google.cloud.assuredworkloa" + + "ds.v1.Workload.ResourceSettingsB\003\340A\004\022`\n\024" + + "kaj_enrollment_state\030\021 \001(\0162=.google.clou" + + "d.assuredworkloads.v1.Workload.KajEnroll" + + "mentStateB\003\340A\003\022&\n\031enable_sovereign_contr" + + "ols\030\022 \001(\010B\003\340A\001\022f\n\027saa_enrollment_respons" + + "e\030\024 \001(\0132@.google.cloud.assuredworkloads." + + "v1.Workload.SaaEnrollmentResponseB\003\340A\003\022." + + "\n!compliant_but_disallowed_services\030\030 \003(" + + "\tB\003\340A\003\022H\n\007partner\030\031 \001(\01622.google.cloud.a" + + "ssuredworkloads.v1.Workload.PartnerB\003\340A\001" + + "\032\211\002\n\014ResourceInfo\022\023\n\013resource_id\030\001 \001(\003\022[" + + "\n\rresource_type\030\002 \001(\0162D.google.cloud.ass" + + "uredworkloads.v1.Workload.ResourceInfo.R" + + "esourceType\"\206\001\n\014ResourceType\022\035\n\031RESOURCE" + + "_TYPE_UNSPECIFIED\020\000\022\030\n\020CONSUMER_PROJECT\020" + + "\001\032\002\010\001\022\023\n\017CONSUMER_FOLDER\020\004\022\033\n\027ENCRYPTION" + + "_KEYS_PROJECT\020\002\022\013\n\007KEYRING\020\003\032\223\001\n\013KMSSett" + + "ings\022A\n\022next_rotation_time\030\001 \001(\0132\032.googl" + + "e.protobuf.TimestampB\t\340A\002\340A\004\340A\005\022=\n\017rotat" + + "ion_period\030\002 \001(\0132\031.google.protobuf.Durat" + + "ionB\t\340A\002\340A\004\340A\005:\002\030\001\032\232\001\n\020ResourceSettings\022" + + "\023\n\013resource_id\030\001 \001(\t\022[\n\rresource_type\030\002 " + + "\001(\0162D.google.cloud.assuredworkloads.v1.W" + + "orkload.ResourceInfo.ResourceType\022\024\n\014dis" + + "play_name\030\003 \001(\t\032\374\003\n\025SaaEnrollmentRespons" + + "e\022f\n\014setup_status\030\001 \001(\0162K.google.cloud.a" + + "ssuredworkloads.v1.Workload.SaaEnrollmen" + + "tResponse.SetupStateH\000\210\001\001\022a\n\014setup_error" + + "s\030\002 \003(\0162K.google.cloud.assuredworkloads." + + "v1.Workload.SaaEnrollmentResponse.SetupE" + + "rror\"R\n\nSetupState\022\033\n\027SETUP_STATE_UNSPEC" + + "IFIED\020\000\022\022\n\016STATUS_PENDING\020\001\022\023\n\017STATUS_CO" + + "MPLETE\020\002\"\262\001\n\nSetupError\022\033\n\027SETUP_ERROR_U" + + "NSPECIFIED\020\000\022\034\n\030ERROR_INVALID_BASE_SETUP" + + "\020\001\022&\n\"ERROR_MISSING_EXTERNAL_SIGNING_KEY" + + "\020\002\022#\n\037ERROR_NOT_ALL_SERVICES_ENROLLED\020\003\022" + + "\034\n\030ERROR_SETUP_CHECK_FAILED\020\004B\017\n\r_setup_" + + "status\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005va" + + "lue\030\002 \001(\t:\0028\001\"\206\002\n\020ComplianceRegime\022!\n\035CO" + + "MPLIANCE_REGIME_UNSPECIFIED\020\000\022\007\n\003IL4\020\001\022\010" + + "\n\004CJIS\020\002\022\020\n\014FEDRAMP_HIGH\020\003\022\024\n\020FEDRAMP_MO" + + "DERATE\020\004\022\026\n\022US_REGIONAL_ACCESS\020\005\022\t\n\005HIPA" + + "A\020\006\022\013\n\007HITRUST\020\007\022\032\n\026EU_REGIONS_AND_SUPPO" + + "RT\020\010\022\032\n\026CA_REGIONS_AND_SUPPORT\020\t\022\010\n\004ITAR" + + "\020\n\022\"\n\036ASSURED_WORKLOADS_FOR_PARTNERS\020\014\"\177" + + "\n\022KajEnrollmentState\022$\n KAJ_ENROLLMENT_S" + + "TATE_UNSPECIFIED\020\000\022 \n\034KAJ_ENROLLMENT_STA" + + "TE_PENDING\020\001\022!\n\035KAJ_ENROLLMENT_STATE_COM" + + "PLETE\020\002\">\n\007Partner\022\027\n\023PARTNER_UNSPECIFIE" + + "D\020\000\022\032\n\026LOCAL_CONTROLS_BY_S3NS\020\001:u\352Ar\n(as" + + "suredworkloads.googleapis.com/Workload\022F" + + "organizations/{organization}/locations/{" + + "location}/workloads/{workload}\"\344\001\n\037Creat" + + "eWorkloadOperationMetadata\0224\n\013create_tim" + + "e\030\001 \001(\0132\032.google.protobuf.TimestampB\003\340A\001" + + "\022\031\n\014display_name\030\002 \001(\tB\003\340A\001\022\023\n\006parent\030\003 " + + "\001(\tB\003\340A\001\022[\n\021compliance_regime\030\004 \001(\0162;.go" + + "ogle.cloud.assuredworkloads.v1.Workload." + + "ComplianceRegimeB\003\340A\001\"\227\002\n\037RestrictAllowe" + + "dResourcesRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\022p\n\020" + + "restriction_type\030\002 \001(\0162Q.google.cloud.as" + + "suredworkloads.v1.RestrictAllowedResourc" + + "esRequest.RestrictionTypeB\003\340A\002\"o\n\017Restri" + + "ctionType\022 \n\034RESTRICTION_TYPE_UNSPECIFIE" + + "D\020\000\022\033\n\027ALLOW_ALL_GCP_RESOURCES\020\001\022\035\n\031ALLO" + + "W_COMPLIANT_RESOURCES\020\002\"\"\n RestrictAllow" + + "edResourcesResponse\"m\n\033AcknowledgeViolat" + + "ionRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\024\n\007comment" + + "\030\002 \001(\tB\003\340A\002\022%\n\030non_compliant_org_policy\030" + + "\003 \001(\tB\003\340A\001\"\036\n\034AcknowledgeViolationRespon" + + "se\"j\n\nTimeWindow\022.\n\nstart_time\030\001 \001(\0132\032.g" + + "oogle.protobuf.Timestamp\022,\n\010end_time\030\002 \001" + + "(\0132\032.google.protobuf.Timestamp\"\345\001\n\025ListV" + + "iolationsRequest\022A\n\006parent\030\001 \001(\tB1\340A\002\372A+" + + "\022)assuredworkloads.googleapis.com/Violat" + + "ion\022C\n\010interval\030\002 \001(\0132,.google.cloud.ass" + + "uredworkloads.v1.TimeWindowB\003\340A\001\022\026\n\tpage" + + "_size\030\003 \001(\005B\003\340A\001\022\027\n\npage_token\030\004 \001(\tB\003\340A" + + "\001\022\023\n\006filter\030\005 \001(\tB\003\340A\001\"r\n\026ListViolations" + + "Response\022?\n\nviolations\030\001 \003(\0132+.google.cl" + + "oud.assuredworkloads.v1.Violation\022\027\n\017nex" + + "t_page_token\030\002 \001(\t\"V\n\023GetViolationReques" + + "t\022?\n\004name\030\001 \001(\tB1\340A\002\372A+\n)assuredworkload" + + "s.googleapis.com/Violation\"\344\r\n\tViolation" + + "\022\024\n\004name\030\001 \001(\tB\006\340A\003\340A\005\022\030\n\013description\030\002 " + + "\001(\tB\003\340A\003\0223\n\nbegin_time\030\003 \001(\0132\032.google.pr" + + "otobuf.TimestampB\003\340A\003\0224\n\013update_time\030\004 \001" + + "(\0132\032.google.protobuf.TimestampB\003\340A\003\0225\n\014r" + + "esolve_time\030\005 \001(\0132\032.google.protobuf.Time" + + "stampB\003\340A\003\022\025\n\010category\030\006 \001(\tB\003\340A\003\022E\n\005sta" + + "te\030\007 \001(\01621.google.cloud.assuredworkloads" + + ".v1.Violation.StateB\003\340A\003\022%\n\025org_policy_c" + + "onstraint\030\010 \001(\tB\006\340A\003\340A\005\022\036\n\016audit_log_lin" + + "k\030\013 \001(\tB\006\340A\003\340A\005\022(\n\030non_compliant_org_pol" + + "icy\030\014 \001(\tB\006\340A\003\340A\005\022Q\n\013remediation\030\r \001(\01327" + + ".google.cloud.assuredworkloads.v1.Violat" + + "ion.RemediationB\003\340A\003\022\031\n\014acknowledged\030\016 \001" + + "(\010B\003\340A\003\022B\n\024acknowledgement_time\030\017 \001(\0132\032." + + "google.protobuf.TimestampB\003\340A\001H\000\210\001\001\032\214\007\n\013" + + "Remediation\022_\n\014instructions\030\001 \001(\0132D.goog" + + "le.cloud.assuredworkloads.v1.Violation.R" + + "emediation.InstructionsB\003\340A\002\022\030\n\020complian" + + "t_values\030\002 \003(\t\022f\n\020remediation_type\030\003 \001(\016" + + "2G.google.cloud.assuredworkloads.v1.Viol" + + "ation.Remediation.RemediationTypeB\003\340A\003\032\372" + + "\002\n\014Instructions\022h\n\023gcloud_instructions\030\001" + + " \001(\0132K.google.cloud.assuredworkloads.v1." + + "Violation.Remediation.Instructions.Gclou" + + "d\022j\n\024console_instructions\030\002 \001(\0132L.google" + + ".cloud.assuredworkloads.v1.Violation.Rem" + + "ediation.Instructions.Console\032J\n\006Gcloud\022" + + "\027\n\017gcloud_commands\030\001 \003(\t\022\r\n\005steps\030\002 \003(\t\022" + + "\030\n\020additional_links\030\003 \003(\t\032H\n\007Console\022\024\n\014" + + "console_uris\030\001 \003(\t\022\r\n\005steps\030\002 \003(\t\022\030\n\020add" + + "itional_links\030\003 \003(\t\"\234\002\n\017RemediationType\022" + + " \n\034REMEDIATION_TYPE_UNSPECIFIED\020\000\022,\n(REM" + + "EDIATION_BOOLEAN_ORG_POLICY_VIOLATION\020\001\022" + + "8\n4REMEDIATION_LIST_ALLOWED_VALUES_ORG_P" + + "OLICY_VIOLATION\020\002\0227\n3REMEDIATION_LIST_DE" + + "NIED_VALUES_ORG_POLICY_VIOLATION\020\003\022F\nBRE" + + "MEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJE" + + "CTS_ORG_POLICY_VIOLATION\020\004\"K\n\005State\022\025\n\021S" + + "TATE_UNSPECIFIED\020\000\022\014\n\010RESOLVED\020\002\022\016\n\nUNRE" + + "SOLVED\020\003\022\r\n\tEXCEPTION\020\004:\216\001\352A\212\001\n)assuredw" + + "orkloads.googleapis.com/Violation\022]organ" + + "izations/{organization}/locations/{locat" + + "ion}/workloads/{workload}/violations/{vi" + + "olation}B\027\n\025_acknowledgement_time2\206\016\n\027As" + + "suredWorkloadsService\022\357\001\n\016CreateWorkload" + + "\0227.google.cloud.assuredworkloads.v1.Crea" + + "teWorkloadRequest\032\035.google.longrunning.O" + + "peration\"\204\001\202\323\344\223\002>\"2/v1/{parent=organizat" + + "ions/*/locations/*}/workloads:\010workload\332" + + "A\017parent,workload\312A+\n\010Workload\022\037CreateWo" + + "rkloadOperationMetadata\022\333\001\n\016UpdateWorklo" + + "ad\0227.google.cloud.assuredworkloads.v1.Up" + + "dateWorkloadRequest\032*.google.cloud.assur" + + "edworkloads.v1.Workload\"d\202\323\344\223\002G2;/v1/{wo" + + "rkload.name=organizations/*/locations/*/" + + "workloads/*}:\010workload\332A\024workload,update" + + "_mask\022\371\001\n\030RestrictAllowedResources\022A.goo" + + "gle.cloud.assuredworkloads.v1.RestrictAl" + + "lowedResourcesRequest\032B.google.cloud.ass" + + "uredworkloads.v1.RestrictAllowedResource" + + "sResponse\"V\202\323\344\223\002P\"K/v1/{name=organizatio" + + "ns/*/locations/*/workloads/*}:restrictAl" + + "lowedResources:\001*\022\244\001\n\016DeleteWorkload\0227.g" + + "oogle.cloud.assuredworkloads.v1.DeleteWo" + + "rkloadRequest\032\026.google.protobuf.Empty\"A\202" + + "\323\344\223\0024*2/v1/{name=organizations/*/locatio" + + "ns/*/workloads/*}\332A\004name\022\262\001\n\013GetWorkload" + + "\0224.google.cloud.assuredworkloads.v1.GetW" + + "orkloadRequest\032*.google.cloud.assuredwor" + + "kloads.v1.Workload\"A\202\323\344\223\0024\0222/v1/{name=or" + + "ganizations/*/locations/*/workloads/*}\332A" + + "\004name\022\305\001\n\rListWorkloads\0226.google.cloud.a" + + "ssuredworkloads.v1.ListWorkloadsRequest\032" + + "7.google.cloud.assuredworkloads.v1.ListW" + + "orkloadsResponse\"C\202\323\344\223\0024\0222/v1/{parent=or" + + "ganizations/*/locations/*}/workloads\332A\006p" + + "arent\022\216\001\n\016ListViolations\0227.google.cloud." + + "assuredworkloads.v1.ListViolationsReques" + + "t\0328.google.cloud.assuredworkloads.v1.Lis" + + "tViolationsResponse\"\t\332A\006parent\022{\n\014GetVio" + + "lation\0225.google.cloud.assuredworkloads.v" + + "1.GetViolationRequest\032+.google.cloud.ass" + + "uredworkloads.v1.Violation\"\007\332A\004name\022\227\001\n\024" + + "AcknowledgeViolation\022=.google.cloud.assu" + + "redworkloads.v1.AcknowledgeViolationRequ" + + "est\032>.google.cloud.assuredworkloads.v1.A" + + "cknowledgeViolationResponse\"\000\032S\312A\037assure" + + "dworkloads.googleapis.com\322A.https://www." + + "googleapis.com/auth/cloud-platformB\335\002\n$c" + + "om.google.cloud.assuredworkloads.v1B\025Ass" + + "uredworkloadsProtoP\001ZPgoogle.golang.org/" + + "genproto/googleapis/cloud/assuredworkloa" + + "ds/v1;assuredworkloads\252\002 Google.Cloud.As" + + "suredWorkloads.V1\312\002 Google\\Cloud\\Assured" + + "Workloads\\V1\352\002#Google::Cloud::AssuredWor" + + "kloads::V1\352A]\n(assuredworkloads.googleap" + + "is.com/Location\0221organizations/{organiza" + + "tion}/locations/{location}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -305,6 +449,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "KajEnrollmentState", "EnableSovereignControls", "SaaEnrollmentResponse", + "CompliantButDisallowedServices", + "Partner", }); internal_static_google_cloud_assuredworkloads_v1_Workload_ResourceInfo_descriptor = internal_static_google_cloud_assuredworkloads_v1_Workload_descriptor @@ -364,6 +510,127 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "CreateTime", "DisplayName", "Parent", "ComplianceRegime", }); + internal_static_google_cloud_assuredworkloads_v1_RestrictAllowedResourcesRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_assuredworkloads_v1_RestrictAllowedResourcesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_assuredworkloads_v1_RestrictAllowedResourcesRequest_descriptor, + new java.lang.String[] { + "Name", "RestrictionType", + }); + internal_static_google_cloud_assuredworkloads_v1_RestrictAllowedResourcesResponse_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_assuredworkloads_v1_RestrictAllowedResourcesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_assuredworkloads_v1_RestrictAllowedResourcesResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_assuredworkloads_v1_AcknowledgeViolationRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_assuredworkloads_v1_AcknowledgeViolationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_assuredworkloads_v1_AcknowledgeViolationRequest_descriptor, + new java.lang.String[] { + "Name", "Comment", "NonCompliantOrgPolicy", + }); + internal_static_google_cloud_assuredworkloads_v1_AcknowledgeViolationResponse_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_assuredworkloads_v1_AcknowledgeViolationResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_assuredworkloads_v1_AcknowledgeViolationResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_assuredworkloads_v1_TimeWindow_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_assuredworkloads_v1_TimeWindow_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_assuredworkloads_v1_TimeWindow_descriptor, + new java.lang.String[] { + "StartTime", "EndTime", + }); + internal_static_google_cloud_assuredworkloads_v1_ListViolationsRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_assuredworkloads_v1_ListViolationsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_assuredworkloads_v1_ListViolationsRequest_descriptor, + new java.lang.String[] { + "Parent", "Interval", "PageSize", "PageToken", "Filter", + }); + internal_static_google_cloud_assuredworkloads_v1_ListViolationsResponse_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_assuredworkloads_v1_ListViolationsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_assuredworkloads_v1_ListViolationsResponse_descriptor, + new java.lang.String[] { + "Violations", "NextPageToken", + }); + internal_static_google_cloud_assuredworkloads_v1_GetViolationRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_assuredworkloads_v1_GetViolationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_assuredworkloads_v1_GetViolationRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_assuredworkloads_v1_Violation_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_assuredworkloads_v1_Violation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_assuredworkloads_v1_Violation_descriptor, + new java.lang.String[] { + "Name", + "Description", + "BeginTime", + "UpdateTime", + "ResolveTime", + "Category", + "State", + "OrgPolicyConstraint", + "AuditLogLink", + "NonCompliantOrgPolicy", + "Remediation", + "Acknowledged", + "AcknowledgementTime", + "AcknowledgementTime", + }); + internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_descriptor = + internal_static_google_cloud_assuredworkloads_v1_Violation_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_descriptor, + new java.lang.String[] { + "Instructions", "CompliantValues", "RemediationType", + }); + internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_descriptor = + internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_descriptor, + new java.lang.String[] { + "GcloudInstructions", "ConsoleInstructions", + }); + internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_Gcloud_descriptor = + internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_Gcloud_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_Gcloud_descriptor, + new java.lang.String[] { + "GcloudCommands", "Steps", "AdditionalLinks", + }); + internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_Console_descriptor = + internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_Console_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_Console_descriptor, + new java.lang.String[] { + "ConsoleUris", "Steps", "AdditionalLinks", + }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.ClientProto.defaultHost); diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/CreateWorkloadOperationMetadata.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/CreateWorkloadOperationMetadata.java index 9b6508f6e8ad..82af52c384ec 100644 --- a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/CreateWorkloadOperationMetadata.java +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/CreateWorkloadOperationMetadata.java @@ -55,81 +55,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private CreateWorkloadOperationMetadata( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (createTime_ != null) { - subBuilder = createTime_.toBuilder(); - } - createTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(createTime_); - createTime_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - displayName_ = s; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 32: - { - int rawValue = input.readEnum(); - - complianceRegime_ = rawValue; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1_CreateWorkloadOperationMetadata_descriptor; @@ -298,8 +223,8 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
-   * Optional. Compliance controls that should be applied to the resources
-   * managed by the workload.
+   * Optional. Compliance controls that should be applied to the resources managed by
+   * the workload.
    * 
* * @@ -316,8 +241,8 @@ public int getComplianceRegimeValue() { * * *
-   * Optional. Compliance controls that should be applied to the resources
-   * managed by the workload.
+   * Optional. Compliance controls that should be applied to the resources managed by
+   * the workload.
    * 
* * @@ -365,7 +290,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io .getNumber()) { output.writeEnum(4, complianceRegime_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -389,7 +314,7 @@ public int getSerializedSize() { .getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, complianceRegime_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -412,7 +337,7 @@ public boolean equals(final java.lang.Object obj) { if (!getDisplayName().equals(other.getDisplayName())) return false; if (!getParent().equals(other.getParent())) return false; if (complianceRegime_ != other.complianceRegime_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -433,7 +358,7 @@ public int hashCode() { hash = (53 * hash) + getParent().hashCode(); hash = (37 * hash) + COMPLIANCE_REGIME_FIELD_NUMBER; hash = (53 * hash) + complianceRegime_; - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -565,17 +490,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using // com.google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -697,7 +615,7 @@ public Builder mergeFrom( if (other.complianceRegime_ != 0) { setComplianceRegimeValue(other.getComplianceRegimeValue()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -712,19 +630,55 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 26 + case 32: + { + complianceRegime_ = input.readEnum(); + + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1137,8 +1091,8 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { * * *
-     * Optional. Compliance controls that should be applied to the resources
-     * managed by the workload.
+     * Optional. Compliance controls that should be applied to the resources managed by
+     * the workload.
      * 
* * @@ -1155,8 +1109,8 @@ public int getComplianceRegimeValue() { * * *
-     * Optional. Compliance controls that should be applied to the resources
-     * managed by the workload.
+     * Optional. Compliance controls that should be applied to the resources managed by
+     * the workload.
      * 
* * @@ -1176,8 +1130,8 @@ public Builder setComplianceRegimeValue(int value) { * * *
-     * Optional. Compliance controls that should be applied to the resources
-     * managed by the workload.
+     * Optional. Compliance controls that should be applied to the resources managed by
+     * the workload.
      * 
* * @@ -1199,8 +1153,8 @@ public com.google.cloud.assuredworkloads.v1.Workload.ComplianceRegime getComplia * * *
-     * Optional. Compliance controls that should be applied to the resources
-     * managed by the workload.
+     * Optional. Compliance controls that should be applied to the resources managed by
+     * the workload.
      * 
* * @@ -1224,8 +1178,8 @@ public Builder setComplianceRegime( * * *
-     * Optional. Compliance controls that should be applied to the resources
-     * managed by the workload.
+     * Optional. Compliance controls that should be applied to the resources managed by
+     * the workload.
      * 
* * @@ -1275,7 +1229,18 @@ public CreateWorkloadOperationMetadata parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new CreateWorkloadOperationMetadata(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/CreateWorkloadOperationMetadataOrBuilder.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/CreateWorkloadOperationMetadataOrBuilder.java index b73db6ff6990..cf53e83f2a7f 100644 --- a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/CreateWorkloadOperationMetadataOrBuilder.java +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/CreateWorkloadOperationMetadataOrBuilder.java @@ -115,8 +115,8 @@ public interface CreateWorkloadOperationMetadataOrBuilder * * *
-   * Optional. Compliance controls that should be applied to the resources
-   * managed by the workload.
+   * Optional. Compliance controls that should be applied to the resources managed by
+   * the workload.
    * 
* * @@ -130,8 +130,8 @@ public interface CreateWorkloadOperationMetadataOrBuilder * * *
-   * Optional. Compliance controls that should be applied to the resources
-   * managed by the workload.
+   * Optional. Compliance controls that should be applied to the resources managed by
+   * the workload.
    * 
* * diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/CreateWorkloadRequest.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/CreateWorkloadRequest.java index 52c29c868b24..f431d3efb926 100644 --- a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/CreateWorkloadRequest.java +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/CreateWorkloadRequest.java @@ -53,75 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private CreateWorkloadRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 18: - { - com.google.cloud.assuredworkloads.v1.Workload.Builder subBuilder = null; - if (workload_ != null) { - subBuilder = workload_.toBuilder(); - } - workload_ = - input.readMessage( - com.google.cloud.assuredworkloads.v1.Workload.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(workload_); - workload_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - externalId_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1_CreateWorkloadRequest_descriptor; @@ -252,8 +183,8 @@ public com.google.cloud.assuredworkloads.v1.WorkloadOrBuilder getWorkloadOrBuild * * *
-   * Optional. A identifier associated with the workload and underlying projects
-   * which allows for the break down of billing costs for a workload. The value
+   * Optional. A identifier associated with the workload and underlying projects which
+   * allows for the break down of billing costs for a workload. The value
    * provided for the identifier will add a label to the workload and contained
    * projects with the identifier as the value.
    * 
@@ -278,8 +209,8 @@ public java.lang.String getExternalId() { * * *
-   * Optional. A identifier associated with the workload and underlying projects
-   * which allows for the break down of billing costs for a workload. The value
+   * Optional. A identifier associated with the workload and underlying projects which
+   * allows for the break down of billing costs for a workload. The value
    * provided for the identifier will add a label to the workload and contained
    * projects with the identifier as the value.
    * 
@@ -324,7 +255,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(externalId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, externalId_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -342,7 +273,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(externalId_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, externalId_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -364,7 +295,7 @@ public boolean equals(final java.lang.Object obj) { if (!getWorkload().equals(other.getWorkload())) return false; } if (!getExternalId().equals(other.getExternalId())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -383,7 +314,7 @@ public int hashCode() { } hash = (37 * hash) + EXTERNAL_ID_FIELD_NUMBER; hash = (53 * hash) + getExternalId().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -513,17 +444,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.assuredworkloads.v1.CreateWorkloadRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -634,7 +558,7 @@ public Builder mergeFrom(com.google.cloud.assuredworkloads.v1.CreateWorkloadRequ externalId_ = other.externalId_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -649,18 +573,49 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1.CreateWorkloadRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getWorkloadFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 26: + { + externalId_ = input.readStringRequireUtf8(); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1.CreateWorkloadRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -994,8 +949,8 @@ public com.google.cloud.assuredworkloads.v1.WorkloadOrBuilder getWorkloadOrBuild * * *
-     * Optional. A identifier associated with the workload and underlying projects
-     * which allows for the break down of billing costs for a workload. The value
+     * Optional. A identifier associated with the workload and underlying projects which
+     * allows for the break down of billing costs for a workload. The value
      * provided for the identifier will add a label to the workload and contained
      * projects with the identifier as the value.
      * 
@@ -1019,8 +974,8 @@ public java.lang.String getExternalId() { * * *
-     * Optional. A identifier associated with the workload and underlying projects
-     * which allows for the break down of billing costs for a workload. The value
+     * Optional. A identifier associated with the workload and underlying projects which
+     * allows for the break down of billing costs for a workload. The value
      * provided for the identifier will add a label to the workload and contained
      * projects with the identifier as the value.
      * 
@@ -1044,8 +999,8 @@ public com.google.protobuf.ByteString getExternalIdBytes() { * * *
-     * Optional. A identifier associated with the workload and underlying projects
-     * which allows for the break down of billing costs for a workload. The value
+     * Optional. A identifier associated with the workload and underlying projects which
+     * allows for the break down of billing costs for a workload. The value
      * provided for the identifier will add a label to the workload and contained
      * projects with the identifier as the value.
      * 
@@ -1068,8 +1023,8 @@ public Builder setExternalId(java.lang.String value) { * * *
-     * Optional. A identifier associated with the workload and underlying projects
-     * which allows for the break down of billing costs for a workload. The value
+     * Optional. A identifier associated with the workload and underlying projects which
+     * allows for the break down of billing costs for a workload. The value
      * provided for the identifier will add a label to the workload and contained
      * projects with the identifier as the value.
      * 
@@ -1088,8 +1043,8 @@ public Builder clearExternalId() { * * *
-     * Optional. A identifier associated with the workload and underlying projects
-     * which allows for the break down of billing costs for a workload. The value
+     * Optional. A identifier associated with the workload and underlying projects which
+     * allows for the break down of billing costs for a workload. The value
      * provided for the identifier will add a label to the workload and contained
      * projects with the identifier as the value.
      * 
@@ -1142,7 +1097,18 @@ public CreateWorkloadRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new CreateWorkloadRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/CreateWorkloadRequestOrBuilder.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/CreateWorkloadRequestOrBuilder.java index bfad0707ecef..fdfd8dea218b 100644 --- a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/CreateWorkloadRequestOrBuilder.java +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/CreateWorkloadRequestOrBuilder.java @@ -99,8 +99,8 @@ public interface CreateWorkloadRequestOrBuilder * * *
-   * Optional. A identifier associated with the workload and underlying projects
-   * which allows for the break down of billing costs for a workload. The value
+   * Optional. A identifier associated with the workload and underlying projects which
+   * allows for the break down of billing costs for a workload. The value
    * provided for the identifier will add a label to the workload and contained
    * projects with the identifier as the value.
    * 
@@ -114,8 +114,8 @@ public interface CreateWorkloadRequestOrBuilder * * *
-   * Optional. A identifier associated with the workload and underlying projects
-   * which allows for the break down of billing costs for a workload. The value
+   * Optional. A identifier associated with the workload and underlying projects which
+   * allows for the break down of billing costs for a workload. The value
    * provided for the identifier will add a label to the workload and contained
    * projects with the identifier as the value.
    * 
diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/DeleteWorkloadRequest.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/DeleteWorkloadRequest.java index dbf35323319b..5b0f1ea0abd5 100644 --- a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/DeleteWorkloadRequest.java +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/DeleteWorkloadRequest.java @@ -53,59 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private DeleteWorkloadRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - etag_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1_DeleteWorkloadRequest_descriptor; @@ -249,7 +196,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, etag_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -264,7 +211,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, etag_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -282,7 +229,7 @@ public boolean equals(final java.lang.Object obj) { if (!getName().equals(other.getName())) return false; if (!getEtag().equals(other.getEtag())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -297,7 +244,7 @@ public int hashCode() { hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + ETAG_FIELD_NUMBER; hash = (53 * hash) + getEtag().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -427,17 +374,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -534,7 +474,7 @@ public Builder mergeFrom(com.google.cloud.assuredworkloads.v1.DeleteWorkloadRequ etag_ = other.etag_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -549,18 +489,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + etag_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -833,7 +798,18 @@ public DeleteWorkloadRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DeleteWorkloadRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/GetViolationRequest.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/GetViolationRequest.java new file mode 100644 index 000000000000..c4e6936d7a38 --- /dev/null +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/GetViolationRequest.java @@ -0,0 +1,644 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/assuredworkloads/v1/assuredworkloads.proto + +package com.google.cloud.assuredworkloads.v1; + +/** + * + * + *
+ * Request for fetching a Workload Violation.
+ * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1.GetViolationRequest} + */ +public final class GetViolationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.assuredworkloads.v1.GetViolationRequest) + GetViolationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetViolationRequest.newBuilder() to construct. + private GetViolationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetViolationRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetViolationRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_GetViolationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_GetViolationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1.GetViolationRequest.class, + com.google.cloud.assuredworkloads.v1.GetViolationRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the Violation to fetch (ie. Violation.name).
+   * Format:
+   * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the Violation to fetch (ie. Violation.name).
+   * Format:
+   * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.assuredworkloads.v1.GetViolationRequest)) { + return super.equals(obj); + } + com.google.cloud.assuredworkloads.v1.GetViolationRequest other = + (com.google.cloud.assuredworkloads.v1.GetViolationRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.assuredworkloads.v1.GetViolationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.GetViolationRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.GetViolationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.GetViolationRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.GetViolationRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.GetViolationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.GetViolationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.GetViolationRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.GetViolationRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.GetViolationRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.GetViolationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.GetViolationRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.assuredworkloads.v1.GetViolationRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for fetching a Workload Violation.
+   * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1.GetViolationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.assuredworkloads.v1.GetViolationRequest) + com.google.cloud.assuredworkloads.v1.GetViolationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_GetViolationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_GetViolationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1.GetViolationRequest.class, + com.google.cloud.assuredworkloads.v1.GetViolationRequest.Builder.class); + } + + // Construct using com.google.cloud.assuredworkloads.v1.GetViolationRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_GetViolationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.GetViolationRequest getDefaultInstanceForType() { + return com.google.cloud.assuredworkloads.v1.GetViolationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.GetViolationRequest build() { + com.google.cloud.assuredworkloads.v1.GetViolationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.GetViolationRequest buildPartial() { + com.google.cloud.assuredworkloads.v1.GetViolationRequest result = + new com.google.cloud.assuredworkloads.v1.GetViolationRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.assuredworkloads.v1.GetViolationRequest) { + return mergeFrom((com.google.cloud.assuredworkloads.v1.GetViolationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.assuredworkloads.v1.GetViolationRequest other) { + if (other == com.google.cloud.assuredworkloads.v1.GetViolationRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the Violation to fetch (ie. Violation.name).
+     * Format:
+     * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Violation to fetch (ie. Violation.name).
+     * Format:
+     * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Violation to fetch (ie. Violation.name).
+     * Format:
+     * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Violation to fetch (ie. Violation.name).
+     * Format:
+     * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Violation to fetch (ie. Violation.name).
+     * Format:
+     * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.assuredworkloads.v1.GetViolationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.assuredworkloads.v1.GetViolationRequest) + private static final com.google.cloud.assuredworkloads.v1.GetViolationRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.assuredworkloads.v1.GetViolationRequest(); + } + + public static com.google.cloud.assuredworkloads.v1.GetViolationRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetViolationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.GetViolationRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/GetViolationRequestOrBuilder.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/GetViolationRequestOrBuilder.java new file mode 100644 index 000000000000..8b94ff294bd4 --- /dev/null +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/GetViolationRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/assuredworkloads/v1/assuredworkloads.proto + +package com.google.cloud.assuredworkloads.v1; + +public interface GetViolationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1.GetViolationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the Violation to fetch (ie. Violation.name).
+   * Format:
+   * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the Violation to fetch (ie. Violation.name).
+   * Format:
+   * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/GetWorkloadRequest.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/GetWorkloadRequest.java index 5a7bd056f618..fcc6a36e5cb7 100644 --- a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/GetWorkloadRequest.java +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/GetWorkloadRequest.java @@ -52,52 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private GetWorkloadRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1_GetWorkloadRequest_descriptor; @@ -119,8 +73,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. The resource name of the Workload to fetch. This is the
-   * workloads's relative path in the API, formatted as
+   * Required. The resource name of the Workload to fetch. This is the workloads's
+   * relative path in the API, formatted as
    * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
    * For example,
    * "organizations/123/locations/us-east1/workloads/assured-workload-1".
@@ -148,8 +102,8 @@ public java.lang.String getName() {
    *
    *
    * 
-   * Required. The resource name of the Workload to fetch. This is the
-   * workloads's relative path in the API, formatted as
+   * Required. The resource name of the Workload to fetch. This is the workloads's
+   * relative path in the API, formatted as
    * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
    * For example,
    * "organizations/123/locations/us-east1/workloads/assured-workload-1".
@@ -191,7 +145,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
     }
-    unknownFields.writeTo(output);
+    getUnknownFields().writeTo(output);
   }
 
   @java.lang.Override
@@ -203,7 +157,7 @@ public int getSerializedSize() {
     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
     }
-    size += unknownFields.getSerializedSize();
+    size += getUnknownFields().getSerializedSize();
     memoizedSize = size;
     return size;
   }
@@ -220,7 +174,7 @@ public boolean equals(final java.lang.Object obj) {
         (com.google.cloud.assuredworkloads.v1.GetWorkloadRequest) obj;
 
     if (!getName().equals(other.getName())) return false;
-    if (!unknownFields.equals(other.unknownFields)) return false;
+    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
     return true;
   }
 
@@ -233,7 +187,7 @@ public int hashCode() {
     hash = (19 * hash) + getDescriptor().hashCode();
     hash = (37 * hash) + NAME_FIELD_NUMBER;
     hash = (53 * hash) + getName().hashCode();
-    hash = (29 * hash) + unknownFields.hashCode();
+    hash = (29 * hash) + getUnknownFields().hashCode();
     memoizedHashCode = hash;
     return hash;
   }
@@ -363,17 +317,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
     }
 
     // Construct using com.google.cloud.assuredworkloads.v1.GetWorkloadRequest.newBuilder()
-    private Builder() {
-      maybeForceBuilderInitialization();
-    }
+    private Builder() {}
 
     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
       super(parent);
-      maybeForceBuilderInitialization();
-    }
-
-    private void maybeForceBuilderInitialization() {
-      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
     }
 
     @java.lang.Override
@@ -463,7 +410,7 @@ public Builder mergeFrom(com.google.cloud.assuredworkloads.v1.GetWorkloadRequest
         name_ = other.name_;
         onChanged();
       }
-      this.mergeUnknownFields(other.unknownFields);
+      this.mergeUnknownFields(other.getUnknownFields());
       onChanged();
       return this;
     }
@@ -478,18 +425,37 @@ public Builder mergeFrom(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      com.google.cloud.assuredworkloads.v1.GetWorkloadRequest parsedMessage = null;
+      if (extensionRegistry == null) {
+        throw new java.lang.NullPointerException();
+      }
       try {
-        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+        boolean done = false;
+        while (!done) {
+          int tag = input.readTag();
+          switch (tag) {
+            case 0:
+              done = true;
+              break;
+            case 10:
+              {
+                name_ = input.readStringRequireUtf8();
+
+                break;
+              } // case 10
+            default:
+              {
+                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
+                  done = true; // was an endgroup tag
+                }
+                break;
+              } // default:
+          } // switch (tag)
+        } // while (!done)
       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-        parsedMessage =
-            (com.google.cloud.assuredworkloads.v1.GetWorkloadRequest) e.getUnfinishedMessage();
         throw e.unwrapIOException();
       } finally {
-        if (parsedMessage != null) {
-          mergeFrom(parsedMessage);
-        }
-      }
+        onChanged();
+      } // finally
       return this;
     }
 
@@ -498,8 +464,8 @@ public Builder mergeFrom(
      *
      *
      * 
-     * Required. The resource name of the Workload to fetch. This is the
-     * workloads's relative path in the API, formatted as
+     * Required. The resource name of the Workload to fetch. This is the workloads's
+     * relative path in the API, formatted as
      * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
      * For example,
      * "organizations/123/locations/us-east1/workloads/assured-workload-1".
@@ -526,8 +492,8 @@ public java.lang.String getName() {
      *
      *
      * 
-     * Required. The resource name of the Workload to fetch. This is the
-     * workloads's relative path in the API, formatted as
+     * Required. The resource name of the Workload to fetch. This is the workloads's
+     * relative path in the API, formatted as
      * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
      * For example,
      * "organizations/123/locations/us-east1/workloads/assured-workload-1".
@@ -554,8 +520,8 @@ public com.google.protobuf.ByteString getNameBytes() {
      *
      *
      * 
-     * Required. The resource name of the Workload to fetch. This is the
-     * workloads's relative path in the API, formatted as
+     * Required. The resource name of the Workload to fetch. This is the workloads's
+     * relative path in the API, formatted as
      * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
      * For example,
      * "organizations/123/locations/us-east1/workloads/assured-workload-1".
@@ -581,8 +547,8 @@ public Builder setName(java.lang.String value) {
      *
      *
      * 
-     * Required. The resource name of the Workload to fetch. This is the
-     * workloads's relative path in the API, formatted as
+     * Required. The resource name of the Workload to fetch. This is the workloads's
+     * relative path in the API, formatted as
      * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
      * For example,
      * "organizations/123/locations/us-east1/workloads/assured-workload-1".
@@ -604,8 +570,8 @@ public Builder clearName() {
      *
      *
      * 
-     * Required. The resource name of the Workload to fetch. This is the
-     * workloads's relative path in the API, formatted as
+     * Required. The resource name of the Workload to fetch. This is the workloads's
+     * relative path in the API, formatted as
      * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
      * For example,
      * "organizations/123/locations/us-east1/workloads/assured-workload-1".
@@ -661,7 +627,18 @@ public GetWorkloadRequest parsePartialFrom(
             com.google.protobuf.CodedInputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws com.google.protobuf.InvalidProtocolBufferException {
-          return new GetWorkloadRequest(input, extensionRegistry);
+          Builder builder = newBuilder();
+          try {
+            builder.mergeFrom(input, extensionRegistry);
+          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+            throw e.setUnfinishedMessage(builder.buildPartial());
+          } catch (com.google.protobuf.UninitializedMessageException e) {
+            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
+          } catch (java.io.IOException e) {
+            throw new com.google.protobuf.InvalidProtocolBufferException(e)
+                .setUnfinishedMessage(builder.buildPartial());
+          }
+          return builder.buildPartial();
         }
       };
 
diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/GetWorkloadRequestOrBuilder.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/GetWorkloadRequestOrBuilder.java
index c0ce0880fce8..e2fca96f9516 100644
--- a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/GetWorkloadRequestOrBuilder.java
+++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/GetWorkloadRequestOrBuilder.java
@@ -27,8 +27,8 @@ public interface GetWorkloadRequestOrBuilder
    *
    *
    * 
-   * Required. The resource name of the Workload to fetch. This is the
-   * workloads's relative path in the API, formatted as
+   * Required. The resource name of the Workload to fetch. This is the workloads's
+   * relative path in the API, formatted as
    * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
    * For example,
    * "organizations/123/locations/us-east1/workloads/assured-workload-1".
@@ -45,8 +45,8 @@ public interface GetWorkloadRequestOrBuilder
    *
    *
    * 
-   * Required. The resource name of the Workload to fetch. This is the
-   * workloads's relative path in the API, formatted as
+   * Required. The resource name of the Workload to fetch. This is the workloads's
+   * relative path in the API, formatted as
    * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
    * For example,
    * "organizations/123/locations/us-east1/workloads/assured-workload-1".
diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/ListViolationsRequest.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/ListViolationsRequest.java
new file mode 100644
index 000000000000..c94b86c17d7e
--- /dev/null
+++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/ListViolationsRequest.java
@@ -0,0 +1,1400 @@
+/*
+ * Copyright 2020 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.
+ */
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: google/cloud/assuredworkloads/v1/assuredworkloads.proto
+
+package com.google.cloud.assuredworkloads.v1;
+
+/**
+ *
+ *
+ * 
+ * Request for fetching violations in an organization.
+ * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1.ListViolationsRequest} + */ +public final class ListViolationsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.assuredworkloads.v1.ListViolationsRequest) + ListViolationsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListViolationsRequest.newBuilder() to construct. + private ListViolationsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListViolationsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListViolationsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_ListViolationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_ListViolationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1.ListViolationsRequest.class, + com.google.cloud.assuredworkloads.v1.ListViolationsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The Workload name.
+   * Format `organizations/{org_id}/locations/{location}/workloads/{workload}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The Workload name.
+   * Format `organizations/{org_id}/locations/{location}/workloads/{workload}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INTERVAL_FIELD_NUMBER = 2; + private com.google.cloud.assuredworkloads.v1.TimeWindow interval_; + /** + * + * + *
+   * Optional. Specifies the time window for retrieving active Violations.
+   * When specified, retrieves Violations that were active between start_time
+   * and end_time.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1.TimeWindow interval = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the interval field is set. + */ + @java.lang.Override + public boolean hasInterval() { + return interval_ != null; + } + /** + * + * + *
+   * Optional. Specifies the time window for retrieving active Violations.
+   * When specified, retrieves Violations that were active between start_time
+   * and end_time.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1.TimeWindow interval = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The interval. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.TimeWindow getInterval() { + return interval_ == null + ? com.google.cloud.assuredworkloads.v1.TimeWindow.getDefaultInstance() + : interval_; + } + /** + * + * + *
+   * Optional. Specifies the time window for retrieving active Violations.
+   * When specified, retrieves Violations that were active between start_time
+   * and end_time.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1.TimeWindow interval = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.TimeWindowOrBuilder getIntervalOrBuilder() { + return getInterval(); + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * Optional. Page size.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Optional. Page token returned from previous request.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Page token returned from previous request.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 5; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Optional. A custom filter for filtering by the Violations properties.
+   * 
+ * + * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A custom filter for filtering by the Violations properties.
+   * 
+ * + * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (interval_ != null) { + output.writeMessage(2, getInterval()); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, filter_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (interval_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getInterval()); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, filter_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.assuredworkloads.v1.ListViolationsRequest)) { + return super.equals(obj); + } + com.google.cloud.assuredworkloads.v1.ListViolationsRequest other = + (com.google.cloud.assuredworkloads.v1.ListViolationsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasInterval() != other.hasInterval()) return false; + if (hasInterval()) { + if (!getInterval().equals(other.getInterval())) return false; + } + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasInterval()) { + hash = (37 * hash) + INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getInterval().hashCode(); + } + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.assuredworkloads.v1.ListViolationsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.ListViolationsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.ListViolationsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.ListViolationsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.ListViolationsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.ListViolationsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.ListViolationsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.ListViolationsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.ListViolationsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.ListViolationsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.ListViolationsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.ListViolationsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.assuredworkloads.v1.ListViolationsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for fetching violations in an organization.
+   * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1.ListViolationsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.assuredworkloads.v1.ListViolationsRequest) + com.google.cloud.assuredworkloads.v1.ListViolationsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_ListViolationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_ListViolationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1.ListViolationsRequest.class, + com.google.cloud.assuredworkloads.v1.ListViolationsRequest.Builder.class); + } + + // Construct using com.google.cloud.assuredworkloads.v1.ListViolationsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (intervalBuilder_ == null) { + interval_ = null; + } else { + interval_ = null; + intervalBuilder_ = null; + } + pageSize_ = 0; + + pageToken_ = ""; + + filter_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_ListViolationsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.ListViolationsRequest getDefaultInstanceForType() { + return com.google.cloud.assuredworkloads.v1.ListViolationsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.ListViolationsRequest build() { + com.google.cloud.assuredworkloads.v1.ListViolationsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.ListViolationsRequest buildPartial() { + com.google.cloud.assuredworkloads.v1.ListViolationsRequest result = + new com.google.cloud.assuredworkloads.v1.ListViolationsRequest(this); + result.parent_ = parent_; + if (intervalBuilder_ == null) { + result.interval_ = interval_; + } else { + result.interval_ = intervalBuilder_.build(); + } + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.assuredworkloads.v1.ListViolationsRequest) { + return mergeFrom((com.google.cloud.assuredworkloads.v1.ListViolationsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.assuredworkloads.v1.ListViolationsRequest other) { + if (other == com.google.cloud.assuredworkloads.v1.ListViolationsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasInterval()) { + mergeInterval(other.getInterval()); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getIntervalFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 24: + { + pageSize_ = input.readInt32(); + + break; + } // case 24 + case 34: + { + pageToken_ = input.readStringRequireUtf8(); + + break; + } // case 34 + case 42: + { + filter_ = input.readStringRequireUtf8(); + + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The Workload name.
+     * Format `organizations/{org_id}/locations/{location}/workloads/{workload}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The Workload name.
+     * Format `organizations/{org_id}/locations/{location}/workloads/{workload}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The Workload name.
+     * Format `organizations/{org_id}/locations/{location}/workloads/{workload}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Workload name.
+     * Format `organizations/{org_id}/locations/{location}/workloads/{workload}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Workload name.
+     * Format `organizations/{org_id}/locations/{location}/workloads/{workload}`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.cloud.assuredworkloads.v1.TimeWindow interval_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1.TimeWindow, + com.google.cloud.assuredworkloads.v1.TimeWindow.Builder, + com.google.cloud.assuredworkloads.v1.TimeWindowOrBuilder> + intervalBuilder_; + /** + * + * + *
+     * Optional. Specifies the time window for retrieving active Violations.
+     * When specified, retrieves Violations that were active between start_time
+     * and end_time.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.TimeWindow interval = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the interval field is set. + */ + public boolean hasInterval() { + return intervalBuilder_ != null || interval_ != null; + } + /** + * + * + *
+     * Optional. Specifies the time window for retrieving active Violations.
+     * When specified, retrieves Violations that were active between start_time
+     * and end_time.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.TimeWindow interval = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The interval. + */ + public com.google.cloud.assuredworkloads.v1.TimeWindow getInterval() { + if (intervalBuilder_ == null) { + return interval_ == null + ? com.google.cloud.assuredworkloads.v1.TimeWindow.getDefaultInstance() + : interval_; + } else { + return intervalBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Specifies the time window for retrieving active Violations.
+     * When specified, retrieves Violations that were active between start_time
+     * and end_time.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.TimeWindow interval = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setInterval(com.google.cloud.assuredworkloads.v1.TimeWindow value) { + if (intervalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + interval_ = value; + onChanged(); + } else { + intervalBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Specifies the time window for retrieving active Violations.
+     * When specified, retrieves Violations that were active between start_time
+     * and end_time.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.TimeWindow interval = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setInterval( + com.google.cloud.assuredworkloads.v1.TimeWindow.Builder builderForValue) { + if (intervalBuilder_ == null) { + interval_ = builderForValue.build(); + onChanged(); + } else { + intervalBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Specifies the time window for retrieving active Violations.
+     * When specified, retrieves Violations that were active between start_time
+     * and end_time.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.TimeWindow interval = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeInterval(com.google.cloud.assuredworkloads.v1.TimeWindow value) { + if (intervalBuilder_ == null) { + if (interval_ != null) { + interval_ = + com.google.cloud.assuredworkloads.v1.TimeWindow.newBuilder(interval_) + .mergeFrom(value) + .buildPartial(); + } else { + interval_ = value; + } + onChanged(); + } else { + intervalBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Specifies the time window for retrieving active Violations.
+     * When specified, retrieves Violations that were active between start_time
+     * and end_time.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.TimeWindow interval = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearInterval() { + if (intervalBuilder_ == null) { + interval_ = null; + onChanged(); + } else { + interval_ = null; + intervalBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Specifies the time window for retrieving active Violations.
+     * When specified, retrieves Violations that were active between start_time
+     * and end_time.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.TimeWindow interval = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.assuredworkloads.v1.TimeWindow.Builder getIntervalBuilder() { + + onChanged(); + return getIntervalFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Specifies the time window for retrieving active Violations.
+     * When specified, retrieves Violations that were active between start_time
+     * and end_time.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.TimeWindow interval = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.assuredworkloads.v1.TimeWindowOrBuilder getIntervalOrBuilder() { + if (intervalBuilder_ != null) { + return intervalBuilder_.getMessageOrBuilder(); + } else { + return interval_ == null + ? com.google.cloud.assuredworkloads.v1.TimeWindow.getDefaultInstance() + : interval_; + } + } + /** + * + * + *
+     * Optional. Specifies the time window for retrieving active Violations.
+     * When specified, retrieves Violations that were active between start_time
+     * and end_time.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.TimeWindow interval = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1.TimeWindow, + com.google.cloud.assuredworkloads.v1.TimeWindow.Builder, + com.google.cloud.assuredworkloads.v1.TimeWindowOrBuilder> + getIntervalFieldBuilder() { + if (intervalBuilder_ == null) { + intervalBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1.TimeWindow, + com.google.cloud.assuredworkloads.v1.TimeWindow.Builder, + com.google.cloud.assuredworkloads.v1.TimeWindowOrBuilder>( + getInterval(), getParentForChildren(), isClean()); + interval_ = null; + } + return intervalBuilder_; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. Page size.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. Page size.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Page size.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. Page token returned from previous request.
+     * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Page token returned from previous request.
+     * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Page token returned from previous request.
+     * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Page token returned from previous request.
+     * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Page token returned from previous request.
+     * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. A custom filter for filtering by the Violations properties.
+     * 
+ * + * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A custom filter for filtering by the Violations properties.
+     * 
+ * + * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A custom filter for filtering by the Violations properties.
+     * 
+ * + * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A custom filter for filtering by the Violations properties.
+     * 
+ * + * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A custom filter for filtering by the Violations properties.
+     * 
+ * + * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.assuredworkloads.v1.ListViolationsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.assuredworkloads.v1.ListViolationsRequest) + private static final com.google.cloud.assuredworkloads.v1.ListViolationsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.assuredworkloads.v1.ListViolationsRequest(); + } + + public static com.google.cloud.assuredworkloads.v1.ListViolationsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListViolationsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.ListViolationsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/ListViolationsRequestOrBuilder.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/ListViolationsRequestOrBuilder.java new file mode 100644 index 000000000000..e51421042aed --- /dev/null +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/ListViolationsRequestOrBuilder.java @@ -0,0 +1,166 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/assuredworkloads/v1/assuredworkloads.proto + +package com.google.cloud.assuredworkloads.v1; + +public interface ListViolationsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1.ListViolationsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The Workload name.
+   * Format `organizations/{org_id}/locations/{location}/workloads/{workload}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The Workload name.
+   * Format `organizations/{org_id}/locations/{location}/workloads/{workload}`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Specifies the time window for retrieving active Violations.
+   * When specified, retrieves Violations that were active between start_time
+   * and end_time.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1.TimeWindow interval = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the interval field is set. + */ + boolean hasInterval(); + /** + * + * + *
+   * Optional. Specifies the time window for retrieving active Violations.
+   * When specified, retrieves Violations that were active between start_time
+   * and end_time.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1.TimeWindow interval = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The interval. + */ + com.google.cloud.assuredworkloads.v1.TimeWindow getInterval(); + /** + * + * + *
+   * Optional. Specifies the time window for retrieving active Violations.
+   * When specified, retrieves Violations that were active between start_time
+   * and end_time.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1.TimeWindow interval = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.assuredworkloads.v1.TimeWindowOrBuilder getIntervalOrBuilder(); + + /** + * + * + *
+   * Optional. Page size.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. Page token returned from previous request.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. Page token returned from previous request.
+   * 
+ * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. A custom filter for filtering by the Violations properties.
+   * 
+ * + * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. A custom filter for filtering by the Violations properties.
+   * 
+ * + * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); +} diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/ListViolationsResponse.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/ListViolationsResponse.java new file mode 100644 index 000000000000..37e8bea73951 --- /dev/null +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/ListViolationsResponse.java @@ -0,0 +1,1108 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/assuredworkloads/v1/assuredworkloads.proto + +package com.google.cloud.assuredworkloads.v1; + +/** + * + * + *
+ * Response of ListViolations endpoint.
+ * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1.ListViolationsResponse} + */ +public final class ListViolationsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.assuredworkloads.v1.ListViolationsResponse) + ListViolationsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListViolationsResponse.newBuilder() to construct. + private ListViolationsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListViolationsResponse() { + violations_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListViolationsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_ListViolationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_ListViolationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1.ListViolationsResponse.class, + com.google.cloud.assuredworkloads.v1.ListViolationsResponse.Builder.class); + } + + public static final int VIOLATIONS_FIELD_NUMBER = 1; + private java.util.List violations_; + /** + * + * + *
+   * List of Violations under a Workload.
+   * 
+ * + * repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + @java.lang.Override + public java.util.List getViolationsList() { + return violations_; + } + /** + * + * + *
+   * List of Violations under a Workload.
+   * 
+ * + * repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + @java.lang.Override + public java.util.List + getViolationsOrBuilderList() { + return violations_; + } + /** + * + * + *
+   * List of Violations under a Workload.
+   * 
+ * + * repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + @java.lang.Override + public int getViolationsCount() { + return violations_.size(); + } + /** + * + * + *
+   * List of Violations under a Workload.
+   * 
+ * + * repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation getViolations(int index) { + return violations_.get(index); + } + /** + * + * + *
+   * List of Violations under a Workload.
+   * 
+ * + * repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.ViolationOrBuilder getViolationsOrBuilder(int index) { + return violations_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * The next page token. Returns empty if reached the last page.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The next page token. Returns empty if reached the last page.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < violations_.size(); i++) { + output.writeMessage(1, violations_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < violations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, violations_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.assuredworkloads.v1.ListViolationsResponse)) { + return super.equals(obj); + } + com.google.cloud.assuredworkloads.v1.ListViolationsResponse other = + (com.google.cloud.assuredworkloads.v1.ListViolationsResponse) obj; + + if (!getViolationsList().equals(other.getViolationsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getViolationsCount() > 0) { + hash = (37 * hash) + VIOLATIONS_FIELD_NUMBER; + hash = (53 * hash) + getViolationsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.assuredworkloads.v1.ListViolationsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.ListViolationsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.ListViolationsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.ListViolationsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.ListViolationsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.ListViolationsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.ListViolationsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.ListViolationsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.ListViolationsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.ListViolationsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.ListViolationsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.ListViolationsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.assuredworkloads.v1.ListViolationsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response of ListViolations endpoint.
+   * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1.ListViolationsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.assuredworkloads.v1.ListViolationsResponse) + com.google.cloud.assuredworkloads.v1.ListViolationsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_ListViolationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_ListViolationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1.ListViolationsResponse.class, + com.google.cloud.assuredworkloads.v1.ListViolationsResponse.Builder.class); + } + + // Construct using com.google.cloud.assuredworkloads.v1.ListViolationsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (violationsBuilder_ == null) { + violations_ = java.util.Collections.emptyList(); + } else { + violations_ = null; + violationsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_ListViolationsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.ListViolationsResponse getDefaultInstanceForType() { + return com.google.cloud.assuredworkloads.v1.ListViolationsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.ListViolationsResponse build() { + com.google.cloud.assuredworkloads.v1.ListViolationsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.ListViolationsResponse buildPartial() { + com.google.cloud.assuredworkloads.v1.ListViolationsResponse result = + new com.google.cloud.assuredworkloads.v1.ListViolationsResponse(this); + int from_bitField0_ = bitField0_; + if (violationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + violations_ = java.util.Collections.unmodifiableList(violations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.violations_ = violations_; + } else { + result.violations_ = violationsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.assuredworkloads.v1.ListViolationsResponse) { + return mergeFrom((com.google.cloud.assuredworkloads.v1.ListViolationsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.assuredworkloads.v1.ListViolationsResponse other) { + if (other == com.google.cloud.assuredworkloads.v1.ListViolationsResponse.getDefaultInstance()) + return this; + if (violationsBuilder_ == null) { + if (!other.violations_.isEmpty()) { + if (violations_.isEmpty()) { + violations_ = other.violations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureViolationsIsMutable(); + violations_.addAll(other.violations_); + } + onChanged(); + } + } else { + if (!other.violations_.isEmpty()) { + if (violationsBuilder_.isEmpty()) { + violationsBuilder_.dispose(); + violationsBuilder_ = null; + violations_ = other.violations_; + bitField0_ = (bitField0_ & ~0x00000001); + violationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getViolationsFieldBuilder() + : null; + } else { + violationsBuilder_.addAllMessages(other.violations_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.assuredworkloads.v1.Violation m = + input.readMessage( + com.google.cloud.assuredworkloads.v1.Violation.parser(), extensionRegistry); + if (violationsBuilder_ == null) { + ensureViolationsIsMutable(); + violations_.add(m); + } else { + violationsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List violations_ = + java.util.Collections.emptyList(); + + private void ensureViolationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + violations_ = + new java.util.ArrayList(violations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.assuredworkloads.v1.Violation, + com.google.cloud.assuredworkloads.v1.Violation.Builder, + com.google.cloud.assuredworkloads.v1.ViolationOrBuilder> + violationsBuilder_; + + /** + * + * + *
+     * List of Violations under a Workload.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + public java.util.List getViolationsList() { + if (violationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(violations_); + } else { + return violationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of Violations under a Workload.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + public int getViolationsCount() { + if (violationsBuilder_ == null) { + return violations_.size(); + } else { + return violationsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of Violations under a Workload.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + public com.google.cloud.assuredworkloads.v1.Violation getViolations(int index) { + if (violationsBuilder_ == null) { + return violations_.get(index); + } else { + return violationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of Violations under a Workload.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + public Builder setViolations(int index, com.google.cloud.assuredworkloads.v1.Violation value) { + if (violationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureViolationsIsMutable(); + violations_.set(index, value); + onChanged(); + } else { + violationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of Violations under a Workload.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + public Builder setViolations( + int index, com.google.cloud.assuredworkloads.v1.Violation.Builder builderForValue) { + if (violationsBuilder_ == null) { + ensureViolationsIsMutable(); + violations_.set(index, builderForValue.build()); + onChanged(); + } else { + violationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of Violations under a Workload.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + public Builder addViolations(com.google.cloud.assuredworkloads.v1.Violation value) { + if (violationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureViolationsIsMutable(); + violations_.add(value); + onChanged(); + } else { + violationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of Violations under a Workload.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + public Builder addViolations(int index, com.google.cloud.assuredworkloads.v1.Violation value) { + if (violationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureViolationsIsMutable(); + violations_.add(index, value); + onChanged(); + } else { + violationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of Violations under a Workload.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + public Builder addViolations( + com.google.cloud.assuredworkloads.v1.Violation.Builder builderForValue) { + if (violationsBuilder_ == null) { + ensureViolationsIsMutable(); + violations_.add(builderForValue.build()); + onChanged(); + } else { + violationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of Violations under a Workload.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + public Builder addViolations( + int index, com.google.cloud.assuredworkloads.v1.Violation.Builder builderForValue) { + if (violationsBuilder_ == null) { + ensureViolationsIsMutable(); + violations_.add(index, builderForValue.build()); + onChanged(); + } else { + violationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of Violations under a Workload.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + public Builder addAllViolations( + java.lang.Iterable values) { + if (violationsBuilder_ == null) { + ensureViolationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, violations_); + onChanged(); + } else { + violationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of Violations under a Workload.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + public Builder clearViolations() { + if (violationsBuilder_ == null) { + violations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + violationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of Violations under a Workload.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + public Builder removeViolations(int index) { + if (violationsBuilder_ == null) { + ensureViolationsIsMutable(); + violations_.remove(index); + onChanged(); + } else { + violationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of Violations under a Workload.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + public com.google.cloud.assuredworkloads.v1.Violation.Builder getViolationsBuilder(int index) { + return getViolationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of Violations under a Workload.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + public com.google.cloud.assuredworkloads.v1.ViolationOrBuilder getViolationsOrBuilder( + int index) { + if (violationsBuilder_ == null) { + return violations_.get(index); + } else { + return violationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of Violations under a Workload.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + public java.util.List + getViolationsOrBuilderList() { + if (violationsBuilder_ != null) { + return violationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(violations_); + } + } + /** + * + * + *
+     * List of Violations under a Workload.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + public com.google.cloud.assuredworkloads.v1.Violation.Builder addViolationsBuilder() { + return getViolationsFieldBuilder() + .addBuilder(com.google.cloud.assuredworkloads.v1.Violation.getDefaultInstance()); + } + /** + * + * + *
+     * List of Violations under a Workload.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + public com.google.cloud.assuredworkloads.v1.Violation.Builder addViolationsBuilder(int index) { + return getViolationsFieldBuilder() + .addBuilder(index, com.google.cloud.assuredworkloads.v1.Violation.getDefaultInstance()); + } + /** + * + * + *
+     * List of Violations under a Workload.
+     * 
+ * + * repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + public java.util.List + getViolationsBuilderList() { + return getViolationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.assuredworkloads.v1.Violation, + com.google.cloud.assuredworkloads.v1.Violation.Builder, + com.google.cloud.assuredworkloads.v1.ViolationOrBuilder> + getViolationsFieldBuilder() { + if (violationsBuilder_ == null) { + violationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.assuredworkloads.v1.Violation, + com.google.cloud.assuredworkloads.v1.Violation.Builder, + com.google.cloud.assuredworkloads.v1.ViolationOrBuilder>( + violations_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + violations_ = null; + } + return violationsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * The next page token. Returns empty if reached the last page.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The next page token. Returns empty if reached the last page.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The next page token. Returns empty if reached the last page.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The next page token. Returns empty if reached the last page.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The next page token. Returns empty if reached the last page.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.assuredworkloads.v1.ListViolationsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.assuredworkloads.v1.ListViolationsResponse) + private static final com.google.cloud.assuredworkloads.v1.ListViolationsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.assuredworkloads.v1.ListViolationsResponse(); + } + + public static com.google.cloud.assuredworkloads.v1.ListViolationsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListViolationsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.ListViolationsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/ListViolationsResponseOrBuilder.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/ListViolationsResponseOrBuilder.java new file mode 100644 index 000000000000..baff259159cd --- /dev/null +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/ListViolationsResponseOrBuilder.java @@ -0,0 +1,102 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/assuredworkloads/v1/assuredworkloads.proto + +package com.google.cloud.assuredworkloads.v1; + +public interface ListViolationsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1.ListViolationsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of Violations under a Workload.
+   * 
+ * + * repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + java.util.List getViolationsList(); + /** + * + * + *
+   * List of Violations under a Workload.
+   * 
+ * + * repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + com.google.cloud.assuredworkloads.v1.Violation getViolations(int index); + /** + * + * + *
+   * List of Violations under a Workload.
+   * 
+ * + * repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + int getViolationsCount(); + /** + * + * + *
+   * List of Violations under a Workload.
+   * 
+ * + * repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + java.util.List + getViolationsOrBuilderList(); + /** + * + * + *
+   * List of Violations under a Workload.
+   * 
+ * + * repeated .google.cloud.assuredworkloads.v1.Violation violations = 1; + */ + com.google.cloud.assuredworkloads.v1.ViolationOrBuilder getViolationsOrBuilder(int index); + + /** + * + * + *
+   * The next page token. Returns empty if reached the last page.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * The next page token. Returns empty if reached the last page.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/ListWorkloadsRequest.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/ListWorkloadsRequest.java index 7fa3f28d1191..a3cba284028a 100644 --- a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/ListWorkloadsRequest.java +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/ListWorkloadsRequest.java @@ -54,71 +54,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private ListWorkloadsRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 16: - { - pageSize_ = input.readInt32(); - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); - - filter_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1_ListWorkloadsRequest_descriptor; @@ -337,7 +272,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -358,7 +293,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -378,7 +313,7 @@ public boolean equals(final java.lang.Object obj) { if (getPageSize() != other.getPageSize()) return false; if (!getPageToken().equals(other.getPageToken())) return false; if (!getFilter().equals(other.getFilter())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -397,7 +332,7 @@ public int hashCode() { hash = (53 * hash) + getPageToken().hashCode(); hash = (37 * hash) + FILTER_FIELD_NUMBER; hash = (53 * hash) + getFilter().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -527,17 +462,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.assuredworkloads.v1.ListWorkloadsRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -647,7 +575,7 @@ public Builder mergeFrom(com.google.cloud.assuredworkloads.v1.ListWorkloadsReque filter_ = other.filter_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -662,18 +590,55 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1.ListWorkloadsRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1.ListWorkloadsRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1109,7 +1074,18 @@ public ListWorkloadsRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ListWorkloadsRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/ListWorkloadsResponse.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/ListWorkloadsResponse.java index 509615c280e6..a025bf3c604e 100644 --- a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/ListWorkloadsResponse.java +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/ListWorkloadsResponse.java @@ -53,68 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private ListWorkloadsResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - workloads_ = - new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - workloads_.add( - input.readMessage( - com.google.cloud.assuredworkloads.v1.Workload.parser(), extensionRegistry)); - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - nextPageToken_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - workloads_ = java.util.Collections.unmodifiableList(workloads_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1_ListWorkloadsResponse_descriptor; @@ -268,7 +206,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -283,7 +221,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -301,7 +239,7 @@ public boolean equals(final java.lang.Object obj) { if (!getWorkloadsList().equals(other.getWorkloadsList())) return false; if (!getNextPageToken().equals(other.getNextPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -318,7 +256,7 @@ public int hashCode() { } hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -448,19 +386,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.assuredworkloads.v1.ListWorkloadsResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getWorkloadsFieldBuilder(); - } } @java.lang.Override @@ -468,10 +397,11 @@ public Builder clear() { super.clear(); if (workloadsBuilder_ == null) { workloads_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + workloads_ = null; workloadsBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); nextPageToken_ = ""; return this; @@ -593,7 +523,7 @@ public Builder mergeFrom(com.google.cloud.assuredworkloads.v1.ListWorkloadsRespo nextPageToken_ = other.nextPageToken_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -608,18 +538,50 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1.ListWorkloadsResponse parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.assuredworkloads.v1.Workload m = + input.readMessage( + com.google.cloud.assuredworkloads.v1.Workload.parser(), extensionRegistry); + if (workloadsBuilder_ == null) { + ensureWorkloadsIsMutable(); + workloads_.add(m); + } else { + workloadsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1.ListWorkloadsResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1114,7 +1076,18 @@ public ListWorkloadsResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ListWorkloadsResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/RestrictAllowedResourcesRequest.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/RestrictAllowedResourcesRequest.java new file mode 100644 index 000000000000..fc25bff40f07 --- /dev/null +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/RestrictAllowedResourcesRequest.java @@ -0,0 +1,1006 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/assuredworkloads/v1/assuredworkloads.proto + +package com.google.cloud.assuredworkloads.v1; + +/** + * + * + *
+ * Request for restricting list of available resources in Workload environment.
+ * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest} + */ +public final class RestrictAllowedResourcesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest) + RestrictAllowedResourcesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RestrictAllowedResourcesRequest.newBuilder() to construct. + private RestrictAllowedResourcesRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RestrictAllowedResourcesRequest() { + name_ = ""; + restrictionType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RestrictAllowedResourcesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_RestrictAllowedResourcesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_RestrictAllowedResourcesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.class, + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.Builder.class); + } + + /** + * + * + *
+   * The type of restriction.
+   * 
+ * + * Protobuf enum {@code + * google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType} + */ + public enum RestrictionType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unknown restriction type.
+     * 
+ * + * RESTRICTION_TYPE_UNSPECIFIED = 0; + */ + RESTRICTION_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Allow the use all of all gcp products, irrespective of the compliance
+     * posture. This effectively removes gcp.restrictServiceUsage OrgPolicy
+     * on the AssuredWorkloads Folder.
+     * 
+ * + * ALLOW_ALL_GCP_RESOURCES = 1; + */ + ALLOW_ALL_GCP_RESOURCES(1), + /** + * + * + *
+     * Based on Workload's compliance regime, allowed list changes.
+     * See - https://cloud.google.com/assured-workloads/docs/supported-products
+     * for the list of supported resources.
+     * 
+ * + * ALLOW_COMPLIANT_RESOURCES = 2; + */ + ALLOW_COMPLIANT_RESOURCES(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unknown restriction type.
+     * 
+ * + * RESTRICTION_TYPE_UNSPECIFIED = 0; + */ + public static final int RESTRICTION_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Allow the use all of all gcp products, irrespective of the compliance
+     * posture. This effectively removes gcp.restrictServiceUsage OrgPolicy
+     * on the AssuredWorkloads Folder.
+     * 
+ * + * ALLOW_ALL_GCP_RESOURCES = 1; + */ + public static final int ALLOW_ALL_GCP_RESOURCES_VALUE = 1; + /** + * + * + *
+     * Based on Workload's compliance regime, allowed list changes.
+     * See - https://cloud.google.com/assured-workloads/docs/supported-products
+     * for the list of supported resources.
+     * 
+ * + * ALLOW_COMPLIANT_RESOURCES = 2; + */ + public static final int ALLOW_COMPLIANT_RESOURCES_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RestrictionType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static RestrictionType forNumber(int value) { + switch (value) { + case 0: + return RESTRICTION_TYPE_UNSPECIFIED; + case 1: + return ALLOW_ALL_GCP_RESOURCES; + case 2: + return ALLOW_COMPLIANT_RESOURCES; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public RestrictionType findValueByNumber(int number) { + return RestrictionType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final RestrictionType[] VALUES = values(); + + public static RestrictionType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private RestrictionType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the Workload. This is the workloads's
+   * relative path in the API, formatted as
+   * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
+   * For example,
+   * "organizations/123/locations/us-east1/workloads/assured-workload-1".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the Workload. This is the workloads's
+   * relative path in the API, formatted as
+   * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
+   * For example,
+   * "organizations/123/locations/us-east1/workloads/assured-workload-1".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESTRICTION_TYPE_FIELD_NUMBER = 2; + private int restrictionType_; + /** + * + * + *
+   * Required. The type of restriction for using gcp products in the Workload environment.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType restriction_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for restrictionType. + */ + @java.lang.Override + public int getRestrictionTypeValue() { + return restrictionType_; + } + /** + * + * + *
+   * Required. The type of restriction for using gcp products in the Workload environment.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType restriction_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The restrictionType. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType + getRestrictionType() { + @SuppressWarnings("deprecation") + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType result = + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType + .valueOf(restrictionType_); + return result == null + ? com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType + .UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (restrictionType_ + != com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType + .RESTRICTION_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, restrictionType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (restrictionType_ + != com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType + .RESTRICTION_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, restrictionType_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest)) { + return super.equals(obj); + } + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest other = + (com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (restrictionType_ != other.restrictionType_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + RESTRICTION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + restrictionType_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for restricting list of available resources in Workload environment.
+   * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest) + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_RestrictAllowedResourcesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_RestrictAllowedResourcesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.class, + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.Builder.class); + } + + // Construct using + // com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + restrictionType_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_RestrictAllowedResourcesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest + getDefaultInstanceForType() { + return com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest build() { + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest buildPartial() { + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest result = + new com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest(this); + result.name_ = name_; + result.restrictionType_ = restrictionType_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest) { + return mergeFrom( + (com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest other) { + if (other + == com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.restrictionType_ != 0) { + setRestrictionTypeValue(other.getRestrictionTypeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + restrictionType_ = input.readEnum(); + + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the Workload. This is the workloads's
+     * relative path in the API, formatted as
+     * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
+     * For example,
+     * "organizations/123/locations/us-east1/workloads/assured-workload-1".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Workload. This is the workloads's
+     * relative path in the API, formatted as
+     * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
+     * For example,
+     * "organizations/123/locations/us-east1/workloads/assured-workload-1".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Workload. This is the workloads's
+     * relative path in the API, formatted as
+     * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
+     * For example,
+     * "organizations/123/locations/us-east1/workloads/assured-workload-1".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Workload. This is the workloads's
+     * relative path in the API, formatted as
+     * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
+     * For example,
+     * "organizations/123/locations/us-east1/workloads/assured-workload-1".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Workload. This is the workloads's
+     * relative path in the API, formatted as
+     * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
+     * For example,
+     * "organizations/123/locations/us-east1/workloads/assured-workload-1".
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private int restrictionType_ = 0; + /** + * + * + *
+     * Required. The type of restriction for using gcp products in the Workload environment.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType restriction_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for restrictionType. + */ + @java.lang.Override + public int getRestrictionTypeValue() { + return restrictionType_; + } + /** + * + * + *
+     * Required. The type of restriction for using gcp products in the Workload environment.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType restriction_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for restrictionType to set. + * @return This builder for chaining. + */ + public Builder setRestrictionTypeValue(int value) { + + restrictionType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of restriction for using gcp products in the Workload environment.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType restriction_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The restrictionType. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType + getRestrictionType() { + @SuppressWarnings("deprecation") + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType result = + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType + .valueOf(restrictionType_); + return result == null + ? com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType + .UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. The type of restriction for using gcp products in the Workload environment.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType restriction_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The restrictionType to set. + * @return This builder for chaining. + */ + public Builder setRestrictionType( + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType + value) { + if (value == null) { + throw new NullPointerException(); + } + + restrictionType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of restriction for using gcp products in the Workload environment.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType restriction_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearRestrictionType() { + + restrictionType_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest) + private static final com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest(); + } + + public static com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RestrictAllowedResourcesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/RestrictAllowedResourcesRequestOrBuilder.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/RestrictAllowedResourcesRequestOrBuilder.java new file mode 100644 index 000000000000..6d4286951e8d --- /dev/null +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/RestrictAllowedResourcesRequestOrBuilder.java @@ -0,0 +1,88 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/assuredworkloads/v1/assuredworkloads.proto + +package com.google.cloud.assuredworkloads.v1; + +public interface RestrictAllowedResourcesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the Workload. This is the workloads's
+   * relative path in the API, formatted as
+   * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
+   * For example,
+   * "organizations/123/locations/us-east1/workloads/assured-workload-1".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the Workload. This is the workloads's
+   * relative path in the API, formatted as
+   * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
+   * For example,
+   * "organizations/123/locations/us-east1/workloads/assured-workload-1".
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The type of restriction for using gcp products in the Workload environment.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType restriction_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for restrictionType. + */ + int getRestrictionTypeValue(); + /** + * + * + *
+   * Required. The type of restriction for using gcp products in the Workload environment.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType restriction_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The restrictionType. + */ + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType + getRestrictionType(); +} diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/RestrictAllowedResourcesResponse.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/RestrictAllowedResourcesResponse.java new file mode 100644 index 000000000000..7161af62020d --- /dev/null +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/RestrictAllowedResourcesResponse.java @@ -0,0 +1,448 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/assuredworkloads/v1/assuredworkloads.proto + +package com.google.cloud.assuredworkloads.v1; + +/** + * + * + *
+ * Response for restricting the list of allowed resources.
+ * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse} + */ +public final class RestrictAllowedResourcesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse) + RestrictAllowedResourcesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use RestrictAllowedResourcesResponse.newBuilder() to construct. + private RestrictAllowedResourcesResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RestrictAllowedResourcesResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RestrictAllowedResourcesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_RestrictAllowedResourcesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_RestrictAllowedResourcesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse.class, + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse)) { + return super.equals(obj); + } + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse other = + (com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response for restricting the list of allowed resources.
+   * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse) + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_RestrictAllowedResourcesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_RestrictAllowedResourcesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse.class, + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse.Builder.class); + } + + // Construct using + // com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_RestrictAllowedResourcesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse + getDefaultInstanceForType() { + return com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse build() { + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse buildPartial() { + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse result = + new com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse) { + return mergeFrom( + (com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse other) { + if (other + == com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse + .getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse) + private static final com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse(); + } + + public static com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RestrictAllowedResourcesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/RestrictAllowedResourcesResponseOrBuilder.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/RestrictAllowedResourcesResponseOrBuilder.java new file mode 100644 index 000000000000..35028d694653 --- /dev/null +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/RestrictAllowedResourcesResponseOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/assuredworkloads/v1/assuredworkloads.proto + +package com.google.cloud.assuredworkloads.v1; + +public interface RestrictAllowedResourcesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/TimeWindow.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/TimeWindow.java new file mode 100644 index 000000000000..f30999852891 --- /dev/null +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/TimeWindow.java @@ -0,0 +1,954 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/assuredworkloads/v1/assuredworkloads.proto + +package com.google.cloud.assuredworkloads.v1; + +/** + * + * + *
+ * Interval defining a time window.
+ * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1.TimeWindow} + */ +public final class TimeWindow extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.assuredworkloads.v1.TimeWindow) + TimeWindowOrBuilder { + private static final long serialVersionUID = 0L; + // Use TimeWindow.newBuilder() to construct. + private TimeWindow(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TimeWindow() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TimeWindow(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_TimeWindow_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_TimeWindow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1.TimeWindow.class, + com.google.cloud.assuredworkloads.v1.TimeWindow.Builder.class); + } + + public static final int START_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+   * The start of the time window.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return startTime_ != null; + } + /** + * + * + *
+   * The start of the time window.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+   * The start of the time window.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return getStartTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * The end of the time window.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * The end of the time window.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * The end of the time window.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (startTime_ != null) { + output.writeMessage(1, getStartTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (startTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getStartTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.assuredworkloads.v1.TimeWindow)) { + return super.equals(obj); + } + com.google.cloud.assuredworkloads.v1.TimeWindow other = + (com.google.cloud.assuredworkloads.v1.TimeWindow) obj; + + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.assuredworkloads.v1.TimeWindow parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.TimeWindow parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.TimeWindow parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.TimeWindow parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.TimeWindow parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.TimeWindow parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.TimeWindow parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.TimeWindow parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.TimeWindow parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.TimeWindow parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.TimeWindow parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.TimeWindow parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.assuredworkloads.v1.TimeWindow prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Interval defining a time window.
+   * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1.TimeWindow} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.assuredworkloads.v1.TimeWindow) + com.google.cloud.assuredworkloads.v1.TimeWindowOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_TimeWindow_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_TimeWindow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1.TimeWindow.class, + com.google.cloud.assuredworkloads.v1.TimeWindow.Builder.class); + } + + // Construct using com.google.cloud.assuredworkloads.v1.TimeWindow.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (startTimeBuilder_ == null) { + startTime_ = null; + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_TimeWindow_descriptor; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.TimeWindow getDefaultInstanceForType() { + return com.google.cloud.assuredworkloads.v1.TimeWindow.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.TimeWindow build() { + com.google.cloud.assuredworkloads.v1.TimeWindow result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.TimeWindow buildPartial() { + com.google.cloud.assuredworkloads.v1.TimeWindow result = + new com.google.cloud.assuredworkloads.v1.TimeWindow(this); + if (startTimeBuilder_ == null) { + result.startTime_ = startTime_; + } else { + result.startTime_ = startTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.assuredworkloads.v1.TimeWindow) { + return mergeFrom((com.google.cloud.assuredworkloads.v1.TimeWindow) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.assuredworkloads.v1.TimeWindow other) { + if (other == com.google.cloud.assuredworkloads.v1.TimeWindow.getDefaultInstance()) + return this; + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+     * The start of the time window.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + * + * + *
+     * The start of the time window.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The start of the time window.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + onChanged(); + } else { + startTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The start of the time window.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + onChanged(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The start of the time window.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (startTime_ != null) { + startTime_ = + com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); + } else { + startTime_ = value; + } + onChanged(); + } else { + startTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The start of the time window.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + startTime_ = null; + onChanged(); + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The start of the time window.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The start of the time window.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + * + * + *
+     * The start of the time window.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * The end of the time window.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + * + * + *
+     * The end of the time window.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The end of the time window.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The end of the time window.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The end of the time window.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The end of the time window.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The end of the time window.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The end of the time window.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * The end of the time window.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.assuredworkloads.v1.TimeWindow) + } + + // @@protoc_insertion_point(class_scope:google.cloud.assuredworkloads.v1.TimeWindow) + private static final com.google.cloud.assuredworkloads.v1.TimeWindow DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.assuredworkloads.v1.TimeWindow(); + } + + public static com.google.cloud.assuredworkloads.v1.TimeWindow getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TimeWindow parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.TimeWindow getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/TimeWindowOrBuilder.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/TimeWindowOrBuilder.java new file mode 100644 index 000000000000..b6e920204849 --- /dev/null +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/TimeWindowOrBuilder.java @@ -0,0 +1,95 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/assuredworkloads/v1/assuredworkloads.proto + +package com.google.cloud.assuredworkloads.v1; + +public interface TimeWindowOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1.TimeWindow) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The start of the time window.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + * + * + *
+   * The start of the time window.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+   * The start of the time window.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * The end of the time window.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * The end of the time window.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * The end of the time window.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); +} diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/UpdateWorkloadRequest.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/UpdateWorkloadRequest.java index ceb0fbfa9502..b3d8a0c26b1f 100644 --- a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/UpdateWorkloadRequest.java +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/UpdateWorkloadRequest.java @@ -50,76 +50,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private UpdateWorkloadRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.assuredworkloads.v1.Workload.Builder subBuilder = null; - if (workload_ != null) { - subBuilder = workload_.toBuilder(); - } - workload_ = - input.readMessage( - com.google.cloud.assuredworkloads.v1.Workload.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(workload_); - workload_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.protobuf.FieldMask.Builder subBuilder = null; - if (updateMask_ != null) { - subBuilder = updateMask_.toBuilder(); - } - updateMask_ = - input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateMask_); - updateMask_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1_UpdateWorkloadRequest_descriptor; @@ -142,7 +72,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
    * Required. The workload to update.
-   * The workload’s `name` field is used to identify the workload to be updated.
+   * The workload's `name` field is used to identify the workload to be updated.
    * Format:
    * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
    * 
@@ -162,7 +92,7 @@ public boolean hasWorkload() { * *
    * Required. The workload to update.
-   * The workload’s `name` field is used to identify the workload to be updated.
+   * The workload's `name` field is used to identify the workload to be updated.
    * Format:
    * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
    * 
@@ -184,7 +114,7 @@ public com.google.cloud.assuredworkloads.v1.Workload getWorkload() { * *
    * Required. The workload to update.
-   * The workload’s `name` field is used to identify the workload to be updated.
+   * The workload's `name` field is used to identify the workload to be updated.
    * Format:
    * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
    * 
@@ -267,7 +197,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (updateMask_ != null) { output.writeMessage(2, getUpdateMask()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -282,7 +212,7 @@ public int getSerializedSize() { if (updateMask_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -306,7 +236,7 @@ public boolean equals(final java.lang.Object obj) { if (hasUpdateMask()) { if (!getUpdateMask().equals(other.getUpdateMask())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -325,7 +255,7 @@ public int hashCode() { hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; hash = (53 * hash) + getUpdateMask().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -455,17 +385,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.assuredworkloads.v1.UpdateWorkloadRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -576,7 +499,7 @@ public Builder mergeFrom(com.google.cloud.assuredworkloads.v1.UpdateWorkloadRequ if (other.hasUpdateMask()) { mergeUpdateMask(other.getUpdateMask()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -591,18 +514,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1.UpdateWorkloadRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getWorkloadFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1.UpdateWorkloadRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -617,7 +565,7 @@ public Builder mergeFrom( * *
      * Required. The workload to update.
-     * The workload’s `name` field is used to identify the workload to be updated.
+     * The workload's `name` field is used to identify the workload to be updated.
      * Format:
      * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
      * 
@@ -636,7 +584,7 @@ public boolean hasWorkload() { * *
      * Required. The workload to update.
-     * The workload’s `name` field is used to identify the workload to be updated.
+     * The workload's `name` field is used to identify the workload to be updated.
      * Format:
      * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
      * 
@@ -661,7 +609,7 @@ public com.google.cloud.assuredworkloads.v1.Workload getWorkload() { * *
      * Required. The workload to update.
-     * The workload’s `name` field is used to identify the workload to be updated.
+     * The workload's `name` field is used to identify the workload to be updated.
      * Format:
      * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
      * 
@@ -688,7 +636,7 @@ public Builder setWorkload(com.google.cloud.assuredworkloads.v1.Workload value) * *
      * Required. The workload to update.
-     * The workload’s `name` field is used to identify the workload to be updated.
+     * The workload's `name` field is used to identify the workload to be updated.
      * Format:
      * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
      * 
@@ -713,7 +661,7 @@ public Builder setWorkload( * *
      * Required. The workload to update.
-     * The workload’s `name` field is used to identify the workload to be updated.
+     * The workload's `name` field is used to identify the workload to be updated.
      * Format:
      * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
      * 
@@ -744,7 +692,7 @@ public Builder mergeWorkload(com.google.cloud.assuredworkloads.v1.Workload value * *
      * Required. The workload to update.
-     * The workload’s `name` field is used to identify the workload to be updated.
+     * The workload's `name` field is used to identify the workload to be updated.
      * Format:
      * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
      * 
@@ -769,7 +717,7 @@ public Builder clearWorkload() { * *
      * Required. The workload to update.
-     * The workload’s `name` field is used to identify the workload to be updated.
+     * The workload's `name` field is used to identify the workload to be updated.
      * Format:
      * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
      * 
@@ -788,7 +736,7 @@ public com.google.cloud.assuredworkloads.v1.Workload.Builder getWorkloadBuilder( * *
      * Required. The workload to update.
-     * The workload’s `name` field is used to identify the workload to be updated.
+     * The workload's `name` field is used to identify the workload to be updated.
      * Format:
      * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
      * 
@@ -811,7 +759,7 @@ public com.google.cloud.assuredworkloads.v1.WorkloadOrBuilder getWorkloadOrBuild * *
      * Required. The workload to update.
-     * The workload’s `name` field is used to identify the workload to be updated.
+     * The workload's `name` field is used to identify the workload to be updated.
      * Format:
      * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
      * 
@@ -1061,7 +1009,18 @@ public UpdateWorkloadRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new UpdateWorkloadRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/UpdateWorkloadRequestOrBuilder.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/UpdateWorkloadRequestOrBuilder.java index 61ac38192bfc..96a2d0117318 100644 --- a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/UpdateWorkloadRequestOrBuilder.java +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/UpdateWorkloadRequestOrBuilder.java @@ -28,7 +28,7 @@ public interface UpdateWorkloadRequestOrBuilder * *
    * Required. The workload to update.
-   * The workload’s `name` field is used to identify the workload to be updated.
+   * The workload's `name` field is used to identify the workload to be updated.
    * Format:
    * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
    * 
@@ -45,7 +45,7 @@ public interface UpdateWorkloadRequestOrBuilder * *
    * Required. The workload to update.
-   * The workload’s `name` field is used to identify the workload to be updated.
+   * The workload's `name` field is used to identify the workload to be updated.
    * Format:
    * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
    * 
@@ -62,7 +62,7 @@ public interface UpdateWorkloadRequestOrBuilder * *
    * Required. The workload to update.
-   * The workload’s `name` field is used to identify the workload to be updated.
+   * The workload's `name` field is used to identify the workload to be updated.
    * Format:
    * organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
    * 
diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/Violation.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/Violation.java new file mode 100644 index 000000000000..aed89a09383b --- /dev/null +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/Violation.java @@ -0,0 +1,9180 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/assuredworkloads/v1/assuredworkloads.proto + +package com.google.cloud.assuredworkloads.v1; + +/** + * + * + *
+ * Workload monitoring Violation.
+ * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1.Violation} + */ +public final class Violation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.assuredworkloads.v1.Violation) + ViolationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Violation.newBuilder() to construct. + private Violation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Violation() { + name_ = ""; + description_ = ""; + category_ = ""; + state_ = 0; + orgPolicyConstraint_ = ""; + auditLogLink_ = ""; + nonCompliantOrgPolicy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Violation(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_Violation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_Violation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1.Violation.class, + com.google.cloud.assuredworkloads.v1.Violation.Builder.class); + } + + /** + * + * + *
+   * Violation State Values
+   * 
+ * + * Protobuf enum {@code google.cloud.assuredworkloads.v1.Violation.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Violation is resolved.
+     * 
+ * + * RESOLVED = 2; + */ + RESOLVED(2), + /** + * + * + *
+     * Violation is Unresolved
+     * 
+ * + * UNRESOLVED = 3; + */ + UNRESOLVED(3), + /** + * + * + *
+     * Violation is Exception
+     * 
+ * + * EXCEPTION = 4; + */ + EXCEPTION(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Violation is resolved.
+     * 
+ * + * RESOLVED = 2; + */ + public static final int RESOLVED_VALUE = 2; + /** + * + * + *
+     * Violation is Unresolved
+     * 
+ * + * UNRESOLVED = 3; + */ + public static final int UNRESOLVED_VALUE = 3; + /** + * + * + *
+     * Violation is Exception
+     * 
+ * + * EXCEPTION = 4; + */ + public static final int EXCEPTION_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 2: + return RESOLVED; + case 3: + return UNRESOLVED; + case 4: + return EXCEPTION; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.Violation.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.assuredworkloads.v1.Violation.State) + } + + public interface RemediationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1.Violation.Remediation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. Remediation instructions to resolve violations
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instructions field is set. + */ + boolean hasInstructions(); + /** + * + * + *
+     * Required. Remediation instructions to resolve violations
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instructions. + */ + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions getInstructions(); + /** + * + * + *
+     * Required. Remediation instructions to resolve violations
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.assuredworkloads.v1.Violation.Remediation.InstructionsOrBuilder + getInstructionsOrBuilder(); + + /** + * + * + *
+     * Values that can resolve the violation
+     * For example: for list org policy violations, this will either be the list
+     * of allowed or denied values
+     * 
+ * + * repeated string compliant_values = 2; + * + * @return A list containing the compliantValues. + */ + java.util.List getCompliantValuesList(); + /** + * + * + *
+     * Values that can resolve the violation
+     * For example: for list org policy violations, this will either be the list
+     * of allowed or denied values
+     * 
+ * + * repeated string compliant_values = 2; + * + * @return The count of compliantValues. + */ + int getCompliantValuesCount(); + /** + * + * + *
+     * Values that can resolve the violation
+     * For example: for list org policy violations, this will either be the list
+     * of allowed or denied values
+     * 
+ * + * repeated string compliant_values = 2; + * + * @param index The index of the element to return. + * @return The compliantValues at the given index. + */ + java.lang.String getCompliantValues(int index); + /** + * + * + *
+     * Values that can resolve the violation
+     * For example: for list org policy violations, this will either be the list
+     * of allowed or denied values
+     * 
+ * + * repeated string compliant_values = 2; + * + * @param index The index of the value to return. + * @return The bytes of the compliantValues at the given index. + */ + com.google.protobuf.ByteString getCompliantValuesBytes(int index); + + /** + * + * + *
+     * Output only. Reemediation type based on the type of org policy values violated
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for remediationType. + */ + int getRemediationTypeValue(); + /** + * + * + *
+     * Output only. Reemediation type based on the type of org policy values violated
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The remediationType. + */ + com.google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType getRemediationType(); + } + /** + * + * + *
+   * Represents remediation guidance to resolve compliance violation for
+   * AssuredWorkload
+   * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1.Violation.Remediation} + */ + public static final class Remediation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.assuredworkloads.v1.Violation.Remediation) + RemediationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Remediation.newBuilder() to construct. + private Remediation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Remediation() { + compliantValues_ = com.google.protobuf.LazyStringArrayList.EMPTY; + remediationType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Remediation(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1.Violation.Remediation.class, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Builder.class); + } + + /** + * + * + *
+     * Classifying remediation into various types based on the kind of
+     * violation. For example, violations caused due to changes in boolean org
+     * policy requires different remediation instructions compared to violation
+     * caused due to changes in allowed values of list org policy.
+     * 
+ * + * Protobuf enum {@code google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType} + */ + public enum RemediationType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Unspecified remediation type
+       * 
+ * + * REMEDIATION_TYPE_UNSPECIFIED = 0; + */ + REMEDIATION_TYPE_UNSPECIFIED(0), + /** + * + * + *
+       * Remediation type for boolean org policy
+       * 
+ * + * REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION = 1; + */ + REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION(1), + /** + * + * + *
+       * Remediation type for list org policy which have allowed values in the
+       * monitoring rule
+       * 
+ * + * REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION = 2; + */ + REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION(2), + /** + * + * + *
+       * Remediation type for list org policy which have denied values in the
+       * monitoring rule
+       * 
+ * + * REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION = 3; + */ + REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION(3), + /** + * + * + *
+       * Remediation type for gcp.restrictCmekCryptoKeyProjects
+       * 
+ * + * REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION = 4; + */ + REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Unspecified remediation type
+       * 
+ * + * REMEDIATION_TYPE_UNSPECIFIED = 0; + */ + public static final int REMEDIATION_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Remediation type for boolean org policy
+       * 
+ * + * REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION = 1; + */ + public static final int REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION_VALUE = 1; + /** + * + * + *
+       * Remediation type for list org policy which have allowed values in the
+       * monitoring rule
+       * 
+ * + * REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION = 2; + */ + public static final int REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION_VALUE = 2; + /** + * + * + *
+       * Remediation type for list org policy which have denied values in the
+       * monitoring rule
+       * 
+ * + * REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION = 3; + */ + public static final int REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION_VALUE = 3; + /** + * + * + *
+       * Remediation type for gcp.restrictCmekCryptoKeyProjects
+       * 
+ * + * REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION = 4; + */ + public static final int + REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RemediationType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static RemediationType forNumber(int value) { + switch (value) { + case 0: + return REMEDIATION_TYPE_UNSPECIFIED; + case 1: + return REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION; + case 2: + return REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION; + case 3: + return REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION; + case 4: + return REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public RemediationType findValueByNumber(int number) { + return RemediationType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.Violation.Remediation.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final RemediationType[] VALUES = values(); + + public static RemediationType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private RemediationType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType) + } + + public interface InstructionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Remediation instructions to resolve violation via gcloud cli
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + * + * @return Whether the gcloudInstructions field is set. + */ + boolean hasGcloudInstructions(); + /** + * + * + *
+       * Remediation instructions to resolve violation via gcloud cli
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + * + * @return The gcloudInstructions. + */ + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + getGcloudInstructions(); + /** + * + * + *
+       * Remediation instructions to resolve violation via gcloud cli
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + */ + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.GcloudOrBuilder + getGcloudInstructionsOrBuilder(); + + /** + * + * + *
+       * Remediation instructions to resolve violation via cloud console
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + * + * @return Whether the consoleInstructions field is set. + */ + boolean hasConsoleInstructions(); + /** + * + * + *
+       * Remediation instructions to resolve violation via cloud console
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + * + * @return The consoleInstructions. + */ + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + getConsoleInstructions(); + /** + * + * + *
+       * Remediation instructions to resolve violation via cloud console
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + */ + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.ConsoleOrBuilder + getConsoleInstructionsOrBuilder(); + } + /** + * + * + *
+     * Instructions to remediate violation
+     * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions} + */ + public static final class Instructions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions) + InstructionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use Instructions.newBuilder() to construct. + private Instructions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Instructions() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Instructions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.class, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Builder + .class); + } + + public interface GcloudOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+         * Gcloud command to resolve violation
+         * 
+ * + * repeated string gcloud_commands = 1; + * + * @return A list containing the gcloudCommands. + */ + java.util.List getGcloudCommandsList(); + /** + * + * + *
+         * Gcloud command to resolve violation
+         * 
+ * + * repeated string gcloud_commands = 1; + * + * @return The count of gcloudCommands. + */ + int getGcloudCommandsCount(); + /** + * + * + *
+         * Gcloud command to resolve violation
+         * 
+ * + * repeated string gcloud_commands = 1; + * + * @param index The index of the element to return. + * @return The gcloudCommands at the given index. + */ + java.lang.String getGcloudCommands(int index); + /** + * + * + *
+         * Gcloud command to resolve violation
+         * 
+ * + * repeated string gcloud_commands = 1; + * + * @param index The index of the value to return. + * @return The bytes of the gcloudCommands at the given index. + */ + com.google.protobuf.ByteString getGcloudCommandsBytes(int index); + + /** + * + * + *
+         * Steps to resolve violation via gcloud cli
+         * 
+ * + * repeated string steps = 2; + * + * @return A list containing the steps. + */ + java.util.List getStepsList(); + /** + * + * + *
+         * Steps to resolve violation via gcloud cli
+         * 
+ * + * repeated string steps = 2; + * + * @return The count of steps. + */ + int getStepsCount(); + /** + * + * + *
+         * Steps to resolve violation via gcloud cli
+         * 
+ * + * repeated string steps = 2; + * + * @param index The index of the element to return. + * @return The steps at the given index. + */ + java.lang.String getSteps(int index); + /** + * + * + *
+         * Steps to resolve violation via gcloud cli
+         * 
+ * + * repeated string steps = 2; + * + * @param index The index of the value to return. + * @return The bytes of the steps at the given index. + */ + com.google.protobuf.ByteString getStepsBytes(int index); + + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @return A list containing the additionalLinks. + */ + java.util.List getAdditionalLinksList(); + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @return The count of additionalLinks. + */ + int getAdditionalLinksCount(); + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the element to return. + * @return The additionalLinks at the given index. + */ + java.lang.String getAdditionalLinks(int index); + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the value to return. + * @return The bytes of the additionalLinks at the given index. + */ + com.google.protobuf.ByteString getAdditionalLinksBytes(int index); + } + /** + * + * + *
+       * Remediation instructions to resolve violation via gcloud cli
+       * 
+ * + * Protobuf type {@code + * google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud} + */ + public static final class Gcloud extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud) + GcloudOrBuilder { + private static final long serialVersionUID = 0L; + // Use Gcloud.newBuilder() to construct. + private Gcloud(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Gcloud() { + gcloudCommands_ = com.google.protobuf.LazyStringArrayList.EMPTY; + steps_ = com.google.protobuf.LazyStringArrayList.EMPTY; + additionalLinks_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Gcloud(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_Gcloud_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_Gcloud_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + .class, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + .Builder.class); + } + + public static final int GCLOUD_COMMANDS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList gcloudCommands_; + /** + * + * + *
+         * Gcloud command to resolve violation
+         * 
+ * + * repeated string gcloud_commands = 1; + * + * @return A list containing the gcloudCommands. + */ + public com.google.protobuf.ProtocolStringList getGcloudCommandsList() { + return gcloudCommands_; + } + /** + * + * + *
+         * Gcloud command to resolve violation
+         * 
+ * + * repeated string gcloud_commands = 1; + * + * @return The count of gcloudCommands. + */ + public int getGcloudCommandsCount() { + return gcloudCommands_.size(); + } + /** + * + * + *
+         * Gcloud command to resolve violation
+         * 
+ * + * repeated string gcloud_commands = 1; + * + * @param index The index of the element to return. + * @return The gcloudCommands at the given index. + */ + public java.lang.String getGcloudCommands(int index) { + return gcloudCommands_.get(index); + } + /** + * + * + *
+         * Gcloud command to resolve violation
+         * 
+ * + * repeated string gcloud_commands = 1; + * + * @param index The index of the value to return. + * @return The bytes of the gcloudCommands at the given index. + */ + public com.google.protobuf.ByteString getGcloudCommandsBytes(int index) { + return gcloudCommands_.getByteString(index); + } + + public static final int STEPS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList steps_; + /** + * + * + *
+         * Steps to resolve violation via gcloud cli
+         * 
+ * + * repeated string steps = 2; + * + * @return A list containing the steps. + */ + public com.google.protobuf.ProtocolStringList getStepsList() { + return steps_; + } + /** + * + * + *
+         * Steps to resolve violation via gcloud cli
+         * 
+ * + * repeated string steps = 2; + * + * @return The count of steps. + */ + public int getStepsCount() { + return steps_.size(); + } + /** + * + * + *
+         * Steps to resolve violation via gcloud cli
+         * 
+ * + * repeated string steps = 2; + * + * @param index The index of the element to return. + * @return The steps at the given index. + */ + public java.lang.String getSteps(int index) { + return steps_.get(index); + } + /** + * + * + *
+         * Steps to resolve violation via gcloud cli
+         * 
+ * + * repeated string steps = 2; + * + * @param index The index of the value to return. + * @return The bytes of the steps at the given index. + */ + public com.google.protobuf.ByteString getStepsBytes(int index) { + return steps_.getByteString(index); + } + + public static final int ADDITIONAL_LINKS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList additionalLinks_; + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @return A list containing the additionalLinks. + */ + public com.google.protobuf.ProtocolStringList getAdditionalLinksList() { + return additionalLinks_; + } + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @return The count of additionalLinks. + */ + public int getAdditionalLinksCount() { + return additionalLinks_.size(); + } + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the element to return. + * @return The additionalLinks at the given index. + */ + public java.lang.String getAdditionalLinks(int index) { + return additionalLinks_.get(index); + } + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the value to return. + * @return The bytes of the additionalLinks at the given index. + */ + public com.google.protobuf.ByteString getAdditionalLinksBytes(int index) { + return additionalLinks_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < gcloudCommands_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 1, gcloudCommands_.getRaw(i)); + } + for (int i = 0; i < steps_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, steps_.getRaw(i)); + } + for (int i = 0; i < additionalLinks_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 3, additionalLinks_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < gcloudCommands_.size(); i++) { + dataSize += computeStringSizeNoTag(gcloudCommands_.getRaw(i)); + } + size += dataSize; + size += 1 * getGcloudCommandsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < steps_.size(); i++) { + dataSize += computeStringSizeNoTag(steps_.getRaw(i)); + } + size += dataSize; + size += 1 * getStepsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < additionalLinks_.size(); i++) { + dataSize += computeStringSizeNoTag(additionalLinks_.getRaw(i)); + } + size += dataSize; + size += 1 * getAdditionalLinksList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud)) { + return super.equals(obj); + } + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud other = + (com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud) obj; + + if (!getGcloudCommandsList().equals(other.getGcloudCommandsList())) return false; + if (!getStepsList().equals(other.getStepsList())) return false; + if (!getAdditionalLinksList().equals(other.getAdditionalLinksList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getGcloudCommandsCount() > 0) { + hash = (37 * hash) + GCLOUD_COMMANDS_FIELD_NUMBER; + hash = (53 * hash) + getGcloudCommandsList().hashCode(); + } + if (getStepsCount() > 0) { + hash = (37 * hash) + STEPS_FIELD_NUMBER; + hash = (53 * hash) + getStepsList().hashCode(); + } + if (getAdditionalLinksCount() > 0) { + hash = (37 * hash) + ADDITIONAL_LINKS_FIELD_NUMBER; + hash = (53 * hash) + getAdditionalLinksList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * Protobuf type {@code + * google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud) + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .GcloudOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_Gcloud_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_Gcloud_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + .class, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + .Builder.class); + } + + // Construct using + // com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + gcloudCommands_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + steps_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + additionalLinks_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_Gcloud_descriptor; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + getDefaultInstanceForType() { + return com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + build() { + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + buildPartial() { + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud result = + new com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud( + this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + gcloudCommands_ = gcloudCommands_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.gcloudCommands_ = gcloudCommands_; + if (((bitField0_ & 0x00000002) != 0)) { + steps_ = steps_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.steps_ = steps_; + if (((bitField0_ & 0x00000004) != 0)) { + additionalLinks_ = additionalLinks_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.additionalLinks_ = additionalLinks_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud) { + return mergeFrom( + (com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + other) { + if (other + == com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + .getDefaultInstance()) return this; + if (!other.gcloudCommands_.isEmpty()) { + if (gcloudCommands_.isEmpty()) { + gcloudCommands_ = other.gcloudCommands_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureGcloudCommandsIsMutable(); + gcloudCommands_.addAll(other.gcloudCommands_); + } + onChanged(); + } + if (!other.steps_.isEmpty()) { + if (steps_.isEmpty()) { + steps_ = other.steps_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureStepsIsMutable(); + steps_.addAll(other.steps_); + } + onChanged(); + } + if (!other.additionalLinks_.isEmpty()) { + if (additionalLinks_.isEmpty()) { + additionalLinks_ = other.additionalLinks_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureAdditionalLinksIsMutable(); + additionalLinks_.addAll(other.additionalLinks_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureGcloudCommandsIsMutable(); + gcloudCommands_.add(s); + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureStepsIsMutable(); + steps_.add(s); + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureAdditionalLinksIsMutable(); + additionalLinks_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList gcloudCommands_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureGcloudCommandsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + gcloudCommands_ = new com.google.protobuf.LazyStringArrayList(gcloudCommands_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+           * Gcloud command to resolve violation
+           * 
+ * + * repeated string gcloud_commands = 1; + * + * @return A list containing the gcloudCommands. + */ + public com.google.protobuf.ProtocolStringList getGcloudCommandsList() { + return gcloudCommands_.getUnmodifiableView(); + } + /** + * + * + *
+           * Gcloud command to resolve violation
+           * 
+ * + * repeated string gcloud_commands = 1; + * + * @return The count of gcloudCommands. + */ + public int getGcloudCommandsCount() { + return gcloudCommands_.size(); + } + /** + * + * + *
+           * Gcloud command to resolve violation
+           * 
+ * + * repeated string gcloud_commands = 1; + * + * @param index The index of the element to return. + * @return The gcloudCommands at the given index. + */ + public java.lang.String getGcloudCommands(int index) { + return gcloudCommands_.get(index); + } + /** + * + * + *
+           * Gcloud command to resolve violation
+           * 
+ * + * repeated string gcloud_commands = 1; + * + * @param index The index of the value to return. + * @return The bytes of the gcloudCommands at the given index. + */ + public com.google.protobuf.ByteString getGcloudCommandsBytes(int index) { + return gcloudCommands_.getByteString(index); + } + /** + * + * + *
+           * Gcloud command to resolve violation
+           * 
+ * + * repeated string gcloud_commands = 1; + * + * @param index The index to set the value at. + * @param value The gcloudCommands to set. + * @return This builder for chaining. + */ + public Builder setGcloudCommands(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureGcloudCommandsIsMutable(); + gcloudCommands_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+           * Gcloud command to resolve violation
+           * 
+ * + * repeated string gcloud_commands = 1; + * + * @param value The gcloudCommands to add. + * @return This builder for chaining. + */ + public Builder addGcloudCommands(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureGcloudCommandsIsMutable(); + gcloudCommands_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+           * Gcloud command to resolve violation
+           * 
+ * + * repeated string gcloud_commands = 1; + * + * @param values The gcloudCommands to add. + * @return This builder for chaining. + */ + public Builder addAllGcloudCommands(java.lang.Iterable values) { + ensureGcloudCommandsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, gcloudCommands_); + onChanged(); + return this; + } + /** + * + * + *
+           * Gcloud command to resolve violation
+           * 
+ * + * repeated string gcloud_commands = 1; + * + * @return This builder for chaining. + */ + public Builder clearGcloudCommands() { + gcloudCommands_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+           * Gcloud command to resolve violation
+           * 
+ * + * repeated string gcloud_commands = 1; + * + * @param value The bytes of the gcloudCommands to add. + * @return This builder for chaining. + */ + public Builder addGcloudCommandsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureGcloudCommandsIsMutable(); + gcloudCommands_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList steps_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureStepsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + steps_ = new com.google.protobuf.LazyStringArrayList(steps_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+           * Steps to resolve violation via gcloud cli
+           * 
+ * + * repeated string steps = 2; + * + * @return A list containing the steps. + */ + public com.google.protobuf.ProtocolStringList getStepsList() { + return steps_.getUnmodifiableView(); + } + /** + * + * + *
+           * Steps to resolve violation via gcloud cli
+           * 
+ * + * repeated string steps = 2; + * + * @return The count of steps. + */ + public int getStepsCount() { + return steps_.size(); + } + /** + * + * + *
+           * Steps to resolve violation via gcloud cli
+           * 
+ * + * repeated string steps = 2; + * + * @param index The index of the element to return. + * @return The steps at the given index. + */ + public java.lang.String getSteps(int index) { + return steps_.get(index); + } + /** + * + * + *
+           * Steps to resolve violation via gcloud cli
+           * 
+ * + * repeated string steps = 2; + * + * @param index The index of the value to return. + * @return The bytes of the steps at the given index. + */ + public com.google.protobuf.ByteString getStepsBytes(int index) { + return steps_.getByteString(index); + } + /** + * + * + *
+           * Steps to resolve violation via gcloud cli
+           * 
+ * + * repeated string steps = 2; + * + * @param index The index to set the value at. + * @param value The steps to set. + * @return This builder for chaining. + */ + public Builder setSteps(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureStepsIsMutable(); + steps_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+           * Steps to resolve violation via gcloud cli
+           * 
+ * + * repeated string steps = 2; + * + * @param value The steps to add. + * @return This builder for chaining. + */ + public Builder addSteps(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureStepsIsMutable(); + steps_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+           * Steps to resolve violation via gcloud cli
+           * 
+ * + * repeated string steps = 2; + * + * @param values The steps to add. + * @return This builder for chaining. + */ + public Builder addAllSteps(java.lang.Iterable values) { + ensureStepsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, steps_); + onChanged(); + return this; + } + /** + * + * + *
+           * Steps to resolve violation via gcloud cli
+           * 
+ * + * repeated string steps = 2; + * + * @return This builder for chaining. + */ + public Builder clearSteps() { + steps_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+           * Steps to resolve violation via gcloud cli
+           * 
+ * + * repeated string steps = 2; + * + * @param value The bytes of the steps to add. + * @return This builder for chaining. + */ + public Builder addStepsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureStepsIsMutable(); + steps_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList additionalLinks_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureAdditionalLinksIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + additionalLinks_ = new com.google.protobuf.LazyStringArrayList(additionalLinks_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @return A list containing the additionalLinks. + */ + public com.google.protobuf.ProtocolStringList getAdditionalLinksList() { + return additionalLinks_.getUnmodifiableView(); + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @return The count of additionalLinks. + */ + public int getAdditionalLinksCount() { + return additionalLinks_.size(); + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the element to return. + * @return The additionalLinks at the given index. + */ + public java.lang.String getAdditionalLinks(int index) { + return additionalLinks_.get(index); + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the value to return. + * @return The bytes of the additionalLinks at the given index. + */ + public com.google.protobuf.ByteString getAdditionalLinksBytes(int index) { + return additionalLinks_.getByteString(index); + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param index The index to set the value at. + * @param value The additionalLinks to set. + * @return This builder for chaining. + */ + public Builder setAdditionalLinks(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalLinksIsMutable(); + additionalLinks_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param value The additionalLinks to add. + * @return This builder for chaining. + */ + public Builder addAdditionalLinks(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalLinksIsMutable(); + additionalLinks_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param values The additionalLinks to add. + * @return This builder for chaining. + */ + public Builder addAllAdditionalLinks(java.lang.Iterable values) { + ensureAdditionalLinksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, additionalLinks_); + onChanged(); + return this; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @return This builder for chaining. + */ + public Builder clearAdditionalLinks() { + additionalLinks_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param value The bytes of the additionalLinks to add. + * @return This builder for chaining. + */ + public Builder addAdditionalLinksBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAdditionalLinksIsMutable(); + additionalLinks_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud) + } + + // @@protoc_insertion_point(class_scope:google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud) + private static final com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .Gcloud + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud(); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Gcloud parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ConsoleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+         * Link to console page where violations can be resolved
+         * 
+ * + * repeated string console_uris = 1; + * + * @return A list containing the consoleUris. + */ + java.util.List getConsoleUrisList(); + /** + * + * + *
+         * Link to console page where violations can be resolved
+         * 
+ * + * repeated string console_uris = 1; + * + * @return The count of consoleUris. + */ + int getConsoleUrisCount(); + /** + * + * + *
+         * Link to console page where violations can be resolved
+         * 
+ * + * repeated string console_uris = 1; + * + * @param index The index of the element to return. + * @return The consoleUris at the given index. + */ + java.lang.String getConsoleUris(int index); + /** + * + * + *
+         * Link to console page where violations can be resolved
+         * 
+ * + * repeated string console_uris = 1; + * + * @param index The index of the value to return. + * @return The bytes of the consoleUris at the given index. + */ + com.google.protobuf.ByteString getConsoleUrisBytes(int index); + + /** + * + * + *
+         * Steps to resolve violation via cloud console
+         * 
+ * + * repeated string steps = 2; + * + * @return A list containing the steps. + */ + java.util.List getStepsList(); + /** + * + * + *
+         * Steps to resolve violation via cloud console
+         * 
+ * + * repeated string steps = 2; + * + * @return The count of steps. + */ + int getStepsCount(); + /** + * + * + *
+         * Steps to resolve violation via cloud console
+         * 
+ * + * repeated string steps = 2; + * + * @param index The index of the element to return. + * @return The steps at the given index. + */ + java.lang.String getSteps(int index); + /** + * + * + *
+         * Steps to resolve violation via cloud console
+         * 
+ * + * repeated string steps = 2; + * + * @param index The index of the value to return. + * @return The bytes of the steps at the given index. + */ + com.google.protobuf.ByteString getStepsBytes(int index); + + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @return A list containing the additionalLinks. + */ + java.util.List getAdditionalLinksList(); + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @return The count of additionalLinks. + */ + int getAdditionalLinksCount(); + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the element to return. + * @return The additionalLinks at the given index. + */ + java.lang.String getAdditionalLinks(int index); + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the value to return. + * @return The bytes of the additionalLinks at the given index. + */ + com.google.protobuf.ByteString getAdditionalLinksBytes(int index); + } + /** + * + * + *
+       * Remediation instructions to resolve violation via cloud console
+       * 
+ * + * Protobuf type {@code + * google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console} + */ + public static final class Console extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console) + ConsoleOrBuilder { + private static final long serialVersionUID = 0L; + // Use Console.newBuilder() to construct. + private Console(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Console() { + consoleUris_ = com.google.protobuf.LazyStringArrayList.EMPTY; + steps_ = com.google.protobuf.LazyStringArrayList.EMPTY; + additionalLinks_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Console(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_Console_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_Console_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + .class, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + .Builder.class); + } + + public static final int CONSOLE_URIS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList consoleUris_; + /** + * + * + *
+         * Link to console page where violations can be resolved
+         * 
+ * + * repeated string console_uris = 1; + * + * @return A list containing the consoleUris. + */ + public com.google.protobuf.ProtocolStringList getConsoleUrisList() { + return consoleUris_; + } + /** + * + * + *
+         * Link to console page where violations can be resolved
+         * 
+ * + * repeated string console_uris = 1; + * + * @return The count of consoleUris. + */ + public int getConsoleUrisCount() { + return consoleUris_.size(); + } + /** + * + * + *
+         * Link to console page where violations can be resolved
+         * 
+ * + * repeated string console_uris = 1; + * + * @param index The index of the element to return. + * @return The consoleUris at the given index. + */ + public java.lang.String getConsoleUris(int index) { + return consoleUris_.get(index); + } + /** + * + * + *
+         * Link to console page where violations can be resolved
+         * 
+ * + * repeated string console_uris = 1; + * + * @param index The index of the value to return. + * @return The bytes of the consoleUris at the given index. + */ + public com.google.protobuf.ByteString getConsoleUrisBytes(int index) { + return consoleUris_.getByteString(index); + } + + public static final int STEPS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList steps_; + /** + * + * + *
+         * Steps to resolve violation via cloud console
+         * 
+ * + * repeated string steps = 2; + * + * @return A list containing the steps. + */ + public com.google.protobuf.ProtocolStringList getStepsList() { + return steps_; + } + /** + * + * + *
+         * Steps to resolve violation via cloud console
+         * 
+ * + * repeated string steps = 2; + * + * @return The count of steps. + */ + public int getStepsCount() { + return steps_.size(); + } + /** + * + * + *
+         * Steps to resolve violation via cloud console
+         * 
+ * + * repeated string steps = 2; + * + * @param index The index of the element to return. + * @return The steps at the given index. + */ + public java.lang.String getSteps(int index) { + return steps_.get(index); + } + /** + * + * + *
+         * Steps to resolve violation via cloud console
+         * 
+ * + * repeated string steps = 2; + * + * @param index The index of the value to return. + * @return The bytes of the steps at the given index. + */ + public com.google.protobuf.ByteString getStepsBytes(int index) { + return steps_.getByteString(index); + } + + public static final int ADDITIONAL_LINKS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList additionalLinks_; + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @return A list containing the additionalLinks. + */ + public com.google.protobuf.ProtocolStringList getAdditionalLinksList() { + return additionalLinks_; + } + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @return The count of additionalLinks. + */ + public int getAdditionalLinksCount() { + return additionalLinks_.size(); + } + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the element to return. + * @return The additionalLinks at the given index. + */ + public java.lang.String getAdditionalLinks(int index) { + return additionalLinks_.get(index); + } + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the value to return. + * @return The bytes of the additionalLinks at the given index. + */ + public com.google.protobuf.ByteString getAdditionalLinksBytes(int index) { + return additionalLinks_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < consoleUris_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, consoleUris_.getRaw(i)); + } + for (int i = 0; i < steps_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, steps_.getRaw(i)); + } + for (int i = 0; i < additionalLinks_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 3, additionalLinks_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < consoleUris_.size(); i++) { + dataSize += computeStringSizeNoTag(consoleUris_.getRaw(i)); + } + size += dataSize; + size += 1 * getConsoleUrisList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < steps_.size(); i++) { + dataSize += computeStringSizeNoTag(steps_.getRaw(i)); + } + size += dataSize; + size += 1 * getStepsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < additionalLinks_.size(); i++) { + dataSize += computeStringSizeNoTag(additionalLinks_.getRaw(i)); + } + size += dataSize; + size += 1 * getAdditionalLinksList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console)) { + return super.equals(obj); + } + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console other = + (com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console) obj; + + if (!getConsoleUrisList().equals(other.getConsoleUrisList())) return false; + if (!getStepsList().equals(other.getStepsList())) return false; + if (!getAdditionalLinksList().equals(other.getAdditionalLinksList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getConsoleUrisCount() > 0) { + hash = (37 * hash) + CONSOLE_URIS_FIELD_NUMBER; + hash = (53 * hash) + getConsoleUrisList().hashCode(); + } + if (getStepsCount() > 0) { + hash = (37 * hash) + STEPS_FIELD_NUMBER; + hash = (53 * hash) + getStepsList().hashCode(); + } + if (getAdditionalLinksCount() > 0) { + hash = (37 * hash) + ADDITIONAL_LINKS_FIELD_NUMBER; + hash = (53 * hash) + getAdditionalLinksList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .Console + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .Console + parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .Console + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .Console + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .Console + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .Console + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .Console + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .Console + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .Console + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .Console + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .Console + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .Console + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * Protobuf type {@code + * google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console) + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .ConsoleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_Console_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_Console_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + .class, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + .Builder.class); + } + + // Construct using + // com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + consoleUris_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + steps_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + additionalLinks_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_Console_descriptor; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + getDefaultInstanceForType() { + return com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + build() { + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + buildPartial() { + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console result = + new com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console( + this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + consoleUris_ = consoleUris_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.consoleUris_ = consoleUris_; + if (((bitField0_ & 0x00000002) != 0)) { + steps_ = steps_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.steps_ = steps_; + if (((bitField0_ & 0x00000004) != 0)) { + additionalLinks_ = additionalLinks_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.additionalLinks_ = additionalLinks_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console) { + return mergeFrom( + (com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + other) { + if (other + == com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + .getDefaultInstance()) return this; + if (!other.consoleUris_.isEmpty()) { + if (consoleUris_.isEmpty()) { + consoleUris_ = other.consoleUris_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureConsoleUrisIsMutable(); + consoleUris_.addAll(other.consoleUris_); + } + onChanged(); + } + if (!other.steps_.isEmpty()) { + if (steps_.isEmpty()) { + steps_ = other.steps_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureStepsIsMutable(); + steps_.addAll(other.steps_); + } + onChanged(); + } + if (!other.additionalLinks_.isEmpty()) { + if (additionalLinks_.isEmpty()) { + additionalLinks_ = other.additionalLinks_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureAdditionalLinksIsMutable(); + additionalLinks_.addAll(other.additionalLinks_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureConsoleUrisIsMutable(); + consoleUris_.add(s); + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureStepsIsMutable(); + steps_.add(s); + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureAdditionalLinksIsMutable(); + additionalLinks_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList consoleUris_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureConsoleUrisIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + consoleUris_ = new com.google.protobuf.LazyStringArrayList(consoleUris_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+           * Link to console page where violations can be resolved
+           * 
+ * + * repeated string console_uris = 1; + * + * @return A list containing the consoleUris. + */ + public com.google.protobuf.ProtocolStringList getConsoleUrisList() { + return consoleUris_.getUnmodifiableView(); + } + /** + * + * + *
+           * Link to console page where violations can be resolved
+           * 
+ * + * repeated string console_uris = 1; + * + * @return The count of consoleUris. + */ + public int getConsoleUrisCount() { + return consoleUris_.size(); + } + /** + * + * + *
+           * Link to console page where violations can be resolved
+           * 
+ * + * repeated string console_uris = 1; + * + * @param index The index of the element to return. + * @return The consoleUris at the given index. + */ + public java.lang.String getConsoleUris(int index) { + return consoleUris_.get(index); + } + /** + * + * + *
+           * Link to console page where violations can be resolved
+           * 
+ * + * repeated string console_uris = 1; + * + * @param index The index of the value to return. + * @return The bytes of the consoleUris at the given index. + */ + public com.google.protobuf.ByteString getConsoleUrisBytes(int index) { + return consoleUris_.getByteString(index); + } + /** + * + * + *
+           * Link to console page where violations can be resolved
+           * 
+ * + * repeated string console_uris = 1; + * + * @param index The index to set the value at. + * @param value The consoleUris to set. + * @return This builder for chaining. + */ + public Builder setConsoleUris(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureConsoleUrisIsMutable(); + consoleUris_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+           * Link to console page where violations can be resolved
+           * 
+ * + * repeated string console_uris = 1; + * + * @param value The consoleUris to add. + * @return This builder for chaining. + */ + public Builder addConsoleUris(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureConsoleUrisIsMutable(); + consoleUris_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+           * Link to console page where violations can be resolved
+           * 
+ * + * repeated string console_uris = 1; + * + * @param values The consoleUris to add. + * @return This builder for chaining. + */ + public Builder addAllConsoleUris(java.lang.Iterable values) { + ensureConsoleUrisIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, consoleUris_); + onChanged(); + return this; + } + /** + * + * + *
+           * Link to console page where violations can be resolved
+           * 
+ * + * repeated string console_uris = 1; + * + * @return This builder for chaining. + */ + public Builder clearConsoleUris() { + consoleUris_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+           * Link to console page where violations can be resolved
+           * 
+ * + * repeated string console_uris = 1; + * + * @param value The bytes of the consoleUris to add. + * @return This builder for chaining. + */ + public Builder addConsoleUrisBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureConsoleUrisIsMutable(); + consoleUris_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList steps_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureStepsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + steps_ = new com.google.protobuf.LazyStringArrayList(steps_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+           * Steps to resolve violation via cloud console
+           * 
+ * + * repeated string steps = 2; + * + * @return A list containing the steps. + */ + public com.google.protobuf.ProtocolStringList getStepsList() { + return steps_.getUnmodifiableView(); + } + /** + * + * + *
+           * Steps to resolve violation via cloud console
+           * 
+ * + * repeated string steps = 2; + * + * @return The count of steps. + */ + public int getStepsCount() { + return steps_.size(); + } + /** + * + * + *
+           * Steps to resolve violation via cloud console
+           * 
+ * + * repeated string steps = 2; + * + * @param index The index of the element to return. + * @return The steps at the given index. + */ + public java.lang.String getSteps(int index) { + return steps_.get(index); + } + /** + * + * + *
+           * Steps to resolve violation via cloud console
+           * 
+ * + * repeated string steps = 2; + * + * @param index The index of the value to return. + * @return The bytes of the steps at the given index. + */ + public com.google.protobuf.ByteString getStepsBytes(int index) { + return steps_.getByteString(index); + } + /** + * + * + *
+           * Steps to resolve violation via cloud console
+           * 
+ * + * repeated string steps = 2; + * + * @param index The index to set the value at. + * @param value The steps to set. + * @return This builder for chaining. + */ + public Builder setSteps(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureStepsIsMutable(); + steps_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+           * Steps to resolve violation via cloud console
+           * 
+ * + * repeated string steps = 2; + * + * @param value The steps to add. + * @return This builder for chaining. + */ + public Builder addSteps(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureStepsIsMutable(); + steps_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+           * Steps to resolve violation via cloud console
+           * 
+ * + * repeated string steps = 2; + * + * @param values The steps to add. + * @return This builder for chaining. + */ + public Builder addAllSteps(java.lang.Iterable values) { + ensureStepsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, steps_); + onChanged(); + return this; + } + /** + * + * + *
+           * Steps to resolve violation via cloud console
+           * 
+ * + * repeated string steps = 2; + * + * @return This builder for chaining. + */ + public Builder clearSteps() { + steps_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+           * Steps to resolve violation via cloud console
+           * 
+ * + * repeated string steps = 2; + * + * @param value The bytes of the steps to add. + * @return This builder for chaining. + */ + public Builder addStepsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureStepsIsMutable(); + steps_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList additionalLinks_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureAdditionalLinksIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + additionalLinks_ = new com.google.protobuf.LazyStringArrayList(additionalLinks_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @return A list containing the additionalLinks. + */ + public com.google.protobuf.ProtocolStringList getAdditionalLinksList() { + return additionalLinks_.getUnmodifiableView(); + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @return The count of additionalLinks. + */ + public int getAdditionalLinksCount() { + return additionalLinks_.size(); + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the element to return. + * @return The additionalLinks at the given index. + */ + public java.lang.String getAdditionalLinks(int index) { + return additionalLinks_.get(index); + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the value to return. + * @return The bytes of the additionalLinks at the given index. + */ + public com.google.protobuf.ByteString getAdditionalLinksBytes(int index) { + return additionalLinks_.getByteString(index); + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param index The index to set the value at. + * @param value The additionalLinks to set. + * @return This builder for chaining. + */ + public Builder setAdditionalLinks(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalLinksIsMutable(); + additionalLinks_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param value The additionalLinks to add. + * @return This builder for chaining. + */ + public Builder addAdditionalLinks(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalLinksIsMutable(); + additionalLinks_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param values The additionalLinks to add. + * @return This builder for chaining. + */ + public Builder addAllAdditionalLinks(java.lang.Iterable values) { + ensureAdditionalLinksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, additionalLinks_); + onChanged(); + return this; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @return This builder for chaining. + */ + public Builder clearAdditionalLinks() { + additionalLinks_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param value The bytes of the additionalLinks to add. + * @return This builder for chaining. + */ + public Builder addAdditionalLinksBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAdditionalLinksIsMutable(); + additionalLinks_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console) + } + + // @@protoc_insertion_point(class_scope:google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console) + private static final com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .Console + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console(); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .Console + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Console parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int GCLOUD_INSTRUCTIONS_FIELD_NUMBER = 1; + private com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + gcloudInstructions_; + /** + * + * + *
+       * Remediation instructions to resolve violation via gcloud cli
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + * + * @return Whether the gcloudInstructions field is set. + */ + @java.lang.Override + public boolean hasGcloudInstructions() { + return gcloudInstructions_ != null; + } + /** + * + * + *
+       * Remediation instructions to resolve violation via gcloud cli
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + * + * @return The gcloudInstructions. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + getGcloudInstructions() { + return gcloudInstructions_ == null + ? com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + .getDefaultInstance() + : gcloudInstructions_; + } + /** + * + * + *
+       * Remediation instructions to resolve violation via gcloud cli
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.GcloudOrBuilder + getGcloudInstructionsOrBuilder() { + return getGcloudInstructions(); + } + + public static final int CONSOLE_INSTRUCTIONS_FIELD_NUMBER = 2; + private com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + consoleInstructions_; + /** + * + * + *
+       * Remediation instructions to resolve violation via cloud console
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + * + * @return Whether the consoleInstructions field is set. + */ + @java.lang.Override + public boolean hasConsoleInstructions() { + return consoleInstructions_ != null; + } + /** + * + * + *
+       * Remediation instructions to resolve violation via cloud console
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + * + * @return The consoleInstructions. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + getConsoleInstructions() { + return consoleInstructions_ == null + ? com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + .getDefaultInstance() + : consoleInstructions_; + } + /** + * + * + *
+       * Remediation instructions to resolve violation via cloud console
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .ConsoleOrBuilder + getConsoleInstructionsOrBuilder() { + return getConsoleInstructions(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (gcloudInstructions_ != null) { + output.writeMessage(1, getGcloudInstructions()); + } + if (consoleInstructions_ != null) { + output.writeMessage(2, getConsoleInstructions()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (gcloudInstructions_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, getGcloudInstructions()); + } + if (consoleInstructions_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, getConsoleInstructions()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions)) { + return super.equals(obj); + } + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions other = + (com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions) obj; + + if (hasGcloudInstructions() != other.hasGcloudInstructions()) return false; + if (hasGcloudInstructions()) { + if (!getGcloudInstructions().equals(other.getGcloudInstructions())) return false; + } + if (hasConsoleInstructions() != other.hasConsoleInstructions()) return false; + if (hasConsoleInstructions()) { + if (!getConsoleInstructions().equals(other.getConsoleInstructions())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasGcloudInstructions()) { + hash = (37 * hash) + GCLOUD_INSTRUCTIONS_FIELD_NUMBER; + hash = (53 * hash) + getGcloudInstructions().hashCode(); + } + if (hasConsoleInstructions()) { + hash = (37 * hash) + CONSOLE_INSTRUCTIONS_FIELD_NUMBER; + hash = (53 * hash) + getConsoleInstructions().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+       * Instructions to remediate violation
+       * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions) + com.google.cloud.assuredworkloads.v1.Violation.Remediation.InstructionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.class, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Builder + .class); + } + + // Construct using + // com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (gcloudInstructionsBuilder_ == null) { + gcloudInstructions_ = null; + } else { + gcloudInstructions_ = null; + gcloudInstructionsBuilder_ = null; + } + if (consoleInstructionsBuilder_ == null) { + consoleInstructions_ = null; + } else { + consoleInstructions_ = null; + consoleInstructionsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_Instructions_descriptor; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + getDefaultInstanceForType() { + return com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions build() { + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + buildPartial() { + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions result = + new com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions(this); + if (gcloudInstructionsBuilder_ == null) { + result.gcloudInstructions_ = gcloudInstructions_; + } else { + result.gcloudInstructions_ = gcloudInstructionsBuilder_.build(); + } + if (consoleInstructionsBuilder_ == null) { + result.consoleInstructions_ = consoleInstructions_; + } else { + result.consoleInstructions_ = consoleInstructionsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions) { + return mergeFrom( + (com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions other) { + if (other + == com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .getDefaultInstance()) return this; + if (other.hasGcloudInstructions()) { + mergeGcloudInstructions(other.getGcloudInstructions()); + } + if (other.hasConsoleInstructions()) { + mergeConsoleInstructions(other.getConsoleInstructions()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getGcloudInstructionsFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage( + getConsoleInstructionsFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + gcloudInstructions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + .Builder, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .GcloudOrBuilder> + gcloudInstructionsBuilder_; + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + * + * @return Whether the gcloudInstructions field is set. + */ + public boolean hasGcloudInstructions() { + return gcloudInstructionsBuilder_ != null || gcloudInstructions_ != null; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + * + * @return The gcloudInstructions. + */ + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + getGcloudInstructions() { + if (gcloudInstructionsBuilder_ == null) { + return gcloudInstructions_ == null + ? com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + .getDefaultInstance() + : gcloudInstructions_; + } else { + return gcloudInstructionsBuilder_.getMessage(); + } + } + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + */ + public Builder setGcloudInstructions( + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud value) { + if (gcloudInstructionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + gcloudInstructions_ = value; + onChanged(); + } else { + gcloudInstructionsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + */ + public Builder setGcloudInstructions( + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud.Builder + builderForValue) { + if (gcloudInstructionsBuilder_ == null) { + gcloudInstructions_ = builderForValue.build(); + onChanged(); + } else { + gcloudInstructionsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + */ + public Builder mergeGcloudInstructions( + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud value) { + if (gcloudInstructionsBuilder_ == null) { + if (gcloudInstructions_ != null) { + gcloudInstructions_ = + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + .newBuilder(gcloudInstructions_) + .mergeFrom(value) + .buildPartial(); + } else { + gcloudInstructions_ = value; + } + onChanged(); + } else { + gcloudInstructionsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + */ + public Builder clearGcloudInstructions() { + if (gcloudInstructionsBuilder_ == null) { + gcloudInstructions_ = null; + onChanged(); + } else { + gcloudInstructions_ = null; + gcloudInstructionsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + */ + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + .Builder + getGcloudInstructionsBuilder() { + + onChanged(); + return getGcloudInstructionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + */ + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .GcloudOrBuilder + getGcloudInstructionsOrBuilder() { + if (gcloudInstructionsBuilder_ != null) { + return gcloudInstructionsBuilder_.getMessageOrBuilder(); + } else { + return gcloudInstructions_ == null + ? com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + .getDefaultInstance() + : gcloudInstructions_; + } + } + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + .Builder, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .GcloudOrBuilder> + getGcloudInstructionsFieldBuilder() { + if (gcloudInstructionsBuilder_ == null) { + gcloudInstructionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + .Builder, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .GcloudOrBuilder>( + getGcloudInstructions(), getParentForChildren(), isClean()); + gcloudInstructions_ = null; + } + return gcloudInstructionsBuilder_; + } + + private com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + consoleInstructions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + .Builder, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .ConsoleOrBuilder> + consoleInstructionsBuilder_; + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + * + * @return Whether the consoleInstructions field is set. + */ + public boolean hasConsoleInstructions() { + return consoleInstructionsBuilder_ != null || consoleInstructions_ != null; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + * + * @return The consoleInstructions. + */ + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + getConsoleInstructions() { + if (consoleInstructionsBuilder_ == null) { + return consoleInstructions_ == null + ? com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + .getDefaultInstance() + : consoleInstructions_; + } else { + return consoleInstructionsBuilder_.getMessage(); + } + } + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + */ + public Builder setConsoleInstructions( + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console value) { + if (consoleInstructionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + consoleInstructions_ = value; + onChanged(); + } else { + consoleInstructionsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + */ + public Builder setConsoleInstructions( + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console.Builder + builderForValue) { + if (consoleInstructionsBuilder_ == null) { + consoleInstructions_ = builderForValue.build(); + onChanged(); + } else { + consoleInstructionsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + */ + public Builder mergeConsoleInstructions( + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console value) { + if (consoleInstructionsBuilder_ == null) { + if (consoleInstructions_ != null) { + consoleInstructions_ = + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + .newBuilder(consoleInstructions_) + .mergeFrom(value) + .buildPartial(); + } else { + consoleInstructions_ = value; + } + onChanged(); + } else { + consoleInstructionsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + */ + public Builder clearConsoleInstructions() { + if (consoleInstructionsBuilder_ == null) { + consoleInstructions_ = null; + onChanged(); + } else { + consoleInstructions_ = null; + consoleInstructionsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + */ + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + .Builder + getConsoleInstructionsBuilder() { + + onChanged(); + return getConsoleInstructionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + */ + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .ConsoleOrBuilder + getConsoleInstructionsOrBuilder() { + if (consoleInstructionsBuilder_ != null) { + return consoleInstructionsBuilder_.getMessageOrBuilder(); + } else { + return consoleInstructions_ == null + ? com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + .getDefaultInstance() + : consoleInstructions_; + } + } + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + .Builder, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .ConsoleOrBuilder> + getConsoleInstructionsFieldBuilder() { + if (consoleInstructionsBuilder_ == null) { + consoleInstructionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + .Builder, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .ConsoleOrBuilder>( + getConsoleInstructions(), getParentForChildren(), isClean()); + consoleInstructions_ = null; + } + return consoleInstructionsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions) + private static final com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions(); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Instructions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int INSTRUCTIONS_FIELD_NUMBER = 1; + private com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions instructions_; + /** + * + * + *
+     * Required. Remediation instructions to resolve violations
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instructions field is set. + */ + @java.lang.Override + public boolean hasInstructions() { + return instructions_ != null; + } + /** + * + * + *
+     * Required. Remediation instructions to resolve violations
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instructions. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + getInstructions() { + return instructions_ == null + ? com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .getDefaultInstance() + : instructions_; + } + /** + * + * + *
+     * Required. Remediation instructions to resolve violations
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.InstructionsOrBuilder + getInstructionsOrBuilder() { + return getInstructions(); + } + + public static final int COMPLIANT_VALUES_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList compliantValues_; + /** + * + * + *
+     * Values that can resolve the violation
+     * For example: for list org policy violations, this will either be the list
+     * of allowed or denied values
+     * 
+ * + * repeated string compliant_values = 2; + * + * @return A list containing the compliantValues. + */ + public com.google.protobuf.ProtocolStringList getCompliantValuesList() { + return compliantValues_; + } + /** + * + * + *
+     * Values that can resolve the violation
+     * For example: for list org policy violations, this will either be the list
+     * of allowed or denied values
+     * 
+ * + * repeated string compliant_values = 2; + * + * @return The count of compliantValues. + */ + public int getCompliantValuesCount() { + return compliantValues_.size(); + } + /** + * + * + *
+     * Values that can resolve the violation
+     * For example: for list org policy violations, this will either be the list
+     * of allowed or denied values
+     * 
+ * + * repeated string compliant_values = 2; + * + * @param index The index of the element to return. + * @return The compliantValues at the given index. + */ + public java.lang.String getCompliantValues(int index) { + return compliantValues_.get(index); + } + /** + * + * + *
+     * Values that can resolve the violation
+     * For example: for list org policy violations, this will either be the list
+     * of allowed or denied values
+     * 
+ * + * repeated string compliant_values = 2; + * + * @param index The index of the value to return. + * @return The bytes of the compliantValues at the given index. + */ + public com.google.protobuf.ByteString getCompliantValuesBytes(int index) { + return compliantValues_.getByteString(index); + } + + public static final int REMEDIATION_TYPE_FIELD_NUMBER = 3; + private int remediationType_; + /** + * + * + *
+     * Output only. Reemediation type based on the type of org policy values violated
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for remediationType. + */ + @java.lang.Override + public int getRemediationTypeValue() { + return remediationType_; + } + /** + * + * + *
+     * Output only. Reemediation type based on the type of org policy values violated
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The remediationType. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType + getRemediationType() { + @SuppressWarnings("deprecation") + com.google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType result = + com.google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType.valueOf( + remediationType_); + return result == null + ? com.google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (instructions_ != null) { + output.writeMessage(1, getInstructions()); + } + for (int i = 0; i < compliantValues_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, compliantValues_.getRaw(i)); + } + if (remediationType_ + != com.google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType + .REMEDIATION_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, remediationType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (instructions_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getInstructions()); + } + { + int dataSize = 0; + for (int i = 0; i < compliantValues_.size(); i++) { + dataSize += computeStringSizeNoTag(compliantValues_.getRaw(i)); + } + size += dataSize; + size += 1 * getCompliantValuesList().size(); + } + if (remediationType_ + != com.google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType + .REMEDIATION_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, remediationType_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.assuredworkloads.v1.Violation.Remediation)) { + return super.equals(obj); + } + com.google.cloud.assuredworkloads.v1.Violation.Remediation other = + (com.google.cloud.assuredworkloads.v1.Violation.Remediation) obj; + + if (hasInstructions() != other.hasInstructions()) return false; + if (hasInstructions()) { + if (!getInstructions().equals(other.getInstructions())) return false; + } + if (!getCompliantValuesList().equals(other.getCompliantValuesList())) return false; + if (remediationType_ != other.remediationType_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasInstructions()) { + hash = (37 * hash) + INSTRUCTIONS_FIELD_NUMBER; + hash = (53 * hash) + getInstructions().hashCode(); + } + if (getCompliantValuesCount() > 0) { + hash = (37 * hash) + COMPLIANT_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getCompliantValuesList().hashCode(); + } + hash = (37 * hash) + REMEDIATION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + remediationType_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.assuredworkloads.v1.Violation.Remediation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Represents remediation guidance to resolve compliance violation for
+     * AssuredWorkload
+     * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1.Violation.Remediation} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.assuredworkloads.v1.Violation.Remediation) + com.google.cloud.assuredworkloads.v1.Violation.RemediationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1.Violation.Remediation.class, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Builder.class); + } + + // Construct using com.google.cloud.assuredworkloads.v1.Violation.Remediation.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (instructionsBuilder_ == null) { + instructions_ = null; + } else { + instructions_ = null; + instructionsBuilder_ = null; + } + compliantValues_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + remediationType_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_Violation_Remediation_descriptor; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation.Remediation + getDefaultInstanceForType() { + return com.google.cloud.assuredworkloads.v1.Violation.Remediation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation.Remediation build() { + com.google.cloud.assuredworkloads.v1.Violation.Remediation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation.Remediation buildPartial() { + com.google.cloud.assuredworkloads.v1.Violation.Remediation result = + new com.google.cloud.assuredworkloads.v1.Violation.Remediation(this); + int from_bitField0_ = bitField0_; + if (instructionsBuilder_ == null) { + result.instructions_ = instructions_; + } else { + result.instructions_ = instructionsBuilder_.build(); + } + if (((bitField0_ & 0x00000001) != 0)) { + compliantValues_ = compliantValues_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.compliantValues_ = compliantValues_; + result.remediationType_ = remediationType_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.assuredworkloads.v1.Violation.Remediation) { + return mergeFrom((com.google.cloud.assuredworkloads.v1.Violation.Remediation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.assuredworkloads.v1.Violation.Remediation other) { + if (other + == com.google.cloud.assuredworkloads.v1.Violation.Remediation.getDefaultInstance()) + return this; + if (other.hasInstructions()) { + mergeInstructions(other.getInstructions()); + } + if (!other.compliantValues_.isEmpty()) { + if (compliantValues_.isEmpty()) { + compliantValues_ = other.compliantValues_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCompliantValuesIsMutable(); + compliantValues_.addAll(other.compliantValues_); + } + onChanged(); + } + if (other.remediationType_ != 0) { + setRemediationTypeValue(other.getRemediationTypeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getInstructionsFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureCompliantValuesIsMutable(); + compliantValues_.add(s); + break; + } // case 18 + case 24: + { + remediationType_ = input.readEnum(); + + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions instructions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Builder, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.InstructionsOrBuilder> + instructionsBuilder_; + /** + * + * + *
+       * Required. Remediation instructions to resolve violations
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instructions field is set. + */ + public boolean hasInstructions() { + return instructionsBuilder_ != null || instructions_ != null; + } + /** + * + * + *
+       * Required. Remediation instructions to resolve violations
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instructions. + */ + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + getInstructions() { + if (instructionsBuilder_ == null) { + return instructions_ == null + ? com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .getDefaultInstance() + : instructions_; + } else { + return instructionsBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Required. Remediation instructions to resolve violations
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstructions( + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions value) { + if (instructionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instructions_ = value; + onChanged(); + } else { + instructionsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Required. Remediation instructions to resolve violations
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstructions( + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Builder + builderForValue) { + if (instructionsBuilder_ == null) { + instructions_ = builderForValue.build(); + onChanged(); + } else { + instructionsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Required. Remediation instructions to resolve violations
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInstructions( + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions value) { + if (instructionsBuilder_ == null) { + if (instructions_ != null) { + instructions_ = + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.newBuilder( + instructions_) + .mergeFrom(value) + .buildPartial(); + } else { + instructions_ = value; + } + onChanged(); + } else { + instructionsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Required. Remediation instructions to resolve violations
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInstructions() { + if (instructionsBuilder_ == null) { + instructions_ = null; + onChanged(); + } else { + instructions_ = null; + instructionsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Required. Remediation instructions to resolve violations
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Builder + getInstructionsBuilder() { + + onChanged(); + return getInstructionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. Remediation instructions to resolve violations
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.InstructionsOrBuilder + getInstructionsOrBuilder() { + if (instructionsBuilder_ != null) { + return instructionsBuilder_.getMessageOrBuilder(); + } else { + return instructions_ == null + ? com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + .getDefaultInstance() + : instructions_; + } + } + /** + * + * + *
+       * Required. Remediation instructions to resolve violations
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Builder, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.InstructionsOrBuilder> + getInstructionsFieldBuilder() { + if (instructionsBuilder_ == null) { + instructionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Builder, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.InstructionsOrBuilder>( + getInstructions(), getParentForChildren(), isClean()); + instructions_ = null; + } + return instructionsBuilder_; + } + + private com.google.protobuf.LazyStringList compliantValues_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureCompliantValuesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + compliantValues_ = new com.google.protobuf.LazyStringArrayList(compliantValues_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Values that can resolve the violation
+       * For example: for list org policy violations, this will either be the list
+       * of allowed or denied values
+       * 
+ * + * repeated string compliant_values = 2; + * + * @return A list containing the compliantValues. + */ + public com.google.protobuf.ProtocolStringList getCompliantValuesList() { + return compliantValues_.getUnmodifiableView(); + } + /** + * + * + *
+       * Values that can resolve the violation
+       * For example: for list org policy violations, this will either be the list
+       * of allowed or denied values
+       * 
+ * + * repeated string compliant_values = 2; + * + * @return The count of compliantValues. + */ + public int getCompliantValuesCount() { + return compliantValues_.size(); + } + /** + * + * + *
+       * Values that can resolve the violation
+       * For example: for list org policy violations, this will either be the list
+       * of allowed or denied values
+       * 
+ * + * repeated string compliant_values = 2; + * + * @param index The index of the element to return. + * @return The compliantValues at the given index. + */ + public java.lang.String getCompliantValues(int index) { + return compliantValues_.get(index); + } + /** + * + * + *
+       * Values that can resolve the violation
+       * For example: for list org policy violations, this will either be the list
+       * of allowed or denied values
+       * 
+ * + * repeated string compliant_values = 2; + * + * @param index The index of the value to return. + * @return The bytes of the compliantValues at the given index. + */ + public com.google.protobuf.ByteString getCompliantValuesBytes(int index) { + return compliantValues_.getByteString(index); + } + /** + * + * + *
+       * Values that can resolve the violation
+       * For example: for list org policy violations, this will either be the list
+       * of allowed or denied values
+       * 
+ * + * repeated string compliant_values = 2; + * + * @param index The index to set the value at. + * @param value The compliantValues to set. + * @return This builder for chaining. + */ + public Builder setCompliantValues(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCompliantValuesIsMutable(); + compliantValues_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Values that can resolve the violation
+       * For example: for list org policy violations, this will either be the list
+       * of allowed or denied values
+       * 
+ * + * repeated string compliant_values = 2; + * + * @param value The compliantValues to add. + * @return This builder for chaining. + */ + public Builder addCompliantValues(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCompliantValuesIsMutable(); + compliantValues_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Values that can resolve the violation
+       * For example: for list org policy violations, this will either be the list
+       * of allowed or denied values
+       * 
+ * + * repeated string compliant_values = 2; + * + * @param values The compliantValues to add. + * @return This builder for chaining. + */ + public Builder addAllCompliantValues(java.lang.Iterable values) { + ensureCompliantValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, compliantValues_); + onChanged(); + return this; + } + /** + * + * + *
+       * Values that can resolve the violation
+       * For example: for list org policy violations, this will either be the list
+       * of allowed or denied values
+       * 
+ * + * repeated string compliant_values = 2; + * + * @return This builder for chaining. + */ + public Builder clearCompliantValues() { + compliantValues_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Values that can resolve the violation
+       * For example: for list org policy violations, this will either be the list
+       * of allowed or denied values
+       * 
+ * + * repeated string compliant_values = 2; + * + * @param value The bytes of the compliantValues to add. + * @return This builder for chaining. + */ + public Builder addCompliantValuesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCompliantValuesIsMutable(); + compliantValues_.add(value); + onChanged(); + return this; + } + + private int remediationType_ = 0; + /** + * + * + *
+       * Output only. Reemediation type based on the type of org policy values violated
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for remediationType. + */ + @java.lang.Override + public int getRemediationTypeValue() { + return remediationType_; + } + /** + * + * + *
+       * Output only. Reemediation type based on the type of org policy values violated
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for remediationType to set. + * @return This builder for chaining. + */ + public Builder setRemediationTypeValue(int value) { + + remediationType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Reemediation type based on the type of org policy values violated
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The remediationType. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType + getRemediationType() { + @SuppressWarnings("deprecation") + com.google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType result = + com.google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType.valueOf( + remediationType_); + return result == null + ? com.google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType + .UNRECOGNIZED + : result; + } + /** + * + * + *
+       * Output only. Reemediation type based on the type of org policy values violated
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The remediationType to set. + * @return This builder for chaining. + */ + public Builder setRemediationType( + com.google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType value) { + if (value == null) { + throw new NullPointerException(); + } + + remediationType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Reemediation type based on the type of org policy values violated
+       * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearRemediationType() { + + remediationType_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.assuredworkloads.v1.Violation.Remediation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.assuredworkloads.v1.Violation.Remediation) + private static final com.google.cloud.assuredworkloads.v1.Violation.Remediation + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.assuredworkloads.v1.Violation.Remediation(); + } + + public static com.google.cloud.assuredworkloads.v1.Violation.Remediation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Remediation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation.Remediation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. Immutable. Name of the Violation.
+   * Format:
+   * organizations/{organization}/locations/{location}/workloads/{workload_id}/violations/{violations_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Immutable. Name of the Violation.
+   * Format:
+   * organizations/{organization}/locations/{location}/workloads/{workload_id}/violations/{violations_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Output only. Description for the Violation.
+   * e.g. OrgPolicy gcp.resourceLocations has non compliant value.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Description for the Violation.
+   * e.g. OrgPolicy gcp.resourceLocations has non compliant value.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BEGIN_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp beginTime_; + /** + * + * + *
+   * Output only. Time of the event which triggered the Violation.
+   * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the beginTime field is set. + */ + @java.lang.Override + public boolean hasBeginTime() { + return beginTime_ != null; + } + /** + * + * + *
+   * Output only. Time of the event which triggered the Violation.
+   * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The beginTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getBeginTime() { + return beginTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : beginTime_; + } + /** + * + * + *
+   * Output only. Time of the event which triggered the Violation.
+   * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getBeginTimeOrBuilder() { + return getBeginTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The last time when the Violation record was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The last time when the Violation record was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The last time when the Violation record was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int RESOLVE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp resolveTime_; + /** + * + * + *
+   * Output only. Time of the event which fixed the Violation.
+   * If the violation is ACTIVE this will be empty.
+   * 
+ * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the resolveTime field is set. + */ + @java.lang.Override + public boolean hasResolveTime() { + return resolveTime_ != null; + } + /** + * + * + *
+   * Output only. Time of the event which fixed the Violation.
+   * If the violation is ACTIVE this will be empty.
+   * 
+ * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The resolveTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getResolveTime() { + return resolveTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : resolveTime_; + } + /** + * + * + *
+   * Output only. Time of the event which fixed the Violation.
+   * If the violation is ACTIVE this will be empty.
+   * 
+ * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getResolveTimeOrBuilder() { + return getResolveTime(); + } + + public static final int CATEGORY_FIELD_NUMBER = 6; + private volatile java.lang.Object category_; + /** + * + * + *
+   * Output only. Category under which this violation is mapped.
+   * e.g. Location, Service Usage, Access, Encryption, etc.
+   * 
+ * + * string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The category. + */ + @java.lang.Override + public java.lang.String getCategory() { + java.lang.Object ref = category_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + category_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Category under which this violation is mapped.
+   * e.g. Location, Service Usage, Access, Encryption, etc.
+   * 
+ * + * string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for category. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCategoryBytes() { + java.lang.Object ref = category_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + category_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 7; + private int state_; + /** + * + * + *
+   * Output only. State of the violation
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. State of the violation
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.assuredworkloads.v1.Violation.State result = + com.google.cloud.assuredworkloads.v1.Violation.State.valueOf(state_); + return result == null + ? com.google.cloud.assuredworkloads.v1.Violation.State.UNRECOGNIZED + : result; + } + + public static final int ORG_POLICY_CONSTRAINT_FIELD_NUMBER = 8; + private volatile java.lang.Object orgPolicyConstraint_; + /** + * + * + *
+   * Output only. Immutable. The org-policy-constraint that was incorrectly changed, which resulted in
+   * this violation.
+   * 
+ * + * + * string org_policy_constraint = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The orgPolicyConstraint. + */ + @java.lang.Override + public java.lang.String getOrgPolicyConstraint() { + java.lang.Object ref = orgPolicyConstraint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orgPolicyConstraint_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Immutable. The org-policy-constraint that was incorrectly changed, which resulted in
+   * this violation.
+   * 
+ * + * + * string org_policy_constraint = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for orgPolicyConstraint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrgPolicyConstraintBytes() { + java.lang.Object ref = orgPolicyConstraint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orgPolicyConstraint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AUDIT_LOG_LINK_FIELD_NUMBER = 11; + private volatile java.lang.Object auditLogLink_; + /** + * + * + *
+   * Output only. Immutable. Audit Log Link for violated resource
+   * Format:
+   * https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{timeRange}{folder}
+   * 
+ * + * + * string audit_log_link = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The auditLogLink. + */ + @java.lang.Override + public java.lang.String getAuditLogLink() { + java.lang.Object ref = auditLogLink_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + auditLogLink_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Immutable. Audit Log Link for violated resource
+   * Format:
+   * https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{timeRange}{folder}
+   * 
+ * + * + * string audit_log_link = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for auditLogLink. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAuditLogLinkBytes() { + java.lang.Object ref = auditLogLink_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + auditLogLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NON_COMPLIANT_ORG_POLICY_FIELD_NUMBER = 12; + private volatile java.lang.Object nonCompliantOrgPolicy_; + /** + * + * + *
+   * Output only. Immutable. Name of the OrgPolicy which was modified with non-compliant change and
+   * resulted this violation.
+   *  Format:
+   *  projects/{project_number}/policies/{constraint_name}
+   *  folders/{folder_id}/policies/{constraint_name}
+   *  organizations/{organization_id}/policies/{constraint_name}
+   * 
+ * + * + * string non_compliant_org_policy = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The nonCompliantOrgPolicy. + */ + @java.lang.Override + public java.lang.String getNonCompliantOrgPolicy() { + java.lang.Object ref = nonCompliantOrgPolicy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nonCompliantOrgPolicy_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Immutable. Name of the OrgPolicy which was modified with non-compliant change and
+   * resulted this violation.
+   *  Format:
+   *  projects/{project_number}/policies/{constraint_name}
+   *  folders/{folder_id}/policies/{constraint_name}
+   *  organizations/{organization_id}/policies/{constraint_name}
+   * 
+ * + * + * string non_compliant_org_policy = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for nonCompliantOrgPolicy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNonCompliantOrgPolicyBytes() { + java.lang.Object ref = nonCompliantOrgPolicy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nonCompliantOrgPolicy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REMEDIATION_FIELD_NUMBER = 13; + private com.google.cloud.assuredworkloads.v1.Violation.Remediation remediation_; + /** + * + * + *
+   * Output only. Compliance violation remediation
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the remediation field is set. + */ + @java.lang.Override + public boolean hasRemediation() { + return remediation_ != null; + } + /** + * + * + *
+   * Output only. Compliance violation remediation
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The remediation. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation.Remediation getRemediation() { + return remediation_ == null + ? com.google.cloud.assuredworkloads.v1.Violation.Remediation.getDefaultInstance() + : remediation_; + } + /** + * + * + *
+   * Output only. Compliance violation remediation
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation.RemediationOrBuilder + getRemediationOrBuilder() { + return getRemediation(); + } + + public static final int ACKNOWLEDGED_FIELD_NUMBER = 14; + private boolean acknowledged_; + /** + * + * + *
+   * Output only. A boolean that indicates if the violation is acknowledged
+   * 
+ * + * bool acknowledged = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The acknowledged. + */ + @java.lang.Override + public boolean getAcknowledged() { + return acknowledged_; + } + + public static final int ACKNOWLEDGEMENT_TIME_FIELD_NUMBER = 15; + private com.google.protobuf.Timestamp acknowledgementTime_; + /** + * + * + *
+   * Optional. Timestamp when this violation was acknowledged last.
+   * This will be absent when acknowledged field is marked as false.
+   * 
+ * + * + * optional .google.protobuf.Timestamp acknowledgement_time = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the acknowledgementTime field is set. + */ + @java.lang.Override + public boolean hasAcknowledgementTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Optional. Timestamp when this violation was acknowledged last.
+   * This will be absent when acknowledged field is marked as false.
+   * 
+ * + * + * optional .google.protobuf.Timestamp acknowledgement_time = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The acknowledgementTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getAcknowledgementTime() { + return acknowledgementTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : acknowledgementTime_; + } + /** + * + * + *
+   * Optional. Timestamp when this violation was acknowledged last.
+   * This will be absent when acknowledged field is marked as false.
+   * 
+ * + * + * optional .google.protobuf.Timestamp acknowledgement_time = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getAcknowledgementTimeOrBuilder() { + return acknowledgementTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : acknowledgementTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (beginTime_ != null) { + output.writeMessage(3, getBeginTime()); + } + if (updateTime_ != null) { + output.writeMessage(4, getUpdateTime()); + } + if (resolveTime_ != null) { + output.writeMessage(5, getResolveTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(category_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, category_); + } + if (state_ + != com.google.cloud.assuredworkloads.v1.Violation.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(7, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orgPolicyConstraint_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, orgPolicyConstraint_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(auditLogLink_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, auditLogLink_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nonCompliantOrgPolicy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, nonCompliantOrgPolicy_); + } + if (remediation_ != null) { + output.writeMessage(13, getRemediation()); + } + if (acknowledged_ != false) { + output.writeBool(14, acknowledged_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(15, getAcknowledgementTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (beginTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBeginTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUpdateTime()); + } + if (resolveTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getResolveTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(category_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, category_); + } + if (state_ + != com.google.cloud.assuredworkloads.v1.Violation.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orgPolicyConstraint_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, orgPolicyConstraint_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(auditLogLink_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, auditLogLink_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nonCompliantOrgPolicy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, nonCompliantOrgPolicy_); + } + if (remediation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getRemediation()); + } + if (acknowledged_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(14, acknowledged_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(15, getAcknowledgementTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.assuredworkloads.v1.Violation)) { + return super.equals(obj); + } + com.google.cloud.assuredworkloads.v1.Violation other = + (com.google.cloud.assuredworkloads.v1.Violation) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (hasBeginTime() != other.hasBeginTime()) return false; + if (hasBeginTime()) { + if (!getBeginTime().equals(other.getBeginTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasResolveTime() != other.hasResolveTime()) return false; + if (hasResolveTime()) { + if (!getResolveTime().equals(other.getResolveTime())) return false; + } + if (!getCategory().equals(other.getCategory())) return false; + if (state_ != other.state_) return false; + if (!getOrgPolicyConstraint().equals(other.getOrgPolicyConstraint())) return false; + if (!getAuditLogLink().equals(other.getAuditLogLink())) return false; + if (!getNonCompliantOrgPolicy().equals(other.getNonCompliantOrgPolicy())) return false; + if (hasRemediation() != other.hasRemediation()) return false; + if (hasRemediation()) { + if (!getRemediation().equals(other.getRemediation())) return false; + } + if (getAcknowledged() != other.getAcknowledged()) return false; + if (hasAcknowledgementTime() != other.hasAcknowledgementTime()) return false; + if (hasAcknowledgementTime()) { + if (!getAcknowledgementTime().equals(other.getAcknowledgementTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasBeginTime()) { + hash = (37 * hash) + BEGIN_TIME_FIELD_NUMBER; + hash = (53 * hash) + getBeginTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasResolveTime()) { + hash = (37 * hash) + RESOLVE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getResolveTime().hashCode(); + } + hash = (37 * hash) + CATEGORY_FIELD_NUMBER; + hash = (53 * hash) + getCategory().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + ORG_POLICY_CONSTRAINT_FIELD_NUMBER; + hash = (53 * hash) + getOrgPolicyConstraint().hashCode(); + hash = (37 * hash) + AUDIT_LOG_LINK_FIELD_NUMBER; + hash = (53 * hash) + getAuditLogLink().hashCode(); + hash = (37 * hash) + NON_COMPLIANT_ORG_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getNonCompliantOrgPolicy().hashCode(); + if (hasRemediation()) { + hash = (37 * hash) + REMEDIATION_FIELD_NUMBER; + hash = (53 * hash) + getRemediation().hashCode(); + } + hash = (37 * hash) + ACKNOWLEDGED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAcknowledged()); + if (hasAcknowledgementTime()) { + hash = (37 * hash) + ACKNOWLEDGEMENT_TIME_FIELD_NUMBER; + hash = (53 * hash) + getAcknowledgementTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.assuredworkloads.v1.Violation parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.Violation parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.Violation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.Violation parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.Violation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.assuredworkloads.v1.Violation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.Violation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.Violation parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.Violation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.Violation parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.assuredworkloads.v1.Violation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.assuredworkloads.v1.Violation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.assuredworkloads.v1.Violation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Workload monitoring Violation.
+   * 
+ * + * Protobuf type {@code google.cloud.assuredworkloads.v1.Violation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.assuredworkloads.v1.Violation) + com.google.cloud.assuredworkloads.v1.ViolationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_Violation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_Violation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.assuredworkloads.v1.Violation.class, + com.google.cloud.assuredworkloads.v1.Violation.Builder.class); + } + + // Construct using com.google.cloud.assuredworkloads.v1.Violation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAcknowledgementTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + description_ = ""; + + if (beginTimeBuilder_ == null) { + beginTime_ = null; + } else { + beginTime_ = null; + beginTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + if (resolveTimeBuilder_ == null) { + resolveTime_ = null; + } else { + resolveTime_ = null; + resolveTimeBuilder_ = null; + } + category_ = ""; + + state_ = 0; + + orgPolicyConstraint_ = ""; + + auditLogLink_ = ""; + + nonCompliantOrgPolicy_ = ""; + + if (remediationBuilder_ == null) { + remediation_ = null; + } else { + remediation_ = null; + remediationBuilder_ = null; + } + acknowledged_ = false; + + if (acknowledgementTimeBuilder_ == null) { + acknowledgementTime_ = null; + } else { + acknowledgementTimeBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto + .internal_static_google_cloud_assuredworkloads_v1_Violation_descriptor; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation getDefaultInstanceForType() { + return com.google.cloud.assuredworkloads.v1.Violation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation build() { + com.google.cloud.assuredworkloads.v1.Violation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation buildPartial() { + com.google.cloud.assuredworkloads.v1.Violation result = + new com.google.cloud.assuredworkloads.v1.Violation(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + result.description_ = description_; + if (beginTimeBuilder_ == null) { + result.beginTime_ = beginTime_; + } else { + result.beginTime_ = beginTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + if (resolveTimeBuilder_ == null) { + result.resolveTime_ = resolveTime_; + } else { + result.resolveTime_ = resolveTimeBuilder_.build(); + } + result.category_ = category_; + result.state_ = state_; + result.orgPolicyConstraint_ = orgPolicyConstraint_; + result.auditLogLink_ = auditLogLink_; + result.nonCompliantOrgPolicy_ = nonCompliantOrgPolicy_; + if (remediationBuilder_ == null) { + result.remediation_ = remediation_; + } else { + result.remediation_ = remediationBuilder_.build(); + } + result.acknowledged_ = acknowledged_; + if (((from_bitField0_ & 0x00000001) != 0)) { + if (acknowledgementTimeBuilder_ == null) { + result.acknowledgementTime_ = acknowledgementTime_; + } else { + result.acknowledgementTime_ = acknowledgementTimeBuilder_.build(); + } + to_bitField0_ |= 0x00000001; + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.assuredworkloads.v1.Violation) { + return mergeFrom((com.google.cloud.assuredworkloads.v1.Violation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.assuredworkloads.v1.Violation other) { + if (other == com.google.cloud.assuredworkloads.v1.Violation.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.hasBeginTime()) { + mergeBeginTime(other.getBeginTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasResolveTime()) { + mergeResolveTime(other.getResolveTime()); + } + if (!other.getCategory().isEmpty()) { + category_ = other.category_; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getOrgPolicyConstraint().isEmpty()) { + orgPolicyConstraint_ = other.orgPolicyConstraint_; + onChanged(); + } + if (!other.getAuditLogLink().isEmpty()) { + auditLogLink_ = other.auditLogLink_; + onChanged(); + } + if (!other.getNonCompliantOrgPolicy().isEmpty()) { + nonCompliantOrgPolicy_ = other.nonCompliantOrgPolicy_; + onChanged(); + } + if (other.hasRemediation()) { + mergeRemediation(other.getRemediation()); + } + if (other.getAcknowledged() != false) { + setAcknowledged(other.getAcknowledged()); + } + if (other.hasAcknowledgementTime()) { + mergeAcknowledgementTime(other.getAcknowledgementTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + description_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + input.readMessage(getBeginTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + case 34: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 34 + case 42: + { + input.readMessage(getResolveTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 42 + case 50: + { + category_ = input.readStringRequireUtf8(); + + break; + } // case 50 + case 56: + { + state_ = input.readEnum(); + + break; + } // case 56 + case 66: + { + orgPolicyConstraint_ = input.readStringRequireUtf8(); + + break; + } // case 66 + case 90: + { + auditLogLink_ = input.readStringRequireUtf8(); + + break; + } // case 90 + case 98: + { + nonCompliantOrgPolicy_ = input.readStringRequireUtf8(); + + break; + } // case 98 + case 106: + { + input.readMessage(getRemediationFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 106 + case 112: + { + acknowledged_ = input.readBool(); + + break; + } // case 112 + case 122: + { + input.readMessage( + getAcknowledgementTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 122 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. Immutable. Name of the Violation.
+     * Format:
+     * organizations/{organization}/locations/{location}/workloads/{workload_id}/violations/{violations_id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Immutable. Name of the Violation.
+     * Format:
+     * organizations/{organization}/locations/{location}/workloads/{workload_id}/violations/{violations_id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Immutable. Name of the Violation.
+     * Format:
+     * organizations/{organization}/locations/{location}/workloads/{workload_id}/violations/{violations_id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Immutable. Name of the Violation.
+     * Format:
+     * organizations/{organization}/locations/{location}/workloads/{workload_id}/violations/{violations_id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Immutable. Name of the Violation.
+     * Format:
+     * organizations/{organization}/locations/{location}/workloads/{workload_id}/violations/{violations_id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Output only. Description for the Violation.
+     * e.g. OrgPolicy gcp.resourceLocations has non compliant value.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Description for the Violation.
+     * e.g. OrgPolicy gcp.resourceLocations has non compliant value.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Description for the Violation.
+     * e.g. OrgPolicy gcp.resourceLocations has non compliant value.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Description for the Violation.
+     * e.g. OrgPolicy gcp.resourceLocations has non compliant value.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Description for the Violation.
+     * e.g. OrgPolicy gcp.resourceLocations has non compliant value.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp beginTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + beginTimeBuilder_; + /** + * + * + *
+     * Output only. Time of the event which triggered the Violation.
+     * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the beginTime field is set. + */ + public boolean hasBeginTime() { + return beginTimeBuilder_ != null || beginTime_ != null; + } + /** + * + * + *
+     * Output only. Time of the event which triggered the Violation.
+     * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The beginTime. + */ + public com.google.protobuf.Timestamp getBeginTime() { + if (beginTimeBuilder_ == null) { + return beginTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : beginTime_; + } else { + return beginTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time of the event which triggered the Violation.
+     * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setBeginTime(com.google.protobuf.Timestamp value) { + if (beginTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + beginTime_ = value; + onChanged(); + } else { + beginTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Time of the event which triggered the Violation.
+     * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setBeginTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (beginTimeBuilder_ == null) { + beginTime_ = builderForValue.build(); + onChanged(); + } else { + beginTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Time of the event which triggered the Violation.
+     * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeBeginTime(com.google.protobuf.Timestamp value) { + if (beginTimeBuilder_ == null) { + if (beginTime_ != null) { + beginTime_ = + com.google.protobuf.Timestamp.newBuilder(beginTime_).mergeFrom(value).buildPartial(); + } else { + beginTime_ = value; + } + onChanged(); + } else { + beginTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Time of the event which triggered the Violation.
+     * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearBeginTime() { + if (beginTimeBuilder_ == null) { + beginTime_ = null; + onChanged(); + } else { + beginTime_ = null; + beginTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Time of the event which triggered the Violation.
+     * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getBeginTimeBuilder() { + + onChanged(); + return getBeginTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time of the event which triggered the Violation.
+     * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getBeginTimeOrBuilder() { + if (beginTimeBuilder_ != null) { + return beginTimeBuilder_.getMessageOrBuilder(); + } else { + return beginTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : beginTime_; + } + } + /** + * + * + *
+     * Output only. Time of the event which triggered the Violation.
+     * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getBeginTimeFieldBuilder() { + if (beginTimeBuilder_ == null) { + beginTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getBeginTime(), getParentForChildren(), isClean()); + beginTime_ = null; + } + return beginTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The last time when the Violation record was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The last time when the Violation record was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The last time when the Violation record was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The last time when the Violation record was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The last time when the Violation record was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The last time when the Violation record was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The last time when the Violation record was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The last time when the Violation record was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. The last time when the Violation record was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.Timestamp resolveTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + resolveTimeBuilder_; + /** + * + * + *
+     * Output only. Time of the event which fixed the Violation.
+     * If the violation is ACTIVE this will be empty.
+     * 
+ * + * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the resolveTime field is set. + */ + public boolean hasResolveTime() { + return resolveTimeBuilder_ != null || resolveTime_ != null; + } + /** + * + * + *
+     * Output only. Time of the event which fixed the Violation.
+     * If the violation is ACTIVE this will be empty.
+     * 
+ * + * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The resolveTime. + */ + public com.google.protobuf.Timestamp getResolveTime() { + if (resolveTimeBuilder_ == null) { + return resolveTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : resolveTime_; + } else { + return resolveTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time of the event which fixed the Violation.
+     * If the violation is ACTIVE this will be empty.
+     * 
+ * + * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setResolveTime(com.google.protobuf.Timestamp value) { + if (resolveTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resolveTime_ = value; + onChanged(); + } else { + resolveTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Time of the event which fixed the Violation.
+     * If the violation is ACTIVE this will be empty.
+     * 
+ * + * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setResolveTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (resolveTimeBuilder_ == null) { + resolveTime_ = builderForValue.build(); + onChanged(); + } else { + resolveTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Time of the event which fixed the Violation.
+     * If the violation is ACTIVE this will be empty.
+     * 
+ * + * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeResolveTime(com.google.protobuf.Timestamp value) { + if (resolveTimeBuilder_ == null) { + if (resolveTime_ != null) { + resolveTime_ = + com.google.protobuf.Timestamp.newBuilder(resolveTime_) + .mergeFrom(value) + .buildPartial(); + } else { + resolveTime_ = value; + } + onChanged(); + } else { + resolveTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Time of the event which fixed the Violation.
+     * If the violation is ACTIVE this will be empty.
+     * 
+ * + * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearResolveTime() { + if (resolveTimeBuilder_ == null) { + resolveTime_ = null; + onChanged(); + } else { + resolveTime_ = null; + resolveTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Time of the event which fixed the Violation.
+     * If the violation is ACTIVE this will be empty.
+     * 
+ * + * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getResolveTimeBuilder() { + + onChanged(); + return getResolveTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time of the event which fixed the Violation.
+     * If the violation is ACTIVE this will be empty.
+     * 
+ * + * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getResolveTimeOrBuilder() { + if (resolveTimeBuilder_ != null) { + return resolveTimeBuilder_.getMessageOrBuilder(); + } else { + return resolveTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : resolveTime_; + } + } + /** + * + * + *
+     * Output only. Time of the event which fixed the Violation.
+     * If the violation is ACTIVE this will be empty.
+     * 
+ * + * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getResolveTimeFieldBuilder() { + if (resolveTimeBuilder_ == null) { + resolveTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getResolveTime(), getParentForChildren(), isClean()); + resolveTime_ = null; + } + return resolveTimeBuilder_; + } + + private java.lang.Object category_ = ""; + /** + * + * + *
+     * Output only. Category under which this violation is mapped.
+     * e.g. Location, Service Usage, Access, Encryption, etc.
+     * 
+ * + * string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The category. + */ + public java.lang.String getCategory() { + java.lang.Object ref = category_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + category_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Category under which this violation is mapped.
+     * e.g. Location, Service Usage, Access, Encryption, etc.
+     * 
+ * + * string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for category. + */ + public com.google.protobuf.ByteString getCategoryBytes() { + java.lang.Object ref = category_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + category_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Category under which this violation is mapped.
+     * e.g. Location, Service Usage, Access, Encryption, etc.
+     * 
+ * + * string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The category to set. + * @return This builder for chaining. + */ + public Builder setCategory(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + category_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Category under which this violation is mapped.
+     * e.g. Location, Service Usage, Access, Encryption, etc.
+     * 
+ * + * string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearCategory() { + + category_ = getDefaultInstance().getCategory(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Category under which this violation is mapped.
+     * e.g. Location, Service Usage, Access, Encryption, etc.
+     * 
+ * + * string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for category to set. + * @return This builder for chaining. + */ + public Builder setCategoryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + category_ = value; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. State of the violation
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. State of the violation
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of the violation
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.assuredworkloads.v1.Violation.State result = + com.google.cloud.assuredworkloads.v1.Violation.State.valueOf(state_); + return result == null + ? com.google.cloud.assuredworkloads.v1.Violation.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. State of the violation
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.assuredworkloads.v1.Violation.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of the violation
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object orgPolicyConstraint_ = ""; + /** + * + * + *
+     * Output only. Immutable. The org-policy-constraint that was incorrectly changed, which resulted in
+     * this violation.
+     * 
+ * + * + * string org_policy_constraint = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The orgPolicyConstraint. + */ + public java.lang.String getOrgPolicyConstraint() { + java.lang.Object ref = orgPolicyConstraint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orgPolicyConstraint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Immutable. The org-policy-constraint that was incorrectly changed, which resulted in
+     * this violation.
+     * 
+ * + * + * string org_policy_constraint = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for orgPolicyConstraint. + */ + public com.google.protobuf.ByteString getOrgPolicyConstraintBytes() { + java.lang.Object ref = orgPolicyConstraint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orgPolicyConstraint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Immutable. The org-policy-constraint that was incorrectly changed, which resulted in
+     * this violation.
+     * 
+ * + * + * string org_policy_constraint = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The orgPolicyConstraint to set. + * @return This builder for chaining. + */ + public Builder setOrgPolicyConstraint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orgPolicyConstraint_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Immutable. The org-policy-constraint that was incorrectly changed, which resulted in
+     * this violation.
+     * 
+ * + * + * string org_policy_constraint = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearOrgPolicyConstraint() { + + orgPolicyConstraint_ = getDefaultInstance().getOrgPolicyConstraint(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Immutable. The org-policy-constraint that was incorrectly changed, which resulted in
+     * this violation.
+     * 
+ * + * + * string org_policy_constraint = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The bytes for orgPolicyConstraint to set. + * @return This builder for chaining. + */ + public Builder setOrgPolicyConstraintBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orgPolicyConstraint_ = value; + onChanged(); + return this; + } + + private java.lang.Object auditLogLink_ = ""; + /** + * + * + *
+     * Output only. Immutable. Audit Log Link for violated resource
+     * Format:
+     * https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{timeRange}{folder}
+     * 
+ * + * + * string audit_log_link = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The auditLogLink. + */ + public java.lang.String getAuditLogLink() { + java.lang.Object ref = auditLogLink_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + auditLogLink_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Immutable. Audit Log Link for violated resource
+     * Format:
+     * https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{timeRange}{folder}
+     * 
+ * + * + * string audit_log_link = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for auditLogLink. + */ + public com.google.protobuf.ByteString getAuditLogLinkBytes() { + java.lang.Object ref = auditLogLink_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + auditLogLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Immutable. Audit Log Link for violated resource
+     * Format:
+     * https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{timeRange}{folder}
+     * 
+ * + * + * string audit_log_link = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The auditLogLink to set. + * @return This builder for chaining. + */ + public Builder setAuditLogLink(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + auditLogLink_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Immutable. Audit Log Link for violated resource
+     * Format:
+     * https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{timeRange}{folder}
+     * 
+ * + * + * string audit_log_link = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearAuditLogLink() { + + auditLogLink_ = getDefaultInstance().getAuditLogLink(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Immutable. Audit Log Link for violated resource
+     * Format:
+     * https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{timeRange}{folder}
+     * 
+ * + * + * string audit_log_link = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The bytes for auditLogLink to set. + * @return This builder for chaining. + */ + public Builder setAuditLogLinkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + auditLogLink_ = value; + onChanged(); + return this; + } + + private java.lang.Object nonCompliantOrgPolicy_ = ""; + /** + * + * + *
+     * Output only. Immutable. Name of the OrgPolicy which was modified with non-compliant change and
+     * resulted this violation.
+     *  Format:
+     *  projects/{project_number}/policies/{constraint_name}
+     *  folders/{folder_id}/policies/{constraint_name}
+     *  organizations/{organization_id}/policies/{constraint_name}
+     * 
+ * + * + * string non_compliant_org_policy = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The nonCompliantOrgPolicy. + */ + public java.lang.String getNonCompliantOrgPolicy() { + java.lang.Object ref = nonCompliantOrgPolicy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nonCompliantOrgPolicy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Immutable. Name of the OrgPolicy which was modified with non-compliant change and
+     * resulted this violation.
+     *  Format:
+     *  projects/{project_number}/policies/{constraint_name}
+     *  folders/{folder_id}/policies/{constraint_name}
+     *  organizations/{organization_id}/policies/{constraint_name}
+     * 
+ * + * + * string non_compliant_org_policy = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for nonCompliantOrgPolicy. + */ + public com.google.protobuf.ByteString getNonCompliantOrgPolicyBytes() { + java.lang.Object ref = nonCompliantOrgPolicy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nonCompliantOrgPolicy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Immutable. Name of the OrgPolicy which was modified with non-compliant change and
+     * resulted this violation.
+     *  Format:
+     *  projects/{project_number}/policies/{constraint_name}
+     *  folders/{folder_id}/policies/{constraint_name}
+     *  organizations/{organization_id}/policies/{constraint_name}
+     * 
+ * + * + * string non_compliant_org_policy = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The nonCompliantOrgPolicy to set. + * @return This builder for chaining. + */ + public Builder setNonCompliantOrgPolicy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nonCompliantOrgPolicy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Immutable. Name of the OrgPolicy which was modified with non-compliant change and
+     * resulted this violation.
+     *  Format:
+     *  projects/{project_number}/policies/{constraint_name}
+     *  folders/{folder_id}/policies/{constraint_name}
+     *  organizations/{organization_id}/policies/{constraint_name}
+     * 
+ * + * + * string non_compliant_org_policy = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearNonCompliantOrgPolicy() { + + nonCompliantOrgPolicy_ = getDefaultInstance().getNonCompliantOrgPolicy(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Immutable. Name of the OrgPolicy which was modified with non-compliant change and
+     * resulted this violation.
+     *  Format:
+     *  projects/{project_number}/policies/{constraint_name}
+     *  folders/{folder_id}/policies/{constraint_name}
+     *  organizations/{organization_id}/policies/{constraint_name}
+     * 
+ * + * + * string non_compliant_org_policy = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The bytes for nonCompliantOrgPolicy to set. + * @return This builder for chaining. + */ + public Builder setNonCompliantOrgPolicyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nonCompliantOrgPolicy_ = value; + onChanged(); + return this; + } + + private com.google.cloud.assuredworkloads.v1.Violation.Remediation remediation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1.Violation.Remediation, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Builder, + com.google.cloud.assuredworkloads.v1.Violation.RemediationOrBuilder> + remediationBuilder_; + /** + * + * + *
+     * Output only. Compliance violation remediation
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the remediation field is set. + */ + public boolean hasRemediation() { + return remediationBuilder_ != null || remediation_ != null; + } + /** + * + * + *
+     * Output only. Compliance violation remediation
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The remediation. + */ + public com.google.cloud.assuredworkloads.v1.Violation.Remediation getRemediation() { + if (remediationBuilder_ == null) { + return remediation_ == null + ? com.google.cloud.assuredworkloads.v1.Violation.Remediation.getDefaultInstance() + : remediation_; + } else { + return remediationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Compliance violation remediation
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setRemediation( + com.google.cloud.assuredworkloads.v1.Violation.Remediation value) { + if (remediationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + remediation_ = value; + onChanged(); + } else { + remediationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Compliance violation remediation
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setRemediation( + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Builder builderForValue) { + if (remediationBuilder_ == null) { + remediation_ = builderForValue.build(); + onChanged(); + } else { + remediationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Compliance violation remediation
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeRemediation( + com.google.cloud.assuredworkloads.v1.Violation.Remediation value) { + if (remediationBuilder_ == null) { + if (remediation_ != null) { + remediation_ = + com.google.cloud.assuredworkloads.v1.Violation.Remediation.newBuilder(remediation_) + .mergeFrom(value) + .buildPartial(); + } else { + remediation_ = value; + } + onChanged(); + } else { + remediationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Compliance violation remediation
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearRemediation() { + if (remediationBuilder_ == null) { + remediation_ = null; + onChanged(); + } else { + remediation_ = null; + remediationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Compliance violation remediation
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.assuredworkloads.v1.Violation.Remediation.Builder + getRemediationBuilder() { + + onChanged(); + return getRemediationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Compliance violation remediation
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.assuredworkloads.v1.Violation.RemediationOrBuilder + getRemediationOrBuilder() { + if (remediationBuilder_ != null) { + return remediationBuilder_.getMessageOrBuilder(); + } else { + return remediation_ == null + ? com.google.cloud.assuredworkloads.v1.Violation.Remediation.getDefaultInstance() + : remediation_; + } + } + /** + * + * + *
+     * Output only. Compliance violation remediation
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1.Violation.Remediation, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Builder, + com.google.cloud.assuredworkloads.v1.Violation.RemediationOrBuilder> + getRemediationFieldBuilder() { + if (remediationBuilder_ == null) { + remediationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.assuredworkloads.v1.Violation.Remediation, + com.google.cloud.assuredworkloads.v1.Violation.Remediation.Builder, + com.google.cloud.assuredworkloads.v1.Violation.RemediationOrBuilder>( + getRemediation(), getParentForChildren(), isClean()); + remediation_ = null; + } + return remediationBuilder_; + } + + private boolean acknowledged_; + /** + * + * + *
+     * Output only. A boolean that indicates if the violation is acknowledged
+     * 
+ * + * bool acknowledged = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The acknowledged. + */ + @java.lang.Override + public boolean getAcknowledged() { + return acknowledged_; + } + /** + * + * + *
+     * Output only. A boolean that indicates if the violation is acknowledged
+     * 
+ * + * bool acknowledged = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The acknowledged to set. + * @return This builder for chaining. + */ + public Builder setAcknowledged(boolean value) { + + acknowledged_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A boolean that indicates if the violation is acknowledged
+     * 
+ * + * bool acknowledged = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearAcknowledged() { + + acknowledged_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp acknowledgementTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + acknowledgementTimeBuilder_; + /** + * + * + *
+     * Optional. Timestamp when this violation was acknowledged last.
+     * This will be absent when acknowledged field is marked as false.
+     * 
+ * + * + * optional .google.protobuf.Timestamp acknowledgement_time = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the acknowledgementTime field is set. + */ + public boolean hasAcknowledgementTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Optional. Timestamp when this violation was acknowledged last.
+     * This will be absent when acknowledged field is marked as false.
+     * 
+ * + * + * optional .google.protobuf.Timestamp acknowledgement_time = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The acknowledgementTime. + */ + public com.google.protobuf.Timestamp getAcknowledgementTime() { + if (acknowledgementTimeBuilder_ == null) { + return acknowledgementTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : acknowledgementTime_; + } else { + return acknowledgementTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Timestamp when this violation was acknowledged last.
+     * This will be absent when acknowledged field is marked as false.
+     * 
+ * + * + * optional .google.protobuf.Timestamp acknowledgement_time = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setAcknowledgementTime(com.google.protobuf.Timestamp value) { + if (acknowledgementTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + acknowledgementTime_ = value; + onChanged(); + } else { + acknowledgementTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+     * Optional. Timestamp when this violation was acknowledged last.
+     * This will be absent when acknowledged field is marked as false.
+     * 
+ * + * + * optional .google.protobuf.Timestamp acknowledgement_time = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setAcknowledgementTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (acknowledgementTimeBuilder_ == null) { + acknowledgementTime_ = builderForValue.build(); + onChanged(); + } else { + acknowledgementTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+     * Optional. Timestamp when this violation was acknowledged last.
+     * This will be absent when acknowledged field is marked as false.
+     * 
+ * + * + * optional .google.protobuf.Timestamp acknowledgement_time = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeAcknowledgementTime(com.google.protobuf.Timestamp value) { + if (acknowledgementTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && acknowledgementTime_ != null + && acknowledgementTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + acknowledgementTime_ = + com.google.protobuf.Timestamp.newBuilder(acknowledgementTime_) + .mergeFrom(value) + .buildPartial(); + } else { + acknowledgementTime_ = value; + } + onChanged(); + } else { + acknowledgementTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+     * Optional. Timestamp when this violation was acknowledged last.
+     * This will be absent when acknowledged field is marked as false.
+     * 
+ * + * + * optional .google.protobuf.Timestamp acknowledgement_time = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearAcknowledgementTime() { + if (acknowledgementTimeBuilder_ == null) { + acknowledgementTime_ = null; + onChanged(); + } else { + acknowledgementTimeBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + /** + * + * + *
+     * Optional. Timestamp when this violation was acknowledged last.
+     * This will be absent when acknowledged field is marked as false.
+     * 
+ * + * + * optional .google.protobuf.Timestamp acknowledgement_time = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Timestamp.Builder getAcknowledgementTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getAcknowledgementTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Timestamp when this violation was acknowledged last.
+     * This will be absent when acknowledged field is marked as false.
+     * 
+ * + * + * optional .google.protobuf.Timestamp acknowledgement_time = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.TimestampOrBuilder getAcknowledgementTimeOrBuilder() { + if (acknowledgementTimeBuilder_ != null) { + return acknowledgementTimeBuilder_.getMessageOrBuilder(); + } else { + return acknowledgementTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : acknowledgementTime_; + } + } + /** + * + * + *
+     * Optional. Timestamp when this violation was acknowledged last.
+     * This will be absent when acknowledged field is marked as false.
+     * 
+ * + * + * optional .google.protobuf.Timestamp acknowledgement_time = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getAcknowledgementTimeFieldBuilder() { + if (acknowledgementTimeBuilder_ == null) { + acknowledgementTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getAcknowledgementTime(), getParentForChildren(), isClean()); + acknowledgementTime_ = null; + } + return acknowledgementTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.assuredworkloads.v1.Violation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.assuredworkloads.v1.Violation) + private static final com.google.cloud.assuredworkloads.v1.Violation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.assuredworkloads.v1.Violation(); + } + + public static com.google.cloud.assuredworkloads.v1.Violation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Violation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Violation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/ViolationName.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/ViolationName.java new file mode 100644 index 000000000000..9373fdc099a7 --- /dev/null +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/ViolationName.java @@ -0,0 +1,269 @@ +/* + * Copyright 2022 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.assuredworkloads.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class ViolationName implements ResourceName { + private static final PathTemplate ORGANIZATION_LOCATION_WORKLOAD_VIOLATION = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}"); + private volatile Map fieldValuesMap; + private final String organization; + private final String location; + private final String workload; + private final String violation; + + @Deprecated + protected ViolationName() { + organization = null; + location = null; + workload = null; + violation = null; + } + + private ViolationName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + workload = Preconditions.checkNotNull(builder.getWorkload()); + violation = Preconditions.checkNotNull(builder.getViolation()); + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getWorkload() { + return workload; + } + + public String getViolation() { + return violation; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ViolationName of( + String organization, String location, String workload, String violation) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setWorkload(workload) + .setViolation(violation) + .build(); + } + + public static String format( + String organization, String location, String workload, String violation) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setWorkload(workload) + .setViolation(violation) + .build() + .toString(); + } + + public static ViolationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_LOCATION_WORKLOAD_VIOLATION.validatedMatch( + formattedString, "ViolationName.parse: formattedString not in valid format"); + return of( + matchMap.get("organization"), + matchMap.get("location"), + matchMap.get("workload"), + matchMap.get("violation")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (ViolationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION_WORKLOAD_VIOLATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (workload != null) { + fieldMapBuilder.put("workload", workload); + } + if (violation != null) { + fieldMapBuilder.put("violation", violation); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION_LOCATION_WORKLOAD_VIOLATION.instantiate( + "organization", + organization, + "location", + location, + "workload", + workload, + "violation", + violation); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ViolationName that = ((ViolationName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location) + && Objects.equals(this.workload, that.workload) + && Objects.equals(this.violation, that.violation); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(workload); + h *= 1000003; + h ^= Objects.hashCode(violation); + return h; + } + + /** + * Builder for + * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}. + */ + public static class Builder { + private String organization; + private String location; + private String workload; + private String violation; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getWorkload() { + return workload; + } + + public String getViolation() { + return violation; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setWorkload(String workload) { + this.workload = workload; + return this; + } + + public Builder setViolation(String violation) { + this.violation = violation; + return this; + } + + private Builder(ViolationName violationName) { + this.organization = violationName.organization; + this.location = violationName.location; + this.workload = violationName.workload; + this.violation = violationName.violation; + } + + public ViolationName build() { + return new ViolationName(this); + } + } +} diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/ViolationOrBuilder.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/ViolationOrBuilder.java new file mode 100644 index 000000000000..80575428a992 --- /dev/null +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/ViolationOrBuilder.java @@ -0,0 +1,459 @@ +/* + * Copyright 2020 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/assuredworkloads/v1/assuredworkloads.proto + +package com.google.cloud.assuredworkloads.v1; + +public interface ViolationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1.Violation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Immutable. Name of the Violation.
+   * Format:
+   * organizations/{organization}/locations/{location}/workloads/{workload_id}/violations/{violations_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. Immutable. Name of the Violation.
+   * Format:
+   * organizations/{organization}/locations/{location}/workloads/{workload_id}/violations/{violations_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. Description for the Violation.
+   * e.g. OrgPolicy gcp.resourceLocations has non compliant value.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Output only. Description for the Violation.
+   * e.g. OrgPolicy gcp.resourceLocations has non compliant value.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. Time of the event which triggered the Violation.
+   * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the beginTime field is set. + */ + boolean hasBeginTime(); + /** + * + * + *
+   * Output only. Time of the event which triggered the Violation.
+   * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The beginTime. + */ + com.google.protobuf.Timestamp getBeginTime(); + /** + * + * + *
+   * Output only. Time of the event which triggered the Violation.
+   * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getBeginTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The last time when the Violation record was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The last time when the Violation record was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The last time when the Violation record was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Time of the event which fixed the Violation.
+   * If the violation is ACTIVE this will be empty.
+   * 
+ * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the resolveTime field is set. + */ + boolean hasResolveTime(); + /** + * + * + *
+   * Output only. Time of the event which fixed the Violation.
+   * If the violation is ACTIVE this will be empty.
+   * 
+ * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The resolveTime. + */ + com.google.protobuf.Timestamp getResolveTime(); + /** + * + * + *
+   * Output only. Time of the event which fixed the Violation.
+   * If the violation is ACTIVE this will be empty.
+   * 
+ * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getResolveTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Category under which this violation is mapped.
+   * e.g. Location, Service Usage, Access, Encryption, etc.
+   * 
+ * + * string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The category. + */ + java.lang.String getCategory(); + /** + * + * + *
+   * Output only. Category under which this violation is mapped.
+   * e.g. Location, Service Usage, Access, Encryption, etc.
+   * 
+ * + * string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for category. + */ + com.google.protobuf.ByteString getCategoryBytes(); + + /** + * + * + *
+   * Output only. State of the violation
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. State of the violation
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.assuredworkloads.v1.Violation.State getState(); + + /** + * + * + *
+   * Output only. Immutable. The org-policy-constraint that was incorrectly changed, which resulted in
+   * this violation.
+   * 
+ * + * + * string org_policy_constraint = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The orgPolicyConstraint. + */ + java.lang.String getOrgPolicyConstraint(); + /** + * + * + *
+   * Output only. Immutable. The org-policy-constraint that was incorrectly changed, which resulted in
+   * this violation.
+   * 
+ * + * + * string org_policy_constraint = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for orgPolicyConstraint. + */ + com.google.protobuf.ByteString getOrgPolicyConstraintBytes(); + + /** + * + * + *
+   * Output only. Immutable. Audit Log Link for violated resource
+   * Format:
+   * https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{timeRange}{folder}
+   * 
+ * + * + * string audit_log_link = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The auditLogLink. + */ + java.lang.String getAuditLogLink(); + /** + * + * + *
+   * Output only. Immutable. Audit Log Link for violated resource
+   * Format:
+   * https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{timeRange}{folder}
+   * 
+ * + * + * string audit_log_link = 11 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for auditLogLink. + */ + com.google.protobuf.ByteString getAuditLogLinkBytes(); + + /** + * + * + *
+   * Output only. Immutable. Name of the OrgPolicy which was modified with non-compliant change and
+   * resulted this violation.
+   *  Format:
+   *  projects/{project_number}/policies/{constraint_name}
+   *  folders/{folder_id}/policies/{constraint_name}
+   *  organizations/{organization_id}/policies/{constraint_name}
+   * 
+ * + * + * string non_compliant_org_policy = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The nonCompliantOrgPolicy. + */ + java.lang.String getNonCompliantOrgPolicy(); + /** + * + * + *
+   * Output only. Immutable. Name of the OrgPolicy which was modified with non-compliant change and
+   * resulted this violation.
+   *  Format:
+   *  projects/{project_number}/policies/{constraint_name}
+   *  folders/{folder_id}/policies/{constraint_name}
+   *  organizations/{organization_id}/policies/{constraint_name}
+   * 
+ * + * + * string non_compliant_org_policy = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for nonCompliantOrgPolicy. + */ + com.google.protobuf.ByteString getNonCompliantOrgPolicyBytes(); + + /** + * + * + *
+   * Output only. Compliance violation remediation
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the remediation field is set. + */ + boolean hasRemediation(); + /** + * + * + *
+   * Output only. Compliance violation remediation
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The remediation. + */ + com.google.cloud.assuredworkloads.v1.Violation.Remediation getRemediation(); + /** + * + * + *
+   * Output only. Compliance violation remediation
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.assuredworkloads.v1.Violation.RemediationOrBuilder getRemediationOrBuilder(); + + /** + * + * + *
+   * Output only. A boolean that indicates if the violation is acknowledged
+   * 
+ * + * bool acknowledged = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The acknowledged. + */ + boolean getAcknowledged(); + + /** + * + * + *
+   * Optional. Timestamp when this violation was acknowledged last.
+   * This will be absent when acknowledged field is marked as false.
+   * 
+ * + * + * optional .google.protobuf.Timestamp acknowledgement_time = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the acknowledgementTime field is set. + */ + boolean hasAcknowledgementTime(); + /** + * + * + *
+   * Optional. Timestamp when this violation was acknowledged last.
+   * This will be absent when acknowledged field is marked as false.
+   * 
+ * + * + * optional .google.protobuf.Timestamp acknowledgement_time = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The acknowledgementTime. + */ + com.google.protobuf.Timestamp getAcknowledgementTime(); + /** + * + * + *
+   * Optional. Timestamp when this violation was acknowledged last.
+   * This will be absent when acknowledged field is marked as false.
+   * 
+ * + * + * optional .google.protobuf.Timestamp acknowledgement_time = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.TimestampOrBuilder getAcknowledgementTimeOrBuilder(); +} diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/Workload.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/Workload.java index 0eec030de310..bcff42a28bb6 100644 --- a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/Workload.java +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/Workload.java @@ -48,6 +48,8 @@ private Workload() { provisionedResourcesParent_ = ""; resourceSettings_ = java.util.Collections.emptyList(); kajEnrollmentState_ = 0; + compliantButDisallowedServices_ = com.google.protobuf.LazyStringArrayList.EMPTY; + partner_ = 0; } @java.lang.Override @@ -61,197 +63,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private Workload( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - displayName_ = s; - break; - } - case 26: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - resources_ = - new java.util.ArrayList< - com.google.cloud.assuredworkloads.v1.Workload.ResourceInfo>(); - mutable_bitField0_ |= 0x00000001; - } - resources_.add( - input.readMessage( - com.google.cloud.assuredworkloads.v1.Workload.ResourceInfo.parser(), - extensionRegistry)); - break; - } - case 32: - { - int rawValue = input.readEnum(); - - complianceRegime_ = rawValue; - break; - } - case 42: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (createTime_ != null) { - subBuilder = createTime_.toBuilder(); - } - createTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(createTime_); - createTime_ = subBuilder.buildPartial(); - } - - break; - } - case 50: - { - java.lang.String s = input.readStringRequireUtf8(); - - billingAccount_ = s; - break; - } - case 74: - { - java.lang.String s = input.readStringRequireUtf8(); - - etag_ = s; - break; - } - case 82: - { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - labels_ = - com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000002; - } - com.google.protobuf.MapEntry labels__ = - input.readMessage( - LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); - break; - } - case 106: - { - java.lang.String s = input.readStringRequireUtf8(); - - provisionedResourcesParent_ = s; - break; - } - case 114: - { - com.google.cloud.assuredworkloads.v1.Workload.KMSSettings.Builder subBuilder = null; - if (kmsSettings_ != null) { - subBuilder = kmsSettings_.toBuilder(); - } - kmsSettings_ = - input.readMessage( - com.google.cloud.assuredworkloads.v1.Workload.KMSSettings.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(kmsSettings_); - kmsSettings_ = subBuilder.buildPartial(); - } - - break; - } - case 122: - { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - resourceSettings_ = - new java.util.ArrayList< - com.google.cloud.assuredworkloads.v1.Workload.ResourceSettings>(); - mutable_bitField0_ |= 0x00000004; - } - resourceSettings_.add( - input.readMessage( - com.google.cloud.assuredworkloads.v1.Workload.ResourceSettings.parser(), - extensionRegistry)); - break; - } - case 136: - { - int rawValue = input.readEnum(); - - kajEnrollmentState_ = rawValue; - break; - } - case 144: - { - enableSovereignControls_ = input.readBool(); - break; - } - case 162: - { - com.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.Builder - subBuilder = null; - if (saaEnrollmentResponse_ != null) { - subBuilder = saaEnrollmentResponse_.toBuilder(); - } - saaEnrollmentResponse_ = - input.readMessage( - com.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(saaEnrollmentResponse_); - saaEnrollmentResponse_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - resources_ = java.util.Collections.unmodifiableList(resources_); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - resourceSettings_ = java.util.Collections.unmodifiableList(resourceSettings_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1_Workload_descriptor; @@ -398,6 +209,16 @@ public enum ComplianceRegime implements com.google.protobuf.ProtocolMessageEnum * ITAR = 10; */ ITAR(10), + /** + * + * + *
+     * Assured Workloads for Partners;
+     * 
+ * + * ASSURED_WORKLOADS_FOR_PARTNERS = 12; + */ + ASSURED_WORKLOADS_FOR_PARTNERS(12), UNRECOGNIZED(-1), ; @@ -511,6 +332,16 @@ public enum ComplianceRegime implements com.google.protobuf.ProtocolMessageEnum * ITAR = 10; */ public static final int ITAR_VALUE = 10; + /** + * + * + *
+     * Assured Workloads for Partners;
+     * 
+ * + * ASSURED_WORKLOADS_FOR_PARTNERS = 12; + */ + public static final int ASSURED_WORKLOADS_FOR_PARTNERS_VALUE = 12; public final int getNumber() { if (this == UNRECOGNIZED) { @@ -558,6 +389,8 @@ public static ComplianceRegime forNumber(int value) { return CA_REGIONS_AND_SUPPORT; case 10: return ITAR; + case 12: + return ASSURED_WORKLOADS_FOR_PARTNERS; default: return null; } @@ -773,6 +606,141 @@ private KajEnrollmentState(int value) { // @@protoc_insertion_point(enum_scope:google.cloud.assuredworkloads.v1.Workload.KajEnrollmentState) } + /** + * + * + *
+   * Supported Assured Workloads Partners.
+   * 
+ * + * Protobuf enum {@code google.cloud.assuredworkloads.v1.Workload.Partner} + */ + public enum Partner implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unknown compliance regime.
+     * 
+ * + * PARTNER_UNSPECIFIED = 0; + */ + PARTNER_UNSPECIFIED(0), + /** + * + * + *
+     * S3NS regime
+     * 
+ * + * LOCAL_CONTROLS_BY_S3NS = 1; + */ + LOCAL_CONTROLS_BY_S3NS(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unknown compliance regime.
+     * 
+ * + * PARTNER_UNSPECIFIED = 0; + */ + public static final int PARTNER_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * S3NS regime
+     * 
+ * + * LOCAL_CONTROLS_BY_S3NS = 1; + */ + public static final int LOCAL_CONTROLS_BY_S3NS_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Partner valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Partner forNumber(int value) { + switch (value) { + case 0: + return PARTNER_UNSPECIFIED; + case 1: + return LOCAL_CONTROLS_BY_S3NS; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Partner findValueByNumber(int number) { + return Partner.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.assuredworkloads.v1.Workload.getDescriptor().getEnumTypes().get(2); + } + + private static final Partner[] VALUES = values(); + + public static Partner valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Partner(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.assuredworkloads.v1.Workload.Partner) + } + public interface ResourceInfoOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1.Workload.ResourceInfo) @@ -853,57 +821,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private ResourceInfo( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - resourceId_ = input.readInt64(); - break; - } - case 16: - { - int rawValue = input.readEnum(); - - resourceType_ = rawValue; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1_Workload_ResourceInfo_descriptor; @@ -944,11 +861,26 @@ public enum ResourceType implements com.google.protobuf.ProtocolMessageEnum { * *
        * Consumer project.
+       * AssuredWorkloads Projects are no longer supported. This field will be
+       * ignored only in CreateWorkload requests. ListWorkloads and GetWorkload
+       * will continue to provide projects information.
+       * Use CONSUMER_FOLDER instead.
        * 
* - * CONSUMER_PROJECT = 1; + * CONSUMER_PROJECT = 1 [deprecated = true]; */ + @java.lang.Deprecated CONSUMER_PROJECT(1), + /** + * + * + *
+       * Consumer Folder.
+       * 
+ * + * CONSUMER_FOLDER = 4; + */ + CONSUMER_FOLDER(4), /** * * @@ -987,11 +919,25 @@ public enum ResourceType implements com.google.protobuf.ProtocolMessageEnum { * *
        * Consumer project.
+       * AssuredWorkloads Projects are no longer supported. This field will be
+       * ignored only in CreateWorkload requests. ListWorkloads and GetWorkload
+       * will continue to provide projects information.
+       * Use CONSUMER_FOLDER instead.
        * 
* - * CONSUMER_PROJECT = 1; + * CONSUMER_PROJECT = 1 [deprecated = true]; */ - public static final int CONSUMER_PROJECT_VALUE = 1; + @java.lang.Deprecated public static final int CONSUMER_PROJECT_VALUE = 1; + /** + * + * + *
+       * Consumer Folder.
+       * 
+ * + * CONSUMER_FOLDER = 4; + */ + public static final int CONSUMER_FOLDER_VALUE = 4; /** * * @@ -1041,6 +987,8 @@ public static ResourceType forNumber(int value) { return RESOURCE_TYPE_UNSPECIFIED; case 1: return CONSUMER_PROJECT; + case 4: + return CONSUMER_FOLDER; case 2: return ENCRYPTION_KEYS_PROJECT; case 3: @@ -1184,7 +1132,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io .getNumber()) { output.writeEnum(2, resourceType_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -1202,7 +1150,7 @@ public int getSerializedSize() { .getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, resourceType_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -1220,7 +1168,7 @@ public boolean equals(final java.lang.Object obj) { if (getResourceId() != other.getResourceId()) return false; if (resourceType_ != other.resourceType_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1235,7 +1183,7 @@ public int hashCode() { hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getResourceId()); hash = (37 * hash) + RESOURCE_TYPE_FIELD_NUMBER; hash = (53 * hash) + resourceType_; - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -1367,17 +1315,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.assuredworkloads.v1.Workload.ResourceInfo.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -1476,7 +1417,7 @@ public Builder mergeFrom(com.google.cloud.assuredworkloads.v1.Workload.ResourceI if (other.resourceType_ != 0) { setResourceTypeValue(other.getResourceTypeValue()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1491,18 +1432,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1.Workload.ResourceInfo parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + resourceId_ = input.readInt64(); + + break; + } // case 8 + case 16: + { + resourceType_ = input.readEnum(); + + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1.Workload.ResourceInfo) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1701,7 +1667,19 @@ public ResourceInfo parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ResourceInfo(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -1720,6 +1698,7 @@ public com.google.cloud.assuredworkloads.v1.Workload.ResourceInfo getDefaultInst } } + @java.lang.Deprecated public interface KMSSettingsOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.assuredworkloads.v1.Workload.KMSSettings) @@ -1729,9 +1708,8 @@ public interface KMSSettingsOrBuilder * * *
-     * Required. Input only. Immutable. The time at which the Key Management
-     * Service will automatically create a new version of the crypto key and
-     * mark it as the primary.
+     * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+     * new version of the crypto key and mark it as the primary.
      * 
* * @@ -1745,9 +1723,8 @@ public interface KMSSettingsOrBuilder * * *
-     * Required. Input only. Immutable. The time at which the Key Management
-     * Service will automatically create a new version of the crypto key and
-     * mark it as the primary.
+     * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+     * new version of the crypto key and mark it as the primary.
      * 
* * @@ -1761,9 +1738,8 @@ public interface KMSSettingsOrBuilder * * *
-     * Required. Input only. Immutable. The time at which the Key Management
-     * Service will automatically create a new version of the crypto key and
-     * mark it as the primary.
+     * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+     * new version of the crypto key and mark it as the primary.
      * 
* * @@ -1776,9 +1752,9 @@ public interface KMSSettingsOrBuilder * * *
-     * Required. Input only. Immutable. [next_rotation_time] will be advanced by
-     * this period when the Key Management Service automatically rotates a key.
-     * Must be at least 24 hours and at most 876,000 hours.
+     * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+     * Management Service automatically rotates a key. Must be at least 24 hours
+     * and at most 876,000 hours.
      * 
* * @@ -1792,9 +1768,9 @@ public interface KMSSettingsOrBuilder * * *
-     * Required. Input only. Immutable. [next_rotation_time] will be advanced by
-     * this period when the Key Management Service automatically rotates a key.
-     * Must be at least 24 hours and at most 876,000 hours.
+     * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+     * Management Service automatically rotates a key. Must be at least 24 hours
+     * and at most 876,000 hours.
      * 
* * @@ -1808,9 +1784,9 @@ public interface KMSSettingsOrBuilder * * *
-     * Required. Input only. Immutable. [next_rotation_time] will be advanced by
-     * this period when the Key Management Service automatically rotates a key.
-     * Must be at least 24 hours and at most 876,000 hours.
+     * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+     * Management Service automatically rotates a key. Must be at least 24 hours
+     * and at most 876,000 hours.
      * 
* * @@ -1828,6 +1804,7 @@ public interface KMSSettingsOrBuilder * * Protobuf type {@code google.cloud.assuredworkloads.v1.Workload.KMSSettings} */ + @java.lang.Deprecated public static final class KMSSettings extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.assuredworkloads.v1.Workload.KMSSettings) @@ -1851,75 +1828,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private KMSSettings( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (nextRotationTime_ != null) { - subBuilder = nextRotationTime_.toBuilder(); - } - nextRotationTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(nextRotationTime_); - nextRotationTime_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.protobuf.Duration.Builder subBuilder = null; - if (rotationPeriod_ != null) { - subBuilder = rotationPeriod_.toBuilder(); - } - rotationPeriod_ = - input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(rotationPeriod_); - rotationPeriod_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1_Workload_KMSSettings_descriptor; @@ -1941,9 +1849,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-     * Required. Input only. Immutable. The time at which the Key Management
-     * Service will automatically create a new version of the crypto key and
-     * mark it as the primary.
+     * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+     * new version of the crypto key and mark it as the primary.
      * 
* * @@ -1960,9 +1867,8 @@ public boolean hasNextRotationTime() { * * *
-     * Required. Input only. Immutable. The time at which the Key Management
-     * Service will automatically create a new version of the crypto key and
-     * mark it as the primary.
+     * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+     * new version of the crypto key and mark it as the primary.
      * 
* * @@ -1981,9 +1887,8 @@ public com.google.protobuf.Timestamp getNextRotationTime() { * * *
-     * Required. Input only. Immutable. The time at which the Key Management
-     * Service will automatically create a new version of the crypto key and
-     * mark it as the primary.
+     * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+     * new version of the crypto key and mark it as the primary.
      * 
* * @@ -2001,9 +1906,9 @@ public com.google.protobuf.TimestampOrBuilder getNextRotationTimeOrBuilder() { * * *
-     * Required. Input only. Immutable. [next_rotation_time] will be advanced by
-     * this period when the Key Management Service automatically rotates a key.
-     * Must be at least 24 hours and at most 876,000 hours.
+     * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+     * Management Service automatically rotates a key. Must be at least 24 hours
+     * and at most 876,000 hours.
      * 
* * @@ -2020,9 +1925,9 @@ public boolean hasRotationPeriod() { * * *
-     * Required. Input only. Immutable. [next_rotation_time] will be advanced by
-     * this period when the Key Management Service automatically rotates a key.
-     * Must be at least 24 hours and at most 876,000 hours.
+     * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+     * Management Service automatically rotates a key. Must be at least 24 hours
+     * and at most 876,000 hours.
      * 
* * @@ -2041,9 +1946,9 @@ public com.google.protobuf.Duration getRotationPeriod() { * * *
-     * Required. Input only. Immutable. [next_rotation_time] will be advanced by
-     * this period when the Key Management Service automatically rotates a key.
-     * Must be at least 24 hours and at most 876,000 hours.
+     * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+     * Management Service automatically rotates a key. Must be at least 24 hours
+     * and at most 876,000 hours.
      * 
* * @@ -2075,7 +1980,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (rotationPeriod_ != null) { output.writeMessage(2, getRotationPeriod()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -2090,7 +1995,7 @@ public int getSerializedSize() { if (rotationPeriod_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRotationPeriod()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -2114,7 +2019,7 @@ public boolean equals(final java.lang.Object obj) { if (hasRotationPeriod()) { if (!getRotationPeriod().equals(other.getRotationPeriod())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -2133,7 +2038,7 @@ public int hashCode() { hash = (37 * hash) + ROTATION_PERIOD_FIELD_NUMBER; hash = (53 * hash) + getRotationPeriod().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -2265,17 +2170,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.assuredworkloads.v1.Workload.KMSSettings.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -2388,7 +2286,7 @@ public Builder mergeFrom(com.google.cloud.assuredworkloads.v1.Workload.KMSSettin if (other.hasRotationPeriod()) { mergeRotationPeriod(other.getRotationPeriod()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -2403,18 +2301,45 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1.Workload.KMSSettings parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getNextRotationTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage( + getRotationPeriodFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1.Workload.KMSSettings) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -2428,9 +2353,8 @@ public Builder mergeFrom( * * *
-       * Required. Input only. Immutable. The time at which the Key Management
-       * Service will automatically create a new version of the crypto key and
-       * mark it as the primary.
+       * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+       * new version of the crypto key and mark it as the primary.
        * 
* * @@ -2446,9 +2370,8 @@ public boolean hasNextRotationTime() { * * *
-       * Required. Input only. Immutable. The time at which the Key Management
-       * Service will automatically create a new version of the crypto key and
-       * mark it as the primary.
+       * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+       * new version of the crypto key and mark it as the primary.
        * 
* * @@ -2470,9 +2393,8 @@ public com.google.protobuf.Timestamp getNextRotationTime() { * * *
-       * Required. Input only. Immutable. The time at which the Key Management
-       * Service will automatically create a new version of the crypto key and
-       * mark it as the primary.
+       * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+       * new version of the crypto key and mark it as the primary.
        * 
* * @@ -2496,9 +2418,8 @@ public Builder setNextRotationTime(com.google.protobuf.Timestamp value) { * * *
-       * Required. Input only. Immutable. The time at which the Key Management
-       * Service will automatically create a new version of the crypto key and
-       * mark it as the primary.
+       * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+       * new version of the crypto key and mark it as the primary.
        * 
* * @@ -2519,9 +2440,8 @@ public Builder setNextRotationTime(com.google.protobuf.Timestamp.Builder builder * * *
-       * Required. Input only. Immutable. The time at which the Key Management
-       * Service will automatically create a new version of the crypto key and
-       * mark it as the primary.
+       * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+       * new version of the crypto key and mark it as the primary.
        * 
* * @@ -2549,9 +2469,8 @@ public Builder mergeNextRotationTime(com.google.protobuf.Timestamp value) { * * *
-       * Required. Input only. Immutable. The time at which the Key Management
-       * Service will automatically create a new version of the crypto key and
-       * mark it as the primary.
+       * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+       * new version of the crypto key and mark it as the primary.
        * 
* * @@ -2573,9 +2492,8 @@ public Builder clearNextRotationTime() { * * *
-       * Required. Input only. Immutable. The time at which the Key Management
-       * Service will automatically create a new version of the crypto key and
-       * mark it as the primary.
+       * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+       * new version of the crypto key and mark it as the primary.
        * 
* * @@ -2591,9 +2509,8 @@ public com.google.protobuf.Timestamp.Builder getNextRotationTimeBuilder() { * * *
-       * Required. Input only. Immutable. The time at which the Key Management
-       * Service will automatically create a new version of the crypto key and
-       * mark it as the primary.
+       * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+       * new version of the crypto key and mark it as the primary.
        * 
* * @@ -2613,9 +2530,8 @@ public com.google.protobuf.TimestampOrBuilder getNextRotationTimeOrBuilder() { * * *
-       * Required. Input only. Immutable. The time at which the Key Management
-       * Service will automatically create a new version of the crypto key and
-       * mark it as the primary.
+       * Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
+       * new version of the crypto key and mark it as the primary.
        * 
* * @@ -2649,9 +2565,9 @@ public com.google.protobuf.TimestampOrBuilder getNextRotationTimeOrBuilder() { * * *
-       * Required. Input only. Immutable. [next_rotation_time] will be advanced by
-       * this period when the Key Management Service automatically rotates a key.
-       * Must be at least 24 hours and at most 876,000 hours.
+       * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+       * Management Service automatically rotates a key. Must be at least 24 hours
+       * and at most 876,000 hours.
        * 
* * @@ -2667,9 +2583,9 @@ public boolean hasRotationPeriod() { * * *
-       * Required. Input only. Immutable. [next_rotation_time] will be advanced by
-       * this period when the Key Management Service automatically rotates a key.
-       * Must be at least 24 hours and at most 876,000 hours.
+       * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+       * Management Service automatically rotates a key. Must be at least 24 hours
+       * and at most 876,000 hours.
        * 
* * @@ -2691,9 +2607,9 @@ public com.google.protobuf.Duration getRotationPeriod() { * * *
-       * Required. Input only. Immutable. [next_rotation_time] will be advanced by
-       * this period when the Key Management Service automatically rotates a key.
-       * Must be at least 24 hours and at most 876,000 hours.
+       * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+       * Management Service automatically rotates a key. Must be at least 24 hours
+       * and at most 876,000 hours.
        * 
* * @@ -2717,9 +2633,9 @@ public Builder setRotationPeriod(com.google.protobuf.Duration value) { * * *
-       * Required. Input only. Immutable. [next_rotation_time] will be advanced by
-       * this period when the Key Management Service automatically rotates a key.
-       * Must be at least 24 hours and at most 876,000 hours.
+       * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+       * Management Service automatically rotates a key. Must be at least 24 hours
+       * and at most 876,000 hours.
        * 
* * @@ -2740,9 +2656,9 @@ public Builder setRotationPeriod(com.google.protobuf.Duration.Builder builderFor * * *
-       * Required. Input only. Immutable. [next_rotation_time] will be advanced by
-       * this period when the Key Management Service automatically rotates a key.
-       * Must be at least 24 hours and at most 876,000 hours.
+       * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+       * Management Service automatically rotates a key. Must be at least 24 hours
+       * and at most 876,000 hours.
        * 
* * @@ -2770,9 +2686,9 @@ public Builder mergeRotationPeriod(com.google.protobuf.Duration value) { * * *
-       * Required. Input only. Immutable. [next_rotation_time] will be advanced by
-       * this period when the Key Management Service automatically rotates a key.
-       * Must be at least 24 hours and at most 876,000 hours.
+       * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+       * Management Service automatically rotates a key. Must be at least 24 hours
+       * and at most 876,000 hours.
        * 
* * @@ -2794,9 +2710,9 @@ public Builder clearRotationPeriod() { * * *
-       * Required. Input only. Immutable. [next_rotation_time] will be advanced by
-       * this period when the Key Management Service automatically rotates a key.
-       * Must be at least 24 hours and at most 876,000 hours.
+       * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+       * Management Service automatically rotates a key. Must be at least 24 hours
+       * and at most 876,000 hours.
        * 
* * @@ -2812,9 +2728,9 @@ public com.google.protobuf.Duration.Builder getRotationPeriodBuilder() { * * *
-       * Required. Input only. Immutable. [next_rotation_time] will be advanced by
-       * this period when the Key Management Service automatically rotates a key.
-       * Must be at least 24 hours and at most 876,000 hours.
+       * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+       * Management Service automatically rotates a key. Must be at least 24 hours
+       * and at most 876,000 hours.
        * 
* * @@ -2834,9 +2750,9 @@ public com.google.protobuf.DurationOrBuilder getRotationPeriodOrBuilder() { * * *
-       * Required. Input only. Immutable. [next_rotation_time] will be advanced by
-       * this period when the Key Management Service automatically rotates a key.
-       * Must be at least 24 hours and at most 876,000 hours.
+       * Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
+       * Management Service automatically rotates a key. Must be at least 24 hours
+       * and at most 876,000 hours.
        * 
* * @@ -2893,7 +2809,19 @@ public KMSSettings parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new KMSSettings(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -2924,6 +2852,8 @@ public interface ResourceSettingsOrBuilder * Resource identifier. * For a project this represents project_id. If the project is already * taken, the workload creation will fail. + * For KeyRing, this represents the keyring_id. + * For a folder, don't set this value as folder_id is assigned by Google. *
* * string resource_id = 1; @@ -2938,6 +2868,8 @@ public interface ResourceSettingsOrBuilder * Resource identifier. * For a project this represents project_id. If the project is already * taken, the workload creation will fail. + * For KeyRing, this represents the keyring_id. + * For a folder, don't set this value as folder_id is assigned by Google. *
* * string resource_id = 1; @@ -3022,84 +2954,24 @@ public static final class ResourceSettings extends com.google.protobuf.Generated private static final long serialVersionUID = 0L; // Use ResourceSettings.newBuilder() to construct. private ResourceSettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ResourceSettings() { - resourceId_ = ""; - resourceType_ = 0; - displayName_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ResourceSettings(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ResourceSettings( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); + super(builder); + } - resourceId_ = s; - break; - } - case 16: - { - int rawValue = input.readEnum(); + private ResourceSettings() { + resourceId_ = ""; + resourceType_ = 0; + displayName_ = ""; + } - resourceType_ = rawValue; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ResourceSettings(); + } - displayName_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -3126,6 +2998,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * Resource identifier. * For a project this represents project_id. If the project is already * taken, the workload creation will fail. + * For KeyRing, this represents the keyring_id. + * For a folder, don't set this value as folder_id is assigned by Google. *
* * string resource_id = 1; @@ -3151,6 +3025,8 @@ public java.lang.String getResourceId() { * Resource identifier. * For a project this represents project_id. If the project is already * taken, the workload creation will fail. + * For KeyRing, this represents the keyring_id. + * For a folder, don't set this value as folder_id is assigned by Google. *
* * string resource_id = 1; @@ -3295,7 +3171,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, displayName_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -3316,7 +3192,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, displayName_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -3335,7 +3211,7 @@ public boolean equals(final java.lang.Object obj) { if (!getResourceId().equals(other.getResourceId())) return false; if (resourceType_ != other.resourceType_) return false; if (!getDisplayName().equals(other.getDisplayName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -3352,7 +3228,7 @@ public int hashCode() { hash = (53 * hash) + resourceType_; hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; hash = (53 * hash) + getDisplayName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -3484,17 +3360,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.assuredworkloads.v1.Workload.ResourceSettings.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -3602,7 +3471,7 @@ public Builder mergeFrom( displayName_ = other.displayName_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -3617,19 +3486,49 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1.Workload.ResourceSettings parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + resourceId_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + resourceType_ = input.readEnum(); + + break; + } // case 16 + case 26: + { + displayName_ = input.readStringRequireUtf8(); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1.Workload.ResourceSettings) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -3641,6 +3540,8 @@ public Builder mergeFrom( * Resource identifier. * For a project this represents project_id. If the project is already * taken, the workload creation will fail. + * For KeyRing, this represents the keyring_id. + * For a folder, don't set this value as folder_id is assigned by Google. *
* * string resource_id = 1; @@ -3665,6 +3566,8 @@ public java.lang.String getResourceId() { * Resource identifier. * For a project this represents project_id. If the project is already * taken, the workload creation will fail. + * For KeyRing, this represents the keyring_id. + * For a folder, don't set this value as folder_id is assigned by Google. *
* * string resource_id = 1; @@ -3689,6 +3592,8 @@ public com.google.protobuf.ByteString getResourceIdBytes() { * Resource identifier. * For a project this represents project_id. If the project is already * taken, the workload creation will fail. + * For KeyRing, this represents the keyring_id. + * For a folder, don't set this value as folder_id is assigned by Google. *
* * string resource_id = 1; @@ -3712,6 +3617,8 @@ public Builder setResourceId(java.lang.String value) { * Resource identifier. * For a project this represents project_id. If the project is already * taken, the workload creation will fail. + * For KeyRing, this represents the keyring_id. + * For a folder, don't set this value as folder_id is assigned by Google. *
* * string resource_id = 1; @@ -3731,6 +3638,8 @@ public Builder clearResourceId() { * Resource identifier. * For a project this represents project_id. If the project is already * taken, the workload creation will fail. + * For KeyRing, this represents the keyring_id. + * For a folder, don't set this value as folder_id is assigned by Google. *
* * string resource_id = 1; @@ -4016,7 +3925,19 @@ public ResourceSettings parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ResourceSettings(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -4194,81 +4115,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private SaaEnrollmentResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - int rawValue = input.readEnum(); - bitField0_ |= 0x00000001; - setupStatus_ = rawValue; - break; - } - case 16: - { - int rawValue = input.readEnum(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - setupErrors_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - setupErrors_.add(rawValue); - break; - } - case 18: - { - int length = input.readRawVarint32(); - int oldLimit = input.pushLimit(length); - while (input.getBytesUntilLimit() > 0) { - int rawValue = input.readEnum(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - setupErrors_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - setupErrors_.add(rawValue); - } - input.popLimit(oldLimit); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) != 0)) { - setupErrors_ = java.util.Collections.unmodifiableList(setupErrors_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1_Workload_SaaEnrollmentResponse_descriptor; @@ -4860,7 +4706,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < setupErrors_.size(); i++) { output.writeEnumNoTag(setupErrors_.get(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -4885,7 +4731,7 @@ public int getSerializedSize() { } setupErrorsMemoizedSerializedSize = dataSize; } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -4906,7 +4752,7 @@ public boolean equals(final java.lang.Object obj) { if (setupStatus_ != other.setupStatus_) return false; } if (!setupErrors_.equals(other.setupErrors_)) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -4925,7 +4771,7 @@ public int hashCode() { hash = (37 * hash) + SETUP_ERRORS_FIELD_NUMBER; hash = (53 * hash) + setupErrors_.hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -5059,17 +4905,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using // com.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -5188,7 +5027,7 @@ public Builder mergeFrom( } onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -5203,19 +5042,56 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + setupStatus_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + int tmpRaw = input.readEnum(); + ensureSetupErrorsIsMutable(); + setupErrors_.add(tmpRaw); + break; + } // case 16 + case 18: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureSetupErrorsIsMutable(); + setupErrors_.add(tmpRaw); + } + input.popLimit(oldLimit); + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -5637,7 +5513,19 @@ public SaaEnrollmentResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new SaaEnrollmentResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -5966,7 +5854,7 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * * *
-   * Required. Input only. The billing account used for the resources which are
+   * Optional. The billing account used for the resources which are
    * direct children of workload. This billing account is initially associated
    * with the resources created as part of Workload creation.
    * After the initial creation of these resources, the customer can change
@@ -5976,9 +5864,7 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() {
    * `billingAccounts/012345-567890-ABCDEF`.
    * 
* - * - * string billing_account = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; - * + * string billing_account = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @return The billingAccount. */ @@ -5998,7 +5884,7 @@ public java.lang.String getBillingAccount() { * * *
-   * Required. Input only. The billing account used for the resources which are
+   * Optional. The billing account used for the resources which are
    * direct children of workload. This billing account is initially associated
    * with the resources created as part of Workload creation.
    * After the initial creation of these resources, the customer can change
@@ -6008,9 +5894,7 @@ public java.lang.String getBillingAccount() {
    * `billingAccounts/012345-567890-ABCDEF`.
    * 
* - * - * string billing_account = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; - * + * string billing_account = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for billingAccount. */ @@ -6182,8 +6066,8 @@ public java.lang.String getLabelsOrThrow(java.lang.String key) { * * *
-   * Input only. The parent resource for the resources managed by this Assured
-   * Workload. May be either empty or a folder resource which is a child of the
+   * Input only. The parent resource for the resources managed by this Assured Workload. May
+   * be either empty or a folder resource which is a child of the
    * Workload parent. If not specified all resources are created under the
    * parent organization.
    * Format:
@@ -6211,8 +6095,8 @@ public java.lang.String getProvisionedResourcesParent() {
    *
    *
    * 
-   * Input only. The parent resource for the resources managed by this Assured
-   * Workload. May be either empty or a folder resource which is a child of the
+   * Input only. The parent resource for the resources managed by this Assured Workload. May
+   * be either empty or a folder resource which is a child of the
    * Workload parent. If not specified all resources are created under the
    * parent organization.
    * Format:
@@ -6243,18 +6127,23 @@ public com.google.protobuf.ByteString getProvisionedResourcesParentBytes() {
    *
    *
    * 
-   * Input only. Settings used to create a CMEK crypto key. When set a project
-   * with a KMS CMEK key is provisioned. This field is mandatory for a subset of
-   * Compliance Regimes.
+   * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS
+   * CMEK key is provisioned.
+   * This field is deprecated as of Feb 28, 2022.
+   * In order to create a Keyring, callers should specify,
+   * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field.
    * 
* * - * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; * * + * @deprecated google.cloud.assuredworkloads.v1.Workload.kms_settings is deprecated. See + * google/cloud/assuredworkloads/v1/assuredworkloads.proto;l=476 * @return Whether the kmsSettings field is set. */ @java.lang.Override + @java.lang.Deprecated public boolean hasKmsSettings() { return kmsSettings_ != null; } @@ -6262,18 +6151,23 @@ public boolean hasKmsSettings() { * * *
-   * Input only. Settings used to create a CMEK crypto key. When set a project
-   * with a KMS CMEK key is provisioned. This field is mandatory for a subset of
-   * Compliance Regimes.
+   * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS
+   * CMEK key is provisioned.
+   * This field is deprecated as of Feb 28, 2022.
+   * In order to create a Keyring, callers should specify,
+   * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field.
    * 
* * - * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; * * + * @deprecated google.cloud.assuredworkloads.v1.Workload.kms_settings is deprecated. See + * google/cloud/assuredworkloads/v1/assuredworkloads.proto;l=476 * @return The kmsSettings. */ @java.lang.Override + @java.lang.Deprecated public com.google.cloud.assuredworkloads.v1.Workload.KMSSettings getKmsSettings() { return kmsSettings_ == null ? com.google.cloud.assuredworkloads.v1.Workload.KMSSettings.getDefaultInstance() @@ -6283,16 +6177,19 @@ public com.google.cloud.assuredworkloads.v1.Workload.KMSSettings getKmsSettings( * * *
-   * Input only. Settings used to create a CMEK crypto key. When set a project
-   * with a KMS CMEK key is provisioned. This field is mandatory for a subset of
-   * Compliance Regimes.
+   * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS
+   * CMEK key is provisioned.
+   * This field is deprecated as of Feb 28, 2022.
+   * In order to create a Keyring, callers should specify,
+   * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field.
    * 
* * - * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; * */ @java.lang.Override + @java.lang.Deprecated public com.google.cloud.assuredworkloads.v1.Workload.KMSSettingsOrBuilder getKmsSettingsOrBuilder() { return getKmsSettings(); @@ -6305,9 +6202,9 @@ public com.google.cloud.assuredworkloads.v1.Workload.KMSSettings getKmsSettings( * * *
-   * Input only. Resource properties that are used to customize workload
-   * resources. These properties (such as custom project id) will be used to
-   * create workload resources if possible. This field is optional.
+   * Input only. Resource properties that are used to customize workload resources.
+   * These properties (such as custom project id) will be used to create
+   * workload resources if possible. This field is optional.
    * 
* * @@ -6323,9 +6220,9 @@ public com.google.cloud.assuredworkloads.v1.Workload.KMSSettings getKmsSettings( * * *
-   * Input only. Resource properties that are used to customize workload
-   * resources. These properties (such as custom project id) will be used to
-   * create workload resources if possible. This field is optional.
+   * Input only. Resource properties that are used to customize workload resources.
+   * These properties (such as custom project id) will be used to create
+   * workload resources if possible. This field is optional.
    * 
* * @@ -6342,9 +6239,9 @@ public com.google.cloud.assuredworkloads.v1.Workload.KMSSettings getKmsSettings( * * *
-   * Input only. Resource properties that are used to customize workload
-   * resources. These properties (such as custom project id) will be used to
-   * create workload resources if possible. This field is optional.
+   * Input only. Resource properties that are used to customize workload resources.
+   * These properties (such as custom project id) will be used to create
+   * workload resources if possible. This field is optional.
    * 
* * @@ -6359,9 +6256,9 @@ public int getResourceSettingsCount() { * * *
-   * Input only. Resource properties that are used to customize workload
-   * resources. These properties (such as custom project id) will be used to
-   * create workload resources if possible. This field is optional.
+   * Input only. Resource properties that are used to customize workload resources.
+   * These properties (such as custom project id) will be used to create
+   * workload resources if possible. This field is optional.
    * 
* * @@ -6377,9 +6274,9 @@ public com.google.cloud.assuredworkloads.v1.Workload.ResourceSettings getResourc * * *
-   * Input only. Resource properties that are used to customize workload
-   * resources. These properties (such as custom project id) will be used to
-   * create workload resources if possible. This field is optional.
+   * Input only. Resource properties that are used to customize workload resources.
+   * These properties (such as custom project id) will be used to create
+   * workload resources if possible. This field is optional.
    * 
* * @@ -6517,6 +6414,129 @@ public boolean hasSaaEnrollmentResponse() { return getSaaEnrollmentResponse(); } + public static final int COMPLIANT_BUT_DISALLOWED_SERVICES_FIELD_NUMBER = 24; + private com.google.protobuf.LazyStringList compliantButDisallowedServices_; + /** + * + * + *
+   * Output only. Urls for services which are compliant for this Assured Workload, but which
+   * are currently disallowed by the ResourceUsageRestriction org policy.
+   * Invoke RestrictAllowedResources endpoint to allow your project developers
+   * to use these services in their environment."
+   * 
+ * + * + * repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the compliantButDisallowedServices. + */ + public com.google.protobuf.ProtocolStringList getCompliantButDisallowedServicesList() { + return compliantButDisallowedServices_; + } + /** + * + * + *
+   * Output only. Urls for services which are compliant for this Assured Workload, but which
+   * are currently disallowed by the ResourceUsageRestriction org policy.
+   * Invoke RestrictAllowedResources endpoint to allow your project developers
+   * to use these services in their environment."
+   * 
+ * + * + * repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of compliantButDisallowedServices. + */ + public int getCompliantButDisallowedServicesCount() { + return compliantButDisallowedServices_.size(); + } + /** + * + * + *
+   * Output only. Urls for services which are compliant for this Assured Workload, but which
+   * are currently disallowed by the ResourceUsageRestriction org policy.
+   * Invoke RestrictAllowedResources endpoint to allow your project developers
+   * to use these services in their environment."
+   * 
+ * + * + * repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The compliantButDisallowedServices at the given index. + */ + public java.lang.String getCompliantButDisallowedServices(int index) { + return compliantButDisallowedServices_.get(index); + } + /** + * + * + *
+   * Output only. Urls for services which are compliant for this Assured Workload, but which
+   * are currently disallowed by the ResourceUsageRestriction org policy.
+   * Invoke RestrictAllowedResources endpoint to allow your project developers
+   * to use these services in their environment."
+   * 
+ * + * + * repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the compliantButDisallowedServices at the given index. + */ + public com.google.protobuf.ByteString getCompliantButDisallowedServicesBytes(int index) { + return compliantButDisallowedServices_.getByteString(index); + } + + public static final int PARTNER_FIELD_NUMBER = 25; + private int partner_; + /** + * + * + *
+   * Optional. Compliance Regime associated with this workload.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1.Workload.Partner partner = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for partner. + */ + @java.lang.Override + public int getPartnerValue() { + return partner_; + } + /** + * + * + *
+   * Optional. Compliance Regime associated with this workload.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1.Workload.Partner partner = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The partner. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Workload.Partner getPartner() { + @SuppressWarnings("deprecation") + com.google.cloud.assuredworkloads.v1.Workload.Partner result = + com.google.cloud.assuredworkloads.v1.Workload.Partner.valueOf(partner_); + return result == null + ? com.google.cloud.assuredworkloads.v1.Workload.Partner.UNRECOGNIZED + : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -6578,7 +6598,15 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (saaEnrollmentResponse_ != null) { output.writeMessage(20, getSaaEnrollmentResponse()); } - unknownFields.writeTo(output); + for (int i = 0; i < compliantButDisallowedServices_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 24, compliantButDisallowedServices_.getRaw(i)); + } + if (partner_ + != com.google.cloud.assuredworkloads.v1.Workload.Partner.PARTNER_UNSPECIFIED.getNumber()) { + output.writeEnum(25, partner_); + } + getUnknownFields().writeTo(output); } @java.lang.Override @@ -6645,7 +6673,19 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream.computeMessageSize(20, getSaaEnrollmentResponse()); } - size += unknownFields.getSerializedSize(); + { + int dataSize = 0; + for (int i = 0; i < compliantButDisallowedServices_.size(); i++) { + dataSize += computeStringSizeNoTag(compliantButDisallowedServices_.getRaw(i)); + } + size += dataSize; + size += 2 * getCompliantButDisallowedServicesList().size(); + } + if (partner_ + != com.google.cloud.assuredworkloads.v1.Workload.Partner.PARTNER_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(25, partner_); + } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -6685,7 +6725,10 @@ public boolean equals(final java.lang.Object obj) { if (hasSaaEnrollmentResponse()) { if (!getSaaEnrollmentResponse().equals(other.getSaaEnrollmentResponse())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getCompliantButDisallowedServicesList() + .equals(other.getCompliantButDisallowedServicesList())) return false; + if (partner_ != other.partner_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -6736,7 +6779,13 @@ public int hashCode() { hash = (37 * hash) + SAA_ENROLLMENT_RESPONSE_FIELD_NUMBER; hash = (53 * hash) + getSaaEnrollmentResponse().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + if (getCompliantButDisallowedServicesCount() > 0) { + hash = (37 * hash) + COMPLIANT_BUT_DISALLOWED_SERVICES_FIELD_NUMBER; + hash = (53 * hash) + getCompliantButDisallowedServicesList().hashCode(); + } + hash = (37 * hash) + PARTNER_FIELD_NUMBER; + hash = (53 * hash) + partner_; + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -6886,20 +6935,10 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } // Construct using com.google.cloud.assuredworkloads.v1.Workload.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getResourcesFieldBuilder(); - getResourceSettingsFieldBuilder(); - } } @java.lang.Override @@ -6911,10 +6950,11 @@ public Builder clear() { if (resourcesBuilder_ == null) { resources_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + resources_ = null; resourcesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); complianceRegime_ = 0; if (createTimeBuilder_ == null) { @@ -6938,10 +6978,11 @@ public Builder clear() { } if (resourceSettingsBuilder_ == null) { resourceSettings_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); } else { + resourceSettings_ = null; resourceSettingsBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000004); kajEnrollmentState_ = 0; enableSovereignControls_ = false; @@ -6952,6 +6993,10 @@ public Builder clear() { saaEnrollmentResponse_ = null; saaEnrollmentResponseBuilder_ = null; } + compliantButDisallowedServices_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + partner_ = 0; + return this; } @@ -7023,6 +7068,12 @@ public com.google.cloud.assuredworkloads.v1.Workload buildPartial() { } else { result.saaEnrollmentResponse_ = saaEnrollmentResponseBuilder_.build(); } + if (((bitField0_ & 0x00000008) != 0)) { + compliantButDisallowedServices_ = compliantButDisallowedServices_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.compliantButDisallowedServices_ = compliantButDisallowedServices_; + result.partner_ = partner_; onBuilt(); return result; } @@ -7165,32 +7216,178 @@ public Builder mergeFrom(com.google.cloud.assuredworkloads.v1.Workload other) { if (other.hasSaaEnrollmentResponse()) { mergeSaaEnrollmentResponse(other.getSaaEnrollmentResponse()); } - this.mergeUnknownFields(other.unknownFields); + if (!other.compliantButDisallowedServices_.isEmpty()) { + if (compliantButDisallowedServices_.isEmpty()) { + compliantButDisallowedServices_ = other.compliantButDisallowedServices_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureCompliantButDisallowedServicesIsMutable(); + compliantButDisallowedServices_.addAll(other.compliantButDisallowedServices_); + } + onChanged(); + } + if (other.partner_ != 0) { + setPartnerValue(other.getPartnerValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } - @java.lang.Override - public final boolean isInitialized() { - return true; - } + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + com.google.cloud.assuredworkloads.v1.Workload.ResourceInfo m = + input.readMessage( + com.google.cloud.assuredworkloads.v1.Workload.ResourceInfo.parser(), + extensionRegistry); + if (resourcesBuilder_ == null) { + ensureResourcesIsMutable(); + resources_.add(m); + } else { + resourcesBuilder_.addMessage(m); + } + break; + } // case 26 + case 32: + { + complianceRegime_ = input.readEnum(); + + break; + } // case 32 + case 42: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 42 + case 50: + { + billingAccount_ = input.readStringRequireUtf8(); + + break; + } // case 50 + case 74: + { + etag_ = input.readStringRequireUtf8(); + + break; + } // case 74 + case 82: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + break; + } // case 82 + case 106: + { + provisionedResourcesParent_ = input.readStringRequireUtf8(); + + break; + } // case 106 + case 114: + { + input.readMessage(getKmsSettingsFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 114 + case 122: + { + com.google.cloud.assuredworkloads.v1.Workload.ResourceSettings m = + input.readMessage( + com.google.cloud.assuredworkloads.v1.Workload.ResourceSettings.parser(), + extensionRegistry); + if (resourceSettingsBuilder_ == null) { + ensureResourceSettingsIsMutable(); + resourceSettings_.add(m); + } else { + resourceSettingsBuilder_.addMessage(m); + } + break; + } // case 122 + case 136: + { + kajEnrollmentState_ = input.readEnum(); + + break; + } // case 136 + case 144: + { + enableSovereignControls_ = input.readBool(); - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.assuredworkloads.v1.Workload parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + break; + } // case 144 + case 162: + { + input.readMessage( + getSaaEnrollmentResponseFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 162 + case 194: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureCompliantButDisallowedServicesIsMutable(); + compliantButDisallowedServices_.add(s); + break; + } // case 194 + case 200: + { + partner_ = input.readEnum(); + + break; + } // case 200 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.assuredworkloads.v1.Workload) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -8209,7 +8406,7 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * * *
-     * Required. Input only. The billing account used for the resources which are
+     * Optional. The billing account used for the resources which are
      * direct children of workload. This billing account is initially associated
      * with the resources created as part of Workload creation.
      * After the initial creation of these resources, the customer can change
@@ -8219,9 +8416,7 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() {
      * `billingAccounts/012345-567890-ABCDEF`.
      * 
* - * - * string billing_account = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; - * + * string billing_account = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @return The billingAccount. */ @@ -8240,7 +8435,7 @@ public java.lang.String getBillingAccount() { * * *
-     * Required. Input only. The billing account used for the resources which are
+     * Optional. The billing account used for the resources which are
      * direct children of workload. This billing account is initially associated
      * with the resources created as part of Workload creation.
      * After the initial creation of these resources, the customer can change
@@ -8250,9 +8445,7 @@ public java.lang.String getBillingAccount() {
      * `billingAccounts/012345-567890-ABCDEF`.
      * 
* - * - * string billing_account = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; - * + * string billing_account = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for billingAccount. */ @@ -8271,7 +8464,7 @@ public com.google.protobuf.ByteString getBillingAccountBytes() { * * *
-     * Required. Input only. The billing account used for the resources which are
+     * Optional. The billing account used for the resources which are
      * direct children of workload. This billing account is initially associated
      * with the resources created as part of Workload creation.
      * After the initial creation of these resources, the customer can change
@@ -8281,9 +8474,7 @@ public com.google.protobuf.ByteString getBillingAccountBytes() {
      * `billingAccounts/012345-567890-ABCDEF`.
      * 
* - * - * string billing_account = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; - * + * string billing_account = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The billingAccount to set. * @return This builder for chaining. @@ -8301,7 +8492,7 @@ public Builder setBillingAccount(java.lang.String value) { * * *
-     * Required. Input only. The billing account used for the resources which are
+     * Optional. The billing account used for the resources which are
      * direct children of workload. This billing account is initially associated
      * with the resources created as part of Workload creation.
      * After the initial creation of these resources, the customer can change
@@ -8311,9 +8502,7 @@ public Builder setBillingAccount(java.lang.String value) {
      * `billingAccounts/012345-567890-ABCDEF`.
      * 
* - * - * string billing_account = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; - * + * string billing_account = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ @@ -8327,7 +8516,7 @@ public Builder clearBillingAccount() { * * *
-     * Required. Input only. The billing account used for the resources which are
+     * Optional. The billing account used for the resources which are
      * direct children of workload. This billing account is initially associated
      * with the resources created as part of Workload creation.
      * After the initial creation of these resources, the customer can change
@@ -8337,9 +8526,7 @@ public Builder clearBillingAccount() {
      * `billingAccounts/012345-567890-ABCDEF`.
      * 
* - * - * string billing_account = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; - * + * string billing_account = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The bytes for billingAccount to set. * @return This builder for chaining. @@ -8629,8 +8816,8 @@ public Builder putAllLabels(java.util.Map va * * *
-     * Input only. The parent resource for the resources managed by this Assured
-     * Workload. May be either empty or a folder resource which is a child of the
+     * Input only. The parent resource for the resources managed by this Assured Workload. May
+     * be either empty or a folder resource which is a child of the
      * Workload parent. If not specified all resources are created under the
      * parent organization.
      * Format:
@@ -8657,8 +8844,8 @@ public java.lang.String getProvisionedResourcesParent() {
      *
      *
      * 
-     * Input only. The parent resource for the resources managed by this Assured
-     * Workload. May be either empty or a folder resource which is a child of the
+     * Input only. The parent resource for the resources managed by this Assured Workload. May
+     * be either empty or a folder resource which is a child of the
      * Workload parent. If not specified all resources are created under the
      * parent organization.
      * Format:
@@ -8685,8 +8872,8 @@ public com.google.protobuf.ByteString getProvisionedResourcesParentBytes() {
      *
      *
      * 
-     * Input only. The parent resource for the resources managed by this Assured
-     * Workload. May be either empty or a folder resource which is a child of the
+     * Input only. The parent resource for the resources managed by this Assured Workload. May
+     * be either empty or a folder resource which is a child of the
      * Workload parent. If not specified all resources are created under the
      * parent organization.
      * Format:
@@ -8712,8 +8899,8 @@ public Builder setProvisionedResourcesParent(java.lang.String value) {
      *
      *
      * 
-     * Input only. The parent resource for the resources managed by this Assured
-     * Workload. May be either empty or a folder resource which is a child of the
+     * Input only. The parent resource for the resources managed by this Assured Workload. May
+     * be either empty or a folder resource which is a child of the
      * Workload parent. If not specified all resources are created under the
      * parent organization.
      * Format:
@@ -8735,8 +8922,8 @@ public Builder clearProvisionedResourcesParent() {
      *
      *
      * 
-     * Input only. The parent resource for the resources managed by this Assured
-     * Workload. May be either empty or a folder resource which is a child of the
+     * Input only. The parent resource for the resources managed by this Assured Workload. May
+     * be either empty or a folder resource which is a child of the
      * Workload parent. If not specified all resources are created under the
      * parent organization.
      * Format:
@@ -8770,17 +8957,22 @@ public Builder setProvisionedResourcesParentBytes(com.google.protobuf.ByteString
      *
      *
      * 
-     * Input only. Settings used to create a CMEK crypto key. When set a project
-     * with a KMS CMEK key is provisioned. This field is mandatory for a subset of
-     * Compliance Regimes.
+     * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS
+     * CMEK key is provisioned.
+     * This field is deprecated as of Feb 28, 2022.
+     * In order to create a Keyring, callers should specify,
+     * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field.
      * 
* * - * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; * * + * @deprecated google.cloud.assuredworkloads.v1.Workload.kms_settings is deprecated. See + * google/cloud/assuredworkloads/v1/assuredworkloads.proto;l=476 * @return Whether the kmsSettings field is set. */ + @java.lang.Deprecated public boolean hasKmsSettings() { return kmsSettingsBuilder_ != null || kmsSettings_ != null; } @@ -8788,17 +8980,22 @@ public boolean hasKmsSettings() { * * *
-     * Input only. Settings used to create a CMEK crypto key. When set a project
-     * with a KMS CMEK key is provisioned. This field is mandatory for a subset of
-     * Compliance Regimes.
+     * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS
+     * CMEK key is provisioned.
+     * This field is deprecated as of Feb 28, 2022.
+     * In order to create a Keyring, callers should specify,
+     * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field.
      * 
* * - * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; * * + * @deprecated google.cloud.assuredworkloads.v1.Workload.kms_settings is deprecated. See + * google/cloud/assuredworkloads/v1/assuredworkloads.proto;l=476 * @return The kmsSettings. */ + @java.lang.Deprecated public com.google.cloud.assuredworkloads.v1.Workload.KMSSettings getKmsSettings() { if (kmsSettingsBuilder_ == null) { return kmsSettings_ == null @@ -8812,15 +9009,18 @@ public com.google.cloud.assuredworkloads.v1.Workload.KMSSettings getKmsSettings( * * *
-     * Input only. Settings used to create a CMEK crypto key. When set a project
-     * with a KMS CMEK key is provisioned. This field is mandatory for a subset of
-     * Compliance Regimes.
+     * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS
+     * CMEK key is provisioned.
+     * This field is deprecated as of Feb 28, 2022.
+     * In order to create a Keyring, callers should specify,
+     * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field.
      * 
* * - * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; * */ + @java.lang.Deprecated public Builder setKmsSettings(com.google.cloud.assuredworkloads.v1.Workload.KMSSettings value) { if (kmsSettingsBuilder_ == null) { if (value == null) { @@ -8838,15 +9038,18 @@ public Builder setKmsSettings(com.google.cloud.assuredworkloads.v1.Workload.KMSS * * *
-     * Input only. Settings used to create a CMEK crypto key. When set a project
-     * with a KMS CMEK key is provisioned. This field is mandatory for a subset of
-     * Compliance Regimes.
+     * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS
+     * CMEK key is provisioned.
+     * This field is deprecated as of Feb 28, 2022.
+     * In order to create a Keyring, callers should specify,
+     * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field.
      * 
* * - * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; * */ + @java.lang.Deprecated public Builder setKmsSettings( com.google.cloud.assuredworkloads.v1.Workload.KMSSettings.Builder builderForValue) { if (kmsSettingsBuilder_ == null) { @@ -8862,15 +9065,18 @@ public Builder setKmsSettings( * * *
-     * Input only. Settings used to create a CMEK crypto key. When set a project
-     * with a KMS CMEK key is provisioned. This field is mandatory for a subset of
-     * Compliance Regimes.
+     * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS
+     * CMEK key is provisioned.
+     * This field is deprecated as of Feb 28, 2022.
+     * In order to create a Keyring, callers should specify,
+     * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field.
      * 
* * - * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; * */ + @java.lang.Deprecated public Builder mergeKmsSettings( com.google.cloud.assuredworkloads.v1.Workload.KMSSettings value) { if (kmsSettingsBuilder_ == null) { @@ -8893,15 +9099,18 @@ public Builder mergeKmsSettings( * * *
-     * Input only. Settings used to create a CMEK crypto key. When set a project
-     * with a KMS CMEK key is provisioned. This field is mandatory for a subset of
-     * Compliance Regimes.
+     * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS
+     * CMEK key is provisioned.
+     * This field is deprecated as of Feb 28, 2022.
+     * In order to create a Keyring, callers should specify,
+     * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field.
      * 
* * - * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; * */ + @java.lang.Deprecated public Builder clearKmsSettings() { if (kmsSettingsBuilder_ == null) { kmsSettings_ = null; @@ -8917,15 +9126,18 @@ public Builder clearKmsSettings() { * * *
-     * Input only. Settings used to create a CMEK crypto key. When set a project
-     * with a KMS CMEK key is provisioned. This field is mandatory for a subset of
-     * Compliance Regimes.
+     * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS
+     * CMEK key is provisioned.
+     * This field is deprecated as of Feb 28, 2022.
+     * In order to create a Keyring, callers should specify,
+     * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field.
      * 
* * - * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; * */ + @java.lang.Deprecated public com.google.cloud.assuredworkloads.v1.Workload.KMSSettings.Builder getKmsSettingsBuilder() { @@ -8936,15 +9148,18 @@ public Builder clearKmsSettings() { * * *
-     * Input only. Settings used to create a CMEK crypto key. When set a project
-     * with a KMS CMEK key is provisioned. This field is mandatory for a subset of
-     * Compliance Regimes.
+     * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS
+     * CMEK key is provisioned.
+     * This field is deprecated as of Feb 28, 2022.
+     * In order to create a Keyring, callers should specify,
+     * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field.
      * 
* * - * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; * */ + @java.lang.Deprecated public com.google.cloud.assuredworkloads.v1.Workload.KMSSettingsOrBuilder getKmsSettingsOrBuilder() { if (kmsSettingsBuilder_ != null) { @@ -8959,13 +9174,15 @@ public Builder clearKmsSettings() { * * *
-     * Input only. Settings used to create a CMEK crypto key. When set a project
-     * with a KMS CMEK key is provisioned. This field is mandatory for a subset of
-     * Compliance Regimes.
+     * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS
+     * CMEK key is provisioned.
+     * This field is deprecated as of Feb 28, 2022.
+     * In order to create a Keyring, callers should specify,
+     * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field.
      * 
* * - * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; * */ private com.google.protobuf.SingleFieldBuilderV3< @@ -9007,9 +9224,9 @@ private void ensureResourceSettingsIsMutable() { * * *
-     * Input only. Resource properties that are used to customize workload
-     * resources. These properties (such as custom project id) will be used to
-     * create workload resources if possible. This field is optional.
+     * Input only. Resource properties that are used to customize workload resources.
+     * These properties (such as custom project id) will be used to create
+     * workload resources if possible. This field is optional.
      * 
* * @@ -9028,9 +9245,9 @@ private void ensureResourceSettingsIsMutable() { * * *
-     * Input only. Resource properties that are used to customize workload
-     * resources. These properties (such as custom project id) will be used to
-     * create workload resources if possible. This field is optional.
+     * Input only. Resource properties that are used to customize workload resources.
+     * These properties (such as custom project id) will be used to create
+     * workload resources if possible. This field is optional.
      * 
* * @@ -9048,9 +9265,9 @@ public int getResourceSettingsCount() { * * *
-     * Input only. Resource properties that are used to customize workload
-     * resources. These properties (such as custom project id) will be used to
-     * create workload resources if possible. This field is optional.
+     * Input only. Resource properties that are used to customize workload resources.
+     * These properties (such as custom project id) will be used to create
+     * workload resources if possible. This field is optional.
      * 
* * @@ -9069,9 +9286,9 @@ public com.google.cloud.assuredworkloads.v1.Workload.ResourceSettings getResourc * * *
-     * Input only. Resource properties that are used to customize workload
-     * resources. These properties (such as custom project id) will be used to
-     * create workload resources if possible. This field is optional.
+     * Input only. Resource properties that are used to customize workload resources.
+     * These properties (such as custom project id) will be used to create
+     * workload resources if possible. This field is optional.
      * 
* * @@ -9096,9 +9313,9 @@ public Builder setResourceSettings( * * *
-     * Input only. Resource properties that are used to customize workload
-     * resources. These properties (such as custom project id) will be used to
-     * create workload resources if possible. This field is optional.
+     * Input only. Resource properties that are used to customize workload resources.
+     * These properties (such as custom project id) will be used to create
+     * workload resources if possible. This field is optional.
      * 
* * @@ -9121,9 +9338,9 @@ public Builder setResourceSettings( * * *
-     * Input only. Resource properties that are used to customize workload
-     * resources. These properties (such as custom project id) will be used to
-     * create workload resources if possible. This field is optional.
+     * Input only. Resource properties that are used to customize workload resources.
+     * These properties (such as custom project id) will be used to create
+     * workload resources if possible. This field is optional.
      * 
* * @@ -9148,9 +9365,9 @@ public Builder addResourceSettings( * * *
-     * Input only. Resource properties that are used to customize workload
-     * resources. These properties (such as custom project id) will be used to
-     * create workload resources if possible. This field is optional.
+     * Input only. Resource properties that are used to customize workload resources.
+     * These properties (such as custom project id) will be used to create
+     * workload resources if possible. This field is optional.
      * 
* * @@ -9175,9 +9392,9 @@ public Builder addResourceSettings( * * *
-     * Input only. Resource properties that are used to customize workload
-     * resources. These properties (such as custom project id) will be used to
-     * create workload resources if possible. This field is optional.
+     * Input only. Resource properties that are used to customize workload resources.
+     * These properties (such as custom project id) will be used to create
+     * workload resources if possible. This field is optional.
      * 
* * @@ -9199,9 +9416,9 @@ public Builder addResourceSettings( * * *
-     * Input only. Resource properties that are used to customize workload
-     * resources. These properties (such as custom project id) will be used to
-     * create workload resources if possible. This field is optional.
+     * Input only. Resource properties that are used to customize workload resources.
+     * These properties (such as custom project id) will be used to create
+     * workload resources if possible. This field is optional.
      * 
* * @@ -9224,9 +9441,9 @@ public Builder addResourceSettings( * * *
-     * Input only. Resource properties that are used to customize workload
-     * resources. These properties (such as custom project id) will be used to
-     * create workload resources if possible. This field is optional.
+     * Input only. Resource properties that are used to customize workload resources.
+     * These properties (such as custom project id) will be used to create
+     * workload resources if possible. This field is optional.
      * 
* * @@ -9249,9 +9466,9 @@ public Builder addAllResourceSettings( * * *
-     * Input only. Resource properties that are used to customize workload
-     * resources. These properties (such as custom project id) will be used to
-     * create workload resources if possible. This field is optional.
+     * Input only. Resource properties that are used to customize workload resources.
+     * These properties (such as custom project id) will be used to create
+     * workload resources if possible. This field is optional.
      * 
* * @@ -9272,9 +9489,9 @@ public Builder clearResourceSettings() { * * *
-     * Input only. Resource properties that are used to customize workload
-     * resources. These properties (such as custom project id) will be used to
-     * create workload resources if possible. This field is optional.
+     * Input only. Resource properties that are used to customize workload resources.
+     * These properties (such as custom project id) will be used to create
+     * workload resources if possible. This field is optional.
      * 
* * @@ -9295,9 +9512,9 @@ public Builder removeResourceSettings(int index) { * * *
-     * Input only. Resource properties that are used to customize workload
-     * resources. These properties (such as custom project id) will be used to
-     * create workload resources if possible. This field is optional.
+     * Input only. Resource properties that are used to customize workload resources.
+     * These properties (such as custom project id) will be used to create
+     * workload resources if possible. This field is optional.
      * 
* * @@ -9312,9 +9529,9 @@ public Builder removeResourceSettings(int index) { * * *
-     * Input only. Resource properties that are used to customize workload
-     * resources. These properties (such as custom project id) will be used to
-     * create workload resources if possible. This field is optional.
+     * Input only. Resource properties that are used to customize workload resources.
+     * These properties (such as custom project id) will be used to create
+     * workload resources if possible. This field is optional.
      * 
* * @@ -9333,9 +9550,9 @@ public Builder removeResourceSettings(int index) { * * *
-     * Input only. Resource properties that are used to customize workload
-     * resources. These properties (such as custom project id) will be used to
-     * create workload resources if possible. This field is optional.
+     * Input only. Resource properties that are used to customize workload resources.
+     * These properties (such as custom project id) will be used to create
+     * workload resources if possible. This field is optional.
      * 
* * @@ -9355,9 +9572,9 @@ public Builder removeResourceSettings(int index) { * * *
-     * Input only. Resource properties that are used to customize workload
-     * resources. These properties (such as custom project id) will be used to
-     * create workload resources if possible. This field is optional.
+     * Input only. Resource properties that are used to customize workload resources.
+     * These properties (such as custom project id) will be used to create
+     * workload resources if possible. This field is optional.
      * 
* * @@ -9374,9 +9591,9 @@ public Builder removeResourceSettings(int index) { * * *
-     * Input only. Resource properties that are used to customize workload
-     * resources. These properties (such as custom project id) will be used to
-     * create workload resources if possible. This field is optional.
+     * Input only. Resource properties that are used to customize workload resources.
+     * These properties (such as custom project id) will be used to create
+     * workload resources if possible. This field is optional.
      * 
* * @@ -9394,9 +9611,9 @@ public Builder removeResourceSettings(int index) { * * *
-     * Input only. Resource properties that are used to customize workload
-     * resources. These properties (such as custom project id) will be used to
-     * create workload resources if possible. This field is optional.
+     * Input only. Resource properties that are used to customize workload resources.
+     * These properties (such as custom project id) will be used to create
+     * workload resources if possible. This field is optional.
      * 
* * @@ -9821,6 +10038,325 @@ public Builder clearSaaEnrollmentResponse() { return saaEnrollmentResponseBuilder_; } + private com.google.protobuf.LazyStringList compliantButDisallowedServices_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureCompliantButDisallowedServicesIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + compliantButDisallowedServices_ = + new com.google.protobuf.LazyStringArrayList(compliantButDisallowedServices_); + bitField0_ |= 0x00000008; + } + } + /** + * + * + *
+     * Output only. Urls for services which are compliant for this Assured Workload, but which
+     * are currently disallowed by the ResourceUsageRestriction org policy.
+     * Invoke RestrictAllowedResources endpoint to allow your project developers
+     * to use these services in their environment."
+     * 
+ * + * + * repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the compliantButDisallowedServices. + */ + public com.google.protobuf.ProtocolStringList getCompliantButDisallowedServicesList() { + return compliantButDisallowedServices_.getUnmodifiableView(); + } + /** + * + * + *
+     * Output only. Urls for services which are compliant for this Assured Workload, but which
+     * are currently disallowed by the ResourceUsageRestriction org policy.
+     * Invoke RestrictAllowedResources endpoint to allow your project developers
+     * to use these services in their environment."
+     * 
+ * + * + * repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of compliantButDisallowedServices. + */ + public int getCompliantButDisallowedServicesCount() { + return compliantButDisallowedServices_.size(); + } + /** + * + * + *
+     * Output only. Urls for services which are compliant for this Assured Workload, but which
+     * are currently disallowed by the ResourceUsageRestriction org policy.
+     * Invoke RestrictAllowedResources endpoint to allow your project developers
+     * to use these services in their environment."
+     * 
+ * + * + * repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The compliantButDisallowedServices at the given index. + */ + public java.lang.String getCompliantButDisallowedServices(int index) { + return compliantButDisallowedServices_.get(index); + } + /** + * + * + *
+     * Output only. Urls for services which are compliant for this Assured Workload, but which
+     * are currently disallowed by the ResourceUsageRestriction org policy.
+     * Invoke RestrictAllowedResources endpoint to allow your project developers
+     * to use these services in their environment."
+     * 
+ * + * + * repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the compliantButDisallowedServices at the given index. + */ + public com.google.protobuf.ByteString getCompliantButDisallowedServicesBytes(int index) { + return compliantButDisallowedServices_.getByteString(index); + } + /** + * + * + *
+     * Output only. Urls for services which are compliant for this Assured Workload, but which
+     * are currently disallowed by the ResourceUsageRestriction org policy.
+     * Invoke RestrictAllowedResources endpoint to allow your project developers
+     * to use these services in their environment."
+     * 
+ * + * + * repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index to set the value at. + * @param value The compliantButDisallowedServices to set. + * @return This builder for chaining. + */ + public Builder setCompliantButDisallowedServices(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCompliantButDisallowedServicesIsMutable(); + compliantButDisallowedServices_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Urls for services which are compliant for this Assured Workload, but which
+     * are currently disallowed by the ResourceUsageRestriction org policy.
+     * Invoke RestrictAllowedResources endpoint to allow your project developers
+     * to use these services in their environment."
+     * 
+ * + * + * repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The compliantButDisallowedServices to add. + * @return This builder for chaining. + */ + public Builder addCompliantButDisallowedServices(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCompliantButDisallowedServicesIsMutable(); + compliantButDisallowedServices_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Urls for services which are compliant for this Assured Workload, but which
+     * are currently disallowed by the ResourceUsageRestriction org policy.
+     * Invoke RestrictAllowedResources endpoint to allow your project developers
+     * to use these services in their environment."
+     * 
+ * + * + * repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param values The compliantButDisallowedServices to add. + * @return This builder for chaining. + */ + public Builder addAllCompliantButDisallowedServices( + java.lang.Iterable values) { + ensureCompliantButDisallowedServicesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, compliantButDisallowedServices_); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Urls for services which are compliant for this Assured Workload, but which
+     * are currently disallowed by the ResourceUsageRestriction org policy.
+     * Invoke RestrictAllowedResources endpoint to allow your project developers
+     * to use these services in their environment."
+     * 
+ * + * + * repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearCompliantButDisallowedServices() { + compliantButDisallowedServices_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Urls for services which are compliant for this Assured Workload, but which
+     * are currently disallowed by the ResourceUsageRestriction org policy.
+     * Invoke RestrictAllowedResources endpoint to allow your project developers
+     * to use these services in their environment."
+     * 
+ * + * + * repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes of the compliantButDisallowedServices to add. + * @return This builder for chaining. + */ + public Builder addCompliantButDisallowedServicesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCompliantButDisallowedServicesIsMutable(); + compliantButDisallowedServices_.add(value); + onChanged(); + return this; + } + + private int partner_ = 0; + /** + * + * + *
+     * Optional. Compliance Regime associated with this workload.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Workload.Partner partner = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for partner. + */ + @java.lang.Override + public int getPartnerValue() { + return partner_; + } + /** + * + * + *
+     * Optional. Compliance Regime associated with this workload.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Workload.Partner partner = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for partner to set. + * @return This builder for chaining. + */ + public Builder setPartnerValue(int value) { + + partner_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Compliance Regime associated with this workload.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Workload.Partner partner = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The partner. + */ + @java.lang.Override + public com.google.cloud.assuredworkloads.v1.Workload.Partner getPartner() { + @SuppressWarnings("deprecation") + com.google.cloud.assuredworkloads.v1.Workload.Partner result = + com.google.cloud.assuredworkloads.v1.Workload.Partner.valueOf(partner_); + return result == null + ? com.google.cloud.assuredworkloads.v1.Workload.Partner.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. Compliance Regime associated with this workload.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Workload.Partner partner = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The partner to set. + * @return This builder for chaining. + */ + public Builder setPartner(com.google.cloud.assuredworkloads.v1.Workload.Partner value) { + if (value == null) { + throw new NullPointerException(); + } + + partner_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Compliance Regime associated with this workload.
+     * 
+ * + * + * .google.cloud.assuredworkloads.v1.Workload.Partner partner = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearPartner() { + + partner_ = 0; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); @@ -9853,7 +10389,18 @@ public Workload parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Workload(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/WorkloadOrBuilder.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/WorkloadOrBuilder.java index 64b611f90b46..74756e140165 100644 --- a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/WorkloadOrBuilder.java +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/java/com/google/cloud/assuredworkloads/v1/WorkloadOrBuilder.java @@ -239,7 +239,7 @@ com.google.cloud.assuredworkloads.v1.Workload.ResourceInfoOrBuilder getResources * * *
-   * Required. Input only. The billing account used for the resources which are
+   * Optional. The billing account used for the resources which are
    * direct children of workload. This billing account is initially associated
    * with the resources created as part of Workload creation.
    * After the initial creation of these resources, the customer can change
@@ -249,9 +249,7 @@ com.google.cloud.assuredworkloads.v1.Workload.ResourceInfoOrBuilder getResources
    * `billingAccounts/012345-567890-ABCDEF`.
    * 
* - * - * string billing_account = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; - * + * string billing_account = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @return The billingAccount. */ @@ -260,7 +258,7 @@ com.google.cloud.assuredworkloads.v1.Workload.ResourceInfoOrBuilder getResources * * *
-   * Required. Input only. The billing account used for the resources which are
+   * Optional. The billing account used for the resources which are
    * direct children of workload. This billing account is initially associated
    * with the resources created as part of Workload creation.
    * After the initial creation of these resources, the customer can change
@@ -270,9 +268,7 @@ com.google.cloud.assuredworkloads.v1.Workload.ResourceInfoOrBuilder getResources
    * `billingAccounts/012345-567890-ABCDEF`.
    * 
* - * - * string billing_account = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; - * + * string billing_account = 6 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for billingAccount. */ @@ -368,8 +364,8 @@ java.lang.String getLabelsOrDefault( * * *
-   * Input only. The parent resource for the resources managed by this Assured
-   * Workload. May be either empty or a folder resource which is a child of the
+   * Input only. The parent resource for the resources managed by this Assured Workload. May
+   * be either empty or a folder resource which is a child of the
    * Workload parent. If not specified all resources are created under the
    * parent organization.
    * Format:
@@ -386,8 +382,8 @@ java.lang.String getLabelsOrDefault(
    *
    *
    * 
-   * Input only. The parent resource for the resources managed by this Assured
-   * Workload. May be either empty or a folder resource which is a child of the
+   * Input only. The parent resource for the resources managed by this Assured Workload. May
+   * be either empty or a folder resource which is a child of the
    * Workload parent. If not specified all resources are created under the
    * parent organization.
    * Format:
@@ -405,56 +401,69 @@ java.lang.String getLabelsOrDefault(
    *
    *
    * 
-   * Input only. Settings used to create a CMEK crypto key. When set a project
-   * with a KMS CMEK key is provisioned. This field is mandatory for a subset of
-   * Compliance Regimes.
+   * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS
+   * CMEK key is provisioned.
+   * This field is deprecated as of Feb 28, 2022.
+   * In order to create a Keyring, callers should specify,
+   * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field.
    * 
* * - * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; * * + * @deprecated google.cloud.assuredworkloads.v1.Workload.kms_settings is deprecated. See + * google/cloud/assuredworkloads/v1/assuredworkloads.proto;l=476 * @return Whether the kmsSettings field is set. */ + @java.lang.Deprecated boolean hasKmsSettings(); /** * * *
-   * Input only. Settings used to create a CMEK crypto key. When set a project
-   * with a KMS CMEK key is provisioned. This field is mandatory for a subset of
-   * Compliance Regimes.
+   * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS
+   * CMEK key is provisioned.
+   * This field is deprecated as of Feb 28, 2022.
+   * In order to create a Keyring, callers should specify,
+   * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field.
    * 
* * - * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; * * + * @deprecated google.cloud.assuredworkloads.v1.Workload.kms_settings is deprecated. See + * google/cloud/assuredworkloads/v1/assuredworkloads.proto;l=476 * @return The kmsSettings. */ + @java.lang.Deprecated com.google.cloud.assuredworkloads.v1.Workload.KMSSettings getKmsSettings(); /** * * *
-   * Input only. Settings used to create a CMEK crypto key. When set a project
-   * with a KMS CMEK key is provisioned. This field is mandatory for a subset of
-   * Compliance Regimes.
+   * Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS
+   * CMEK key is provisioned.
+   * This field is deprecated as of Feb 28, 2022.
+   * In order to create a Keyring, callers should specify,
+   * ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field.
    * 
* * - * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [(.google.api.field_behavior) = INPUT_ONLY]; + * .google.cloud.assuredworkloads.v1.Workload.KMSSettings kms_settings = 14 [deprecated = true, (.google.api.field_behavior) = INPUT_ONLY]; * */ + @java.lang.Deprecated com.google.cloud.assuredworkloads.v1.Workload.KMSSettingsOrBuilder getKmsSettingsOrBuilder(); /** * * *
-   * Input only. Resource properties that are used to customize workload
-   * resources. These properties (such as custom project id) will be used to
-   * create workload resources if possible. This field is optional.
+   * Input only. Resource properties that are used to customize workload resources.
+   * These properties (such as custom project id) will be used to create
+   * workload resources if possible. This field is optional.
    * 
* * @@ -467,9 +476,9 @@ java.lang.String getLabelsOrDefault( * * *
-   * Input only. Resource properties that are used to customize workload
-   * resources. These properties (such as custom project id) will be used to
-   * create workload resources if possible. This field is optional.
+   * Input only. Resource properties that are used to customize workload resources.
+   * These properties (such as custom project id) will be used to create
+   * workload resources if possible. This field is optional.
    * 
* * @@ -481,9 +490,9 @@ java.lang.String getLabelsOrDefault( * * *
-   * Input only. Resource properties that are used to customize workload
-   * resources. These properties (such as custom project id) will be used to
-   * create workload resources if possible. This field is optional.
+   * Input only. Resource properties that are used to customize workload resources.
+   * These properties (such as custom project id) will be used to create
+   * workload resources if possible. This field is optional.
    * 
* * @@ -495,9 +504,9 @@ java.lang.String getLabelsOrDefault( * * *
-   * Input only. Resource properties that are used to customize workload
-   * resources. These properties (such as custom project id) will be used to
-   * create workload resources if possible. This field is optional.
+   * Input only. Resource properties that are used to customize workload resources.
+   * These properties (such as custom project id) will be used to create
+   * workload resources if possible. This field is optional.
    * 
* * @@ -510,9 +519,9 @@ java.lang.String getLabelsOrDefault( * * *
-   * Input only. Resource properties that are used to customize workload
-   * resources. These properties (such as custom project id) will be used to
-   * create workload resources if possible. This field is optional.
+   * Input only. Resource properties that are used to customize workload resources.
+   * These properties (such as custom project id) will be used to create
+   * workload resources if possible. This field is optional.
    * 
* * @@ -612,4 +621,104 @@ java.lang.String getLabelsOrDefault( */ com.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponseOrBuilder getSaaEnrollmentResponseOrBuilder(); + + /** + * + * + *
+   * Output only. Urls for services which are compliant for this Assured Workload, but which
+   * are currently disallowed by the ResourceUsageRestriction org policy.
+   * Invoke RestrictAllowedResources endpoint to allow your project developers
+   * to use these services in their environment."
+   * 
+ * + * + * repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return A list containing the compliantButDisallowedServices. + */ + java.util.List getCompliantButDisallowedServicesList(); + /** + * + * + *
+   * Output only. Urls for services which are compliant for this Assured Workload, but which
+   * are currently disallowed by the ResourceUsageRestriction org policy.
+   * Invoke RestrictAllowedResources endpoint to allow your project developers
+   * to use these services in their environment."
+   * 
+ * + * + * repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The count of compliantButDisallowedServices. + */ + int getCompliantButDisallowedServicesCount(); + /** + * + * + *
+   * Output only. Urls for services which are compliant for this Assured Workload, but which
+   * are currently disallowed by the ResourceUsageRestriction org policy.
+   * Invoke RestrictAllowedResources endpoint to allow your project developers
+   * to use these services in their environment."
+   * 
+ * + * + * repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the element to return. + * @return The compliantButDisallowedServices at the given index. + */ + java.lang.String getCompliantButDisallowedServices(int index); + /** + * + * + *
+   * Output only. Urls for services which are compliant for this Assured Workload, but which
+   * are currently disallowed by the ResourceUsageRestriction org policy.
+   * Invoke RestrictAllowedResources endpoint to allow your project developers
+   * to use these services in their environment."
+   * 
+ * + * + * repeated string compliant_but_disallowed_services = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param index The index of the value to return. + * @return The bytes of the compliantButDisallowedServices at the given index. + */ + com.google.protobuf.ByteString getCompliantButDisallowedServicesBytes(int index); + + /** + * + * + *
+   * Optional. Compliance Regime associated with this workload.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1.Workload.Partner partner = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for partner. + */ + int getPartnerValue(); + /** + * + * + *
+   * Optional. Compliance Regime associated with this workload.
+   * 
+ * + * + * .google.cloud.assuredworkloads.v1.Workload.Partner partner = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The partner. + */ + com.google.cloud.assuredworkloads.v1.Workload.Partner getPartner(); } diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/proto/google/cloud/assuredworkloads/v1/assuredworkloads.proto b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/proto/google/cloud/assuredworkloads/v1/assuredworkloads.proto index 9d4045e46d2a..7068506f6121 100644 --- a/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/proto/google/cloud/assuredworkloads/v1/assuredworkloads.proto +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1/src/main/proto/google/cloud/assuredworkloads/v1/assuredworkloads.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -41,12 +41,10 @@ option (google.api.resource_definition) = { // Service to manage AssuredWorkloads. service AssuredWorkloadsService { option (google.api.default_host) = "assuredworkloads.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; // Creates Assured Workload. - rpc CreateWorkload(CreateWorkloadRequest) - returns (google.longrunning.Operation) { + rpc CreateWorkload(CreateWorkloadRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=organizations/*/locations/*}/workloads" body: "workload" @@ -70,6 +68,19 @@ service AssuredWorkloadsService { option (google.api.method_signature) = "workload,update_mask"; } + // Restrict the list of resources allowed in the Workload environment. + // The current list of allowed products can be found at + // https://cloud.google.com/assured-workloads/docs/supported-products + // In addition to assuredworkloads.workload.update permission, the user should + // also have orgpolicy.policy.set permission on the folder resource + // to use this functionality. + rpc RestrictAllowedResources(RestrictAllowedResourcesRequest) returns (RestrictAllowedResourcesResponse) { + option (google.api.http) = { + post: "/v1/{name=organizations/*/locations/*/workloads/*}:restrictAllowedResources" + body: "*" + }; + } + // Deletes the workload. Make sure that workload's direct children are already // in a deleted state, otherwise the request will fail with a // FAILED_PRECONDITION error. @@ -95,6 +106,27 @@ service AssuredWorkloadsService { }; option (google.api.method_signature) = "parent"; } + + // Lists the Violations in the AssuredWorkload Environment. + // Callers may also choose to read across multiple Workloads as per + // [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash + // character) as a wildcard character instead of workload-id in the parent. + // Format `organizations/{org_id}/locations/{location}/workloads/-` + rpc ListViolations(ListViolationsRequest) returns (ListViolationsResponse) { + option (google.api.method_signature) = "parent"; + } + + // Retrieves Assured Workload Violation based on ID. + rpc GetViolation(GetViolationRequest) returns (Violation) { + option (google.api.method_signature) = "name"; + } + + // Acknowledges an existing violation. By acknowledging a violation, users + // acknowledge the existence of a compliance violation in their workload and + // decide to ignore it due to a valid business justification. Acknowledgement + // is a permanent operation and it cannot be reverted. + rpc AcknowledgeViolation(AcknowledgeViolationRequest) returns (AcknowledgeViolationResponse) { + } } // Request for creating a workload. @@ -111,8 +143,8 @@ message CreateWorkloadRequest { // Required. Assured Workload to create Workload workload = 2 [(google.api.field_behavior) = REQUIRED]; - // Optional. A identifier associated with the workload and underlying projects - // which allows for the break down of billing costs for a workload. The value + // Optional. A identifier associated with the workload and underlying projects which + // allows for the break down of billing costs for a workload. The value // provided for the identifier will add a label to the workload and contained // projects with the identifier as the value. string external_id = 3 [(google.api.field_behavior) = OPTIONAL]; @@ -121,14 +153,13 @@ message CreateWorkloadRequest { // Request for Updating a workload. message UpdateWorkloadRequest { // Required. The workload to update. - // The workload’s `name` field is used to identify the workload to be updated. + // The workload's `name` field is used to identify the workload to be updated. // Format: // organizations/{org_id}/locations/{location_id}/workloads/{workload_id} Workload workload = 1 [(google.api.field_behavior) = REQUIRED]; // Required. The list of fields to be updated. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; } // Request for deleting a Workload. @@ -150,8 +181,8 @@ message DeleteWorkloadRequest { // Request for fetching a workload. message GetWorkloadRequest { - // Required. The resource name of the Workload to fetch. This is the - // workloads's relative path in the API, formatted as + // Required. The resource name of the Workload to fetch. This is the workloads's + // relative path in the API, formatted as // "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". // For example, // "organizations/123/locations/us-east1/workloads/assured-workload-1". @@ -212,7 +243,14 @@ message Workload { RESOURCE_TYPE_UNSPECIFIED = 0; // Consumer project. - CONSUMER_PROJECT = 1; + // AssuredWorkloads Projects are no longer supported. This field will be + // ignored only in CreateWorkload requests. ListWorkloads and GetWorkload + // will continue to provide projects information. + // Use CONSUMER_FOLDER instead. + CONSUMER_PROJECT = 1 [deprecated = true]; + + // Consumer Folder. + CONSUMER_FOLDER = 4; // Consumer project containing encryption keys. ENCRYPTION_KEYS_PROJECT = 2; @@ -229,20 +267,60 @@ message Workload { ResourceType resource_type = 2; } + // Supported Compliance Regimes. + enum ComplianceRegime { + // Unknown compliance regime. + COMPLIANCE_REGIME_UNSPECIFIED = 0; + + // Information protection as per DoD IL4 requirements. + IL4 = 1; + + // Criminal Justice Information Services (CJIS) Security policies. + CJIS = 2; + + // FedRAMP High data protection controls + FEDRAMP_HIGH = 3; + + // FedRAMP Moderate data protection controls + FEDRAMP_MODERATE = 4; + + // Assured Workloads For US Regions data protection controls + US_REGIONAL_ACCESS = 5; + + // Health Insurance Portability and Accountability Act controls + HIPAA = 6; + + // Health Information Trust Alliance controls + HITRUST = 7; + + // Assured Workloads For EU Regions and Support controls + EU_REGIONS_AND_SUPPORT = 8; + + // Assured Workloads For Canada Regions and Support controls + CA_REGIONS_AND_SUPPORT = 9; + + // International Traffic in Arms Regulations + ITAR = 10; + + // Assured Workloads for Partners; + ASSURED_WORKLOADS_FOR_PARTNERS = 12; + } + // Settings specific to the Key Management Service. message KMSSettings { - // Required. Input only. Immutable. The time at which the Key Management - // Service will automatically create a new version of the crypto key and - // mark it as the primary. + option deprecated = true; + + // Required. Input only. Immutable. The time at which the Key Management Service will automatically create a + // new version of the crypto key and mark it as the primary. google.protobuf.Timestamp next_rotation_time = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = INPUT_ONLY, (google.api.field_behavior) = IMMUTABLE ]; - // Required. Input only. Immutable. [next_rotation_time] will be advanced by - // this period when the Key Management Service automatically rotates a key. - // Must be at least 24 hours and at most 876,000 hours. + // Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key + // Management Service automatically rotates a key. Must be at least 24 hours + // and at most 876,000 hours. google.protobuf.Duration rotation_period = 2 [ (google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = INPUT_ONLY, @@ -255,6 +333,8 @@ message Workload { // Resource identifier. // For a project this represents project_id. If the project is already // taken, the workload creation will fail. + // For KeyRing, this represents the keyring_id. + // For a folder, don't set this value as folder_id is assigned by Google. string resource_id = 1; // Indicates the type of resource. This field should be specified to @@ -268,6 +348,18 @@ message Workload { string display_name = 3; } + // Key Access Justifications(KAJ) Enrollment State. + enum KajEnrollmentState { + // Default State for KAJ Enrollment. + KAJ_ENROLLMENT_STATE_UNSPECIFIED = 0; + + // Pending State for KAJ Enrollment. + KAJ_ENROLLMENT_STATE_PENDING = 1; + + // Complete State for KAJ Enrollment. + KAJ_ENROLLMENT_STATE_COMPLETE = 2; + } + // Signed Access Approvals (SAA) enrollment response. message SaaEnrollmentResponse { // Setup state of SAA enrollment. @@ -310,52 +402,13 @@ message Workload { repeated SetupError setup_errors = 2; } - // Supported Compliance Regimes. - enum ComplianceRegime { + // Supported Assured Workloads Partners. + enum Partner { // Unknown compliance regime. - COMPLIANCE_REGIME_UNSPECIFIED = 0; - - // Information protection as per DoD IL4 requirements. - IL4 = 1; - - // Criminal Justice Information Services (CJIS) Security policies. - CJIS = 2; - - // FedRAMP High data protection controls - FEDRAMP_HIGH = 3; - - // FedRAMP Moderate data protection controls - FEDRAMP_MODERATE = 4; - - // Assured Workloads For US Regions data protection controls - US_REGIONAL_ACCESS = 5; + PARTNER_UNSPECIFIED = 0; - // Health Insurance Portability and Accountability Act controls - HIPAA = 6; - - // Health Information Trust Alliance controls - HITRUST = 7; - - // Assured Workloads For EU Regions and Support controls - EU_REGIONS_AND_SUPPORT = 8; - - // Assured Workloads For Canada Regions and Support controls - CA_REGIONS_AND_SUPPORT = 9; - - // International Traffic in Arms Regulations - ITAR = 10; - } - - // Key Access Justifications(KAJ) Enrollment State. - enum KajEnrollmentState { - // Default State for KAJ Enrollment. - KAJ_ENROLLMENT_STATE_UNSPECIFIED = 0; - - // Pending State for KAJ Enrollment. - KAJ_ENROLLMENT_STATE_PENDING = 1; - - // Complete State for KAJ Enrollment. - KAJ_ENROLLMENT_STATE_COMPLETE = 2; + // S3NS regime + LOCAL_CONTROLS_BY_S3NS = 1; } // Optional. The resource name of the workload. @@ -377,8 +430,7 @@ message Workload { // These resources will be created when creating the workload. // If any of the projects already exist, the workload creation will fail. // Always read only. - repeated ResourceInfo resources = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; + repeated ResourceInfo resources = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; // Required. Immutable. Compliance Regime associated with this workload. ComplianceRegime compliance_regime = 4 [ @@ -392,7 +444,7 @@ message Workload { (google.api.field_behavior) = IMMUTABLE ]; - // Required. Input only. The billing account used for the resources which are + // Optional. The billing account used for the resources which are // direct children of workload. This billing account is initially associated // with the resources created as part of Workload creation. // After the initial creation of these resources, the customer can change @@ -400,10 +452,7 @@ message Workload { // The resource name has the form // `billingAccounts/{billing_account_id}`. For example, // `billingAccounts/012345-567890-ABCDEF`. - string billing_account = 6 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = INPUT_ONLY - ]; + string billing_account = 6 [(google.api.field_behavior) = OPTIONAL]; // Optional. ETag of the workload, it is calculated on the basis // of the Workload contents. It will be used in Update & Delete operations. @@ -412,29 +461,31 @@ message Workload { // Optional. Labels applied to the workload. map labels = 10 [(google.api.field_behavior) = OPTIONAL]; - // Input only. The parent resource for the resources managed by this Assured - // Workload. May be either empty or a folder resource which is a child of the + // Input only. The parent resource for the resources managed by this Assured Workload. May + // be either empty or a folder resource which is a child of the // Workload parent. If not specified all resources are created under the // parent organization. // Format: // folders/{folder_id} - string provisioned_resources_parent = 13 - [(google.api.field_behavior) = INPUT_ONLY]; - - // Input only. Settings used to create a CMEK crypto key. When set a project - // with a KMS CMEK key is provisioned. This field is mandatory for a subset of - // Compliance Regimes. - KMSSettings kms_settings = 14 [(google.api.field_behavior) = INPUT_ONLY]; + string provisioned_resources_parent = 13 [(google.api.field_behavior) = INPUT_ONLY]; + + // Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS + // CMEK key is provisioned. + // This field is deprecated as of Feb 28, 2022. + // In order to create a Keyring, callers should specify, + // ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field. + KMSSettings kms_settings = 14 [ + deprecated = true, + (google.api.field_behavior) = INPUT_ONLY + ]; - // Input only. Resource properties that are used to customize workload - // resources. These properties (such as custom project id) will be used to - // create workload resources if possible. This field is optional. - repeated ResourceSettings resource_settings = 15 - [(google.api.field_behavior) = INPUT_ONLY]; + // Input only. Resource properties that are used to customize workload resources. + // These properties (such as custom project id) will be used to create + // workload resources if possible. This field is optional. + repeated ResourceSettings resource_settings = 15 [(google.api.field_behavior) = INPUT_ONLY]; // Output only. Represents the KAJ enrollment state of the given workload. - KajEnrollmentState kaj_enrollment_state = 17 - [(google.api.field_behavior) = OUTPUT_ONLY]; + KajEnrollmentState kaj_enrollment_state = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; // Optional. Indicates the sovereignty status of the given workload. // Currently meant to be used by Europe/Canada customers. @@ -443,15 +494,22 @@ message Workload { // Output only. Represents the SAA enrollment response of the given workload. // SAA enrollment response is queried during GetWorkload call. // In failure cases, user friendly error message is shown in SAA details page. - SaaEnrollmentResponse saa_enrollment_response = 20 - [(google.api.field_behavior) = OUTPUT_ONLY]; + SaaEnrollmentResponse saa_enrollment_response = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Urls for services which are compliant for this Assured Workload, but which + // are currently disallowed by the ResourceUsageRestriction org policy. + // Invoke RestrictAllowedResources endpoint to allow your project developers + // to use these services in their environment." + repeated string compliant_but_disallowed_services = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Compliance Regime associated with this workload. + Partner partner = 25 [(google.api.field_behavior) = OPTIONAL]; } // Operation metadata to give request details of CreateWorkload. message CreateWorkloadOperationMetadata { // Optional. Time when the operation was created. - google.protobuf.Timestamp create_time = 1 - [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OPTIONAL]; // Optional. The display name of the workload. string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; @@ -459,8 +517,282 @@ message CreateWorkloadOperationMetadata { // Optional. The parent of the workload. string parent = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Compliance controls that should be applied to the resources - // managed by the workload. - Workload.ComplianceRegime compliance_regime = 4 - [(google.api.field_behavior) = OPTIONAL]; + // Optional. Compliance controls that should be applied to the resources managed by + // the workload. + Workload.ComplianceRegime compliance_regime = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for restricting list of available resources in Workload environment. +message RestrictAllowedResourcesRequest { + // The type of restriction. + enum RestrictionType { + // Unknown restriction type. + RESTRICTION_TYPE_UNSPECIFIED = 0; + + // Allow the use all of all gcp products, irrespective of the compliance + // posture. This effectively removes gcp.restrictServiceUsage OrgPolicy + // on the AssuredWorkloads Folder. + ALLOW_ALL_GCP_RESOURCES = 1; + + // Based on Workload's compliance regime, allowed list changes. + // See - https://cloud.google.com/assured-workloads/docs/supported-products + // for the list of supported resources. + ALLOW_COMPLIANT_RESOURCES = 2; + } + + // Required. The resource name of the Workload. This is the workloads's + // relative path in the API, formatted as + // "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + // For example, + // "organizations/123/locations/us-east1/workloads/assured-workload-1". + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The type of restriction for using gcp products in the Workload environment. + RestrictionType restriction_type = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response for restricting the list of allowed resources. +message RestrictAllowedResourcesResponse { + +} + +// Request for acknowledging the violation +// Next Id: 4 +message AcknowledgeViolationRequest { + // Required. The resource name of the Violation to acknowledge. + // Format: + // organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation} + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Business justification explaining the need for violation acknowledgement + string comment = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Name of the OrgPolicy which was modified with non-compliant change and + // resulted in this violation. + // Format: + // projects/{project_number}/policies/{constraint_name} + // folders/{folder_id}/policies/{constraint_name} + // organizations/{organization_id}/policies/{constraint_name} + string non_compliant_org_policy = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for violation acknowledgement +message AcknowledgeViolationResponse { + +} + +// Interval defining a time window. +message TimeWindow { + // The start of the time window. + google.protobuf.Timestamp start_time = 1; + + // The end of the time window. + google.protobuf.Timestamp end_time = 2; +} + +// Request for fetching violations in an organization. +message ListViolationsRequest { + // Required. The Workload name. + // Format `organizations/{org_id}/locations/{location}/workloads/{workload}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "assuredworkloads.googleapis.com/Violation" + } + ]; + + // Optional. Specifies the time window for retrieving active Violations. + // When specified, retrieves Violations that were active between start_time + // and end_time. + TimeWindow interval = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Page size. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Page token returned from previous request. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A custom filter for filtering by the Violations properties. + string filter = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response of ListViolations endpoint. +message ListViolationsResponse { + // List of Violations under a Workload. + repeated Violation violations = 1; + + // The next page token. Returns empty if reached the last page. + string next_page_token = 2; +} + +// Request for fetching a Workload Violation. +message GetViolationRequest { + // Required. The resource name of the Violation to fetch (ie. Violation.name). + // Format: + // organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "assuredworkloads.googleapis.com/Violation" + } + ]; +} + +// Workload monitoring Violation. +message Violation { + option (google.api.resource) = { + type: "assuredworkloads.googleapis.com/Violation" + pattern: "organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}" + }; + + // Violation State Values + enum State { + // Unspecified state. + STATE_UNSPECIFIED = 0; + + // Violation is resolved. + RESOLVED = 2; + + // Violation is Unresolved + UNRESOLVED = 3; + + // Violation is Exception + EXCEPTION = 4; + } + + // Represents remediation guidance to resolve compliance violation for + // AssuredWorkload + message Remediation { + // Classifying remediation into various types based on the kind of + // violation. For example, violations caused due to changes in boolean org + // policy requires different remediation instructions compared to violation + // caused due to changes in allowed values of list org policy. + enum RemediationType { + // Unspecified remediation type + REMEDIATION_TYPE_UNSPECIFIED = 0; + + // Remediation type for boolean org policy + REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION = 1; + + // Remediation type for list org policy which have allowed values in the + // monitoring rule + REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION = 2; + + // Remediation type for list org policy which have denied values in the + // monitoring rule + REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION = 3; + + // Remediation type for gcp.restrictCmekCryptoKeyProjects + REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION = 4; + } + + // Instructions to remediate violation + message Instructions { + // Remediation instructions to resolve violation via gcloud cli + message Gcloud { + // Gcloud command to resolve violation + repeated string gcloud_commands = 1; + + // Steps to resolve violation via gcloud cli + repeated string steps = 2; + + // Additional urls for more information about steps + repeated string additional_links = 3; + } + + // Remediation instructions to resolve violation via cloud console + message Console { + // Link to console page where violations can be resolved + repeated string console_uris = 1; + + // Steps to resolve violation via cloud console + repeated string steps = 2; + + // Additional urls for more information about steps + repeated string additional_links = 3; + } + + // Remediation instructions to resolve violation via gcloud cli + Gcloud gcloud_instructions = 1; + + // Remediation instructions to resolve violation via cloud console + Console console_instructions = 2; + } + + // Required. Remediation instructions to resolve violations + Instructions instructions = 1 [(google.api.field_behavior) = REQUIRED]; + + // Values that can resolve the violation + // For example: for list org policy violations, this will either be the list + // of allowed or denied values + repeated string compliant_values = 2; + + // Output only. Reemediation type based on the type of org policy values violated + RemediationType remediation_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. Immutable. Name of the Violation. + // Format: + // organizations/{organization}/locations/{location}/workloads/{workload_id}/violations/{violations_id} + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. Description for the Violation. + // e.g. OrgPolicy gcp.resourceLocations has non compliant value. + string description = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time of the event which triggered the Violation. + google.protobuf.Timestamp begin_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last time when the Violation record was updated. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time of the event which fixed the Violation. + // If the violation is ACTIVE this will be empty. + google.protobuf.Timestamp resolve_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Category under which this violation is mapped. + // e.g. Location, Service Usage, Access, Encryption, etc. + string category = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. State of the violation + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Immutable. The org-policy-constraint that was incorrectly changed, which resulted in + // this violation. + string org_policy_constraint = 8 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. Immutable. Audit Log Link for violated resource + // Format: + // https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{timeRange}{folder} + string audit_log_link = 11 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. Immutable. Name of the OrgPolicy which was modified with non-compliant change and + // resulted this violation. + // Format: + // projects/{project_number}/policies/{constraint_name} + // folders/{folder_id}/policies/{constraint_name} + // organizations/{organization_id}/policies/{constraint_name} + string non_compliant_org_policy = 12 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. Compliance violation remediation + Remediation remediation = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A boolean that indicates if the violation is acknowledged + bool acknowledged = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Timestamp when this violation was acknowledged last. + // This will be absent when acknowledged field is marked as false. + optional google.protobuf.Timestamp acknowledgement_time = 15 [(google.api.field_behavior) = OPTIONAL]; } diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/AnalyzeWorkloadMoveRequest.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/AnalyzeWorkloadMoveRequest.java index 0b2d21837859..a512a0ea1622 100644 --- a/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/AnalyzeWorkloadMoveRequest.java +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/AnalyzeWorkloadMoveRequest.java @@ -53,66 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private AnalyzeWorkloadMoveRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - projectOrWorkloadResourceCase_ = 1; - projectOrWorkloadResource_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - target_ = s; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - projectOrWorkloadResourceCase_ = 3; - projectOrWorkloadResource_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1beta1_AnalyzeWorkloadMoveRequest_descriptor; @@ -424,7 +364,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (projectOrWorkloadResourceCase_ == 3) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, projectOrWorkloadResource_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -444,7 +384,7 @@ public int getSerializedSize() { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, projectOrWorkloadResource_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -473,7 +413,7 @@ public boolean equals(final java.lang.Object obj) { case 0: default: } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -498,7 +438,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -631,17 +571,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using // com.google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -765,7 +698,7 @@ public Builder mergeFrom( break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -780,19 +713,51 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + projectOrWorkloadResourceCase_ = 1; + projectOrWorkloadResource_ = s; + break; + } // case 10 + case 18: + { + target_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + projectOrWorkloadResourceCase_ = 3; + projectOrWorkloadResource_ = s; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1297,7 +1262,18 @@ public AnalyzeWorkloadMoveRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AnalyzeWorkloadMoveRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/AnalyzeWorkloadMoveResponse.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/AnalyzeWorkloadMoveResponse.java index 451540968fb2..a68ddd680a64 100644 --- a/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/AnalyzeWorkloadMoveResponse.java +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/AnalyzeWorkloadMoveResponse.java @@ -52,59 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private AnalyzeWorkloadMoveResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - blockers_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - blockers_.add(s); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - blockers_ = blockers_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1beta1_AnalyzeWorkloadMoveResponse_descriptor; @@ -202,7 +149,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < blockers_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, blockers_.getRaw(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -219,7 +166,7 @@ public int getSerializedSize() { size += dataSize; size += 1 * getBlockersList().size(); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -236,7 +183,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse) obj; if (!getBlockersList().equals(other.getBlockersList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -251,7 +198,7 @@ public int hashCode() { hash = (37 * hash) + BLOCKERS_FIELD_NUMBER; hash = (53 * hash) + getBlockersList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -383,17 +330,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using // com.google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -499,7 +439,7 @@ public Builder mergeFrom( } onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -514,19 +454,38 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureBlockersIsMutable(); + blockers_.add(s); + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -743,7 +702,18 @@ public AnalyzeWorkloadMoveResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AnalyzeWorkloadMoveResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/CreateWorkloadOperationMetadata.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/CreateWorkloadOperationMetadata.java index bbbe1018d0c4..3e6cafc8f332 100644 --- a/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/CreateWorkloadOperationMetadata.java +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/CreateWorkloadOperationMetadata.java @@ -56,99 +56,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private CreateWorkloadOperationMetadata( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (createTime_ != null) { - subBuilder = createTime_.toBuilder(); - } - createTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(createTime_); - createTime_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - displayName_ = s; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 32: - { - int rawValue = input.readEnum(); - - complianceRegime_ = rawValue; - break; - } - case 42: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - resourceSettings_ = - new java.util.ArrayList< - com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings>(); - mutable_bitField0_ |= 0x00000001; - } - resourceSettings_.add( - input.readMessage( - com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.parser(), - extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - resourceSettings_ = java.util.Collections.unmodifiableList(resourceSettings_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1beta1_CreateWorkloadOperationMetadata_descriptor; @@ -478,7 +385,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < resourceSettings_.size(); i++) { output.writeMessage(5, resourceSettings_.get(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -505,7 +412,7 @@ public int getSerializedSize() { for (int i = 0; i < resourceSettings_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, resourceSettings_.get(i)); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -530,7 +437,7 @@ public boolean equals(final java.lang.Object obj) { if (!getParent().equals(other.getParent())) return false; if (complianceRegime_ != other.complianceRegime_) return false; if (!getResourceSettingsList().equals(other.getResourceSettingsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -555,7 +462,7 @@ public int hashCode() { hash = (37 * hash) + RESOURCE_SETTINGS_FIELD_NUMBER; hash = (53 * hash) + getResourceSettingsList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -688,19 +595,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using // com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getResourceSettingsFieldBuilder(); - } } @java.lang.Override @@ -720,10 +618,11 @@ public Builder clear() { if (resourceSettingsBuilder_ == null) { resourceSettings_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + resourceSettings_ = null; resourceSettingsBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); return this; } @@ -868,7 +767,7 @@ public Builder mergeFrom( } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -883,20 +782,70 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata parsedMessage = - null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 26 + case 32: + { + complianceRegime_ = input.readEnum(); + + break; + } // case 32 + case 42: + { + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings m = + input.readMessage( + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings + .parser(), + extensionRegistry); + if (resourceSettingsBuilder_ == null) { + ensureResourceSettingsIsMutable(); + resourceSettings_.add(m); + } else { + resourceSettingsBuilder_.addMessage(m); + } + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1885,7 +1834,18 @@ public CreateWorkloadOperationMetadata parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new CreateWorkloadOperationMetadata(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/CreateWorkloadRequest.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/CreateWorkloadRequest.java index e08edeb8b779..84f3429246c7 100644 --- a/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/CreateWorkloadRequest.java +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/CreateWorkloadRequest.java @@ -53,76 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private CreateWorkloadRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 18: - { - com.google.cloud.assuredworkloads.v1beta1.Workload.Builder subBuilder = null; - if (workload_ != null) { - subBuilder = workload_.toBuilder(); - } - workload_ = - input.readMessage( - com.google.cloud.assuredworkloads.v1beta1.Workload.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(workload_); - workload_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - externalId_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1beta1_CreateWorkloadRequest_descriptor; @@ -325,7 +255,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(externalId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, externalId_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -343,7 +273,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(externalId_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, externalId_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -365,7 +295,7 @@ public boolean equals(final java.lang.Object obj) { if (!getWorkload().equals(other.getWorkload())) return false; } if (!getExternalId().equals(other.getExternalId())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -384,7 +314,7 @@ public int hashCode() { } hash = (37 * hash) + EXTERNAL_ID_FIELD_NUMBER; hash = (53 * hash) + getExternalId().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -514,17 +444,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -638,7 +561,7 @@ public Builder mergeFrom( externalId_ = other.externalId_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -653,19 +576,49 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getWorkloadFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 26: + { + externalId_ = input.readStringRequireUtf8(); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1149,7 +1102,18 @@ public CreateWorkloadRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new CreateWorkloadRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/DeleteWorkloadRequest.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/DeleteWorkloadRequest.java index ea7ce0c31593..e87540220ba2 100644 --- a/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/DeleteWorkloadRequest.java +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/DeleteWorkloadRequest.java @@ -53,59 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private DeleteWorkloadRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - etag_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1beta1_DeleteWorkloadRequest_descriptor; @@ -249,7 +196,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, etag_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -264,7 +211,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, etag_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -282,7 +229,7 @@ public boolean equals(final java.lang.Object obj) { if (!getName().equals(other.getName())) return false; if (!getEtag().equals(other.getEtag())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -297,7 +244,7 @@ public int hashCode() { hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + ETAG_FIELD_NUMBER; hash = (53 * hash) + getEtag().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -427,17 +374,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -537,7 +477,7 @@ public Builder mergeFrom( etag_ = other.etag_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -552,19 +492,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + etag_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -839,7 +803,18 @@ public DeleteWorkloadRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DeleteWorkloadRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/GetWorkloadRequest.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/GetWorkloadRequest.java index b16cf3933677..338471cf31a7 100644 --- a/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/GetWorkloadRequest.java +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/GetWorkloadRequest.java @@ -52,52 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private GetWorkloadRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1beta1_GetWorkloadRequest_descriptor; @@ -191,7 +145,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -203,7 +157,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -220,7 +174,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest) obj; if (!getName().equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -233,7 +187,7 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -363,17 +317,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -465,7 +412,7 @@ public Builder mergeFrom(com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRe name_ = other.name_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -480,18 +427,37 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -664,7 +630,18 @@ public GetWorkloadRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new GetWorkloadRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/ListWorkloadsRequest.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/ListWorkloadsRequest.java index 2b09c8ea2ad8..fc6c6f952b25 100644 --- a/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/ListWorkloadsRequest.java +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/ListWorkloadsRequest.java @@ -54,71 +54,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private ListWorkloadsRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 16: - { - pageSize_ = input.readInt32(); - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); - - filter_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1beta1_ListWorkloadsRequest_descriptor; @@ -337,7 +272,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -358,7 +293,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -378,7 +313,7 @@ public boolean equals(final java.lang.Object obj) { if (getPageSize() != other.getPageSize()) return false; if (!getPageToken().equals(other.getPageToken())) return false; if (!getFilter().equals(other.getFilter())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -397,7 +332,7 @@ public int hashCode() { hash = (53 * hash) + getPageToken().hashCode(); hash = (37 * hash) + FILTER_FIELD_NUMBER; hash = (53 * hash) + getFilter().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -527,17 +462,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -649,7 +577,7 @@ public Builder mergeFrom(com.google.cloud.assuredworkloads.v1beta1.ListWorkloads filter_ = other.filter_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -664,19 +592,55 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1114,7 +1078,18 @@ public ListWorkloadsRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ListWorkloadsRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/ListWorkloadsResponse.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/ListWorkloadsResponse.java index 40737ded9df5..74ec9a7d6452 100644 --- a/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/ListWorkloadsResponse.java +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/ListWorkloadsResponse.java @@ -53,69 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private ListWorkloadsResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - workloads_ = - new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - workloads_.add( - input.readMessage( - com.google.cloud.assuredworkloads.v1beta1.Workload.parser(), - extensionRegistry)); - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - nextPageToken_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - workloads_ = java.util.Collections.unmodifiableList(workloads_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1beta1_ListWorkloadsResponse_descriptor; @@ -270,7 +207,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -285,7 +222,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -303,7 +240,7 @@ public boolean equals(final java.lang.Object obj) { if (!getWorkloadsList().equals(other.getWorkloadsList())) return false; if (!getNextPageToken().equals(other.getNextPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -320,7 +257,7 @@ public int hashCode() { } hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -450,19 +387,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getWorkloadsFieldBuilder(); - } } @java.lang.Override @@ -470,10 +398,11 @@ public Builder clear() { super.clear(); if (workloadsBuilder_ == null) { workloads_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + workloads_ = null; workloadsBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); nextPageToken_ = ""; return this; @@ -598,7 +527,7 @@ public Builder mergeFrom( nextPageToken_ = other.nextPageToken_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -613,19 +542,51 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.assuredworkloads.v1beta1.Workload m = + input.readMessage( + com.google.cloud.assuredworkloads.v1beta1.Workload.parser(), + extensionRegistry); + if (workloadsBuilder_ == null) { + ensureWorkloadsIsMutable(); + workloads_.add(m); + } else { + workloadsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1128,7 +1089,18 @@ public ListWorkloadsResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ListWorkloadsResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/RestrictAllowedResourcesRequest.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/RestrictAllowedResourcesRequest.java index 2710bc8daa0d..175394694c3f 100644 --- a/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/RestrictAllowedResourcesRequest.java +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/RestrictAllowedResourcesRequest.java @@ -54,59 +54,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private RestrictAllowedResourcesRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 16: - { - int rawValue = input.readEnum(); - - restrictionType_ = rawValue; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1beta1_RestrictAllowedResourcesRequest_descriptor; @@ -420,7 +367,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io .getNumber()) { output.writeEnum(2, restrictionType_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -438,7 +385,7 @@ public int getSerializedSize() { .getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, restrictionType_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -457,7 +404,7 @@ public boolean equals(final java.lang.Object obj) { if (!getName().equals(other.getName())) return false; if (restrictionType_ != other.restrictionType_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -472,7 +419,7 @@ public int hashCode() { hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + RESTRICTION_TYPE_FIELD_NUMBER; hash = (53 * hash) + restrictionType_; - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -605,17 +552,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using // com.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -719,7 +659,7 @@ public Builder mergeFrom( if (other.restrictionType_ != 0) { setRestrictionTypeValue(other.getRestrictionTypeValue()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -734,20 +674,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest parsedMessage = - null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + restrictionType_ = input.readEnum(); + + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1021,7 +984,18 @@ public RestrictAllowedResourcesRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new RestrictAllowedResourcesRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/RestrictAllowedResourcesResponse.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/RestrictAllowedResourcesResponse.java index c13d6ae62d22..b61378fc1a94 100644 --- a/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/RestrictAllowedResourcesResponse.java +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/RestrictAllowedResourcesResponse.java @@ -51,45 +51,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private RestrictAllowedResourcesResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1beta1_RestrictAllowedResourcesResponse_descriptor; @@ -120,7 +81,7 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -129,7 +90,7 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -146,7 +107,7 @@ public boolean equals(final java.lang.Object obj) { com.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse other = (com.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse) obj; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -157,7 +118,7 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -295,17 +256,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using // com.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -396,7 +350,7 @@ public Builder mergeFrom( if (other == com.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse .getDefaultInstance()) return this; - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -411,20 +365,31 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse parsedMessage = - null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -463,7 +428,18 @@ public RestrictAllowedResourcesResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new RestrictAllowedResourcesResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/UpdateWorkloadRequest.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/UpdateWorkloadRequest.java index 233549f5f813..70ff55cd7e3a 100644 --- a/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/UpdateWorkloadRequest.java +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/UpdateWorkloadRequest.java @@ -50,77 +50,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private UpdateWorkloadRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.assuredworkloads.v1beta1.Workload.Builder subBuilder = null; - if (workload_ != null) { - subBuilder = workload_.toBuilder(); - } - workload_ = - input.readMessage( - com.google.cloud.assuredworkloads.v1beta1.Workload.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(workload_); - workload_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.protobuf.FieldMask.Builder subBuilder = null; - if (updateMask_ != null) { - subBuilder = updateMask_.toBuilder(); - } - updateMask_ = - input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateMask_); - updateMask_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1beta1_UpdateWorkloadRequest_descriptor; @@ -268,7 +197,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (updateMask_ != null) { output.writeMessage(2, getUpdateMask()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -283,7 +212,7 @@ public int getSerializedSize() { if (updateMask_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -307,7 +236,7 @@ public boolean equals(final java.lang.Object obj) { if (hasUpdateMask()) { if (!getUpdateMask().equals(other.getUpdateMask())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -326,7 +255,7 @@ public int hashCode() { hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; hash = (53 * hash) + getUpdateMask().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -456,17 +385,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -580,7 +502,7 @@ public Builder mergeFrom( if (other.hasUpdateMask()) { mergeUpdateMask(other.getUpdateMask()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -595,19 +517,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getWorkloadFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1068,7 +1014,18 @@ public UpdateWorkloadRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new UpdateWorkloadRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/Workload.java b/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/Workload.java index 321004cd210b..a5942bb1ec23 100644 --- a/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/Workload.java +++ b/java-assured-workloads/proto-google-cloud-assured-workloads-v1beta1/src/main/java/com/google/cloud/assuredworkloads/v1beta1/Workload.java @@ -62,306 +62,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private Workload( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - displayName_ = s; - break; - } - case 26: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - resources_ = - new java.util.ArrayList< - com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo>(); - mutable_bitField0_ |= 0x00000001; - } - resources_.add( - input.readMessage( - com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.parser(), - extensionRegistry)); - break; - } - case 32: - { - int rawValue = input.readEnum(); - - complianceRegime_ = rawValue; - break; - } - case 42: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (createTime_ != null) { - subBuilder = createTime_.toBuilder(); - } - createTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(createTime_); - createTime_ = subBuilder.buildPartial(); - } - - break; - } - case 50: - { - java.lang.String s = input.readStringRequireUtf8(); - - billingAccount_ = s; - break; - } - case 58: - { - com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.Builder subBuilder = - null; - if (complianceRegimeSettingsCase_ == 7) { - subBuilder = - ((com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings) - complianceRegimeSettings_) - .toBuilder(); - } - complianceRegimeSettings_ = - input.readMessage( - com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom( - (com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings) - complianceRegimeSettings_); - complianceRegimeSettings_ = subBuilder.buildPartial(); - } - complianceRegimeSettingsCase_ = 7; - break; - } - case 66: - { - com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.Builder subBuilder = - null; - if (complianceRegimeSettingsCase_ == 8) { - subBuilder = - ((com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings) - complianceRegimeSettings_) - .toBuilder(); - } - complianceRegimeSettings_ = - input.readMessage( - com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom( - (com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings) - complianceRegimeSettings_); - complianceRegimeSettings_ = subBuilder.buildPartial(); - } - complianceRegimeSettingsCase_ = 8; - break; - } - case 74: - { - java.lang.String s = input.readStringRequireUtf8(); - - etag_ = s; - break; - } - case 82: - { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - labels_ = - com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000002; - } - com.google.protobuf.MapEntry labels__ = - input.readMessage( - LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); - break; - } - case 90: - { - com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.Builder - subBuilder = null; - if (complianceRegimeSettingsCase_ == 11) { - subBuilder = - ((com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings) - complianceRegimeSettings_) - .toBuilder(); - } - complianceRegimeSettings_ = - input.readMessage( - com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings - .parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom( - (com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings) - complianceRegimeSettings_); - complianceRegimeSettings_ = subBuilder.buildPartial(); - } - complianceRegimeSettingsCase_ = 11; - break; - } - case 98: - { - com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.Builder - subBuilder = null; - if (complianceRegimeSettingsCase_ == 12) { - subBuilder = - ((com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings) - complianceRegimeSettings_) - .toBuilder(); - } - complianceRegimeSettings_ = - input.readMessage( - com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings - .parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom( - (com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings) - complianceRegimeSettings_); - complianceRegimeSettings_ = subBuilder.buildPartial(); - } - complianceRegimeSettingsCase_ = 12; - break; - } - case 106: - { - java.lang.String s = input.readStringRequireUtf8(); - - provisionedResourcesParent_ = s; - break; - } - case 114: - { - com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.Builder subBuilder = - null; - if (kmsSettings_ != null) { - subBuilder = kmsSettings_.toBuilder(); - } - kmsSettings_ = - input.readMessage( - com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(kmsSettings_); - kmsSettings_ = subBuilder.buildPartial(); - } - - break; - } - case 122: - { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - resourceSettings_ = - new java.util.ArrayList< - com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings>(); - mutable_bitField0_ |= 0x00000004; - } - resourceSettings_.add( - input.readMessage( - com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.parser(), - extensionRegistry)); - break; - } - case 136: - { - int rawValue = input.readEnum(); - - kajEnrollmentState_ = rawValue; - break; - } - case 144: - { - enableSovereignControls_ = input.readBool(); - break; - } - case 162: - { - com.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.Builder - subBuilder = null; - if (saaEnrollmentResponse_ != null) { - subBuilder = saaEnrollmentResponse_.toBuilder(); - } - saaEnrollmentResponse_ = - input.readMessage( - com.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse - .parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(saaEnrollmentResponse_); - saaEnrollmentResponse_ = subBuilder.buildPartial(); - } - - break; - } - case 194: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000008) != 0)) { - compliantButDisallowedServices_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000008; - } - compliantButDisallowedServices_.add(s); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - resources_ = java.util.Collections.unmodifiableList(resources_); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - resourceSettings_ = java.util.Collections.unmodifiableList(resourceSettings_); - } - if (((mutable_bitField0_ & 0x00000008) != 0)) { - compliantButDisallowedServices_ = compliantButDisallowedServices_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_descriptor; @@ -991,57 +691,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private ResourceInfo( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - resourceId_ = input.readInt64(); - break; - } - case 16: - { - int rawValue = input.readEnum(); - - resourceType_ = rawValue; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_ResourceInfo_descriptor; @@ -1351,7 +1000,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io .getNumber()) { output.writeEnum(2, resourceType_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -1369,7 +1018,7 @@ public int getSerializedSize() { .getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, resourceType_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -1387,7 +1036,7 @@ public boolean equals(final java.lang.Object obj) { if (getResourceId() != other.getResourceId()) return false; if (resourceType_ != other.resourceType_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1402,7 +1051,7 @@ public int hashCode() { hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getResourceId()); hash = (37 * hash) + RESOURCE_TYPE_FIELD_NUMBER; hash = (53 * hash) + resourceType_; - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -1536,17 +1185,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using // com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -1646,7 +1288,7 @@ public Builder mergeFrom( if (other.resourceType_ != 0) { setResourceTypeValue(other.getResourceTypeValue()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1661,19 +1303,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + resourceId_ = input.readInt64(); + + break; + } // case 8 + case 16: + { + resourceType_ = input.readEnum(); + + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1874,7 +1540,19 @@ public ResourceInfo parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ResourceInfo(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -2024,75 +1702,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private KMSSettings( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (nextRotationTime_ != null) { - subBuilder = nextRotationTime_.toBuilder(); - } - nextRotationTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(nextRotationTime_); - nextRotationTime_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.protobuf.Duration.Builder subBuilder = null; - if (rotationPeriod_ != null) { - subBuilder = rotationPeriod_.toBuilder(); - } - rotationPeriod_ = - input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(rotationPeriod_); - rotationPeriod_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_KMSSettings_descriptor; @@ -2245,7 +1854,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (rotationPeriod_ != null) { output.writeMessage(2, getRotationPeriod()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -2260,7 +1869,7 @@ public int getSerializedSize() { if (rotationPeriod_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRotationPeriod()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -2284,7 +1893,7 @@ public boolean equals(final java.lang.Object obj) { if (hasRotationPeriod()) { if (!getRotationPeriod().equals(other.getRotationPeriod())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -2303,7 +1912,7 @@ public int hashCode() { hash = (37 * hash) + ROTATION_PERIOD_FIELD_NUMBER; hash = (53 * hash) + getRotationPeriod().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -2435,17 +2044,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -2561,7 +2163,7 @@ public Builder mergeFrom( if (other.hasRotationPeriod()) { mergeRotationPeriod(other.getRotationPeriod()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -2576,19 +2178,45 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getNextRotationTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage( + getRotationPeriodFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -3060,7 +2688,19 @@ public KMSSettings parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new KMSSettings(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -3161,63 +2801,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private IL4Settings( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.Builder subBuilder = - null; - if (kmsSettings_ != null) { - subBuilder = kmsSettings_.toBuilder(); - } - kmsSettings_ = - input.readMessage( - com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(kmsSettings_); - kmsSettings_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_IL4Settings_descriptor; @@ -3305,7 +2888,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (kmsSettings_ != null) { output.writeMessage(1, getKmsSettings()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -3317,7 +2900,7 @@ public int getSerializedSize() { if (kmsSettings_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getKmsSettings()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -3337,7 +2920,7 @@ public boolean equals(final java.lang.Object obj) { if (hasKmsSettings()) { if (!getKmsSettings().equals(other.getKmsSettings())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -3352,7 +2935,7 @@ public int hashCode() { hash = (37 * hash) + KMS_SETTINGS_FIELD_NUMBER; hash = (53 * hash) + getKmsSettings().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -3484,17 +3067,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -3596,7 +3172,7 @@ public Builder mergeFrom( if (other.hasKmsSettings()) { mergeKmsSettings(other.getKmsSettings()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -3611,19 +3187,37 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getKmsSettingsFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -3871,7 +3465,19 @@ public IL4Settings parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new IL4Settings(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -3972,63 +3578,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private CJISSettings( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.Builder subBuilder = - null; - if (kmsSettings_ != null) { - subBuilder = kmsSettings_.toBuilder(); - } - kmsSettings_ = - input.readMessage( - com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(kmsSettings_); - kmsSettings_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_CJISSettings_descriptor; @@ -4116,7 +3665,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (kmsSettings_ != null) { output.writeMessage(1, getKmsSettings()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -4128,7 +3677,7 @@ public int getSerializedSize() { if (kmsSettings_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getKmsSettings()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -4148,7 +3697,7 @@ public boolean equals(final java.lang.Object obj) { if (hasKmsSettings()) { if (!getKmsSettings().equals(other.getKmsSettings())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -4163,7 +3712,7 @@ public int hashCode() { hash = (37 * hash) + KMS_SETTINGS_FIELD_NUMBER; hash = (53 * hash) + getKmsSettings().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -4297,17 +3846,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using // com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -4409,7 +3951,7 @@ public Builder mergeFrom( if (other.hasKmsSettings()) { mergeKmsSettings(other.getKmsSettings()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -4424,19 +3966,37 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getKmsSettingsFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -4684,7 +4244,19 @@ public CJISSettings parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new CJISSettings(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -4785,63 +4357,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private FedrampHighSettings( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.Builder subBuilder = - null; - if (kmsSettings_ != null) { - subBuilder = kmsSettings_.toBuilder(); - } - kmsSettings_ = - input.readMessage( - com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(kmsSettings_); - kmsSettings_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_FedrampHighSettings_descriptor; @@ -4929,7 +4444,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (kmsSettings_ != null) { output.writeMessage(1, getKmsSettings()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -4941,7 +4456,7 @@ public int getSerializedSize() { if (kmsSettings_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getKmsSettings()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -4962,7 +4477,7 @@ public boolean equals(final java.lang.Object obj) { if (hasKmsSettings()) { if (!getKmsSettings().equals(other.getKmsSettings())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -4977,7 +4492,7 @@ public int hashCode() { hash = (37 * hash) + KMS_SETTINGS_FIELD_NUMBER; hash = (53 * hash) + getKmsSettings().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -5112,17 +4627,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using // com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -5228,7 +4736,7 @@ public Builder mergeFrom( if (other.hasKmsSettings()) { mergeKmsSettings(other.getKmsSettings()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -5243,19 +4751,37 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getKmsSettingsFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -5504,7 +5030,19 @@ public FedrampHighSettings parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new FedrampHighSettings(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -5605,63 +5143,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private FedrampModerateSettings( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.Builder subBuilder = - null; - if (kmsSettings_ != null) { - subBuilder = kmsSettings_.toBuilder(); - } - kmsSettings_ = - input.readMessage( - com.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(kmsSettings_); - kmsSettings_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_FedrampModerateSettings_descriptor; @@ -5750,7 +5231,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (kmsSettings_ != null) { output.writeMessage(1, getKmsSettings()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -5762,7 +5243,7 @@ public int getSerializedSize() { if (kmsSettings_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getKmsSettings()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -5783,7 +5264,7 @@ public boolean equals(final java.lang.Object obj) { if (hasKmsSettings()) { if (!getKmsSettings().equals(other.getKmsSettings())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -5798,7 +5279,7 @@ public int hashCode() { hash = (37 * hash) + KMS_SETTINGS_FIELD_NUMBER; hash = (53 * hash) + getKmsSettings().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -5938,17 +5419,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using // com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -6055,7 +5529,7 @@ public Builder mergeFrom( if (other.hasKmsSettings()) { mergeKmsSettings(other.getKmsSettings()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -6070,20 +5544,37 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings parsedMessage = - null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getKmsSettingsFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -6332,7 +5823,19 @@ public FedrampModerateSettings parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new FedrampModerateSettings(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -6488,66 +5991,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private ResourceSettings( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - resourceId_ = s; - break; - } - case 16: - { - int rawValue = input.readEnum(); - - resourceType_ = rawValue; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - displayName_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_ResourceSettings_descriptor; @@ -6748,7 +6191,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, displayName_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -6769,7 +6212,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, displayName_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -6788,7 +6231,7 @@ public boolean equals(final java.lang.Object obj) { if (!getResourceId().equals(other.getResourceId())) return false; if (resourceType_ != other.resourceType_) return false; if (!getDisplayName().equals(other.getDisplayName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -6805,7 +6248,7 @@ public int hashCode() { hash = (53 * hash) + resourceType_; hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; hash = (53 * hash) + getDisplayName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -6939,17 +6382,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using // com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -7059,7 +6495,7 @@ public Builder mergeFrom( displayName_ = other.displayName_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -7074,19 +6510,49 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + resourceId_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 16: + { + resourceType_ = input.readEnum(); + + break; + } // case 16 + case 26: + { + displayName_ = input.readStringRequireUtf8(); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -7484,7 +6950,19 @@ public ResourceSettings parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ResourceSettings(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -7664,81 +7142,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private SaaEnrollmentResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - int rawValue = input.readEnum(); - bitField0_ |= 0x00000001; - setupStatus_ = rawValue; - break; - } - case 16: - { - int rawValue = input.readEnum(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - setupErrors_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - setupErrors_.add(rawValue); - break; - } - case 18: - { - int length = input.readRawVarint32(); - int oldLimit = input.pushLimit(length); - while (input.getBytesUntilLimit() > 0) { - int rawValue = input.readEnum(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - setupErrors_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - setupErrors_.add(rawValue); - } - input.popLimit(oldLimit); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) != 0)) { - setupErrors_ = java.util.Collections.unmodifiableList(setupErrors_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.assuredworkloads.v1beta1.AssuredworkloadsProto .internal_static_google_cloud_assuredworkloads_v1beta1_Workload_SaaEnrollmentResponse_descriptor; @@ -8335,7 +7738,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < setupErrors_.size(); i++) { output.writeEnumNoTag(setupErrors_.get(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -8360,7 +7763,7 @@ public int getSerializedSize() { } setupErrorsMemoizedSerializedSize = dataSize; } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -8382,7 +7785,7 @@ public boolean equals(final java.lang.Object obj) { if (setupStatus_ != other.setupStatus_) return false; } if (!setupErrors_.equals(other.setupErrors_)) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -8401,7 +7804,7 @@ public int hashCode() { hash = (37 * hash) + SETUP_ERRORS_FIELD_NUMBER; hash = (53 * hash) + setupErrors_.hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -8541,17 +7944,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using // com.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -8673,7 +8069,7 @@ public Builder mergeFrom( } onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -8688,20 +8084,56 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse parsedMessage = - null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + setupStatus_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + int tmpRaw = input.readEnum(); + ensureSetupErrorsIsMutable(); + setupErrors_.add(tmpRaw); + break; + } // case 16 + case 18: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureSetupErrorsIsMutable(); + setupErrors_.add(tmpRaw); + } + input.popLimit(oldLimit); + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -9127,7 +8559,19 @@ public SaaEnrollmentResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new SaaEnrollmentResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -10521,7 +9965,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io com.google.protobuf.GeneratedMessageV3.writeString( output, 24, compliantButDisallowedServices_.getRaw(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -10624,7 +10068,7 @@ public int getSerializedSize() { size += dataSize; size += 2 * getCompliantButDisallowedServicesList().size(); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -10684,7 +10128,7 @@ public boolean equals(final java.lang.Object obj) { case 0: default: } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -10759,7 +10203,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -10909,20 +10353,10 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } // Construct using com.google.cloud.assuredworkloads.v1beta1.Workload.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getResourcesFieldBuilder(); - getResourceSettingsFieldBuilder(); - } } @java.lang.Override @@ -10934,10 +10368,11 @@ public Builder clear() { if (resourcesBuilder_ == null) { resources_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + resources_ = null; resourcesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); complianceRegime_ = 0; if (createTimeBuilder_ == null) { @@ -10948,6 +10383,18 @@ public Builder clear() { } billingAccount_ = ""; + if (il4SettingsBuilder_ != null) { + il4SettingsBuilder_.clear(); + } + if (cjisSettingsBuilder_ != null) { + cjisSettingsBuilder_.clear(); + } + if (fedrampHighSettingsBuilder_ != null) { + fedrampHighSettingsBuilder_.clear(); + } + if (fedrampModerateSettingsBuilder_ != null) { + fedrampModerateSettingsBuilder_.clear(); + } etag_ = ""; internalGetMutableLabels().clear(); @@ -10961,10 +10408,11 @@ public Builder clear() { } if (resourceSettingsBuilder_ == null) { resourceSettings_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); } else { + resourceSettings_ = null; resourceSettingsBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000004); kajEnrollmentState_ = 0; enableSovereignControls_ = false; @@ -11263,7 +10711,7 @@ public Builder mergeFrom(com.google.cloud.assuredworkloads.v1beta1.Workload othe break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -11278,18 +10726,171 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.assuredworkloads.v1beta1.Workload parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo m = + input.readMessage( + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.parser(), + extensionRegistry); + if (resourcesBuilder_ == null) { + ensureResourcesIsMutable(); + resources_.add(m); + } else { + resourcesBuilder_.addMessage(m); + } + break; + } // case 26 + case 32: + { + complianceRegime_ = input.readEnum(); + + break; + } // case 32 + case 42: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 42 + case 50: + { + billingAccount_ = input.readStringRequireUtf8(); + + break; + } // case 50 + case 58: + { + input.readMessage(getIl4SettingsFieldBuilder().getBuilder(), extensionRegistry); + complianceRegimeSettingsCase_ = 7; + break; + } // case 58 + case 66: + { + input.readMessage(getCjisSettingsFieldBuilder().getBuilder(), extensionRegistry); + complianceRegimeSettingsCase_ = 8; + break; + } // case 66 + case 74: + { + etag_ = input.readStringRequireUtf8(); + + break; + } // case 74 + case 82: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + break; + } // case 82 + case 90: + { + input.readMessage( + getFedrampHighSettingsFieldBuilder().getBuilder(), extensionRegistry); + complianceRegimeSettingsCase_ = 11; + break; + } // case 90 + case 98: + { + input.readMessage( + getFedrampModerateSettingsFieldBuilder().getBuilder(), extensionRegistry); + complianceRegimeSettingsCase_ = 12; + break; + } // case 98 + case 106: + { + provisionedResourcesParent_ = input.readStringRequireUtf8(); + + break; + } // case 106 + case 114: + { + input.readMessage(getKmsSettingsFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 114 + case 122: + { + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings m = + input.readMessage( + com.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings + .parser(), + extensionRegistry); + if (resourceSettingsBuilder_ == null) { + ensureResourceSettingsIsMutable(); + resourceSettings_.add(m); + } else { + resourceSettingsBuilder_.addMessage(m); + } + break; + } // case 122 + case 136: + { + kajEnrollmentState_ = input.readEnum(); + + break; + } // case 136 + case 144: + { + enableSovereignControls_ = input.readBool(); + + break; + } // case 144 + case 162: + { + input.readMessage( + getSaaEnrollmentResponseFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 162 + case 194: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureCompliantButDisallowedServicesIsMutable(); + compliantButDisallowedServices_.add(s); + break; + } // case 194 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.assuredworkloads.v1beta1.Workload) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -15233,7 +14834,18 @@ public Workload parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Workload(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/acknowledgeviolation/AsyncAcknowledgeViolation.java b/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/acknowledgeviolation/AsyncAcknowledgeViolation.java new file mode 100644 index 000000000000..efa53600cac4 --- /dev/null +++ b/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/acknowledgeviolation/AsyncAcknowledgeViolation.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 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.assuredworkloads.v1.samples; + +// [START assuredworkloads_v1_generated_assuredworkloadsserviceclient_acknowledgeviolation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest; +import com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse; +import com.google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient; + +public class AsyncAcknowledgeViolation { + + public static void main(String[] args) throws Exception { + asyncAcknowledgeViolation(); + } + + public static void asyncAcknowledgeViolation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = + AssuredWorkloadsServiceClient.create()) { + AcknowledgeViolationRequest request = + AcknowledgeViolationRequest.newBuilder() + .setName("name3373707") + .setComment("comment950398559") + .setNonCompliantOrgPolicy("nonCompliantOrgPolicy-1928466552") + .build(); + ApiFuture future = + assuredWorkloadsServiceClient.acknowledgeViolationCallable().futureCall(request); + // Do something. + AcknowledgeViolationResponse response = future.get(); + } + } +} +// [END assuredworkloads_v1_generated_assuredworkloadsserviceclient_acknowledgeviolation_async] diff --git a/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/acknowledgeviolation/SyncAcknowledgeViolation.java b/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/acknowledgeviolation/SyncAcknowledgeViolation.java new file mode 100644 index 000000000000..63b50cb1cb7b --- /dev/null +++ b/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/acknowledgeviolation/SyncAcknowledgeViolation.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.assuredworkloads.v1.samples; + +// [START assuredworkloads_v1_generated_assuredworkloadsserviceclient_acknowledgeviolation_sync] +import com.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest; +import com.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse; +import com.google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient; + +public class SyncAcknowledgeViolation { + + public static void main(String[] args) throws Exception { + syncAcknowledgeViolation(); + } + + public static void syncAcknowledgeViolation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = + AssuredWorkloadsServiceClient.create()) { + AcknowledgeViolationRequest request = + AcknowledgeViolationRequest.newBuilder() + .setName("name3373707") + .setComment("comment950398559") + .setNonCompliantOrgPolicy("nonCompliantOrgPolicy-1928466552") + .build(); + AcknowledgeViolationResponse response = + assuredWorkloadsServiceClient.acknowledgeViolation(request); + } + } +} +// [END assuredworkloads_v1_generated_assuredworkloadsserviceclient_acknowledgeviolation_sync] diff --git a/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/getviolation/AsyncGetViolation.java b/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/getviolation/AsyncGetViolation.java new file mode 100644 index 000000000000..497218cc45b7 --- /dev/null +++ b/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/getviolation/AsyncGetViolation.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 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.assuredworkloads.v1.samples; + +// [START assuredworkloads_v1_generated_assuredworkloadsserviceclient_getviolation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient; +import com.google.cloud.assuredworkloads.v1.GetViolationRequest; +import com.google.cloud.assuredworkloads.v1.Violation; +import com.google.cloud.assuredworkloads.v1.ViolationName; + +public class AsyncGetViolation { + + public static void main(String[] args) throws Exception { + asyncGetViolation(); + } + + public static void asyncGetViolation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = + AssuredWorkloadsServiceClient.create()) { + GetViolationRequest request = + GetViolationRequest.newBuilder() + .setName( + ViolationName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]", "[VIOLATION]") + .toString()) + .build(); + ApiFuture future = + assuredWorkloadsServiceClient.getViolationCallable().futureCall(request); + // Do something. + Violation response = future.get(); + } + } +} +// [END assuredworkloads_v1_generated_assuredworkloadsserviceclient_getviolation_async] diff --git a/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/getviolation/SyncGetViolation.java b/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/getviolation/SyncGetViolation.java new file mode 100644 index 000000000000..196120e75b7f --- /dev/null +++ b/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/getviolation/SyncGetViolation.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.assuredworkloads.v1.samples; + +// [START assuredworkloads_v1_generated_assuredworkloadsserviceclient_getviolation_sync] +import com.google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient; +import com.google.cloud.assuredworkloads.v1.GetViolationRequest; +import com.google.cloud.assuredworkloads.v1.Violation; +import com.google.cloud.assuredworkloads.v1.ViolationName; + +public class SyncGetViolation { + + public static void main(String[] args) throws Exception { + syncGetViolation(); + } + + public static void syncGetViolation() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = + AssuredWorkloadsServiceClient.create()) { + GetViolationRequest request = + GetViolationRequest.newBuilder() + .setName( + ViolationName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]", "[VIOLATION]") + .toString()) + .build(); + Violation response = assuredWorkloadsServiceClient.getViolation(request); + } + } +} +// [END assuredworkloads_v1_generated_assuredworkloadsserviceclient_getviolation_sync] diff --git a/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/getviolation/SyncGetViolationString.java b/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/getviolation/SyncGetViolationString.java new file mode 100644 index 000000000000..bb32aa3c82a1 --- /dev/null +++ b/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/getviolation/SyncGetViolationString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 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.assuredworkloads.v1.samples; + +// [START assuredworkloads_v1_generated_assuredworkloadsserviceclient_getviolation_string_sync] +import com.google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient; +import com.google.cloud.assuredworkloads.v1.Violation; +import com.google.cloud.assuredworkloads.v1.ViolationName; + +public class SyncGetViolationString { + + public static void main(String[] args) throws Exception { + syncGetViolationString(); + } + + public static void syncGetViolationString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = + AssuredWorkloadsServiceClient.create()) { + String name = + ViolationName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]", "[VIOLATION]").toString(); + Violation response = assuredWorkloadsServiceClient.getViolation(name); + } + } +} +// [END assuredworkloads_v1_generated_assuredworkloadsserviceclient_getviolation_string_sync] diff --git a/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/getviolation/SyncGetViolationViolationname.java b/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/getviolation/SyncGetViolationViolationname.java new file mode 100644 index 000000000000..91934e8fd378 --- /dev/null +++ b/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/getviolation/SyncGetViolationViolationname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 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.assuredworkloads.v1.samples; + +// [START assuredworkloads_v1_generated_assuredworkloadsserviceclient_getviolation_violationname_sync] +import com.google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient; +import com.google.cloud.assuredworkloads.v1.Violation; +import com.google.cloud.assuredworkloads.v1.ViolationName; + +public class SyncGetViolationViolationname { + + public static void main(String[] args) throws Exception { + syncGetViolationViolationname(); + } + + public static void syncGetViolationViolationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = + AssuredWorkloadsServiceClient.create()) { + ViolationName name = + ViolationName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]", "[VIOLATION]"); + Violation response = assuredWorkloadsServiceClient.getViolation(name); + } + } +} +// [END assuredworkloads_v1_generated_assuredworkloadsserviceclient_getviolation_violationname_sync] diff --git a/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/listviolations/AsyncListViolations.java b/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/listviolations/AsyncListViolations.java new file mode 100644 index 000000000000..41a4cca8da65 --- /dev/null +++ b/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/listviolations/AsyncListViolations.java @@ -0,0 +1,58 @@ +/* + * Copyright 2022 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.assuredworkloads.v1.samples; + +// [START assuredworkloads_v1_generated_assuredworkloadsserviceclient_listviolations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient; +import com.google.cloud.assuredworkloads.v1.ListViolationsRequest; +import com.google.cloud.assuredworkloads.v1.TimeWindow; +import com.google.cloud.assuredworkloads.v1.Violation; +import com.google.cloud.assuredworkloads.v1.WorkloadName; + +public class AsyncListViolations { + + public static void main(String[] args) throws Exception { + asyncListViolations(); + } + + public static void asyncListViolations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = + AssuredWorkloadsServiceClient.create()) { + ListViolationsRequest request = + ListViolationsRequest.newBuilder() + .setParent(WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]").toString()) + .setInterval(TimeWindow.newBuilder().build()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + ApiFuture future = + assuredWorkloadsServiceClient.listViolationsPagedCallable().futureCall(request); + // Do something. + for (Violation element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END assuredworkloads_v1_generated_assuredworkloadsserviceclient_listviolations_async] diff --git a/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/listviolations/AsyncListViolationsPaged.java b/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/listviolations/AsyncListViolationsPaged.java new file mode 100644 index 000000000000..4dd86565ae70 --- /dev/null +++ b/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/listviolations/AsyncListViolationsPaged.java @@ -0,0 +1,66 @@ +/* + * Copyright 2022 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.assuredworkloads.v1.samples; + +// [START assuredworkloads_v1_generated_assuredworkloadsserviceclient_listviolations_paged_async] +import com.google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient; +import com.google.cloud.assuredworkloads.v1.ListViolationsRequest; +import com.google.cloud.assuredworkloads.v1.ListViolationsResponse; +import com.google.cloud.assuredworkloads.v1.TimeWindow; +import com.google.cloud.assuredworkloads.v1.Violation; +import com.google.cloud.assuredworkloads.v1.WorkloadName; +import com.google.common.base.Strings; + +public class AsyncListViolationsPaged { + + public static void main(String[] args) throws Exception { + asyncListViolationsPaged(); + } + + public static void asyncListViolationsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = + AssuredWorkloadsServiceClient.create()) { + ListViolationsRequest request = + ListViolationsRequest.newBuilder() + .setParent(WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]").toString()) + .setInterval(TimeWindow.newBuilder().build()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + while (true) { + ListViolationsResponse response = + assuredWorkloadsServiceClient.listViolationsCallable().call(request); + for (Violation element : response.getViolationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END assuredworkloads_v1_generated_assuredworkloadsserviceclient_listviolations_paged_async] diff --git a/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/listviolations/SyncListViolations.java b/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/listviolations/SyncListViolations.java new file mode 100644 index 000000000000..2134c82b030e --- /dev/null +++ b/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/listviolations/SyncListViolations.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 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.assuredworkloads.v1.samples; + +// [START assuredworkloads_v1_generated_assuredworkloadsserviceclient_listviolations_sync] +import com.google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient; +import com.google.cloud.assuredworkloads.v1.ListViolationsRequest; +import com.google.cloud.assuredworkloads.v1.TimeWindow; +import com.google.cloud.assuredworkloads.v1.Violation; +import com.google.cloud.assuredworkloads.v1.WorkloadName; + +public class SyncListViolations { + + public static void main(String[] args) throws Exception { + syncListViolations(); + } + + public static void syncListViolations() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = + AssuredWorkloadsServiceClient.create()) { + ListViolationsRequest request = + ListViolationsRequest.newBuilder() + .setParent(WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]").toString()) + .setInterval(TimeWindow.newBuilder().build()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + for (Violation element : assuredWorkloadsServiceClient.listViolations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END assuredworkloads_v1_generated_assuredworkloadsserviceclient_listviolations_sync] diff --git a/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/listviolations/SyncListViolationsString.java b/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/listviolations/SyncListViolationsString.java new file mode 100644 index 000000000000..9c08c7849a88 --- /dev/null +++ b/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/listviolations/SyncListViolationsString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 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.assuredworkloads.v1.samples; + +// [START assuredworkloads_v1_generated_assuredworkloadsserviceclient_listviolations_string_sync] +import com.google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient; +import com.google.cloud.assuredworkloads.v1.Violation; +import com.google.cloud.assuredworkloads.v1.WorkloadName; + +public class SyncListViolationsString { + + public static void main(String[] args) throws Exception { + syncListViolationsString(); + } + + public static void syncListViolationsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = + AssuredWorkloadsServiceClient.create()) { + String parent = WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]").toString(); + for (Violation element : assuredWorkloadsServiceClient.listViolations(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END assuredworkloads_v1_generated_assuredworkloadsserviceclient_listviolations_string_sync] diff --git a/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/listviolations/SyncListViolationsWorkloadname.java b/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/listviolations/SyncListViolationsWorkloadname.java new file mode 100644 index 000000000000..3d8f90180e38 --- /dev/null +++ b/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/listviolations/SyncListViolationsWorkloadname.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 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.assuredworkloads.v1.samples; + +// [START assuredworkloads_v1_generated_assuredworkloadsserviceclient_listviolations_workloadname_sync] +import com.google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient; +import com.google.cloud.assuredworkloads.v1.Violation; +import com.google.cloud.assuredworkloads.v1.WorkloadName; + +public class SyncListViolationsWorkloadname { + + public static void main(String[] args) throws Exception { + syncListViolationsWorkloadname(); + } + + public static void syncListViolationsWorkloadname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = + AssuredWorkloadsServiceClient.create()) { + WorkloadName parent = WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[WORKLOAD]"); + for (Violation element : assuredWorkloadsServiceClient.listViolations(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END assuredworkloads_v1_generated_assuredworkloadsserviceclient_listviolations_workloadname_sync] diff --git a/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/restrictallowedresources/AsyncRestrictAllowedResources.java b/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/restrictallowedresources/AsyncRestrictAllowedResources.java new file mode 100644 index 000000000000..7df29900f964 --- /dev/null +++ b/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/restrictallowedresources/AsyncRestrictAllowedResources.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.assuredworkloads.v1.samples; + +// [START assuredworkloads_v1_generated_assuredworkloadsserviceclient_restrictallowedresources_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient; +import com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest; +import com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse; + +public class AsyncRestrictAllowedResources { + + public static void main(String[] args) throws Exception { + asyncRestrictAllowedResources(); + } + + public static void asyncRestrictAllowedResources() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = + AssuredWorkloadsServiceClient.create()) { + RestrictAllowedResourcesRequest request = + RestrictAllowedResourcesRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = + assuredWorkloadsServiceClient.restrictAllowedResourcesCallable().futureCall(request); + // Do something. + RestrictAllowedResourcesResponse response = future.get(); + } + } +} +// [END assuredworkloads_v1_generated_assuredworkloadsserviceclient_restrictallowedresources_async] diff --git a/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/restrictallowedresources/SyncRestrictAllowedResources.java b/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/restrictallowedresources/SyncRestrictAllowedResources.java new file mode 100644 index 000000000000..2d39da7566f1 --- /dev/null +++ b/java-assured-workloads/samples/snippets/generated/com/google/cloud/assuredworkloads/v1/assuredworkloadsserviceclient/restrictallowedresources/SyncRestrictAllowedResources.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 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.assuredworkloads.v1.samples; + +// [START assuredworkloads_v1_generated_assuredworkloadsserviceclient_restrictallowedresources_sync] +import com.google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient; +import com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest; +import com.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse; + +public class SyncRestrictAllowedResources { + + public static void main(String[] args) throws Exception { + syncRestrictAllowedResources(); + } + + public static void syncRestrictAllowedResources() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AssuredWorkloadsServiceClient assuredWorkloadsServiceClient = + AssuredWorkloadsServiceClient.create()) { + RestrictAllowedResourcesRequest request = + RestrictAllowedResourcesRequest.newBuilder().setName("name3373707").build(); + RestrictAllowedResourcesResponse response = + assuredWorkloadsServiceClient.restrictAllowedResources(request); + } + } +} +// [END assuredworkloads_v1_generated_assuredworkloadsserviceclient_restrictallowedresources_sync]