From 2f76c7425680b767af129ec3c6db67351d6f6311 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sun, 2 Oct 2022 03:18:13 +0000 Subject: [PATCH] chore(bazel): update protobuf to v3.21.7 (#436) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 477955264 Source-Link: https://togithub.com/googleapis/googleapis/commit/a724450af76d0001f23602684c49cd6a4b3a5654 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/4abcbcaec855e74a0b22a4988cf9e0eb61a83094 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGFiY2JjYWVjODU1ZTc0YTBiMjJhNDk4OGNmOWUwZWI2MWE4MzA5NCJ9 feat!: remove ListApplicablePolicies PiperOrigin-RevId: 475955031 Source-Link: https://togithub.com/googleapis/googleapis/commit/65376f43de1a43dcd40b21a5c2f844bde0049604 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/c8504e97891ed9e664cf68270d7e61bec160fe57 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzg1MDRlOTc4OTFlZDllNjY0Y2Y2ODI3MGQ3ZTYxYmVjMTYwZmU1NyJ9 --- .../com/google/iam/v2/PoliciesClient.java | 249 --- .../com/google/iam/v2/PoliciesSettings.java | 19 - .../com/google/iam/v2/gapic_metadata.json | 3 - .../google/iam/v2/stub/GrpcPoliciesStub.java | 54 - .../iam/v2/stub/HttpJsonPoliciesStub.java | 76 - .../com/google/iam/v2/stub/PoliciesStub.java | 14 - .../iam/v2/stub/PoliciesStubSettings.java | 115 +- .../com/google/iam/v2/MockPoliciesImpl.java | 22 - .../iam/v2/PoliciesClientHttpJsonTest.java | 52 - .../com/google/iam/v2/PoliciesClientTest.java | 47 - .../java/com/google/iam/v2/PoliciesGrpc.java | 166 +- java-iam/pom.xml | 10 + .../java/com/google/iam/v1/AuditConfig.java | 143 +- .../com/google/iam/v1/AuditConfigDelta.java | 151 +- .../com/google/iam/v1/AuditLogConfig.java | 133 +- .../main/java/com/google/iam/v1/Binding.java | 153 +- .../java/com/google/iam/v1/BindingDelta.java | 158 +- .../google/iam/v1/GetIamPolicyRequest.java | 133 +- .../com/google/iam/v1/GetPolicyOptions.java | 110 +- .../main/java/com/google/iam/v1/Policy.java | 181 +- .../java/com/google/iam/v1/PolicyDelta.java | 161 +- .../google/iam/v1/SetIamPolicyRequest.java | 153 +- .../iam/v1/TestIamPermissionsRequest.java | 133 +- .../iam/v1/TestIamPermissionsResponse.java | 120 +- .../google/iam/v2/CreatePolicyRequest.java | 173 +- .../iam/v2/CreatePolicyRequestOrBuilder.java | 8 +- .../google/iam/v2/DeletePolicyRequest.java | 167 +- .../iam/v2/DeletePolicyRequestOrBuilder.java | 12 +- .../main/java/com/google/iam/v2/DenyRule.java | 201 +-- .../com/google/iam/v2/GetPolicyRequest.java | 112 +- .../iam/v2/ListApplicablePoliciesRequest.java | 1207 ------------- ...istApplicablePoliciesRequestOrBuilder.java | 141 -- .../v2/ListApplicablePoliciesResponse.java | 1503 ----------------- ...stApplicablePoliciesResponseOrBuilder.java | 180 -- .../google/iam/v2/ListPoliciesRequest.java | 206 +-- .../iam/v2/ListPoliciesRequestOrBuilder.java | 20 +- .../google/iam/v2/ListPoliciesResponse.java | 164 +- .../iam/v2/ListPoliciesResponseOrBuilder.java | 6 +- .../main/java/com/google/iam/v2/Policy.java | 410 ++--- .../iam/v2/PolicyOperationMetadata.java | 120 +- .../com/google/iam/v2/PolicyOrBuilder.java | 31 +- .../java/com/google/iam/v2/PolicyProto.java | 92 +- .../java/com/google/iam/v2/PolicyRule.java | 135 +- .../google/iam/v2/UpdatePolicyRequest.java | 119 +- .../src/main/proto/google/iam/v2/policy.proto | 133 +- .../iam/v2beta/CreatePolicyRequest.java | 145 +- .../iam/v2beta/DeletePolicyRequest.java | 125 +- .../java/com/google/iam/v2beta/DenyRule.java | 201 +-- .../google/iam/v2beta/GetPolicyRequest.java | 112 +- .../iam/v2beta/ListPoliciesRequest.java | 136 +- .../iam/v2beta/ListPoliciesResponse.java | 143 +- .../java/com/google/iam/v2beta/Policy.java | 284 ++-- .../iam/v2beta/PolicyOperationMetadata.java | 120 +- .../com/google/iam/v2beta/PolicyRule.java | 135 +- .../iam/v2beta/UpdatePolicyRequest.java | 119 +- 55 files changed, 2121 insertions(+), 7095 deletions(-) delete mode 100644 java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesRequest.java delete mode 100644 java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesRequestOrBuilder.java delete mode 100644 java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesResponse.java delete mode 100644 java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesResponseOrBuilder.java diff --git a/java-iam/google-iam-policy/src/main/java/com/google/iam/v2/PoliciesClient.java b/java-iam/google-iam-policy/src/main/java/com/google/iam/v2/PoliciesClient.java index b7e40fcd0a36..92be44bc442b 100644 --- a/java-iam/google-iam-policy/src/main/java/com/google/iam/v2/PoliciesClient.java +++ b/java-iam/google-iam-policy/src/main/java/com/google/iam/v2/PoliciesClient.java @@ -780,175 +780,6 @@ public final UnaryCallable deletePolicyCallable( return stub.deletePolicyCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves all the policies that are attached to the specified resource, or anywhere in the - * ancestry of the resource. For example, for a project this endpoint would return all the - * `denyPolicy` kind policies attached to the project, its parent folder (if any), and its parent - * organization (if any). The endpoint requires the same permissions that it would take to call - * `ListPolicies` or `GetPolicy`. - * - *

The main reason to use this endpoint is as a policy admin to debug access issues for a - * resource. - * - *

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 (PoliciesClient policiesClient = PoliciesClient.create()) {
-   *   String attachmentPoint = "attachmentPoint-686994899";
-   *   for (Policy element : policiesClient.listApplicablePolicies(attachmentPoint).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param attachmentPoint Required. The Cloud resource at which the applicable policies are to be - * retrieved. Format: `{attachment-point}` Use the URL-encoded full resource name, which means - * that the forward-slash character, `/`, must be written as `%2F`. For example, - * `cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project`. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListApplicablePoliciesPagedResponse listApplicablePolicies(String attachmentPoint) { - ListApplicablePoliciesRequest request = - ListApplicablePoliciesRequest.newBuilder().setAttachmentPoint(attachmentPoint).build(); - return listApplicablePolicies(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves all the policies that are attached to the specified resource, or anywhere in the - * ancestry of the resource. For example, for a project this endpoint would return all the - * `denyPolicy` kind policies attached to the project, its parent folder (if any), and its parent - * organization (if any). The endpoint requires the same permissions that it would take to call - * `ListPolicies` or `GetPolicy`. - * - *

The main reason to use this endpoint is as a policy admin to debug access issues for a - * resource. - * - *

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 (PoliciesClient policiesClient = PoliciesClient.create()) {
-   *   ListApplicablePoliciesRequest request =
-   *       ListApplicablePoliciesRequest.newBuilder()
-   *           .setAttachmentPoint("attachmentPoint-686994899")
-   *           .setFilter("filter-1274492040")
-   *           .setPageToken("pageToken873572522")
-   *           .setPageSize(883849137)
-   *           .build();
-   *   for (Policy element : policiesClient.listApplicablePolicies(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 ListApplicablePoliciesPagedResponse listApplicablePolicies( - ListApplicablePoliciesRequest request) { - return listApplicablePoliciesPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves all the policies that are attached to the specified resource, or anywhere in the - * ancestry of the resource. For example, for a project this endpoint would return all the - * `denyPolicy` kind policies attached to the project, its parent folder (if any), and its parent - * organization (if any). The endpoint requires the same permissions that it would take to call - * `ListPolicies` or `GetPolicy`. - * - *

The main reason to use this endpoint is as a policy admin to debug access issues for a - * resource. - * - *

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 (PoliciesClient policiesClient = PoliciesClient.create()) {
-   *   ListApplicablePoliciesRequest request =
-   *       ListApplicablePoliciesRequest.newBuilder()
-   *           .setAttachmentPoint("attachmentPoint-686994899")
-   *           .setFilter("filter-1274492040")
-   *           .setPageToken("pageToken873572522")
-   *           .setPageSize(883849137)
-   *           .build();
-   *   ApiFuture future =
-   *       policiesClient.listApplicablePoliciesPagedCallable().futureCall(request);
-   *   // Do something.
-   *   for (Policy element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable - listApplicablePoliciesPagedCallable() { - return stub.listApplicablePoliciesPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves all the policies that are attached to the specified resource, or anywhere in the - * ancestry of the resource. For example, for a project this endpoint would return all the - * `denyPolicy` kind policies attached to the project, its parent folder (if any), and its parent - * organization (if any). The endpoint requires the same permissions that it would take to call - * `ListPolicies` or `GetPolicy`. - * - *

The main reason to use this endpoint is as a policy admin to debug access issues for a - * resource. - * - *

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 (PoliciesClient policiesClient = PoliciesClient.create()) {
-   *   ListApplicablePoliciesRequest request =
-   *       ListApplicablePoliciesRequest.newBuilder()
-   *           .setAttachmentPoint("attachmentPoint-686994899")
-   *           .setFilter("filter-1274492040")
-   *           .setPageToken("pageToken873572522")
-   *           .setPageSize(883849137)
-   *           .build();
-   *   while (true) {
-   *     ListApplicablePoliciesResponse response =
-   *         policiesClient.listApplicablePoliciesCallable().call(request);
-   *     for (Policy element : response.getPoliciesList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable - listApplicablePoliciesCallable() { - return stub.listApplicablePoliciesCallable(); - } - @Override public final void close() { stub.close(); @@ -1053,84 +884,4 @@ protected ListPoliciesFixedSizeCollection createCollection( return new ListPoliciesFixedSizeCollection(pages, collectionSize); } } - - public static class ListApplicablePoliciesPagedResponse - extends AbstractPagedListResponse< - ListApplicablePoliciesRequest, - ListApplicablePoliciesResponse, - Policy, - ListApplicablePoliciesPage, - ListApplicablePoliciesFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListApplicablePoliciesPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, - input -> new ListApplicablePoliciesPagedResponse(input), - MoreExecutors.directExecutor()); - } - - private ListApplicablePoliciesPagedResponse(ListApplicablePoliciesPage page) { - super(page, ListApplicablePoliciesFixedSizeCollection.createEmptyCollection()); - } - } - - public static class ListApplicablePoliciesPage - extends AbstractPage< - ListApplicablePoliciesRequest, - ListApplicablePoliciesResponse, - Policy, - ListApplicablePoliciesPage> { - - private ListApplicablePoliciesPage( - PageContext context, - ListApplicablePoliciesResponse response) { - super(context, response); - } - - private static ListApplicablePoliciesPage createEmptyPage() { - return new ListApplicablePoliciesPage(null, null); - } - - @Override - protected ListApplicablePoliciesPage createPage( - PageContext context, - ListApplicablePoliciesResponse response) { - return new ListApplicablePoliciesPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class ListApplicablePoliciesFixedSizeCollection - extends AbstractFixedSizeCollection< - ListApplicablePoliciesRequest, - ListApplicablePoliciesResponse, - Policy, - ListApplicablePoliciesPage, - ListApplicablePoliciesFixedSizeCollection> { - - private ListApplicablePoliciesFixedSizeCollection( - List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListApplicablePoliciesFixedSizeCollection createEmptyCollection() { - return new ListApplicablePoliciesFixedSizeCollection(null, 0); - } - - @Override - protected ListApplicablePoliciesFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListApplicablePoliciesFixedSizeCollection(pages, collectionSize); - } - } } diff --git a/java-iam/google-iam-policy/src/main/java/com/google/iam/v2/PoliciesSettings.java b/java-iam/google-iam-policy/src/main/java/com/google/iam/v2/PoliciesSettings.java index a8e27342b871..06ec905be736 100644 --- a/java-iam/google-iam-policy/src/main/java/com/google/iam/v2/PoliciesSettings.java +++ b/java-iam/google-iam-policy/src/main/java/com/google/iam/v2/PoliciesSettings.java @@ -16,7 +16,6 @@ package com.google.iam.v2; -import static com.google.iam.v2.PoliciesClient.ListApplicablePoliciesPagedResponse; import static com.google.iam.v2.PoliciesClient.ListPoliciesPagedResponse; import com.google.api.core.ApiFunction; @@ -118,15 +117,6 @@ public UnaryCallSettings deletePolicySettings() return ((PoliciesStubSettings) getStubSettings()).deletePolicyOperationSettings(); } - /** Returns the object with the settings used for calls to listApplicablePolicies. */ - public PagedCallSettings< - ListApplicablePoliciesRequest, - ListApplicablePoliciesResponse, - ListApplicablePoliciesPagedResponse> - listApplicablePoliciesSettings() { - return ((PoliciesStubSettings) getStubSettings()).listApplicablePoliciesSettings(); - } - public static final PoliciesSettings create(PoliciesStubSettings stub) throws IOException { return new PoliciesSettings.Builder(stub.toBuilder()).build(); } @@ -286,15 +276,6 @@ public UnaryCallSettings.Builder deletePolicySet return getStubSettingsBuilder().deletePolicyOperationSettings(); } - /** Returns the builder for the settings used for calls to listApplicablePolicies. */ - public PagedCallSettings.Builder< - ListApplicablePoliciesRequest, - ListApplicablePoliciesResponse, - ListApplicablePoliciesPagedResponse> - listApplicablePoliciesSettings() { - return getStubSettingsBuilder().listApplicablePoliciesSettings(); - } - @Override public PoliciesSettings build() throws IOException { return new PoliciesSettings(this); diff --git a/java-iam/google-iam-policy/src/main/java/com/google/iam/v2/gapic_metadata.json b/java-iam/google-iam-policy/src/main/java/com/google/iam/v2/gapic_metadata.json index c0965438d84f..4277cbfcc4ab 100644 --- a/java-iam/google-iam-policy/src/main/java/com/google/iam/v2/gapic_metadata.json +++ b/java-iam/google-iam-policy/src/main/java/com/google/iam/v2/gapic_metadata.json @@ -19,9 +19,6 @@ "GetPolicy": { "methods": ["getPolicy", "getPolicy", "getPolicyCallable"] }, - "ListApplicablePolicies": { - "methods": ["listApplicablePolicies", "listApplicablePolicies", "listApplicablePoliciesPagedCallable", "listApplicablePoliciesCallable"] - }, "ListPolicies": { "methods": ["listPolicies", "listPolicies", "listPoliciesPagedCallable", "listPoliciesCallable"] }, diff --git a/java-iam/google-iam-policy/src/main/java/com/google/iam/v2/stub/GrpcPoliciesStub.java b/java-iam/google-iam-policy/src/main/java/com/google/iam/v2/stub/GrpcPoliciesStub.java index 3a0f0620f166..61258f90181e 100644 --- a/java-iam/google-iam-policy/src/main/java/com/google/iam/v2/stub/GrpcPoliciesStub.java +++ b/java-iam/google-iam-policy/src/main/java/com/google/iam/v2/stub/GrpcPoliciesStub.java @@ -16,7 +16,6 @@ package com.google.iam.v2.stub; -import static com.google.iam.v2.PoliciesClient.ListApplicablePoliciesPagedResponse; import static com.google.iam.v2.PoliciesClient.ListPoliciesPagedResponse; import com.google.api.gax.core.BackgroundResource; @@ -30,8 +29,6 @@ import com.google.iam.v2.CreatePolicyRequest; import com.google.iam.v2.DeletePolicyRequest; import com.google.iam.v2.GetPolicyRequest; -import com.google.iam.v2.ListApplicablePoliciesRequest; -import com.google.iam.v2.ListApplicablePoliciesResponse; import com.google.iam.v2.ListPoliciesRequest; import com.google.iam.v2.ListPoliciesResponse; import com.google.iam.v2.Policy; @@ -98,19 +95,6 @@ public class GrpcPoliciesStub extends PoliciesStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); - private static final MethodDescriptor< - ListApplicablePoliciesRequest, ListApplicablePoliciesResponse> - listApplicablePoliciesMethodDescriptor = - MethodDescriptor - .newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.iam.v2.Policies/ListApplicablePolicies") - .setRequestMarshaller( - ProtoUtils.marshaller(ListApplicablePoliciesRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(ListApplicablePoliciesResponse.getDefaultInstance())) - .build(); - private final UnaryCallable listPoliciesCallable; private final UnaryCallable listPoliciesPagedCallable; @@ -124,10 +108,6 @@ public class GrpcPoliciesStub extends PoliciesStub { private final UnaryCallable deletePolicyCallable; private final OperationCallable deletePolicyOperationCallable; - private final UnaryCallable - listApplicablePoliciesCallable; - private final UnaryCallable - listApplicablePoliciesPagedCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -218,18 +198,6 @@ protected GrpcPoliciesStub( return params.build(); }) .build(); - GrpcCallSettings - listApplicablePoliciesTransportSettings = - GrpcCallSettings - .newBuilder() - .setMethodDescriptor(listApplicablePoliciesMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("attachment_point", String.valueOf(request.getAttachmentPoint())); - return params.build(); - }) - .build(); this.listPoliciesCallable = callableFactory.createUnaryCallable( @@ -267,16 +235,6 @@ protected GrpcPoliciesStub( settings.deletePolicyOperationSettings(), clientContext, operationsStub); - this.listApplicablePoliciesCallable = - callableFactory.createUnaryCallable( - listApplicablePoliciesTransportSettings, - settings.listApplicablePoliciesSettings(), - clientContext); - this.listApplicablePoliciesPagedCallable = - callableFactory.createPagedCallable( - listApplicablePoliciesTransportSettings, - settings.listApplicablePoliciesSettings(), - clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -334,18 +292,6 @@ public UnaryCallable deletePolicyCallable() { return deletePolicyOperationCallable; } - @Override - public UnaryCallable - listApplicablePoliciesCallable() { - return listApplicablePoliciesCallable; - } - - @Override - public UnaryCallable - listApplicablePoliciesPagedCallable() { - return listApplicablePoliciesPagedCallable; - } - @Override public final void close() { try { diff --git a/java-iam/google-iam-policy/src/main/java/com/google/iam/v2/stub/HttpJsonPoliciesStub.java b/java-iam/google-iam-policy/src/main/java/com/google/iam/v2/stub/HttpJsonPoliciesStub.java index 6370f750ee4d..fce3838dd1e3 100644 --- a/java-iam/google-iam-policy/src/main/java/com/google/iam/v2/stub/HttpJsonPoliciesStub.java +++ b/java-iam/google-iam-policy/src/main/java/com/google/iam/v2/stub/HttpJsonPoliciesStub.java @@ -16,7 +16,6 @@ package com.google.iam.v2.stub; -import static com.google.iam.v2.PoliciesClient.ListApplicablePoliciesPagedResponse; import static com.google.iam.v2.PoliciesClient.ListPoliciesPagedResponse; import com.google.api.core.BetaApi; @@ -37,8 +36,6 @@ import com.google.iam.v2.CreatePolicyRequest; import com.google.iam.v2.DeletePolicyRequest; import com.google.iam.v2.GetPolicyRequest; -import com.google.iam.v2.ListApplicablePoliciesRequest; -import com.google.iam.v2.ListApplicablePoliciesResponse; import com.google.iam.v2.ListPoliciesRequest; import com.google.iam.v2.ListPoliciesResponse; import com.google.iam.v2.Policy; @@ -253,45 +250,6 @@ public class HttpJsonPoliciesStub extends PoliciesStub { HttpJsonOperationSnapshot.create(response)) .build(); - private static final ApiMethodDescriptor< - ListApplicablePoliciesRequest, ListApplicablePoliciesResponse> - listApplicablePoliciesMethodDescriptor = - ApiMethodDescriptor - .newBuilder() - .setFullMethodName("google.iam.v2.Policies/ListApplicablePolicies") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v2/{attachmentPoint=*}:listApplicablePolicies", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam( - fields, "attachmentPoint", request.getAttachmentPoint()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "filter", request.getFilter()); - serializer.putQueryParam(fields, "pageSize", request.getPageSize()); - serializer.putQueryParam(fields, "pageToken", request.getPageToken()); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ListApplicablePoliciesResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - private final UnaryCallable listPoliciesCallable; private final UnaryCallable listPoliciesPagedCallable; @@ -305,10 +263,6 @@ public class HttpJsonPoliciesStub extends PoliciesStub { private final UnaryCallable deletePolicyCallable; private final OperationCallable deletePolicyOperationCallable; - private final UnaryCallable - listApplicablePoliciesCallable; - private final UnaryCallable - listApplicablePoliciesPagedCallable; private final BackgroundResource backgroundResources; private final HttpJsonOperationsStub httpJsonOperationsStub; @@ -379,13 +333,6 @@ protected HttpJsonPoliciesStub( .setMethodDescriptor(deletePolicyMethodDescriptor) .setTypeRegistry(typeRegistry) .build(); - HttpJsonCallSettings - listApplicablePoliciesTransportSettings = - HttpJsonCallSettings - .newBuilder() - .setMethodDescriptor(listApplicablePoliciesMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); this.listPoliciesCallable = callableFactory.createUnaryCallable( @@ -423,16 +370,6 @@ protected HttpJsonPoliciesStub( settings.deletePolicyOperationSettings(), clientContext, httpJsonOperationsStub); - this.listApplicablePoliciesCallable = - callableFactory.createUnaryCallable( - listApplicablePoliciesTransportSettings, - settings.listApplicablePoliciesSettings(), - clientContext); - this.listApplicablePoliciesPagedCallable = - callableFactory.createPagedCallable( - listApplicablePoliciesTransportSettings, - settings.listApplicablePoliciesSettings(), - clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -446,7 +383,6 @@ public static List getMethodDescriptors() { methodDescriptors.add(createPolicyMethodDescriptor); methodDescriptors.add(updatePolicyMethodDescriptor); methodDescriptors.add(deletePolicyMethodDescriptor); - methodDescriptors.add(listApplicablePoliciesMethodDescriptor); return methodDescriptors; } @@ -502,18 +438,6 @@ public UnaryCallable deletePolicyCallable() { return deletePolicyOperationCallable; } - @Override - public UnaryCallable - listApplicablePoliciesCallable() { - return listApplicablePoliciesCallable; - } - - @Override - public UnaryCallable - listApplicablePoliciesPagedCallable() { - return listApplicablePoliciesPagedCallable; - } - @Override public final void close() { try { diff --git a/java-iam/google-iam-policy/src/main/java/com/google/iam/v2/stub/PoliciesStub.java b/java-iam/google-iam-policy/src/main/java/com/google/iam/v2/stub/PoliciesStub.java index f00f4af8f2aa..90d52e011f07 100644 --- a/java-iam/google-iam-policy/src/main/java/com/google/iam/v2/stub/PoliciesStub.java +++ b/java-iam/google-iam-policy/src/main/java/com/google/iam/v2/stub/PoliciesStub.java @@ -16,7 +16,6 @@ package com.google.iam.v2.stub; -import static com.google.iam.v2.PoliciesClient.ListApplicablePoliciesPagedResponse; import static com.google.iam.v2.PoliciesClient.ListPoliciesPagedResponse; import com.google.api.gax.core.BackgroundResource; @@ -25,8 +24,6 @@ import com.google.iam.v2.CreatePolicyRequest; import com.google.iam.v2.DeletePolicyRequest; import com.google.iam.v2.GetPolicyRequest; -import com.google.iam.v2.ListApplicablePoliciesRequest; -import com.google.iam.v2.ListApplicablePoliciesResponse; import com.google.iam.v2.ListPoliciesRequest; import com.google.iam.v2.ListPoliciesResponse; import com.google.iam.v2.Policy; @@ -92,17 +89,6 @@ public UnaryCallable deletePolicyCallable() { throw new UnsupportedOperationException("Not implemented: deletePolicyCallable()"); } - public UnaryCallable - listApplicablePoliciesPagedCallable() { - throw new UnsupportedOperationException( - "Not implemented: listApplicablePoliciesPagedCallable()"); - } - - public UnaryCallable - listApplicablePoliciesCallable() { - throw new UnsupportedOperationException("Not implemented: listApplicablePoliciesCallable()"); - } - @Override public abstract void close(); } diff --git a/java-iam/google-iam-policy/src/main/java/com/google/iam/v2/stub/PoliciesStubSettings.java b/java-iam/google-iam-policy/src/main/java/com/google/iam/v2/stub/PoliciesStubSettings.java index 3a7ffe924800..2a9434e11fb0 100644 --- a/java-iam/google-iam-policy/src/main/java/com/google/iam/v2/stub/PoliciesStubSettings.java +++ b/java-iam/google-iam-policy/src/main/java/com/google/iam/v2/stub/PoliciesStubSettings.java @@ -16,7 +16,6 @@ package com.google.iam.v2.stub; -import static com.google.iam.v2.PoliciesClient.ListApplicablePoliciesPagedResponse; import static com.google.iam.v2.PoliciesClient.ListPoliciesPagedResponse; import com.google.api.core.ApiFunction; @@ -55,8 +54,6 @@ import com.google.iam.v2.CreatePolicyRequest; import com.google.iam.v2.DeletePolicyRequest; import com.google.iam.v2.GetPolicyRequest; -import com.google.iam.v2.ListApplicablePoliciesRequest; -import com.google.iam.v2.ListApplicablePoliciesResponse; import com.google.iam.v2.ListPoliciesRequest; import com.google.iam.v2.ListPoliciesResponse; import com.google.iam.v2.Policy; @@ -120,11 +117,6 @@ public class PoliciesStubSettings extends StubSettings { private final UnaryCallSettings deletePolicySettings; private final OperationCallSettings deletePolicyOperationSettings; - private final PagedCallSettings< - ListApplicablePoliciesRequest, - ListApplicablePoliciesResponse, - ListApplicablePoliciesPagedResponse> - listApplicablePoliciesSettings; private static final PagedListDescriptor LIST_POLICIES_PAGE_STR_DESC = @@ -162,48 +154,6 @@ public Iterable extractResources(ListPoliciesResponse payload) { } }; - private static final PagedListDescriptor< - ListApplicablePoliciesRequest, ListApplicablePoliciesResponse, Policy> - LIST_APPLICABLE_POLICIES_PAGE_STR_DESC = - new PagedListDescriptor< - ListApplicablePoliciesRequest, ListApplicablePoliciesResponse, Policy>() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListApplicablePoliciesRequest injectToken( - ListApplicablePoliciesRequest payload, String token) { - return ListApplicablePoliciesRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListApplicablePoliciesRequest injectPageSize( - ListApplicablePoliciesRequest payload, int pageSize) { - return ListApplicablePoliciesRequest.newBuilder(payload) - .setPageSize(pageSize) - .build(); - } - - @Override - public Integer extractPageSize(ListApplicablePoliciesRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListApplicablePoliciesResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListApplicablePoliciesResponse payload) { - return payload.getPoliciesList() == null - ? ImmutableList.of() - : payload.getPoliciesList(); - } - }; - private static final PagedListResponseFactory< ListPoliciesRequest, ListPoliciesResponse, ListPoliciesPagedResponse> LIST_POLICIES_PAGE_STR_FACT = @@ -221,30 +171,6 @@ public ApiFuture getFuturePagedResponse( } }; - private static final PagedListResponseFactory< - ListApplicablePoliciesRequest, - ListApplicablePoliciesResponse, - ListApplicablePoliciesPagedResponse> - LIST_APPLICABLE_POLICIES_PAGE_STR_FACT = - new PagedListResponseFactory< - ListApplicablePoliciesRequest, - ListApplicablePoliciesResponse, - ListApplicablePoliciesPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable - callable, - ListApplicablePoliciesRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext - pageContext = - PageContext.create( - callable, LIST_APPLICABLE_POLICIES_PAGE_STR_DESC, request, context); - return ListApplicablePoliciesPagedResponse.createAsync(pageContext, futureResponse); - } - }; - /** Returns the object with the settings used for calls to listPolicies. */ public PagedCallSettings listPoliciesSettings() { @@ -289,15 +215,6 @@ public UnaryCallSettings deletePolicySettings() return deletePolicyOperationSettings; } - /** Returns the object with the settings used for calls to listApplicablePolicies. */ - public PagedCallSettings< - ListApplicablePoliciesRequest, - ListApplicablePoliciesResponse, - ListApplicablePoliciesPagedResponse> - listApplicablePoliciesSettings() { - return listApplicablePoliciesSettings; - } - public PoliciesStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() @@ -410,7 +327,6 @@ protected PoliciesStubSettings(Builder settingsBuilder) throws IOException { updatePolicyOperationSettings = settingsBuilder.updatePolicyOperationSettings().build(); deletePolicySettings = settingsBuilder.deletePolicySettings().build(); deletePolicyOperationSettings = settingsBuilder.deletePolicyOperationSettings().build(); - listApplicablePoliciesSettings = settingsBuilder.listApplicablePoliciesSettings().build(); } /** Builder for PoliciesStubSettings. */ @@ -432,11 +348,6 @@ public static class Builder extends StubSettings.Builder deletePolicyOperationSettings; - private final PagedCallSettings.Builder< - ListApplicablePoliciesRequest, - ListApplicablePoliciesResponse, - ListApplicablePoliciesPagedResponse> - listApplicablePoliciesSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -446,7 +357,6 @@ public static class Builder extends StubSettings.BuildernewArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -466,8 +376,6 @@ public static class Builder extends StubSettings.Builder>of( @@ -495,8 +401,7 @@ protected Builder(ClientContext clientContext) { getPolicySettings, createPolicySettings, updatePolicySettings, - deletePolicySettings, - listApplicablePoliciesSettings); + deletePolicySettings); initDefaults(this); } @@ -511,7 +416,6 @@ protected Builder(PoliciesStubSettings settings) { updatePolicyOperationSettings = settings.updatePolicyOperationSettings.toBuilder(); deletePolicySettings = settings.deletePolicySettings.toBuilder(); deletePolicyOperationSettings = settings.deletePolicyOperationSettings.toBuilder(); - listApplicablePoliciesSettings = settings.listApplicablePoliciesSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -519,8 +423,7 @@ protected Builder(PoliciesStubSettings settings) { getPolicySettings, createPolicySettings, updatePolicySettings, - deletePolicySettings, - listApplicablePoliciesSettings); + deletePolicySettings); } private static Builder createDefault() { @@ -575,11 +478,6 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - builder - .listApplicablePoliciesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - builder .createPolicyOperationSettings() .setInitialCallSettings( @@ -721,15 +619,6 @@ public UnaryCallSettings.Builder deletePolicySet return deletePolicyOperationSettings; } - /** Returns the builder for the settings used for calls to listApplicablePolicies. */ - public PagedCallSettings.Builder< - ListApplicablePoliciesRequest, - ListApplicablePoliciesResponse, - ListApplicablePoliciesPagedResponse> - listApplicablePoliciesSettings() { - return listApplicablePoliciesSettings; - } - @Override public PoliciesStubSettings build() throws IOException { return new PoliciesStubSettings(this); diff --git a/java-iam/google-iam-policy/src/test/java/com/google/iam/v2/MockPoliciesImpl.java b/java-iam/google-iam-policy/src/test/java/com/google/iam/v2/MockPoliciesImpl.java index 1abaf30f096a..a77354b79a58 100644 --- a/java-iam/google-iam-policy/src/test/java/com/google/iam/v2/MockPoliciesImpl.java +++ b/java-iam/google-iam-policy/src/test/java/com/google/iam/v2/MockPoliciesImpl.java @@ -162,26 +162,4 @@ public void deletePolicy( Exception.class.getName()))); } } - - @Override - public void listApplicablePolicies( - ListApplicablePoliciesRequest request, - StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof ListApplicablePoliciesResponse) { - requests.add(request); - responseObserver.onNext(((ListApplicablePoliciesResponse) 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 ListApplicablePolicies, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ListApplicablePoliciesResponse.class.getName(), - Exception.class.getName()))); - } - } } diff --git a/java-iam/google-iam-policy/src/test/java/com/google/iam/v2/PoliciesClientHttpJsonTest.java b/java-iam/google-iam-policy/src/test/java/com/google/iam/v2/PoliciesClientHttpJsonTest.java index e6534c8592a8..91228b7801e4 100644 --- a/java-iam/google-iam-policy/src/test/java/com/google/iam/v2/PoliciesClientHttpJsonTest.java +++ b/java-iam/google-iam-policy/src/test/java/com/google/iam/v2/PoliciesClientHttpJsonTest.java @@ -16,7 +16,6 @@ package com.google.iam.v2; -import static com.google.iam.v2.PoliciesClient.ListApplicablePoliciesPagedResponse; import static com.google.iam.v2.PoliciesClient.ListPoliciesPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; @@ -397,55 +396,4 @@ public void deletePolicyExceptionTest() throws Exception { } catch (ExecutionException e) { } } - - @Test - public void listApplicablePoliciesTest() throws Exception { - Policy responsesElement = Policy.newBuilder().build(); - ListApplicablePoliciesResponse expectedResponse = - ListApplicablePoliciesResponse.newBuilder() - .setNextPageToken("") - .addAllPolicies(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - String attachmentPoint = "attachmentPoint-4653"; - - ListApplicablePoliciesPagedResponse pagedListResponse = - client.listApplicablePolicies(attachmentPoint); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getPoliciesList().get(0), resources.get(0)); - - 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 listApplicablePoliciesExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String attachmentPoint = "attachmentPoint-4653"; - client.listApplicablePolicies(attachmentPoint); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } } diff --git a/java-iam/google-iam-policy/src/test/java/com/google/iam/v2/PoliciesClientTest.java b/java-iam/google-iam-policy/src/test/java/com/google/iam/v2/PoliciesClientTest.java index 5001a4d24162..81c53a73ed9d 100644 --- a/java-iam/google-iam-policy/src/test/java/com/google/iam/v2/PoliciesClientTest.java +++ b/java-iam/google-iam-policy/src/test/java/com/google/iam/v2/PoliciesClientTest.java @@ -16,7 +16,6 @@ package com.google.iam.v2; -import static com.google.iam.v2.PoliciesClient.ListApplicablePoliciesPagedResponse; import static com.google.iam.v2.PoliciesClient.ListPoliciesPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; @@ -353,50 +352,4 @@ public void deletePolicyExceptionTest() throws Exception { Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } - - @Test - public void listApplicablePoliciesTest() throws Exception { - Policy responsesElement = Policy.newBuilder().build(); - ListApplicablePoliciesResponse expectedResponse = - ListApplicablePoliciesResponse.newBuilder() - .setNextPageToken("") - .addAllPolicies(Arrays.asList(responsesElement)) - .build(); - mockPolicies.addResponse(expectedResponse); - - String attachmentPoint = "attachmentPoint-686994899"; - - ListApplicablePoliciesPagedResponse pagedListResponse = - client.listApplicablePolicies(attachmentPoint); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getPoliciesList().get(0), resources.get(0)); - - List actualRequests = mockPolicies.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListApplicablePoliciesRequest actualRequest = - ((ListApplicablePoliciesRequest) actualRequests.get(0)); - - Assert.assertEquals(attachmentPoint, actualRequest.getAttachmentPoint()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listApplicablePoliciesExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockPolicies.addException(exception); - - try { - String attachmentPoint = "attachmentPoint-686994899"; - client.listApplicablePolicies(attachmentPoint); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } } diff --git a/java-iam/grpc-google-iam-v2/src/main/java/com/google/iam/v2/PoliciesGrpc.java b/java-iam/grpc-google-iam-v2/src/main/java/com/google/iam/v2/PoliciesGrpc.java index b5b34c763f87..bfd3857e078a 100644 --- a/java-iam/grpc-google-iam-v2/src/main/java/com/google/iam/v2/PoliciesGrpc.java +++ b/java-iam/grpc-google-iam-v2/src/main/java/com/google/iam/v2/PoliciesGrpc.java @@ -234,54 +234,6 @@ private PoliciesGrpc() {} return getDeletePolicyMethod; } - private static volatile io.grpc.MethodDescriptor< - com.google.iam.v2.ListApplicablePoliciesRequest, - com.google.iam.v2.ListApplicablePoliciesResponse> - getListApplicablePoliciesMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ListApplicablePolicies", - requestType = com.google.iam.v2.ListApplicablePoliciesRequest.class, - responseType = com.google.iam.v2.ListApplicablePoliciesResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.iam.v2.ListApplicablePoliciesRequest, - com.google.iam.v2.ListApplicablePoliciesResponse> - getListApplicablePoliciesMethod() { - io.grpc.MethodDescriptor< - com.google.iam.v2.ListApplicablePoliciesRequest, - com.google.iam.v2.ListApplicablePoliciesResponse> - getListApplicablePoliciesMethod; - if ((getListApplicablePoliciesMethod = PoliciesGrpc.getListApplicablePoliciesMethod) == null) { - synchronized (PoliciesGrpc.class) { - if ((getListApplicablePoliciesMethod = PoliciesGrpc.getListApplicablePoliciesMethod) - == null) { - PoliciesGrpc.getListApplicablePoliciesMethod = - getListApplicablePoliciesMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - generateFullMethodName(SERVICE_NAME, "ListApplicablePolicies")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.iam.v2.ListApplicablePoliciesRequest.getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.iam.v2.ListApplicablePoliciesResponse - .getDefaultInstance())) - .setSchemaDescriptor( - new PoliciesMethodDescriptorSupplier("ListApplicablePolicies")) - .build(); - } - } - } - return getListApplicablePoliciesMethod; - } - /** Creates a new async stub that supports all call types for the service */ public static PoliciesStub newStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory factory = @@ -382,8 +334,7 @@ public void createPolicy( * Updates the specified policy. * You can update only the rules and the display name for the policy. * To update a policy, you should use a read-modify-write loop: - * 1. Use [GetPolicy][google.iam.v2.Policies.GetPolicy] to read the current - * version of the policy. + * 1. Use [GetPolicy][google.iam.v2.Policies.GetPolicy] to read the current version of the policy. * 2. Modify the policy as needed. * 3. Use `UpdatePolicy` to write the updated policy. * This pattern helps prevent conflicts between concurrent updates. @@ -410,29 +361,6 @@ public void deletePolicy( getDeletePolicyMethod(), responseObserver); } - /** - * - * - *
-     * Retrieves all the policies that are attached to the specified resource,
-     * or anywhere in the ancestry of the resource. For example, for a project
-     * this endpoint would return all the `denyPolicy` kind policies attached to
-     * the project, its parent folder (if any), and its parent organization (if
-     * any).
-     * The endpoint requires the same permissions that it would take to call
-     * `ListPolicies` or `GetPolicy`.
-     * The main reason to use this endpoint is as a policy admin to debug access
-     * issues for a resource.
-     * 
- */ - public void listApplicablePolicies( - com.google.iam.v2.ListApplicablePoliciesRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getListApplicablePoliciesMethod(), responseObserver); - } - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) @@ -465,13 +393,6 @@ public final io.grpc.ServerServiceDefinition bindService() { new MethodHandlers< com.google.iam.v2.DeletePolicyRequest, com.google.longrunning.Operation>( this, METHODID_DELETE_POLICY))) - .addMethod( - getListApplicablePoliciesMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.iam.v2.ListApplicablePoliciesRequest, - com.google.iam.v2.ListApplicablePoliciesResponse>( - this, METHODID_LIST_APPLICABLE_POLICIES))) .build(); } } @@ -549,8 +470,7 @@ public void createPolicy( * Updates the specified policy. * You can update only the rules and the display name for the policy. * To update a policy, you should use a read-modify-write loop: - * 1. Use [GetPolicy][google.iam.v2.Policies.GetPolicy] to read the current - * version of the policy. + * 1. Use [GetPolicy][google.iam.v2.Policies.GetPolicy] to read the current version of the policy. * 2. Modify the policy as needed. * 3. Use `UpdatePolicy` to write the updated policy. * This pattern helps prevent conflicts between concurrent updates. @@ -580,31 +500,6 @@ public void deletePolicy( request, responseObserver); } - - /** - * - * - *
-     * Retrieves all the policies that are attached to the specified resource,
-     * or anywhere in the ancestry of the resource. For example, for a project
-     * this endpoint would return all the `denyPolicy` kind policies attached to
-     * the project, its parent folder (if any), and its parent organization (if
-     * any).
-     * The endpoint requires the same permissions that it would take to call
-     * `ListPolicies` or `GetPolicy`.
-     * The main reason to use this endpoint is as a policy admin to debug access
-     * issues for a resource.
-     * 
- */ - public void listApplicablePolicies( - com.google.iam.v2.ListApplicablePoliciesRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListApplicablePoliciesMethod(), getCallOptions()), - request, - responseObserver); - } } /** @@ -673,8 +568,7 @@ public com.google.longrunning.Operation createPolicy( * Updates the specified policy. * You can update only the rules and the display name for the policy. * To update a policy, you should use a read-modify-write loop: - * 1. Use [GetPolicy][google.iam.v2.Policies.GetPolicy] to read the current - * version of the policy. + * 1. Use [GetPolicy][google.iam.v2.Policies.GetPolicy] to read the current version of the policy. * 2. Modify the policy as needed. * 3. Use `UpdatePolicy` to write the updated policy. * This pattern helps prevent conflicts between concurrent updates. @@ -698,27 +592,6 @@ public com.google.longrunning.Operation deletePolicy( return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getDeletePolicyMethod(), getCallOptions(), request); } - - /** - * - * - *
-     * Retrieves all the policies that are attached to the specified resource,
-     * or anywhere in the ancestry of the resource. For example, for a project
-     * this endpoint would return all the `denyPolicy` kind policies attached to
-     * the project, its parent folder (if any), and its parent organization (if
-     * any).
-     * The endpoint requires the same permissions that it would take to call
-     * `ListPolicies` or `GetPolicy`.
-     * The main reason to use this endpoint is as a policy admin to debug access
-     * issues for a resource.
-     * 
- */ - public com.google.iam.v2.ListApplicablePoliciesResponse listApplicablePolicies( - com.google.iam.v2.ListApplicablePoliciesRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListApplicablePoliciesMethod(), getCallOptions(), request); - } } /** @@ -789,8 +662,7 @@ public com.google.common.util.concurrent.ListenableFuture - * Retrieves all the policies that are attached to the specified resource, - * or anywhere in the ancestry of the resource. For example, for a project - * this endpoint would return all the `denyPolicy` kind policies attached to - * the project, its parent folder (if any), and its parent organization (if - * any). - * The endpoint requires the same permissions that it would take to call - * `ListPolicies` or `GetPolicy`. - * The main reason to use this endpoint is as a policy admin to debug access - * issues for a resource. - * - */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.iam.v2.ListApplicablePoliciesResponse> - listApplicablePolicies(com.google.iam.v2.ListApplicablePoliciesRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListApplicablePoliciesMethod(), getCallOptions()), request); - } } private static final int METHODID_LIST_POLICIES = 0; @@ -843,7 +693,6 @@ public com.google.common.util.concurrent.ListenableFuture implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -888,12 +737,6 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.iam.v2.DeletePolicyRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; - case METHODID_LIST_APPLICABLE_POLICIES: - serviceImpl.listApplicablePolicies( - (com.google.iam.v2.ListApplicablePoliciesRequest) request, - (io.grpc.stub.StreamObserver) - responseObserver); - break; default: throw new AssertionError(); } @@ -961,7 +804,6 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getCreatePolicyMethod()) .addMethod(getUpdatePolicyMethod()) .addMethod(getDeletePolicyMethod()) - .addMethod(getListApplicablePoliciesMethod()) .build(); } } diff --git a/java-iam/pom.xml b/java-iam/pom.xml index a7121ad6650e..977fc944c398 100644 --- a/java-iam/pom.xml +++ b/java-iam/pom.xml @@ -68,6 +68,16 @@ + com.google.protobuf + protobuf-bom + 3.21.7 + pom + import + + + com.google.cloud google-cloud-shared-dependencies 3.0.3 diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditConfig.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditConfig.java index ec61d337d125..7d07f32436f0 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditConfig.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditConfig.java @@ -99,66 +99,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private AuditConfig( - 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(); - - service_ = s; - break; - } - case 26: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - auditLogConfigs_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - auditLogConfigs_.add( - input.readMessage(com.google.iam.v1.AuditLogConfig.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)) { - auditLogConfigs_ = java.util.Collections.unmodifiableList(auditLogConfigs_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v1.PolicyProto.internal_static_google_iam_v1_AuditConfig_descriptor; } @@ -314,7 +254,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < auditLogConfigs_.size(); i++) { output.writeMessage(3, auditLogConfigs_.get(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -329,7 +269,7 @@ public int getSerializedSize() { for (int i = 0; i < auditLogConfigs_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, auditLogConfigs_.get(i)); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -346,7 +286,7 @@ public boolean equals(final java.lang.Object obj) { if (!getService().equals(other.getService())) return false; if (!getAuditLogConfigsList().equals(other.getAuditLogConfigsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -363,7 +303,7 @@ public int hashCode() { hash = (37 * hash) + AUDIT_LOG_CONFIGS_FIELD_NUMBER; hash = (53 * hash) + getAuditLogConfigsList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -535,19 +475,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v1.AuditConfig.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) { - getAuditLogConfigsFieldBuilder(); - } } @java.lang.Override @@ -557,10 +488,11 @@ public Builder clear() { if (auditLogConfigsBuilder_ == null) { auditLogConfigs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + auditLogConfigs_ = null; auditLogConfigsBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); return this; } @@ -677,7 +609,7 @@ public Builder mergeFrom(com.google.iam.v1.AuditConfig other) { } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -692,17 +624,49 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v1.AuditConfig 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: + { + service_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 26: + { + com.google.iam.v1.AuditLogConfig m = + input.readMessage(com.google.iam.v1.AuditLogConfig.parser(), extensionRegistry); + if (auditLogConfigsBuilder_ == null) { + ensureAuditLogConfigsIsMutable(); + auditLogConfigs_.add(m); + } else { + auditLogConfigsBuilder_.addMessage(m); + } + 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.iam.v1.AuditConfig) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1209,7 +1173,18 @@ public AuditConfig parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AuditConfig(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-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditConfigDelta.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditConfigDelta.java index 56e4b058637c..622b64143c1c 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditConfigDelta.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditConfigDelta.java @@ -56,73 +56,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private AuditConfigDelta( - 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: - { - int rawValue = input.readEnum(); - - action_ = rawValue; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - service_ = s; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - exemptedMember_ = s; - break; - } - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); - - logType_ = 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.iam.v1.PolicyProto.internal_static_google_iam_v1_AuditConfigDelta_descriptor; } @@ -519,7 +452,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(logType_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, logType_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -540,7 +473,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(logType_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, logType_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -559,7 +492,7 @@ public boolean equals(final java.lang.Object obj) { if (!getService().equals(other.getService())) return false; if (!getExemptedMember().equals(other.getExemptedMember())) return false; if (!getLogType().equals(other.getLogType())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -578,7 +511,7 @@ public int hashCode() { hash = (53 * hash) + getExemptedMember().hashCode(); hash = (37 * hash) + LOG_TYPE_FIELD_NUMBER; hash = (53 * hash) + getLogType().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -707,17 +640,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v1.AuditConfigDelta.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 @@ -825,7 +751,7 @@ public Builder mergeFrom(com.google.iam.v1.AuditConfigDelta other) { logType_ = other.logType_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -840,17 +766,55 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v1.AuditConfigDelta 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: + { + action_ = input.readEnum(); + + break; + } // case 8 + case 18: + { + service_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + exemptedMember_ = input.readStringRequireUtf8(); + + break; + } // case 26 + case 34: + { + logType_ = 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.iam.v1.AuditConfigDelta) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1335,7 +1299,18 @@ public AuditConfigDelta parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AuditConfigDelta(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-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditLogConfig.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditLogConfig.java index 0008387a0040..645f2c04db07 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditLogConfig.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditLogConfig.java @@ -69,66 +69,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private AuditLogConfig( - 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(); - - logType_ = rawValue; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - exemptedMembers_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - exemptedMembers_.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)) { - exemptedMembers_ = exemptedMembers_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v1.PolicyProto.internal_static_google_iam_v1_AuditLogConfig_descriptor; } @@ -447,7 +387,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < exemptedMembers_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, exemptedMembers_.getRaw(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -467,7 +407,7 @@ public int getSerializedSize() { size += dataSize; size += 1 * getExemptedMembersList().size(); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -484,7 +424,7 @@ public boolean equals(final java.lang.Object obj) { if (logType_ != other.logType_) return false; if (!getExemptedMembersList().equals(other.getExemptedMembersList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -501,7 +441,7 @@ public int hashCode() { hash = (37 * hash) + EXEMPTED_MEMBERS_FIELD_NUMBER; hash = (53 * hash) + getExemptedMembersList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -644,17 +584,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v1.AuditLogConfig.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 @@ -758,7 +691,7 @@ public Builder mergeFrom(com.google.iam.v1.AuditLogConfig other) { } onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -773,17 +706,44 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v1.AuditLogConfig 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: + { + logType_ = input.readEnum(); + + break; + } // case 8 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureExemptedMembersIsMutable(); + exemptedMembers_.add(s); + 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.iam.v1.AuditLogConfig) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1098,7 +1058,18 @@ public AuditLogConfig parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AuditLogConfig(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-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/Binding.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/Binding.java index cf06536c0fb4..d4cb1d80f702 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/Binding.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/Binding.java @@ -53,80 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private Binding( - 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(); - - role_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - members_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - members_.add(s); - break; - } - case 26: - { - com.google.type.Expr.Builder subBuilder = null; - if (condition_ != null) { - subBuilder = condition_.toBuilder(); - } - condition_ = input.readMessage(com.google.type.Expr.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(condition_); - condition_ = 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)) { - members_ = members_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v1.PolicyProto.internal_static_google_iam_v1_Binding_descriptor; } @@ -464,7 +390,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (condition_ != null) { output.writeMessage(3, getCondition()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -487,7 +413,7 @@ public int getSerializedSize() { if (condition_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCondition()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -508,7 +434,7 @@ public boolean equals(final java.lang.Object obj) { if (hasCondition()) { if (!getCondition().equals(other.getCondition())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -529,7 +455,7 @@ public int hashCode() { hash = (37 * hash) + CONDITION_FIELD_NUMBER; hash = (53 * hash) + getCondition().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -654,17 +580,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v1.Binding.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 @@ -783,7 +702,7 @@ public Builder mergeFrom(com.google.iam.v1.Binding other) { if (other.hasCondition()) { mergeCondition(other.getCondition()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -798,17 +717,50 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v1.Binding 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: + { + role_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureMembersIsMutable(); + members_.add(s); + break; + } // case 18 + case 26: + { + input.readMessage(getConditionFieldBuilder().getBuilder(), extensionRegistry); + + 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.iam.v1.Binding) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1639,7 +1591,18 @@ public Binding parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Binding(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-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/BindingDelta.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/BindingDelta.java index b6ef165322ed..f6d46a10beb1 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/BindingDelta.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/BindingDelta.java @@ -55,80 +55,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private BindingDelta( - 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: - { - int rawValue = input.readEnum(); - - action_ = rawValue; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - role_ = s; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - member_ = s; - break; - } - case 34: - { - com.google.type.Expr.Builder subBuilder = null; - if (condition_ != null) { - subBuilder = condition_.toBuilder(); - } - condition_ = input.readMessage(com.google.type.Expr.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(condition_); - condition_ = 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.iam.v1.PolicyProto.internal_static_google_iam_v1_BindingDelta_descriptor; } @@ -515,7 +441,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (condition_ != null) { output.writeMessage(4, getCondition()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -536,7 +462,7 @@ public int getSerializedSize() { if (condition_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCondition()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -558,7 +484,7 @@ public boolean equals(final java.lang.Object obj) { if (hasCondition()) { if (!getCondition().equals(other.getCondition())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -579,7 +505,7 @@ public int hashCode() { hash = (37 * hash) + CONDITION_FIELD_NUMBER; hash = (53 * hash) + getCondition().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -706,17 +632,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v1.BindingDelta.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 @@ -830,7 +749,7 @@ public Builder mergeFrom(com.google.iam.v1.BindingDelta other) { if (other.hasCondition()) { mergeCondition(other.getCondition()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -845,17 +764,55 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v1.BindingDelta 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: + { + action_ = input.readEnum(); + + break; + } // case 8 + case 18: + { + role_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + member_ = input.readStringRequireUtf8(); + + break; + } // case 26 + case 34: + { + input.readMessage(getConditionFieldBuilder().getBuilder(), extensionRegistry); + + 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.iam.v1.BindingDelta) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1391,7 +1348,18 @@ public BindingDelta parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new BindingDelta(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-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/GetIamPolicyRequest.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/GetIamPolicyRequest.java index 1a41603b08c6..883feeaae90d 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/GetIamPolicyRequest.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/GetIamPolicyRequest.java @@ -52,67 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private GetIamPolicyRequest( - 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(); - - resource_ = s; - break; - } - case 18: - { - com.google.iam.v1.GetPolicyOptions.Builder subBuilder = null; - if (options_ != null) { - subBuilder = options_.toBuilder(); - } - options_ = - input.readMessage(com.google.iam.v1.GetPolicyOptions.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(options_); - options_ = 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.iam.v1.IamPolicyProto .internal_static_google_iam_v1_GetIamPolicyRequest_descriptor; @@ -252,7 +191,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (options_ != null) { output.writeMessage(2, getOptions()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -267,7 +206,7 @@ public int getSerializedSize() { if (options_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getOptions()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -287,7 +226,7 @@ public boolean equals(final java.lang.Object obj) { if (hasOptions()) { if (!getOptions().equals(other.getOptions())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -304,7 +243,7 @@ public int hashCode() { hash = (37 * hash) + OPTIONS_FIELD_NUMBER; hash = (53 * hash) + getOptions().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -432,17 +371,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v1.GetIamPolicyRequest.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 @@ -545,7 +477,7 @@ public Builder mergeFrom(com.google.iam.v1.GetIamPolicyRequest other) { if (other.hasOptions()) { mergeOptions(other.getOptions()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -560,17 +492,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v1.GetIamPolicyRequest 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: + { + resource_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getOptionsFieldBuilder().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.iam.v1.GetIamPolicyRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -921,7 +879,18 @@ public GetIamPolicyRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new GetIamPolicyRequest(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-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/GetPolicyOptions.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/GetPolicyOptions.java index 488dad2cc5d6..1c427ecb8ddc 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/GetPolicyOptions.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/GetPolicyOptions.java @@ -50,50 +50,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private GetPolicyOptions( - 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: - { - requestedPolicyVersion_ = input.readInt32(); - 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.iam.v1.OptionsProto.internal_static_google_iam_v1_GetPolicyOptions_descriptor; } @@ -156,7 +112,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (requestedPolicyVersion_ != 0) { output.writeInt32(1, requestedPolicyVersion_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -168,7 +124,7 @@ public int getSerializedSize() { if (requestedPolicyVersion_ != 0) { size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, requestedPolicyVersion_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -184,7 +140,7 @@ public boolean equals(final java.lang.Object obj) { com.google.iam.v1.GetPolicyOptions other = (com.google.iam.v1.GetPolicyOptions) obj; if (getRequestedPolicyVersion() != other.getRequestedPolicyVersion()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -197,7 +153,7 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + REQUESTED_POLICY_VERSION_FIELD_NUMBER; hash = (53 * hash) + getRequestedPolicyVersion(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -325,17 +281,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v1.GetPolicyOptions.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 @@ -422,7 +371,7 @@ public Builder mergeFrom(com.google.iam.v1.GetPolicyOptions other) { if (other.getRequestedPolicyVersion() != 0) { setRequestedPolicyVersion(other.getRequestedPolicyVersion()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -437,17 +386,37 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v1.GetPolicyOptions 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: + { + requestedPolicyVersion_ = input.readInt32(); + + break; + } // case 8 + 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.iam.v1.GetPolicyOptions) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -574,7 +543,18 @@ public GetPolicyOptions parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new GetPolicyOptions(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-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/Policy.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/Policy.java index db26b549fd00..b03aa80d06ab 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/Policy.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/Policy.java @@ -112,82 +112,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private Policy( - 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: - { - version_ = input.readInt32(); - break; - } - case 26: - { - etag_ = input.readBytes(); - break; - } - case 34: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - bindings_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - bindings_.add( - input.readMessage(com.google.iam.v1.Binding.parser(), extensionRegistry)); - break; - } - case 50: - { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - auditConfigs_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - auditConfigs_.add( - input.readMessage(com.google.iam.v1.AuditConfig.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)) { - bindings_ = java.util.Collections.unmodifiableList(bindings_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - auditConfigs_ = java.util.Collections.unmodifiableList(auditConfigs_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v1.PolicyProto.internal_static_google_iam_v1_Policy_descriptor; } @@ -466,7 +390,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < auditConfigs_.size(); i++) { output.writeMessage(6, auditConfigs_.get(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -487,7 +411,7 @@ public int getSerializedSize() { for (int i = 0; i < auditConfigs_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, auditConfigs_.get(i)); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -506,7 +430,7 @@ public boolean equals(final java.lang.Object obj) { if (!getBindingsList().equals(other.getBindingsList())) return false; if (!getAuditConfigsList().equals(other.getAuditConfigsList())) 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; } @@ -529,7 +453,7 @@ public int 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; } @@ -712,20 +636,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v1.Policy.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) { - getBindingsFieldBuilder(); - getAuditConfigsFieldBuilder(); - } } @java.lang.Override @@ -735,16 +649,18 @@ public Builder clear() { if (bindingsBuilder_ == null) { bindings_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + bindings_ = null; bindingsBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); if (auditConfigsBuilder_ == null) { auditConfigs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); } else { + auditConfigs_ = null; auditConfigsBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000002); etag_ = com.google.protobuf.ByteString.EMPTY; return this; @@ -902,7 +818,7 @@ public Builder mergeFrom(com.google.iam.v1.Policy other) { if (other.getEtag() != com.google.protobuf.ByteString.EMPTY) { setEtag(other.getEtag()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -917,17 +833,67 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v1.Policy 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: + { + version_ = input.readInt32(); + + break; + } // case 8 + case 26: + { + etag_ = input.readBytes(); + + break; + } // case 26 + case 34: + { + com.google.iam.v1.Binding m = + input.readMessage(com.google.iam.v1.Binding.parser(), extensionRegistry); + if (bindingsBuilder_ == null) { + ensureBindingsIsMutable(); + bindings_.add(m); + } else { + bindingsBuilder_.addMessage(m); + } + break; + } // case 34 + case 50: + { + com.google.iam.v1.AuditConfig m = + input.readMessage(com.google.iam.v1.AuditConfig.parser(), extensionRegistry); + if (auditConfigsBuilder_ == null) { + ensureAuditConfigsIsMutable(); + auditConfigs_.add(m); + } else { + auditConfigsBuilder_.addMessage(m); + } + break; + } // case 50 + 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.iam.v1.Policy) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1987,7 +1953,18 @@ public Policy parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Policy(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-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/PolicyDelta.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/PolicyDelta.java index ed094c19ce28..536ede1a7c94 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/PolicyDelta.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/PolicyDelta.java @@ -53,73 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private PolicyDelta( - 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)) { - bindingDeltas_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - bindingDeltas_.add( - input.readMessage(com.google.iam.v1.BindingDelta.parser(), extensionRegistry)); - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - auditConfigDeltas_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - auditConfigDeltas_.add( - input.readMessage( - com.google.iam.v1.AuditConfigDelta.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)) { - bindingDeltas_ = java.util.Collections.unmodifiableList(bindingDeltas_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - auditConfigDeltas_ = java.util.Collections.unmodifiableList(auditConfigDeltas_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v1.PolicyProto.internal_static_google_iam_v1_PolicyDelta_descriptor; } @@ -291,7 +224,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < auditConfigDeltas_.size(); i++) { output.writeMessage(2, auditConfigDeltas_.get(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -307,7 +240,7 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, auditConfigDeltas_.get(i)); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -324,7 +257,7 @@ public boolean equals(final java.lang.Object obj) { if (!getBindingDeltasList().equals(other.getBindingDeltasList())) return false; if (!getAuditConfigDeltasList().equals(other.getAuditConfigDeltasList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -343,7 +276,7 @@ public int hashCode() { hash = (37 * hash) + AUDIT_CONFIG_DELTAS_FIELD_NUMBER; hash = (53 * hash) + getAuditConfigDeltasList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -469,20 +402,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v1.PolicyDelta.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) { - getBindingDeltasFieldBuilder(); - getAuditConfigDeltasFieldBuilder(); - } } @java.lang.Override @@ -490,16 +413,18 @@ public Builder clear() { super.clear(); if (bindingDeltasBuilder_ == null) { bindingDeltas_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + bindingDeltas_ = null; bindingDeltasBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); if (auditConfigDeltasBuilder_ == null) { auditConfigDeltas_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); } else { + auditConfigDeltas_ = null; auditConfigDeltasBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000002); return this; } @@ -647,7 +572,7 @@ public Builder mergeFrom(com.google.iam.v1.PolicyDelta other) { } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -662,17 +587,56 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v1.PolicyDelta 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.iam.v1.BindingDelta m = + input.readMessage(com.google.iam.v1.BindingDelta.parser(), extensionRegistry); + if (bindingDeltasBuilder_ == null) { + ensureBindingDeltasIsMutable(); + bindingDeltas_.add(m); + } else { + bindingDeltasBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + com.google.iam.v1.AuditConfigDelta m = + input.readMessage( + com.google.iam.v1.AuditConfigDelta.parser(), extensionRegistry); + if (auditConfigDeltasBuilder_ == null) { + ensureAuditConfigDeltasIsMutable(); + auditConfigDeltas_.add(m); + } else { + auditConfigDeltasBuilder_.addMessage(m); + } + 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.iam.v1.PolicyDelta) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1415,7 +1379,18 @@ public PolicyDelta parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new PolicyDelta(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-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/SetIamPolicyRequest.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/SetIamPolicyRequest.java index 3bf8dfa8c739..78d0c7aa0130 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/SetIamPolicyRequest.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/SetIamPolicyRequest.java @@ -52,81 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private SetIamPolicyRequest( - 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(); - - resource_ = s; - break; - } - case 18: - { - com.google.iam.v1.Policy.Builder subBuilder = null; - if (policy_ != null) { - subBuilder = policy_.toBuilder(); - } - policy_ = input.readMessage(com.google.iam.v1.Policy.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(policy_); - policy_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - 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.iam.v1.IamPolicyProto .internal_static_google_iam_v1_SetIamPolicyRequest_descriptor; @@ -330,7 +255,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (updateMask_ != null) { output.writeMessage(3, getUpdateMask()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -348,7 +273,7 @@ public int getSerializedSize() { if (updateMask_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateMask()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -372,7 +297,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; } @@ -393,7 +318,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; } @@ -521,17 +446,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v1.SetIamPolicyRequest.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 @@ -648,7 +566,7 @@ public Builder mergeFrom(com.google.iam.v1.SetIamPolicyRequest other) { if (other.hasUpdateMask()) { mergeUpdateMask(other.getUpdateMask()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -663,17 +581,49 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v1.SetIamPolicyRequest 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: + { + resource_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getPolicyFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 26: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + + 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.iam.v1.SetIamPolicyRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1244,7 +1194,18 @@ public SetIamPolicyRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new SetIamPolicyRequest(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-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/TestIamPermissionsRequest.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/TestIamPermissionsRequest.java index 7e4b65833bc4..cb5dab7d8f15 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/TestIamPermissionsRequest.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/TestIamPermissionsRequest.java @@ -53,66 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private TestIamPermissionsRequest( - 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(); - - resource_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - permissions_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - permissions_.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)) { - permissions_ = permissions_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v1.IamPolicyProto .internal_static_google_iam_v1_TestIamPermissionsRequest_descriptor; @@ -276,7 +216,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < permissions_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, permissions_.getRaw(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -296,7 +236,7 @@ public int getSerializedSize() { size += dataSize; size += 1 * getPermissionsList().size(); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -314,7 +254,7 @@ public boolean equals(final java.lang.Object obj) { if (!getResource().equals(other.getResource())) return false; if (!getPermissionsList().equals(other.getPermissionsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -331,7 +271,7 @@ public int hashCode() { hash = (37 * hash) + PERMISSIONS_FIELD_NUMBER; hash = (53 * hash) + getPermissionsList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -460,17 +400,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v1.TestIamPermissionsRequest.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 @@ -577,7 +510,7 @@ public Builder mergeFrom(com.google.iam.v1.TestIamPermissionsRequest other) { } onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -592,17 +525,44 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v1.TestIamPermissionsRequest 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: + { + resource_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensurePermissionsIsMutable(); + permissions_.add(s); + 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.iam.v1.TestIamPermissionsRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -956,7 +916,18 @@ public TestIamPermissionsRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new TestIamPermissionsRequest(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-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/TestIamPermissionsResponse.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/TestIamPermissionsResponse.java index 0aec2dfd047b..fbe4f1a3e7c7 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/TestIamPermissionsResponse.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/TestIamPermissionsResponse.java @@ -52,59 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private TestIamPermissionsResponse( - 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)) { - permissions_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - permissions_.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)) { - permissions_ = permissions_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v1.IamPolicyProto .internal_static_google_iam_v1_TestIamPermissionsResponse_descriptor; @@ -202,7 +149,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < permissions_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, permissions_.getRaw(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -219,7 +166,7 @@ public int getSerializedSize() { size += dataSize; size += 1 * getPermissionsList().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.iam.v1.TestIamPermissionsResponse) obj; if (!getPermissionsList().equals(other.getPermissionsList())) 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) + PERMISSIONS_FIELD_NUMBER; hash = (53 * hash) + getPermissionsList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -380,17 +327,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v1.TestIamPermissionsResponse.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 @@ -490,7 +430,7 @@ public Builder mergeFrom(com.google.iam.v1.TestIamPermissionsResponse other) { } onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -505,17 +445,38 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v1.TestIamPermissionsResponse 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(); + ensurePermissionsIsMutable(); + permissions_.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.iam.v1.TestIamPermissionsResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -730,7 +691,18 @@ public TestIamPermissionsResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new TestIamPermissionsResponse(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-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/CreatePolicyRequest.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/CreatePolicyRequest.java index 3a88d070ef31..3566ce1abde0 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/CreatePolicyRequest.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/CreatePolicyRequest.java @@ -53,73 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private CreatePolicyRequest( - 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.iam.v2.Policy.Builder subBuilder = null; - if (policy_ != null) { - subBuilder = policy_.toBuilder(); - } - policy_ = input.readMessage(com.google.iam.v2.Policy.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(policy_); - policy_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - policyId_ = 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.iam.v2.PolicyProto .internal_static_google_iam_v2_CreatePolicyRequest_descriptor; @@ -141,8 +74,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. The resource that the policy is attached to, along with the kind
-   * of policy to create. Format: `policies/{attachment_point}/denypolicies`
+   * Required. The resource that the policy is attached to, along with the kind of policy
+   * to create. Format: `policies/{attachment_point}/denypolicies`
    * The attachment point is identified by its URL-encoded full resource name,
    * which means that the forward-slash character, `/`, must be written as
    * `%2F`. For example,
@@ -171,8 +104,8 @@ public java.lang.String getParent() {
    *
    *
    * 
-   * Required. The resource that the policy is attached to, along with the kind
-   * of policy to create. Format: `policies/{attachment_point}/denypolicies`
+   * Required. The resource that the policy is attached to, along with the kind of policy
+   * to create. Format: `policies/{attachment_point}/denypolicies`
    * The attachment point is identified by its URL-encoded full resource name,
    * which means that the forward-slash character, `/`, must be written as
    * `%2F`. For example,
@@ -322,7 +255,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(policyId_)) {
       com.google.protobuf.GeneratedMessageV3.writeString(output, 3, policyId_);
     }
-    unknownFields.writeTo(output);
+    getUnknownFields().writeTo(output);
   }
 
   @java.lang.Override
@@ -340,7 +273,7 @@ public int getSerializedSize() {
     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(policyId_)) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, policyId_);
     }
-    size += unknownFields.getSerializedSize();
+    size += getUnknownFields().getSerializedSize();
     memoizedSize = size;
     return size;
   }
@@ -361,7 +294,7 @@ public boolean equals(final java.lang.Object obj) {
       if (!getPolicy().equals(other.getPolicy())) return false;
     }
     if (!getPolicyId().equals(other.getPolicyId())) return false;
-    if (!unknownFields.equals(other.unknownFields)) return false;
+    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
     return true;
   }
 
@@ -380,7 +313,7 @@ public int hashCode() {
     }
     hash = (37 * hash) + POLICY_ID_FIELD_NUMBER;
     hash = (53 * hash) + getPolicyId().hashCode();
-    hash = (29 * hash) + unknownFields.hashCode();
+    hash = (29 * hash) + getUnknownFields().hashCode();
     memoizedHashCode = hash;
     return hash;
   }
@@ -508,17 +441,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
     }
 
     // Construct using com.google.iam.v2.CreatePolicyRequest.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
@@ -628,7 +554,7 @@ public Builder mergeFrom(com.google.iam.v2.CreatePolicyRequest other) {
         policyId_ = other.policyId_;
         onChanged();
       }
-      this.mergeUnknownFields(other.unknownFields);
+      this.mergeUnknownFields(other.getUnknownFields());
       onChanged();
       return this;
     }
@@ -643,17 +569,49 @@ public Builder mergeFrom(
         com.google.protobuf.CodedInputStream input,
         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
         throws java.io.IOException {
-      com.google.iam.v2.CreatePolicyRequest 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(getPolicyFieldBuilder().getBuilder(), extensionRegistry);
+
+                break;
+              } // case 18
+            case 26:
+              {
+                policyId_ = 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.iam.v2.CreatePolicyRequest) e.getUnfinishedMessage();
         throw e.unwrapIOException();
       } finally {
-        if (parsedMessage != null) {
-          mergeFrom(parsedMessage);
-        }
-      }
+        onChanged();
+      } // finally
       return this;
     }
 
@@ -662,8 +620,8 @@ public Builder mergeFrom(
      *
      *
      * 
-     * Required. The resource that the policy is attached to, along with the kind
-     * of policy to create. Format: `policies/{attachment_point}/denypolicies`
+     * Required. The resource that the policy is attached to, along with the kind of policy
+     * to create. Format: `policies/{attachment_point}/denypolicies`
      * The attachment point is identified by its URL-encoded full resource name,
      * which means that the forward-slash character, `/`, must be written as
      * `%2F`. For example,
@@ -691,8 +649,8 @@ public java.lang.String getParent() {
      *
      *
      * 
-     * Required. The resource that the policy is attached to, along with the kind
-     * of policy to create. Format: `policies/{attachment_point}/denypolicies`
+     * Required. The resource that the policy is attached to, along with the kind of policy
+     * to create. Format: `policies/{attachment_point}/denypolicies`
      * The attachment point is identified by its URL-encoded full resource name,
      * which means that the forward-slash character, `/`, must be written as
      * `%2F`. For example,
@@ -720,8 +678,8 @@ public com.google.protobuf.ByteString getParentBytes() {
      *
      *
      * 
-     * Required. The resource that the policy is attached to, along with the kind
-     * of policy to create. Format: `policies/{attachment_point}/denypolicies`
+     * Required. The resource that the policy is attached to, along with the kind of policy
+     * to create. Format: `policies/{attachment_point}/denypolicies`
      * The attachment point is identified by its URL-encoded full resource name,
      * which means that the forward-slash character, `/`, must be written as
      * `%2F`. For example,
@@ -748,8 +706,8 @@ public Builder setParent(java.lang.String value) {
      *
      *
      * 
-     * Required. The resource that the policy is attached to, along with the kind
-     * of policy to create. Format: `policies/{attachment_point}/denypolicies`
+     * Required. The resource that the policy is attached to, along with the kind of policy
+     * to create. Format: `policies/{attachment_point}/denypolicies`
      * The attachment point is identified by its URL-encoded full resource name,
      * which means that the forward-slash character, `/`, must be written as
      * `%2F`. For example,
@@ -772,8 +730,8 @@ public Builder clearParent() {
      *
      *
      * 
-     * Required. The resource that the policy is attached to, along with the kind
-     * of policy to create. Format: `policies/{attachment_point}/denypolicies`
+     * Required. The resource that the policy is attached to, along with the kind of policy
+     * to create. Format: `policies/{attachment_point}/denypolicies`
      * The attachment point is identified by its URL-encoded full resource name,
      * which means that the forward-slash character, `/`, must be written as
      * `%2F`. For example,
@@ -1128,7 +1086,18 @@ public CreatePolicyRequest parsePartialFrom(
             com.google.protobuf.CodedInputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws com.google.protobuf.InvalidProtocolBufferException {
-          return new CreatePolicyRequest(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-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/CreatePolicyRequestOrBuilder.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/CreatePolicyRequestOrBuilder.java
index 35cbef4d5956..3825ae18ff91 100644
--- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/CreatePolicyRequestOrBuilder.java
+++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/CreatePolicyRequestOrBuilder.java
@@ -27,8 +27,8 @@ public interface CreatePolicyRequestOrBuilder
    *
    *
    * 
-   * Required. The resource that the policy is attached to, along with the kind
-   * of policy to create. Format: `policies/{attachment_point}/denypolicies`
+   * Required. The resource that the policy is attached to, along with the kind of policy
+   * to create. Format: `policies/{attachment_point}/denypolicies`
    * The attachment point is identified by its URL-encoded full resource name,
    * which means that the forward-slash character, `/`, must be written as
    * `%2F`. For example,
@@ -46,8 +46,8 @@ public interface CreatePolicyRequestOrBuilder
    *
    *
    * 
-   * Required. The resource that the policy is attached to, along with the kind
-   * of policy to create. Format: `policies/{attachment_point}/denypolicies`
+   * Required. The resource that the policy is attached to, along with the kind of policy
+   * to create. Format: `policies/{attachment_point}/denypolicies`
    * The attachment point is identified by its URL-encoded full resource name,
    * which means that the forward-slash character, `/`, must be written as
    * `%2F`. For example,
diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DeletePolicyRequest.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DeletePolicyRequest.java
index 44d2147b0b8c..3900d3dc95d6 100644
--- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DeletePolicyRequest.java
+++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DeletePolicyRequest.java
@@ -53,59 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
     return this.unknownFields;
   }
 
-  private DeletePolicyRequest(
-      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.iam.v2.PolicyProto
         .internal_static_google_iam_v2_DeletePolicyRequest_descriptor;
@@ -188,9 +135,9 @@ public com.google.protobuf.ByteString getNameBytes() {
    *
    *
    * 
-   * Optional. The expected `etag` of the policy to delete. If the value does
-   * not match the value that is stored in IAM, the request fails with a `409`
-   * error code and `ABORTED` status.
+   * Optional. The expected `etag` of the policy to delete. If the value does not match
+   * the value that is stored in IAM, the request fails with a `409` error code
+   * and `ABORTED` status.
    * If you omit this field, the policy is deleted regardless of its current
    * `etag`.
    * 
@@ -215,9 +162,9 @@ public java.lang.String getEtag() { * * *
-   * Optional. The expected `etag` of the policy to delete. If the value does
-   * not match the value that is stored in IAM, the request fails with a `409`
-   * error code and `ABORTED` status.
+   * Optional. The expected `etag` of the policy to delete. If the value does not match
+   * the value that is stored in IAM, the request fails with a `409` error code
+   * and `ABORTED` status.
    * If you omit this field, the policy is deleted regardless of its current
    * `etag`.
    * 
@@ -259,7 +206,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 @@ -274,7 +221,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; } @@ -291,7 +238,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; } @@ -306,7 +253,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; } @@ -434,17 +381,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v2.DeletePolicyRequest.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 @@ -540,7 +480,7 @@ public Builder mergeFrom(com.google.iam.v2.DeletePolicyRequest other) { etag_ = other.etag_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -555,17 +495,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v2.DeletePolicyRequest 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.iam.v2.DeletePolicyRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -710,9 +676,9 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * * *
-     * Optional. The expected `etag` of the policy to delete. If the value does
-     * not match the value that is stored in IAM, the request fails with a `409`
-     * error code and `ABORTED` status.
+     * Optional. The expected `etag` of the policy to delete. If the value does not match
+     * the value that is stored in IAM, the request fails with a `409` error code
+     * and `ABORTED` status.
      * If you omit this field, the policy is deleted regardless of its current
      * `etag`.
      * 
@@ -736,9 +702,9 @@ public java.lang.String getEtag() { * * *
-     * Optional. The expected `etag` of the policy to delete. If the value does
-     * not match the value that is stored in IAM, the request fails with a `409`
-     * error code and `ABORTED` status.
+     * Optional. The expected `etag` of the policy to delete. If the value does not match
+     * the value that is stored in IAM, the request fails with a `409` error code
+     * and `ABORTED` status.
      * If you omit this field, the policy is deleted regardless of its current
      * `etag`.
      * 
@@ -762,9 +728,9 @@ public com.google.protobuf.ByteString getEtagBytes() { * * *
-     * Optional. The expected `etag` of the policy to delete. If the value does
-     * not match the value that is stored in IAM, the request fails with a `409`
-     * error code and `ABORTED` status.
+     * Optional. The expected `etag` of the policy to delete. If the value does not match
+     * the value that is stored in IAM, the request fails with a `409` error code
+     * and `ABORTED` status.
      * If you omit this field, the policy is deleted regardless of its current
      * `etag`.
      * 
@@ -787,9 +753,9 @@ public Builder setEtag(java.lang.String value) { * * *
-     * Optional. The expected `etag` of the policy to delete. If the value does
-     * not match the value that is stored in IAM, the request fails with a `409`
-     * error code and `ABORTED` status.
+     * Optional. The expected `etag` of the policy to delete. If the value does not match
+     * the value that is stored in IAM, the request fails with a `409` error code
+     * and `ABORTED` status.
      * If you omit this field, the policy is deleted regardless of its current
      * `etag`.
      * 
@@ -808,9 +774,9 @@ public Builder clearEtag() { * * *
-     * Optional. The expected `etag` of the policy to delete. If the value does
-     * not match the value that is stored in IAM, the request fails with a `409`
-     * error code and `ABORTED` status.
+     * Optional. The expected `etag` of the policy to delete. If the value does not match
+     * the value that is stored in IAM, the request fails with a `409` error code
+     * and `ABORTED` status.
      * If you omit this field, the policy is deleted regardless of its current
      * `etag`.
      * 
@@ -863,7 +829,18 @@ public DeletePolicyRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DeletePolicyRequest(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-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DeletePolicyRequestOrBuilder.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DeletePolicyRequestOrBuilder.java index a0d077f2f4f3..9bdd7fc3d3ba 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DeletePolicyRequestOrBuilder.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DeletePolicyRequestOrBuilder.java @@ -64,9 +64,9 @@ public interface DeletePolicyRequestOrBuilder * * *
-   * Optional. The expected `etag` of the policy to delete. If the value does
-   * not match the value that is stored in IAM, the request fails with a `409`
-   * error code and `ABORTED` status.
+   * Optional. The expected `etag` of the policy to delete. If the value does not match
+   * the value that is stored in IAM, the request fails with a `409` error code
+   * and `ABORTED` status.
    * If you omit this field, the policy is deleted regardless of its current
    * `etag`.
    * 
@@ -80,9 +80,9 @@ public interface DeletePolicyRequestOrBuilder * * *
-   * Optional. The expected `etag` of the policy to delete. If the value does
-   * not match the value that is stored in IAM, the request fails with a `409`
-   * error code and `ABORTED` status.
+   * Optional. The expected `etag` of the policy to delete. If the value does not match
+   * the value that is stored in IAM, the request fails with a `409` error code
+   * and `ABORTED` status.
    * If you omit this field, the policy is deleted regardless of its current
    * `etag`.
    * 
diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DenyRule.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DenyRule.java index 61475584629b..f3bc03f5993c 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DenyRule.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DenyRule.java @@ -55,113 +55,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private DenyRule( - 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)) { - deniedPrincipals_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - deniedPrincipals_.add(s); - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - exceptionPrincipals_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000002; - } - exceptionPrincipals_.add(s); - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - deniedPermissions_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000004; - } - deniedPermissions_.add(s); - break; - } - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000008) != 0)) { - exceptionPermissions_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000008; - } - exceptionPermissions_.add(s); - break; - } - case 42: - { - com.google.type.Expr.Builder subBuilder = null; - if (denialCondition_ != null) { - subBuilder = denialCondition_.toBuilder(); - } - denialCondition_ = - input.readMessage(com.google.type.Expr.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(denialCondition_); - denialCondition_ = 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)) { - deniedPrincipals_ = deniedPrincipals_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - exceptionPrincipals_ = exceptionPrincipals_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - deniedPermissions_ = deniedPermissions_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000008) != 0)) { - exceptionPermissions_ = exceptionPermissions_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v2.DenyRuleProto.internal_static_google_iam_v2_DenyRule_descriptor; } @@ -698,7 +591,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (denialCondition_ != null) { output.writeMessage(5, getDenialCondition()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -742,7 +635,7 @@ public int getSerializedSize() { if (denialCondition_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getDenialCondition()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -765,7 +658,7 @@ public boolean equals(final java.lang.Object obj) { if (hasDenialCondition()) { if (!getDenialCondition().equals(other.getDenialCondition())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -796,7 +689,7 @@ public int hashCode() { hash = (37 * hash) + DENIAL_CONDITION_FIELD_NUMBER; hash = (53 * hash) + getDenialCondition().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -922,17 +815,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v2.DenyRule.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 @@ -1095,7 +981,7 @@ public Builder mergeFrom(com.google.iam.v2.DenyRule other) { if (other.hasDenialCondition()) { mergeDenialCondition(other.getDenialCondition()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1110,17 +996,65 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v2.DenyRule 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(); + ensureDeniedPrincipalsIsMutable(); + deniedPrincipals_.add(s); + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureExceptionPrincipalsIsMutable(); + exceptionPrincipals_.add(s); + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDeniedPermissionsIsMutable(); + deniedPermissions_.add(s); + break; + } // case 26 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureExceptionPermissionsIsMutable(); + exceptionPermissions_.add(s); + break; + } // case 34 + case 42: + { + input.readMessage(getDenialConditionFieldBuilder().getBuilder(), extensionRegistry); + + 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.iam.v2.DenyRule) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -2484,7 +2418,18 @@ public DenyRule parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DenyRule(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-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/GetPolicyRequest.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/GetPolicyRequest.java index 895940744b66..e3888a12fd71 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/GetPolicyRequest.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/GetPolicyRequest.java @@ -52,52 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private GetPolicyRequest( - 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.iam.v2.PolicyProto.internal_static_google_iam_v2_GetPolicyRequest_descriptor; } @@ -190,7 +144,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 @@ -202,7 +156,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; } @@ -218,7 +172,7 @@ public boolean equals(final java.lang.Object obj) { com.google.iam.v2.GetPolicyRequest other = (com.google.iam.v2.GetPolicyRequest) obj; if (!getName().equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -231,7 +185,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; } @@ -359,17 +313,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v2.GetPolicyRequest.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 @@ -457,7 +404,7 @@ public Builder mergeFrom(com.google.iam.v2.GetPolicyRequest other) { name_ = other.name_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -472,17 +419,37 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v2.GetPolicyRequest 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.iam.v2.GetPolicyRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -654,7 +621,18 @@ public GetPolicyRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new GetPolicyRequest(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-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesRequest.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesRequest.java deleted file mode 100644 index fad84f5d0789..000000000000 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesRequest.java +++ /dev/null @@ -1,1207 +0,0 @@ -/* - * 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/iam/v2/policy.proto - -package com.google.iam.v2; - -/** - * - * - *
- * `ListApplicablePoliciesRequest` represents the Request message for the
- * `ListApplicablePolicies` method. It provides the input for a filterable query
- * of Policies that apply to a certain GCP Resource, specified by the field
- * `attachment_point`, found on this message.
- * Example:
- * ```
- * {
- *    attachment_point:
- *    'cloudresourcemanager.googleapis.com%2Forganizations%2F212345678901'
- *    filter: 'kind:denyPolicies'
- * }
- * ```
- * 
- * - * Protobuf type {@code google.iam.v2.ListApplicablePoliciesRequest} - */ -public final class ListApplicablePoliciesRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.iam.v2.ListApplicablePoliciesRequest) - ListApplicablePoliciesRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListApplicablePoliciesRequest.newBuilder() to construct. - private ListApplicablePoliciesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListApplicablePoliciesRequest() { - attachmentPoint_ = ""; - filter_ = ""; - pageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListApplicablePoliciesRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ListApplicablePoliciesRequest( - 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(); - - attachmentPoint_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - filter_ = s; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - case 32: - { - pageSize_ = input.readInt32(); - 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.iam.v2.PolicyProto - .internal_static_google_iam_v2_ListApplicablePoliciesRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.iam.v2.PolicyProto - .internal_static_google_iam_v2_ListApplicablePoliciesRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.iam.v2.ListApplicablePoliciesRequest.class, - com.google.iam.v2.ListApplicablePoliciesRequest.Builder.class); - } - - public static final int ATTACHMENT_POINT_FIELD_NUMBER = 1; - private volatile java.lang.Object attachmentPoint_; - /** - * - * - *
-   * Required. The Cloud resource at which the applicable policies are to be
-   * retrieved. Format: `{attachment-point}` Use the URL-encoded full resource
-   * name, which means that the forward-slash character, `/`, must be written as
-   * `%2F`. For example,
-   * `cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project`.
-   * 
- * - * string attachment_point = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The attachmentPoint. - */ - @java.lang.Override - public java.lang.String getAttachmentPoint() { - java.lang.Object ref = attachmentPoint_; - 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(); - attachmentPoint_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The Cloud resource at which the applicable policies are to be
-   * retrieved. Format: `{attachment-point}` Use the URL-encoded full resource
-   * name, which means that the forward-slash character, `/`, must be written as
-   * `%2F`. For example,
-   * `cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project`.
-   * 
- * - * string attachment_point = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for attachmentPoint. - */ - @java.lang.Override - public com.google.protobuf.ByteString getAttachmentPointBytes() { - java.lang.Object ref = attachmentPoint_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - attachmentPoint_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int FILTER_FIELD_NUMBER = 2; - private volatile java.lang.Object filter_; - /** - * - * - *
-   * Filtering currently only supports the kind of policies to return, and
-   * must be in the format “kind:[policyKind1] OR kind:[policyKind2]”.  New
-   * policy kinds may be added in the future without notice.
-   * Example value: “kind:denyPolicies”
-   * 
- * - * string filter = 2; - * - * @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; - } - } - /** - * - * - *
-   * Filtering currently only supports the kind of policies to return, and
-   * must be in the format “kind:[policyKind1] OR kind:[policyKind2]”.  New
-   * policy kinds may be added in the future without notice.
-   * Example value: “kind:denyPolicies”
-   * 
- * - * string filter = 2; - * - * @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; - } - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 3; - private volatile java.lang.Object pageToken_; - /** - * - * - *
-   * If present, then retrieve the batch of results following the results from
-   * the preceding call to this method.  `page_token` must be the value of
-   * `next_page_token`
-   * [ListApplicablePoliciesResponse.next_page_token][google.iam.v2.ListApplicablePoliciesResponse.next_page_token]
-   * from the previous response.  The values of other method parameters should
-   * be identical to those in the previous call.
-   * 
- * - * string page_token = 3; - * - * @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; - } - } - /** - * - * - *
-   * If present, then retrieve the batch of results following the results from
-   * the preceding call to this method.  `page_token` must be the value of
-   * `next_page_token`
-   * [ListApplicablePoliciesResponse.next_page_token][google.iam.v2.ListApplicablePoliciesResponse.next_page_token]
-   * from the previous response.  The values of other method parameters should
-   * be identical to those in the previous call.
-   * 
- * - * string page_token = 3; - * - * @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 PAGE_SIZE_FIELD_NUMBER = 4; - private int pageSize_; - /** - * - * - *
-   * Limit on the number of policies to include in the response.
-   * Further policies can subsequently be obtained by including the
-   * [ListApplicablePoliciesResponse.next_page_token][google.iam.admin.v1.ListApplicablePoliciesResponse.next_page_token]
-   * in a subsequent request.
-   * The minimum is 25, and the maximum is 100.
-   * 
- * - * int32 page_size = 4; - * - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - - 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(attachmentPoint_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, attachmentPoint_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); - } - if (pageSize_ != 0) { - output.writeInt32(4, pageSize_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attachmentPoint_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, attachmentPoint_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); - } - if (pageSize_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, pageSize_); - } - size += unknownFields.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.iam.v2.ListApplicablePoliciesRequest)) { - return super.equals(obj); - } - com.google.iam.v2.ListApplicablePoliciesRequest other = - (com.google.iam.v2.ListApplicablePoliciesRequest) obj; - - if (!getAttachmentPoint().equals(other.getAttachmentPoint())) return false; - if (!getFilter().equals(other.getFilter())) return false; - if (!getPageToken().equals(other.getPageToken())) return false; - if (getPageSize() != other.getPageSize()) return false; - if (!unknownFields.equals(other.unknownFields)) 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) + ATTACHMENT_POINT_FIELD_NUMBER; - hash = (53 * hash) + getAttachmentPoint().hashCode(); - hash = (37 * hash) + FILTER_FIELD_NUMBER; - hash = (53 * hash) + getFilter().hashCode(); - hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getPageToken().hashCode(); - hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; - hash = (53 * hash) + getPageSize(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.iam.v2.ListApplicablePoliciesRequest parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.iam.v2.ListApplicablePoliciesRequest parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.iam.v2.ListApplicablePoliciesRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.iam.v2.ListApplicablePoliciesRequest 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.iam.v2.ListApplicablePoliciesRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.iam.v2.ListApplicablePoliciesRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.iam.v2.ListApplicablePoliciesRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.iam.v2.ListApplicablePoliciesRequest 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.iam.v2.ListApplicablePoliciesRequest parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.iam.v2.ListApplicablePoliciesRequest 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.iam.v2.ListApplicablePoliciesRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.iam.v2.ListApplicablePoliciesRequest 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.iam.v2.ListApplicablePoliciesRequest 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; - } - /** - * - * - *
-   * `ListApplicablePoliciesRequest` represents the Request message for the
-   * `ListApplicablePolicies` method. It provides the input for a filterable query
-   * of Policies that apply to a certain GCP Resource, specified by the field
-   * `attachment_point`, found on this message.
-   * Example:
-   * ```
-   * {
-   *    attachment_point:
-   *    'cloudresourcemanager.googleapis.com%2Forganizations%2F212345678901'
-   *    filter: 'kind:denyPolicies'
-   * }
-   * ```
-   * 
- * - * Protobuf type {@code google.iam.v2.ListApplicablePoliciesRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.iam.v2.ListApplicablePoliciesRequest) - com.google.iam.v2.ListApplicablePoliciesRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.iam.v2.PolicyProto - .internal_static_google_iam_v2_ListApplicablePoliciesRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.iam.v2.PolicyProto - .internal_static_google_iam_v2_ListApplicablePoliciesRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.iam.v2.ListApplicablePoliciesRequest.class, - com.google.iam.v2.ListApplicablePoliciesRequest.Builder.class); - } - - // Construct using com.google.iam.v2.ListApplicablePoliciesRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - attachmentPoint_ = ""; - - filter_ = ""; - - pageToken_ = ""; - - pageSize_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.iam.v2.PolicyProto - .internal_static_google_iam_v2_ListApplicablePoliciesRequest_descriptor; - } - - @java.lang.Override - public com.google.iam.v2.ListApplicablePoliciesRequest getDefaultInstanceForType() { - return com.google.iam.v2.ListApplicablePoliciesRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.iam.v2.ListApplicablePoliciesRequest build() { - com.google.iam.v2.ListApplicablePoliciesRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.iam.v2.ListApplicablePoliciesRequest buildPartial() { - com.google.iam.v2.ListApplicablePoliciesRequest result = - new com.google.iam.v2.ListApplicablePoliciesRequest(this); - result.attachmentPoint_ = attachmentPoint_; - result.filter_ = filter_; - result.pageToken_ = pageToken_; - result.pageSize_ = pageSize_; - 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.iam.v2.ListApplicablePoliciesRequest) { - return mergeFrom((com.google.iam.v2.ListApplicablePoliciesRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.iam.v2.ListApplicablePoliciesRequest other) { - if (other == com.google.iam.v2.ListApplicablePoliciesRequest.getDefaultInstance()) - return this; - if (!other.getAttachmentPoint().isEmpty()) { - attachmentPoint_ = other.attachmentPoint_; - onChanged(); - } - if (!other.getFilter().isEmpty()) { - filter_ = other.filter_; - onChanged(); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - onChanged(); - } - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.iam.v2.ListApplicablePoliciesRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.iam.v2.ListApplicablePoliciesRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object attachmentPoint_ = ""; - /** - * - * - *
-     * Required. The Cloud resource at which the applicable policies are to be
-     * retrieved. Format: `{attachment-point}` Use the URL-encoded full resource
-     * name, which means that the forward-slash character, `/`, must be written as
-     * `%2F`. For example,
-     * `cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project`.
-     * 
- * - * string attachment_point = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The attachmentPoint. - */ - public java.lang.String getAttachmentPoint() { - java.lang.Object ref = attachmentPoint_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - attachmentPoint_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The Cloud resource at which the applicable policies are to be
-     * retrieved. Format: `{attachment-point}` Use the URL-encoded full resource
-     * name, which means that the forward-slash character, `/`, must be written as
-     * `%2F`. For example,
-     * `cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project`.
-     * 
- * - * string attachment_point = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for attachmentPoint. - */ - public com.google.protobuf.ByteString getAttachmentPointBytes() { - java.lang.Object ref = attachmentPoint_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - attachmentPoint_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The Cloud resource at which the applicable policies are to be
-     * retrieved. Format: `{attachment-point}` Use the URL-encoded full resource
-     * name, which means that the forward-slash character, `/`, must be written as
-     * `%2F`. For example,
-     * `cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project`.
-     * 
- * - * string attachment_point = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The attachmentPoint to set. - * @return This builder for chaining. - */ - public Builder setAttachmentPoint(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - attachmentPoint_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The Cloud resource at which the applicable policies are to be
-     * retrieved. Format: `{attachment-point}` Use the URL-encoded full resource
-     * name, which means that the forward-slash character, `/`, must be written as
-     * `%2F`. For example,
-     * `cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project`.
-     * 
- * - * string attachment_point = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. - */ - public Builder clearAttachmentPoint() { - - attachmentPoint_ = getDefaultInstance().getAttachmentPoint(); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The Cloud resource at which the applicable policies are to be
-     * retrieved. Format: `{attachment-point}` Use the URL-encoded full resource
-     * name, which means that the forward-slash character, `/`, must be written as
-     * `%2F`. For example,
-     * `cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project`.
-     * 
- * - * string attachment_point = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bytes for attachmentPoint to set. - * @return This builder for chaining. - */ - public Builder setAttachmentPointBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - attachmentPoint_ = value; - onChanged(); - return this; - } - - private java.lang.Object filter_ = ""; - /** - * - * - *
-     * Filtering currently only supports the kind of policies to return, and
-     * must be in the format “kind:[policyKind1] OR kind:[policyKind2]”.  New
-     * policy kinds may be added in the future without notice.
-     * Example value: “kind:denyPolicies”
-     * 
- * - * string filter = 2; - * - * @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; - } - } - /** - * - * - *
-     * Filtering currently only supports the kind of policies to return, and
-     * must be in the format “kind:[policyKind1] OR kind:[policyKind2]”.  New
-     * policy kinds may be added in the future without notice.
-     * Example value: “kind:denyPolicies”
-     * 
- * - * string filter = 2; - * - * @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; - } - } - /** - * - * - *
-     * Filtering currently only supports the kind of policies to return, and
-     * must be in the format “kind:[policyKind1] OR kind:[policyKind2]”.  New
-     * policy kinds may be added in the future without notice.
-     * Example value: “kind:denyPolicies”
-     * 
- * - * string filter = 2; - * - * @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; - } - /** - * - * - *
-     * Filtering currently only supports the kind of policies to return, and
-     * must be in the format “kind:[policyKind1] OR kind:[policyKind2]”.  New
-     * policy kinds may be added in the future without notice.
-     * Example value: “kind:denyPolicies”
-     * 
- * - * string filter = 2; - * - * @return This builder for chaining. - */ - public Builder clearFilter() { - - filter_ = getDefaultInstance().getFilter(); - onChanged(); - return this; - } - /** - * - * - *
-     * Filtering currently only supports the kind of policies to return, and
-     * must be in the format “kind:[policyKind1] OR kind:[policyKind2]”.  New
-     * policy kinds may be added in the future without notice.
-     * Example value: “kind:denyPolicies”
-     * 
- * - * string filter = 2; - * - * @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; - } - - private java.lang.Object pageToken_ = ""; - /** - * - * - *
-     * If present, then retrieve the batch of results following the results from
-     * the preceding call to this method.  `page_token` must be the value of
-     * `next_page_token`
-     * [ListApplicablePoliciesResponse.next_page_token][google.iam.v2.ListApplicablePoliciesResponse.next_page_token]
-     * from the previous response.  The values of other method parameters should
-     * be identical to those in the previous call.
-     * 
- * - * string page_token = 3; - * - * @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; - } - } - /** - * - * - *
-     * If present, then retrieve the batch of results following the results from
-     * the preceding call to this method.  `page_token` must be the value of
-     * `next_page_token`
-     * [ListApplicablePoliciesResponse.next_page_token][google.iam.v2.ListApplicablePoliciesResponse.next_page_token]
-     * from the previous response.  The values of other method parameters should
-     * be identical to those in the previous call.
-     * 
- * - * string page_token = 3; - * - * @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; - } - } - /** - * - * - *
-     * If present, then retrieve the batch of results following the results from
-     * the preceding call to this method.  `page_token` must be the value of
-     * `next_page_token`
-     * [ListApplicablePoliciesResponse.next_page_token][google.iam.v2.ListApplicablePoliciesResponse.next_page_token]
-     * from the previous response.  The values of other method parameters should
-     * be identical to those in the previous call.
-     * 
- * - * string page_token = 3; - * - * @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; - } - /** - * - * - *
-     * If present, then retrieve the batch of results following the results from
-     * the preceding call to this method.  `page_token` must be the value of
-     * `next_page_token`
-     * [ListApplicablePoliciesResponse.next_page_token][google.iam.v2.ListApplicablePoliciesResponse.next_page_token]
-     * from the previous response.  The values of other method parameters should
-     * be identical to those in the previous call.
-     * 
- * - * string page_token = 3; - * - * @return This builder for chaining. - */ - public Builder clearPageToken() { - - pageToken_ = getDefaultInstance().getPageToken(); - onChanged(); - return this; - } - /** - * - * - *
-     * If present, then retrieve the batch of results following the results from
-     * the preceding call to this method.  `page_token` must be the value of
-     * `next_page_token`
-     * [ListApplicablePoliciesResponse.next_page_token][google.iam.v2.ListApplicablePoliciesResponse.next_page_token]
-     * from the previous response.  The values of other method parameters should
-     * be identical to those in the previous call.
-     * 
- * - * string page_token = 3; - * - * @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 int pageSize_; - /** - * - * - *
-     * Limit on the number of policies to include in the response.
-     * Further policies can subsequently be obtained by including the
-     * [ListApplicablePoliciesResponse.next_page_token][google.iam.admin.v1.ListApplicablePoliciesResponse.next_page_token]
-     * in a subsequent request.
-     * The minimum is 25, and the maximum is 100.
-     * 
- * - * int32 page_size = 4; - * - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - /** - * - * - *
-     * Limit on the number of policies to include in the response.
-     * Further policies can subsequently be obtained by including the
-     * [ListApplicablePoliciesResponse.next_page_token][google.iam.admin.v1.ListApplicablePoliciesResponse.next_page_token]
-     * in a subsequent request.
-     * The minimum is 25, and the maximum is 100.
-     * 
- * - * int32 page_size = 4; - * - * @param value The pageSize to set. - * @return This builder for chaining. - */ - public Builder setPageSize(int value) { - - pageSize_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Limit on the number of policies to include in the response.
-     * Further policies can subsequently be obtained by including the
-     * [ListApplicablePoliciesResponse.next_page_token][google.iam.admin.v1.ListApplicablePoliciesResponse.next_page_token]
-     * in a subsequent request.
-     * The minimum is 25, and the maximum is 100.
-     * 
- * - * int32 page_size = 4; - * - * @return This builder for chaining. - */ - public Builder clearPageSize() { - - pageSize_ = 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.iam.v2.ListApplicablePoliciesRequest) - } - - // @@protoc_insertion_point(class_scope:google.iam.v2.ListApplicablePoliciesRequest) - private static final com.google.iam.v2.ListApplicablePoliciesRequest DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.iam.v2.ListApplicablePoliciesRequest(); - } - - public static com.google.iam.v2.ListApplicablePoliciesRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListApplicablePoliciesRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListApplicablePoliciesRequest(input, extensionRegistry); - } - }; - - 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.iam.v2.ListApplicablePoliciesRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesRequestOrBuilder.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesRequestOrBuilder.java deleted file mode 100644 index b4b9180803de..000000000000 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesRequestOrBuilder.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * 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/iam/v2/policy.proto - -package com.google.iam.v2; - -public interface ListApplicablePoliciesRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.iam.v2.ListApplicablePoliciesRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The Cloud resource at which the applicable policies are to be
-   * retrieved. Format: `{attachment-point}` Use the URL-encoded full resource
-   * name, which means that the forward-slash character, `/`, must be written as
-   * `%2F`. For example,
-   * `cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project`.
-   * 
- * - * string attachment_point = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The attachmentPoint. - */ - java.lang.String getAttachmentPoint(); - /** - * - * - *
-   * Required. The Cloud resource at which the applicable policies are to be
-   * retrieved. Format: `{attachment-point}` Use the URL-encoded full resource
-   * name, which means that the forward-slash character, `/`, must be written as
-   * `%2F`. For example,
-   * `cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project`.
-   * 
- * - * string attachment_point = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for attachmentPoint. - */ - com.google.protobuf.ByteString getAttachmentPointBytes(); - - /** - * - * - *
-   * Filtering currently only supports the kind of policies to return, and
-   * must be in the format “kind:[policyKind1] OR kind:[policyKind2]”.  New
-   * policy kinds may be added in the future without notice.
-   * Example value: “kind:denyPolicies”
-   * 
- * - * string filter = 2; - * - * @return The filter. - */ - java.lang.String getFilter(); - /** - * - * - *
-   * Filtering currently only supports the kind of policies to return, and
-   * must be in the format “kind:[policyKind1] OR kind:[policyKind2]”.  New
-   * policy kinds may be added in the future without notice.
-   * Example value: “kind:denyPolicies”
-   * 
- * - * string filter = 2; - * - * @return The bytes for filter. - */ - com.google.protobuf.ByteString getFilterBytes(); - - /** - * - * - *
-   * If present, then retrieve the batch of results following the results from
-   * the preceding call to this method.  `page_token` must be the value of
-   * `next_page_token`
-   * [ListApplicablePoliciesResponse.next_page_token][google.iam.v2.ListApplicablePoliciesResponse.next_page_token]
-   * from the previous response.  The values of other method parameters should
-   * be identical to those in the previous call.
-   * 
- * - * string page_token = 3; - * - * @return The pageToken. - */ - java.lang.String getPageToken(); - /** - * - * - *
-   * If present, then retrieve the batch of results following the results from
-   * the preceding call to this method.  `page_token` must be the value of
-   * `next_page_token`
-   * [ListApplicablePoliciesResponse.next_page_token][google.iam.v2.ListApplicablePoliciesResponse.next_page_token]
-   * from the previous response.  The values of other method parameters should
-   * be identical to those in the previous call.
-   * 
- * - * string page_token = 3; - * - * @return The bytes for pageToken. - */ - com.google.protobuf.ByteString getPageTokenBytes(); - - /** - * - * - *
-   * Limit on the number of policies to include in the response.
-   * Further policies can subsequently be obtained by including the
-   * [ListApplicablePoliciesResponse.next_page_token][google.iam.admin.v1.ListApplicablePoliciesResponse.next_page_token]
-   * in a subsequent request.
-   * The minimum is 25, and the maximum is 100.
-   * 
- * - * int32 page_size = 4; - * - * @return The pageSize. - */ - int getPageSize(); -} diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesResponse.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesResponse.java deleted file mode 100644 index 6c31b640b6c5..000000000000 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesResponse.java +++ /dev/null @@ -1,1503 +0,0 @@ -/* - * 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/iam/v2/policy.proto - -package com.google.iam.v2; - -/** - * - * - *
- * Response message for [ListApplicablePolicies][] method.
- * 
- * - * Protobuf type {@code google.iam.v2.ListApplicablePoliciesResponse} - */ -public final class ListApplicablePoliciesResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.iam.v2.ListApplicablePoliciesResponse) - ListApplicablePoliciesResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListApplicablePoliciesResponse.newBuilder() to construct. - private ListApplicablePoliciesResponse( - com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListApplicablePoliciesResponse() { - policies_ = java.util.Collections.emptyList(); - inaccessible_ = com.google.protobuf.LazyStringArrayList.EMPTY; - nextPageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListApplicablePoliciesResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ListApplicablePoliciesResponse( - 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)) { - policies_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - policies_.add( - input.readMessage(com.google.iam.v2.Policy.parser(), extensionRegistry)); - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - inaccessible_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000002; - } - inaccessible_.add(s); - break; - } - case 26: - { - 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)) { - policies_ = java.util.Collections.unmodifiableList(policies_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - inaccessible_ = inaccessible_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.iam.v2.PolicyProto - .internal_static_google_iam_v2_ListApplicablePoliciesResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.iam.v2.PolicyProto - .internal_static_google_iam_v2_ListApplicablePoliciesResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.iam.v2.ListApplicablePoliciesResponse.class, - com.google.iam.v2.ListApplicablePoliciesResponse.Builder.class); - } - - public static final int POLICIES_FIELD_NUMBER = 1; - private java.util.List policies_; - /** - * - * - *
-   * Ordered list starting from the resource on which this API was called
-   * then proceeding up the hierarchy. Policies for the same attachment point
-   * will be grouped, but no further ordering is guaranteed.
-   * 
- * - * repeated .google.iam.v2.Policy policies = 1; - */ - @java.lang.Override - public java.util.List getPoliciesList() { - return policies_; - } - /** - * - * - *
-   * Ordered list starting from the resource on which this API was called
-   * then proceeding up the hierarchy. Policies for the same attachment point
-   * will be grouped, but no further ordering is guaranteed.
-   * 
- * - * repeated .google.iam.v2.Policy policies = 1; - */ - @java.lang.Override - public java.util.List getPoliciesOrBuilderList() { - return policies_; - } - /** - * - * - *
-   * Ordered list starting from the resource on which this API was called
-   * then proceeding up the hierarchy. Policies for the same attachment point
-   * will be grouped, but no further ordering is guaranteed.
-   * 
- * - * repeated .google.iam.v2.Policy policies = 1; - */ - @java.lang.Override - public int getPoliciesCount() { - return policies_.size(); - } - /** - * - * - *
-   * Ordered list starting from the resource on which this API was called
-   * then proceeding up the hierarchy. Policies for the same attachment point
-   * will be grouped, but no further ordering is guaranteed.
-   * 
- * - * repeated .google.iam.v2.Policy policies = 1; - */ - @java.lang.Override - public com.google.iam.v2.Policy getPolicies(int index) { - return policies_.get(index); - } - /** - * - * - *
-   * Ordered list starting from the resource on which this API was called
-   * then proceeding up the hierarchy. Policies for the same attachment point
-   * will be grouped, but no further ordering is guaranteed.
-   * 
- * - * repeated .google.iam.v2.Policy policies = 1; - */ - @java.lang.Override - public com.google.iam.v2.PolicyOrBuilder getPoliciesOrBuilder(int index) { - return policies_.get(index); - } - - public static final int INACCESSIBLE_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList inaccessible_; - /** - * - * - *
-   * A list of resources that the caller does not have permission to retrieve.
-   * List or Get can be used to get detailed error messages.
-   * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
-   * List: `policies/{attachment-point}/denypolicies`
-   * 
- * - * repeated string inaccessible = 2; - * - * @return A list containing the inaccessible. - */ - public com.google.protobuf.ProtocolStringList getInaccessibleList() { - return inaccessible_; - } - /** - * - * - *
-   * A list of resources that the caller does not have permission to retrieve.
-   * List or Get can be used to get detailed error messages.
-   * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
-   * List: `policies/{attachment-point}/denypolicies`
-   * 
- * - * repeated string inaccessible = 2; - * - * @return The count of inaccessible. - */ - public int getInaccessibleCount() { - return inaccessible_.size(); - } - /** - * - * - *
-   * A list of resources that the caller does not have permission to retrieve.
-   * List or Get can be used to get detailed error messages.
-   * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
-   * List: `policies/{attachment-point}/denypolicies`
-   * 
- * - * repeated string inaccessible = 2; - * - * @param index The index of the element to return. - * @return The inaccessible at the given index. - */ - public java.lang.String getInaccessible(int index) { - return inaccessible_.get(index); - } - /** - * - * - *
-   * A list of resources that the caller does not have permission to retrieve.
-   * List or Get can be used to get detailed error messages.
-   * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
-   * List: `policies/{attachment-point}/denypolicies`
-   * 
- * - * repeated string inaccessible = 2; - * - * @param index The index of the value to return. - * @return The bytes of the inaccessible at the given index. - */ - public com.google.protobuf.ByteString getInaccessibleBytes(int index) { - return inaccessible_.getByteString(index); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 3; - private volatile java.lang.Object nextPageToken_; - /** - * - * - *
-   * A page token that can be used in a
-   * [ListApplicablePoliciesRequest][google.iam.v2.ListApplicablePoliciesRequest]
-   * to retrieve the next page. If this field is blank, there are no additional
-   * pages.
-   * 
- * - * string next_page_token = 3; - * - * @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; - } - } - /** - * - * - *
-   * A page token that can be used in a
-   * [ListApplicablePoliciesRequest][google.iam.v2.ListApplicablePoliciesRequest]
-   * to retrieve the next page. If this field is blank, there are no additional
-   * pages.
-   * 
- * - * string next_page_token = 3; - * - * @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 < policies_.size(); i++) { - output.writeMessage(1, policies_.get(i)); - } - for (int i = 0; i < inaccessible_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, inaccessible_.getRaw(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, nextPageToken_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < policies_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, policies_.get(i)); - } - { - int dataSize = 0; - for (int i = 0; i < inaccessible_.size(); i++) { - dataSize += computeStringSizeNoTag(inaccessible_.getRaw(i)); - } - size += dataSize; - size += 1 * getInaccessibleList().size(); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, nextPageToken_); - } - size += unknownFields.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.iam.v2.ListApplicablePoliciesResponse)) { - return super.equals(obj); - } - com.google.iam.v2.ListApplicablePoliciesResponse other = - (com.google.iam.v2.ListApplicablePoliciesResponse) obj; - - if (!getPoliciesList().equals(other.getPoliciesList())) return false; - if (!getInaccessibleList().equals(other.getInaccessibleList())) return false; - if (!getNextPageToken().equals(other.getNextPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getPoliciesCount() > 0) { - hash = (37 * hash) + POLICIES_FIELD_NUMBER; - hash = (53 * hash) + getPoliciesList().hashCode(); - } - if (getInaccessibleCount() > 0) { - hash = (37 * hash) + INACCESSIBLE_FIELD_NUMBER; - hash = (53 * hash) + getInaccessibleList().hashCode(); - } - hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.iam.v2.ListApplicablePoliciesResponse parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.iam.v2.ListApplicablePoliciesResponse parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.iam.v2.ListApplicablePoliciesResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.iam.v2.ListApplicablePoliciesResponse 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.iam.v2.ListApplicablePoliciesResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.iam.v2.ListApplicablePoliciesResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.iam.v2.ListApplicablePoliciesResponse parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.iam.v2.ListApplicablePoliciesResponse 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.iam.v2.ListApplicablePoliciesResponse parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.iam.v2.ListApplicablePoliciesResponse 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.iam.v2.ListApplicablePoliciesResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.iam.v2.ListApplicablePoliciesResponse 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.iam.v2.ListApplicablePoliciesResponse 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 message for [ListApplicablePolicies][] method.
-   * 
- * - * Protobuf type {@code google.iam.v2.ListApplicablePoliciesResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.iam.v2.ListApplicablePoliciesResponse) - com.google.iam.v2.ListApplicablePoliciesResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.iam.v2.PolicyProto - .internal_static_google_iam_v2_ListApplicablePoliciesResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.iam.v2.PolicyProto - .internal_static_google_iam_v2_ListApplicablePoliciesResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.iam.v2.ListApplicablePoliciesResponse.class, - com.google.iam.v2.ListApplicablePoliciesResponse.Builder.class); - } - - // Construct using com.google.iam.v2.ListApplicablePoliciesResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getPoliciesFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - if (policiesBuilder_ == null) { - policies_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - policiesBuilder_.clear(); - } - inaccessible_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - nextPageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.iam.v2.PolicyProto - .internal_static_google_iam_v2_ListApplicablePoliciesResponse_descriptor; - } - - @java.lang.Override - public com.google.iam.v2.ListApplicablePoliciesResponse getDefaultInstanceForType() { - return com.google.iam.v2.ListApplicablePoliciesResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.iam.v2.ListApplicablePoliciesResponse build() { - com.google.iam.v2.ListApplicablePoliciesResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.iam.v2.ListApplicablePoliciesResponse buildPartial() { - com.google.iam.v2.ListApplicablePoliciesResponse result = - new com.google.iam.v2.ListApplicablePoliciesResponse(this); - int from_bitField0_ = bitField0_; - if (policiesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - policies_ = java.util.Collections.unmodifiableList(policies_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.policies_ = policies_; - } else { - result.policies_ = policiesBuilder_.build(); - } - if (((bitField0_ & 0x00000002) != 0)) { - inaccessible_ = inaccessible_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.inaccessible_ = inaccessible_; - 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.iam.v2.ListApplicablePoliciesResponse) { - return mergeFrom((com.google.iam.v2.ListApplicablePoliciesResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.iam.v2.ListApplicablePoliciesResponse other) { - if (other == com.google.iam.v2.ListApplicablePoliciesResponse.getDefaultInstance()) - return this; - if (policiesBuilder_ == null) { - if (!other.policies_.isEmpty()) { - if (policies_.isEmpty()) { - policies_ = other.policies_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePoliciesIsMutable(); - policies_.addAll(other.policies_); - } - onChanged(); - } - } else { - if (!other.policies_.isEmpty()) { - if (policiesBuilder_.isEmpty()) { - policiesBuilder_.dispose(); - policiesBuilder_ = null; - policies_ = other.policies_; - bitField0_ = (bitField0_ & ~0x00000001); - policiesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getPoliciesFieldBuilder() - : null; - } else { - policiesBuilder_.addAllMessages(other.policies_); - } - } - } - if (!other.inaccessible_.isEmpty()) { - if (inaccessible_.isEmpty()) { - inaccessible_ = other.inaccessible_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureInaccessibleIsMutable(); - inaccessible_.addAll(other.inaccessible_); - } - onChanged(); - } - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - 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 { - com.google.iam.v2.ListApplicablePoliciesResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.iam.v2.ListApplicablePoliciesResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private java.util.List policies_ = java.util.Collections.emptyList(); - - private void ensurePoliciesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - policies_ = new java.util.ArrayList(policies_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.iam.v2.Policy, - com.google.iam.v2.Policy.Builder, - com.google.iam.v2.PolicyOrBuilder> - policiesBuilder_; - - /** - * - * - *
-     * Ordered list starting from the resource on which this API was called
-     * then proceeding up the hierarchy. Policies for the same attachment point
-     * will be grouped, but no further ordering is guaranteed.
-     * 
- * - * repeated .google.iam.v2.Policy policies = 1; - */ - public java.util.List getPoliciesList() { - if (policiesBuilder_ == null) { - return java.util.Collections.unmodifiableList(policies_); - } else { - return policiesBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * Ordered list starting from the resource on which this API was called
-     * then proceeding up the hierarchy. Policies for the same attachment point
-     * will be grouped, but no further ordering is guaranteed.
-     * 
- * - * repeated .google.iam.v2.Policy policies = 1; - */ - public int getPoliciesCount() { - if (policiesBuilder_ == null) { - return policies_.size(); - } else { - return policiesBuilder_.getCount(); - } - } - /** - * - * - *
-     * Ordered list starting from the resource on which this API was called
-     * then proceeding up the hierarchy. Policies for the same attachment point
-     * will be grouped, but no further ordering is guaranteed.
-     * 
- * - * repeated .google.iam.v2.Policy policies = 1; - */ - public com.google.iam.v2.Policy getPolicies(int index) { - if (policiesBuilder_ == null) { - return policies_.get(index); - } else { - return policiesBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * Ordered list starting from the resource on which this API was called
-     * then proceeding up the hierarchy. Policies for the same attachment point
-     * will be grouped, but no further ordering is guaranteed.
-     * 
- * - * repeated .google.iam.v2.Policy policies = 1; - */ - public Builder setPolicies(int index, com.google.iam.v2.Policy value) { - if (policiesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePoliciesIsMutable(); - policies_.set(index, value); - onChanged(); - } else { - policiesBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Ordered list starting from the resource on which this API was called
-     * then proceeding up the hierarchy. Policies for the same attachment point
-     * will be grouped, but no further ordering is guaranteed.
-     * 
- * - * repeated .google.iam.v2.Policy policies = 1; - */ - public Builder setPolicies(int index, com.google.iam.v2.Policy.Builder builderForValue) { - if (policiesBuilder_ == null) { - ensurePoliciesIsMutable(); - policies_.set(index, builderForValue.build()); - onChanged(); - } else { - policiesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Ordered list starting from the resource on which this API was called
-     * then proceeding up the hierarchy. Policies for the same attachment point
-     * will be grouped, but no further ordering is guaranteed.
-     * 
- * - * repeated .google.iam.v2.Policy policies = 1; - */ - public Builder addPolicies(com.google.iam.v2.Policy value) { - if (policiesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePoliciesIsMutable(); - policies_.add(value); - onChanged(); - } else { - policiesBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * Ordered list starting from the resource on which this API was called
-     * then proceeding up the hierarchy. Policies for the same attachment point
-     * will be grouped, but no further ordering is guaranteed.
-     * 
- * - * repeated .google.iam.v2.Policy policies = 1; - */ - public Builder addPolicies(int index, com.google.iam.v2.Policy value) { - if (policiesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePoliciesIsMutable(); - policies_.add(index, value); - onChanged(); - } else { - policiesBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Ordered list starting from the resource on which this API was called
-     * then proceeding up the hierarchy. Policies for the same attachment point
-     * will be grouped, but no further ordering is guaranteed.
-     * 
- * - * repeated .google.iam.v2.Policy policies = 1; - */ - public Builder addPolicies(com.google.iam.v2.Policy.Builder builderForValue) { - if (policiesBuilder_ == null) { - ensurePoliciesIsMutable(); - policies_.add(builderForValue.build()); - onChanged(); - } else { - policiesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Ordered list starting from the resource on which this API was called
-     * then proceeding up the hierarchy. Policies for the same attachment point
-     * will be grouped, but no further ordering is guaranteed.
-     * 
- * - * repeated .google.iam.v2.Policy policies = 1; - */ - public Builder addPolicies(int index, com.google.iam.v2.Policy.Builder builderForValue) { - if (policiesBuilder_ == null) { - ensurePoliciesIsMutable(); - policies_.add(index, builderForValue.build()); - onChanged(); - } else { - policiesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Ordered list starting from the resource on which this API was called
-     * then proceeding up the hierarchy. Policies for the same attachment point
-     * will be grouped, but no further ordering is guaranteed.
-     * 
- * - * repeated .google.iam.v2.Policy policies = 1; - */ - public Builder addAllPolicies(java.lang.Iterable values) { - if (policiesBuilder_ == null) { - ensurePoliciesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, policies_); - onChanged(); - } else { - policiesBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * Ordered list starting from the resource on which this API was called
-     * then proceeding up the hierarchy. Policies for the same attachment point
-     * will be grouped, but no further ordering is guaranteed.
-     * 
- * - * repeated .google.iam.v2.Policy policies = 1; - */ - public Builder clearPolicies() { - if (policiesBuilder_ == null) { - policies_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - policiesBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Ordered list starting from the resource on which this API was called
-     * then proceeding up the hierarchy. Policies for the same attachment point
-     * will be grouped, but no further ordering is guaranteed.
-     * 
- * - * repeated .google.iam.v2.Policy policies = 1; - */ - public Builder removePolicies(int index) { - if (policiesBuilder_ == null) { - ensurePoliciesIsMutable(); - policies_.remove(index); - onChanged(); - } else { - policiesBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * Ordered list starting from the resource on which this API was called
-     * then proceeding up the hierarchy. Policies for the same attachment point
-     * will be grouped, but no further ordering is guaranteed.
-     * 
- * - * repeated .google.iam.v2.Policy policies = 1; - */ - public com.google.iam.v2.Policy.Builder getPoliciesBuilder(int index) { - return getPoliciesFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * Ordered list starting from the resource on which this API was called
-     * then proceeding up the hierarchy. Policies for the same attachment point
-     * will be grouped, but no further ordering is guaranteed.
-     * 
- * - * repeated .google.iam.v2.Policy policies = 1; - */ - public com.google.iam.v2.PolicyOrBuilder getPoliciesOrBuilder(int index) { - if (policiesBuilder_ == null) { - return policies_.get(index); - } else { - return policiesBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * Ordered list starting from the resource on which this API was called
-     * then proceeding up the hierarchy. Policies for the same attachment point
-     * will be grouped, but no further ordering is guaranteed.
-     * 
- * - * repeated .google.iam.v2.Policy policies = 1; - */ - public java.util.List getPoliciesOrBuilderList() { - if (policiesBuilder_ != null) { - return policiesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(policies_); - } - } - /** - * - * - *
-     * Ordered list starting from the resource on which this API was called
-     * then proceeding up the hierarchy. Policies for the same attachment point
-     * will be grouped, but no further ordering is guaranteed.
-     * 
- * - * repeated .google.iam.v2.Policy policies = 1; - */ - public com.google.iam.v2.Policy.Builder addPoliciesBuilder() { - return getPoliciesFieldBuilder().addBuilder(com.google.iam.v2.Policy.getDefaultInstance()); - } - /** - * - * - *
-     * Ordered list starting from the resource on which this API was called
-     * then proceeding up the hierarchy. Policies for the same attachment point
-     * will be grouped, but no further ordering is guaranteed.
-     * 
- * - * repeated .google.iam.v2.Policy policies = 1; - */ - public com.google.iam.v2.Policy.Builder addPoliciesBuilder(int index) { - return getPoliciesFieldBuilder() - .addBuilder(index, com.google.iam.v2.Policy.getDefaultInstance()); - } - /** - * - * - *
-     * Ordered list starting from the resource on which this API was called
-     * then proceeding up the hierarchy. Policies for the same attachment point
-     * will be grouped, but no further ordering is guaranteed.
-     * 
- * - * repeated .google.iam.v2.Policy policies = 1; - */ - public java.util.List getPoliciesBuilderList() { - return getPoliciesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.iam.v2.Policy, - com.google.iam.v2.Policy.Builder, - com.google.iam.v2.PolicyOrBuilder> - getPoliciesFieldBuilder() { - if (policiesBuilder_ == null) { - policiesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.iam.v2.Policy, - com.google.iam.v2.Policy.Builder, - com.google.iam.v2.PolicyOrBuilder>( - policies_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - policies_ = null; - } - return policiesBuilder_; - } - - private com.google.protobuf.LazyStringList inaccessible_ = - com.google.protobuf.LazyStringArrayList.EMPTY; - - private void ensureInaccessibleIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - inaccessible_ = new com.google.protobuf.LazyStringArrayList(inaccessible_); - bitField0_ |= 0x00000002; - } - } - /** - * - * - *
-     * A list of resources that the caller does not have permission to retrieve.
-     * List or Get can be used to get detailed error messages.
-     * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
-     * List: `policies/{attachment-point}/denypolicies`
-     * 
- * - * repeated string inaccessible = 2; - * - * @return A list containing the inaccessible. - */ - public com.google.protobuf.ProtocolStringList getInaccessibleList() { - return inaccessible_.getUnmodifiableView(); - } - /** - * - * - *
-     * A list of resources that the caller does not have permission to retrieve.
-     * List or Get can be used to get detailed error messages.
-     * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
-     * List: `policies/{attachment-point}/denypolicies`
-     * 
- * - * repeated string inaccessible = 2; - * - * @return The count of inaccessible. - */ - public int getInaccessibleCount() { - return inaccessible_.size(); - } - /** - * - * - *
-     * A list of resources that the caller does not have permission to retrieve.
-     * List or Get can be used to get detailed error messages.
-     * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
-     * List: `policies/{attachment-point}/denypolicies`
-     * 
- * - * repeated string inaccessible = 2; - * - * @param index The index of the element to return. - * @return The inaccessible at the given index. - */ - public java.lang.String getInaccessible(int index) { - return inaccessible_.get(index); - } - /** - * - * - *
-     * A list of resources that the caller does not have permission to retrieve.
-     * List or Get can be used to get detailed error messages.
-     * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
-     * List: `policies/{attachment-point}/denypolicies`
-     * 
- * - * repeated string inaccessible = 2; - * - * @param index The index of the value to return. - * @return The bytes of the inaccessible at the given index. - */ - public com.google.protobuf.ByteString getInaccessibleBytes(int index) { - return inaccessible_.getByteString(index); - } - /** - * - * - *
-     * A list of resources that the caller does not have permission to retrieve.
-     * List or Get can be used to get detailed error messages.
-     * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
-     * List: `policies/{attachment-point}/denypolicies`
-     * 
- * - * repeated string inaccessible = 2; - * - * @param index The index to set the value at. - * @param value The inaccessible to set. - * @return This builder for chaining. - */ - public Builder setInaccessible(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureInaccessibleIsMutable(); - inaccessible_.set(index, value); - onChanged(); - return this; - } - /** - * - * - *
-     * A list of resources that the caller does not have permission to retrieve.
-     * List or Get can be used to get detailed error messages.
-     * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
-     * List: `policies/{attachment-point}/denypolicies`
-     * 
- * - * repeated string inaccessible = 2; - * - * @param value The inaccessible to add. - * @return This builder for chaining. - */ - public Builder addInaccessible(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureInaccessibleIsMutable(); - inaccessible_.add(value); - onChanged(); - return this; - } - /** - * - * - *
-     * A list of resources that the caller does not have permission to retrieve.
-     * List or Get can be used to get detailed error messages.
-     * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
-     * List: `policies/{attachment-point}/denypolicies`
-     * 
- * - * repeated string inaccessible = 2; - * - * @param values The inaccessible to add. - * @return This builder for chaining. - */ - public Builder addAllInaccessible(java.lang.Iterable values) { - ensureInaccessibleIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, inaccessible_); - onChanged(); - return this; - } - /** - * - * - *
-     * A list of resources that the caller does not have permission to retrieve.
-     * List or Get can be used to get detailed error messages.
-     * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
-     * List: `policies/{attachment-point}/denypolicies`
-     * 
- * - * repeated string inaccessible = 2; - * - * @return This builder for chaining. - */ - public Builder clearInaccessible() { - inaccessible_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - * - * - *
-     * A list of resources that the caller does not have permission to retrieve.
-     * List or Get can be used to get detailed error messages.
-     * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
-     * List: `policies/{attachment-point}/denypolicies`
-     * 
- * - * repeated string inaccessible = 2; - * - * @param value The bytes of the inaccessible to add. - * @return This builder for chaining. - */ - public Builder addInaccessibleBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureInaccessibleIsMutable(); - inaccessible_.add(value); - onChanged(); - return this; - } - - private java.lang.Object nextPageToken_ = ""; - /** - * - * - *
-     * A page token that can be used in a
-     * [ListApplicablePoliciesRequest][google.iam.v2.ListApplicablePoliciesRequest]
-     * to retrieve the next page. If this field is blank, there are no additional
-     * pages.
-     * 
- * - * string next_page_token = 3; - * - * @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; - } - } - /** - * - * - *
-     * A page token that can be used in a
-     * [ListApplicablePoliciesRequest][google.iam.v2.ListApplicablePoliciesRequest]
-     * to retrieve the next page. If this field is blank, there are no additional
-     * pages.
-     * 
- * - * string next_page_token = 3; - * - * @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; - } - } - /** - * - * - *
-     * A page token that can be used in a
-     * [ListApplicablePoliciesRequest][google.iam.v2.ListApplicablePoliciesRequest]
-     * to retrieve the next page. If this field is blank, there are no additional
-     * pages.
-     * 
- * - * string next_page_token = 3; - * - * @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; - } - /** - * - * - *
-     * A page token that can be used in a
-     * [ListApplicablePoliciesRequest][google.iam.v2.ListApplicablePoliciesRequest]
-     * to retrieve the next page. If this field is blank, there are no additional
-     * pages.
-     * 
- * - * string next_page_token = 3; - * - * @return This builder for chaining. - */ - public Builder clearNextPageToken() { - - nextPageToken_ = getDefaultInstance().getNextPageToken(); - onChanged(); - return this; - } - /** - * - * - *
-     * A page token that can be used in a
-     * [ListApplicablePoliciesRequest][google.iam.v2.ListApplicablePoliciesRequest]
-     * to retrieve the next page. If this field is blank, there are no additional
-     * pages.
-     * 
- * - * string next_page_token = 3; - * - * @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.iam.v2.ListApplicablePoliciesResponse) - } - - // @@protoc_insertion_point(class_scope:google.iam.v2.ListApplicablePoliciesResponse) - private static final com.google.iam.v2.ListApplicablePoliciesResponse DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.iam.v2.ListApplicablePoliciesResponse(); - } - - public static com.google.iam.v2.ListApplicablePoliciesResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListApplicablePoliciesResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListApplicablePoliciesResponse(input, extensionRegistry); - } - }; - - 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.iam.v2.ListApplicablePoliciesResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesResponseOrBuilder.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesResponseOrBuilder.java deleted file mode 100644 index f83bbeda4e91..000000000000 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListApplicablePoliciesResponseOrBuilder.java +++ /dev/null @@ -1,180 +0,0 @@ -/* - * 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/iam/v2/policy.proto - -package com.google.iam.v2; - -public interface ListApplicablePoliciesResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.iam.v2.ListApplicablePoliciesResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Ordered list starting from the resource on which this API was called
-   * then proceeding up the hierarchy. Policies for the same attachment point
-   * will be grouped, but no further ordering is guaranteed.
-   * 
- * - * repeated .google.iam.v2.Policy policies = 1; - */ - java.util.List getPoliciesList(); - /** - * - * - *
-   * Ordered list starting from the resource on which this API was called
-   * then proceeding up the hierarchy. Policies for the same attachment point
-   * will be grouped, but no further ordering is guaranteed.
-   * 
- * - * repeated .google.iam.v2.Policy policies = 1; - */ - com.google.iam.v2.Policy getPolicies(int index); - /** - * - * - *
-   * Ordered list starting from the resource on which this API was called
-   * then proceeding up the hierarchy. Policies for the same attachment point
-   * will be grouped, but no further ordering is guaranteed.
-   * 
- * - * repeated .google.iam.v2.Policy policies = 1; - */ - int getPoliciesCount(); - /** - * - * - *
-   * Ordered list starting from the resource on which this API was called
-   * then proceeding up the hierarchy. Policies for the same attachment point
-   * will be grouped, but no further ordering is guaranteed.
-   * 
- * - * repeated .google.iam.v2.Policy policies = 1; - */ - java.util.List getPoliciesOrBuilderList(); - /** - * - * - *
-   * Ordered list starting from the resource on which this API was called
-   * then proceeding up the hierarchy. Policies for the same attachment point
-   * will be grouped, but no further ordering is guaranteed.
-   * 
- * - * repeated .google.iam.v2.Policy policies = 1; - */ - com.google.iam.v2.PolicyOrBuilder getPoliciesOrBuilder(int index); - - /** - * - * - *
-   * A list of resources that the caller does not have permission to retrieve.
-   * List or Get can be used to get detailed error messages.
-   * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
-   * List: `policies/{attachment-point}/denypolicies`
-   * 
- * - * repeated string inaccessible = 2; - * - * @return A list containing the inaccessible. - */ - java.util.List getInaccessibleList(); - /** - * - * - *
-   * A list of resources that the caller does not have permission to retrieve.
-   * List or Get can be used to get detailed error messages.
-   * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
-   * List: `policies/{attachment-point}/denypolicies`
-   * 
- * - * repeated string inaccessible = 2; - * - * @return The count of inaccessible. - */ - int getInaccessibleCount(); - /** - * - * - *
-   * A list of resources that the caller does not have permission to retrieve.
-   * List or Get can be used to get detailed error messages.
-   * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
-   * List: `policies/{attachment-point}/denypolicies`
-   * 
- * - * repeated string inaccessible = 2; - * - * @param index The index of the element to return. - * @return The inaccessible at the given index. - */ - java.lang.String getInaccessible(int index); - /** - * - * - *
-   * A list of resources that the caller does not have permission to retrieve.
-   * List or Get can be used to get detailed error messages.
-   * Get: `policies/{attachment-point}/denypolicies/{policy-id}`
-   * List: `policies/{attachment-point}/denypolicies`
-   * 
- * - * repeated string inaccessible = 2; - * - * @param index The index of the value to return. - * @return The bytes of the inaccessible at the given index. - */ - com.google.protobuf.ByteString getInaccessibleBytes(int index); - - /** - * - * - *
-   * A page token that can be used in a
-   * [ListApplicablePoliciesRequest][google.iam.v2.ListApplicablePoliciesRequest]
-   * to retrieve the next page. If this field is blank, there are no additional
-   * pages.
-   * 
- * - * string next_page_token = 3; - * - * @return The nextPageToken. - */ - java.lang.String getNextPageToken(); - /** - * - * - *
-   * A page token that can be used in a
-   * [ListApplicablePoliciesRequest][google.iam.v2.ListApplicablePoliciesRequest]
-   * to retrieve the next page. If this field is blank, there are no additional
-   * pages.
-   * 
- * - * string next_page_token = 3; - * - * @return The bytes for nextPageToken. - */ - com.google.protobuf.ByteString getNextPageTokenBytes(); -} diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesRequest.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesRequest.java index 5665c5b7b990..124798c38a4c 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesRequest.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesRequest.java @@ -53,64 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private ListPoliciesRequest( - 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; - } - 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.iam.v2.PolicyProto .internal_static_google_iam_v2_ListPoliciesRequest_descriptor; @@ -132,8 +74,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. The resource that the policy is attached to, along with the kind
-   * of policy to list. Format: `policies/{attachment_point}/denypolicies`
+   * Required. The resource that the policy is attached to, along with the kind of policy
+   * to list. Format:
+   * `policies/{attachment_point}/denypolicies`
    * The attachment point is identified by its URL-encoded full resource name,
    * which means that the forward-slash character, `/`, must be written as
    * `%2F`. For example,
@@ -162,8 +105,9 @@ public java.lang.String getParent() {
    *
    *
    * 
-   * Required. The resource that the policy is attached to, along with the kind
-   * of policy to list. Format: `policies/{attachment_point}/denypolicies`
+   * Required. The resource that the policy is attached to, along with the kind of policy
+   * to list. Format:
+   * `policies/{attachment_point}/denypolicies`
    * The attachment point is identified by its URL-encoded full resource name,
    * which means that the forward-slash character, `/`, must be written as
    * `%2F`. For example,
@@ -214,9 +158,8 @@ public int getPageSize() {
    *
    *
    * 
-   * A page token received in a
-   * [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this
-   * token to retrieve the next page.
+   * A page token received in a [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this token to
+   * retrieve the next page.
    * 
* * string page_token = 3; @@ -239,9 +182,8 @@ public java.lang.String getPageToken() { * * *
-   * A page token received in a
-   * [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this
-   * token to retrieve the next page.
+   * A page token received in a [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this token to
+   * retrieve the next page.
    * 
* * string page_token = 3; @@ -284,7 +226,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -302,7 +244,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -320,7 +262,7 @@ public boolean equals(final java.lang.Object obj) { if (!getParent().equals(other.getParent())) return false; if (getPageSize() != other.getPageSize()) return false; if (!getPageToken().equals(other.getPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -337,7 +279,7 @@ public int hashCode() { hash = (53 * hash) + getPageSize(); hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -465,17 +407,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v2.ListPoliciesRequest.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 @@ -577,7 +512,7 @@ public Builder mergeFrom(com.google.iam.v2.ListPoliciesRequest other) { pageToken_ = other.pageToken_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -592,17 +527,49 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v2.ListPoliciesRequest 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 + 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.iam.v2.ListPoliciesRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -611,8 +578,9 @@ public Builder mergeFrom( * * *
-     * Required. The resource that the policy is attached to, along with the kind
-     * of policy to list. Format: `policies/{attachment_point}/denypolicies`
+     * Required. The resource that the policy is attached to, along with the kind of policy
+     * to list. Format:
+     * `policies/{attachment_point}/denypolicies`
      * The attachment point is identified by its URL-encoded full resource name,
      * which means that the forward-slash character, `/`, must be written as
      * `%2F`. For example,
@@ -640,8 +608,9 @@ public java.lang.String getParent() {
      *
      *
      * 
-     * Required. The resource that the policy is attached to, along with the kind
-     * of policy to list. Format: `policies/{attachment_point}/denypolicies`
+     * Required. The resource that the policy is attached to, along with the kind of policy
+     * to list. Format:
+     * `policies/{attachment_point}/denypolicies`
      * The attachment point is identified by its URL-encoded full resource name,
      * which means that the forward-slash character, `/`, must be written as
      * `%2F`. For example,
@@ -669,8 +638,9 @@ public com.google.protobuf.ByteString getParentBytes() {
      *
      *
      * 
-     * Required. The resource that the policy is attached to, along with the kind
-     * of policy to list. Format: `policies/{attachment_point}/denypolicies`
+     * Required. The resource that the policy is attached to, along with the kind of policy
+     * to list. Format:
+     * `policies/{attachment_point}/denypolicies`
      * The attachment point is identified by its URL-encoded full resource name,
      * which means that the forward-slash character, `/`, must be written as
      * `%2F`. For example,
@@ -697,8 +667,9 @@ public Builder setParent(java.lang.String value) {
      *
      *
      * 
-     * Required. The resource that the policy is attached to, along with the kind
-     * of policy to list. Format: `policies/{attachment_point}/denypolicies`
+     * Required. The resource that the policy is attached to, along with the kind of policy
+     * to list. Format:
+     * `policies/{attachment_point}/denypolicies`
      * The attachment point is identified by its URL-encoded full resource name,
      * which means that the forward-slash character, `/`, must be written as
      * `%2F`. For example,
@@ -721,8 +692,9 @@ public Builder clearParent() {
      *
      *
      * 
-     * Required. The resource that the policy is attached to, along with the kind
-     * of policy to list. Format: `policies/{attachment_point}/denypolicies`
+     * Required. The resource that the policy is attached to, along with the kind of policy
+     * to list. Format:
+     * `policies/{attachment_point}/denypolicies`
      * The attachment point is identified by its URL-encoded full resource name,
      * which means that the forward-slash character, `/`, must be written as
      * `%2F`. For example,
@@ -807,9 +779,8 @@ public Builder clearPageSize() {
      *
      *
      * 
-     * A page token received in a
-     * [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this
-     * token to retrieve the next page.
+     * A page token received in a [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this token to
+     * retrieve the next page.
      * 
* * string page_token = 3; @@ -831,9 +802,8 @@ public java.lang.String getPageToken() { * * *
-     * A page token received in a
-     * [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this
-     * token to retrieve the next page.
+     * A page token received in a [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this token to
+     * retrieve the next page.
      * 
* * string page_token = 3; @@ -855,9 +825,8 @@ public com.google.protobuf.ByteString getPageTokenBytes() { * * *
-     * A page token received in a
-     * [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this
-     * token to retrieve the next page.
+     * A page token received in a [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this token to
+     * retrieve the next page.
      * 
* * string page_token = 3; @@ -878,9 +847,8 @@ public Builder setPageToken(java.lang.String value) { * * *
-     * A page token received in a
-     * [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this
-     * token to retrieve the next page.
+     * A page token received in a [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this token to
+     * retrieve the next page.
      * 
* * string page_token = 3; @@ -897,9 +865,8 @@ public Builder clearPageToken() { * * *
-     * A page token received in a
-     * [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this
-     * token to retrieve the next page.
+     * A page token received in a [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this token to
+     * retrieve the next page.
      * 
* * string page_token = 3; @@ -950,7 +917,18 @@ public ListPoliciesRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ListPoliciesRequest(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-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesRequestOrBuilder.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesRequestOrBuilder.java index 5ccf0c27491b..bfea871b46c3 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesRequestOrBuilder.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesRequestOrBuilder.java @@ -27,8 +27,9 @@ public interface ListPoliciesRequestOrBuilder * * *
-   * Required. The resource that the policy is attached to, along with the kind
-   * of policy to list. Format: `policies/{attachment_point}/denypolicies`
+   * Required. The resource that the policy is attached to, along with the kind of policy
+   * to list. Format:
+   * `policies/{attachment_point}/denypolicies`
    * The attachment point is identified by its URL-encoded full resource name,
    * which means that the forward-slash character, `/`, must be written as
    * `%2F`. For example,
@@ -46,8 +47,9 @@ public interface ListPoliciesRequestOrBuilder
    *
    *
    * 
-   * Required. The resource that the policy is attached to, along with the kind
-   * of policy to list. Format: `policies/{attachment_point}/denypolicies`
+   * Required. The resource that the policy is attached to, along with the kind of policy
+   * to list. Format:
+   * `policies/{attachment_point}/denypolicies`
    * The attachment point is identified by its URL-encoded full resource name,
    * which means that the forward-slash character, `/`, must be written as
    * `%2F`. For example,
@@ -80,9 +82,8 @@ public interface ListPoliciesRequestOrBuilder
    *
    *
    * 
-   * A page token received in a
-   * [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this
-   * token to retrieve the next page.
+   * A page token received in a [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this token to
+   * retrieve the next page.
    * 
* * string page_token = 3; @@ -94,9 +95,8 @@ public interface ListPoliciesRequestOrBuilder * * *
-   * A page token received in a
-   * [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this
-   * token to retrieve the next page.
+   * A page token received in a [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this token to
+   * retrieve the next page.
    * 
* * string page_token = 3; diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesResponse.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesResponse.java index fa2820bd98d2..62cdb5ecac8e 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesResponse.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesResponse.java @@ -53,66 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private ListPoliciesResponse( - 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)) { - policies_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - policies_.add( - input.readMessage(com.google.iam.v2.Policy.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)) { - policies_ = java.util.Collections.unmodifiableList(policies_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v2.PolicyProto .internal_static_google_iam_v2_ListPoliciesResponse_descriptor; @@ -202,8 +142,7 @@ public com.google.iam.v2.PolicyOrBuilder getPoliciesOrBuilder(int index) { * * *
-   * A page token that you can use in a
-   * [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the
+   * A page token that you can use in a [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the
    * next page. If this field is omitted, there are no additional pages.
    * 
* @@ -227,8 +166,7 @@ public java.lang.String getNextPageToken() { * * *
-   * A page token that you can use in a
-   * [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the
+   * A page token that you can use in a [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the
    * next page. If this field is omitted, there are no additional pages.
    * 
* @@ -269,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 @@ -284,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; } @@ -301,7 +239,7 @@ public boolean equals(final java.lang.Object obj) { if (!getPoliciesList().equals(other.getPoliciesList())) 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; } @@ -447,19 +385,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v2.ListPoliciesResponse.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) { - getPoliciesFieldBuilder(); - } } @java.lang.Override @@ -467,10 +396,11 @@ public Builder clear() { super.clear(); if (policiesBuilder_ == null) { policies_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + policies_ = null; policiesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); nextPageToken_ = ""; return this; @@ -591,7 +521,7 @@ public Builder mergeFrom(com.google.iam.v2.ListPoliciesResponse other) { nextPageToken_ = other.nextPageToken_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -606,17 +536,49 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v2.ListPoliciesResponse 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.iam.v2.Policy m = + input.readMessage(com.google.iam.v2.Policy.parser(), extensionRegistry); + if (policiesBuilder_ == null) { + ensurePoliciesIsMutable(); + policies_.add(m); + } else { + policiesBuilder_.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.iam.v2.ListPoliciesResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -969,8 +931,7 @@ public java.util.List getPoliciesBuilderList() * * *
-     * A page token that you can use in a
-     * [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the
+     * A page token that you can use in a [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the
      * next page. If this field is omitted, there are no additional pages.
      * 
* @@ -993,8 +954,7 @@ public java.lang.String getNextPageToken() { * * *
-     * A page token that you can use in a
-     * [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the
+     * A page token that you can use in a [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the
      * next page. If this field is omitted, there are no additional pages.
      * 
* @@ -1017,8 +977,7 @@ public com.google.protobuf.ByteString getNextPageTokenBytes() { * * *
-     * A page token that you can use in a
-     * [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the
+     * A page token that you can use in a [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the
      * next page. If this field is omitted, there are no additional pages.
      * 
* @@ -1040,8 +999,7 @@ public Builder setNextPageToken(java.lang.String value) { * * *
-     * A page token that you can use in a
-     * [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the
+     * A page token that you can use in a [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the
      * next page. If this field is omitted, there are no additional pages.
      * 
* @@ -1059,8 +1017,7 @@ public Builder clearNextPageToken() { * * *
-     * A page token that you can use in a
-     * [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the
+     * A page token that you can use in a [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the
      * next page. If this field is omitted, there are no additional pages.
      * 
* @@ -1112,7 +1069,18 @@ public ListPoliciesResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ListPoliciesResponse(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-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesResponseOrBuilder.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesResponseOrBuilder.java index 54a77f751ce1..1faeb31cfb39 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesResponseOrBuilder.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesResponseOrBuilder.java @@ -78,8 +78,7 @@ public interface ListPoliciesResponseOrBuilder * * *
-   * A page token that you can use in a
-   * [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the
+   * A page token that you can use in a [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the
    * next page. If this field is omitted, there are no additional pages.
    * 
* @@ -92,8 +91,7 @@ public interface ListPoliciesResponseOrBuilder * * *
-   * A page token that you can use in a
-   * [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the
+   * A page token that you can use in a [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the
    * next page. If this field is omitted, there are no additional pages.
    * 
* diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/Policy.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/Policy.java index 2de2078edfe0..82a241e71d7e 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/Policy.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/Policy.java @@ -58,161 +58,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private Policy( - 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(); - - uid_ = s; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - kind_ = s; - break; - } - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); - - displayName_ = s; - break; - } - case 42: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - annotations_ = - com.google.protobuf.MapField.newMapField( - AnnotationsDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry annotations__ = - input.readMessage( - AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), - extensionRegistry); - annotations_.getMutableMap().put(annotations__.getKey(), annotations__.getValue()); - break; - } - case 50: - { - java.lang.String s = input.readStringRequireUtf8(); - - etag_ = s; - break; - } - case 58: - { - 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 66: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (updateTime_ != null) { - subBuilder = updateTime_.toBuilder(); - } - updateTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateTime_); - updateTime_ = subBuilder.buildPartial(); - } - - break; - } - case 74: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (deleteTime_ != null) { - subBuilder = deleteTime_.toBuilder(); - } - deleteTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(deleteTime_); - deleteTime_ = subBuilder.buildPartial(); - } - - break; - } - case 82: - { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - rules_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - rules_.add( - input.readMessage(com.google.iam.v2.PolicyRule.parser(), extensionRegistry)); - break; - } - case 90: - { - java.lang.String s = input.readStringRequireUtf8(); - - managingAuthority_ = 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_ & 0x00000002) != 0)) { - rules_ = java.util.Collections.unmodifiableList(rules_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v2.PolicyProto.internal_static_google_iam_v2_Policy_descriptor; } @@ -307,8 +152,8 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-   * Immutable. The globally unique ID of the `Policy`. Assigned automatically
-   * when the `Policy` is created.
+   * Immutable. The globally unique ID of the `Policy`. Assigned automatically when the
+   * `Policy` is created.
    * 
* * string uid = 2 [(.google.api.field_behavior) = IMMUTABLE]; @@ -331,8 +176,8 @@ public java.lang.String getUid() { * * *
-   * Immutable. The globally unique ID of the `Policy`. Assigned automatically
-   * when the `Policy` is created.
+   * Immutable. The globally unique ID of the `Policy`. Assigned automatically when the
+   * `Policy` is created.
    * 
* * string uid = 2 [(.google.api.field_behavior) = IMMUTABLE]; @@ -358,8 +203,7 @@ public com.google.protobuf.ByteString getUidBytes() { * * *
-   * Output only. The kind of the `Policy`. Always contains the value
-   * `DenyPolicy`.
+   * Output only. The kind of the `Policy`. Always contains the value `DenyPolicy`.
    * 
* * string kind = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -382,8 +226,7 @@ public java.lang.String getKind() { * * *
-   * Output only. The kind of the `Policy`. Always contains the value
-   * `DenyPolicy`.
+   * Output only. The kind of the `Policy`. Always contains the value `DenyPolicy`.
    * 
* * string kind = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -719,8 +562,7 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { * * *
-   * Output only. The time when the `Policy` was deleted. Empty if the policy is
-   * not deleted.
+   * Output only. The time when the `Policy` was deleted. Empty if the policy is not deleted.
    * 
* * .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -736,8 +578,7 @@ public boolean hasDeleteTime() { * * *
-   * Output only. The time when the `Policy` was deleted. Empty if the policy is
-   * not deleted.
+   * Output only. The time when the `Policy` was deleted. Empty if the policy is not deleted.
    * 
* * .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -753,8 +594,7 @@ public com.google.protobuf.Timestamp getDeleteTime() { * * *
-   * Output only. The time when the `Policy` was deleted. Empty if the policy is
-   * not deleted.
+   * Output only. The time when the `Policy` was deleted. Empty if the policy is not deleted.
    * 
* * .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -844,8 +684,8 @@ public com.google.iam.v2.PolicyRuleOrBuilder getRulesOrBuilder(int index) { * * *
-   * Immutable. Specifies that this policy is managed by an authority and can
-   * only be modified by that authority. Usage is restricted.
+   * Immutable. Specifies that this policy is managed by an authority and can only be
+   * modified by that authority. Usage is restricted.
    * 
* * string managing_authority = 11 [(.google.api.field_behavior) = IMMUTABLE]; @@ -868,8 +708,8 @@ public java.lang.String getManagingAuthority() { * * *
-   * Immutable. Specifies that this policy is managed by an authority and can
-   * only be modified by that authority. Usage is restricted.
+   * Immutable. Specifies that this policy is managed by an authority and can only be
+   * modified by that authority. Usage is restricted.
    * 
* * string managing_authority = 11 [(.google.api.field_behavior) = IMMUTABLE]; @@ -935,7 +775,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(managingAuthority_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 11, managingAuthority_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -984,7 +824,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(managingAuthority_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, managingAuthority_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -1019,7 +859,7 @@ public boolean equals(final java.lang.Object obj) { } if (!getRulesList().equals(other.getRulesList())) return false; if (!getManagingAuthority().equals(other.getManagingAuthority())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1062,7 +902,7 @@ public int hashCode() { } hash = (37 * hash) + MANAGING_AUTHORITY_FIELD_NUMBER; hash = (53 * hash) + getManagingAuthority().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -1207,19 +1047,10 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } // Construct using com.google.iam.v2.Policy.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) { - getRulesFieldBuilder(); - } } @java.lang.Override @@ -1256,10 +1087,11 @@ public Builder clear() { } if (rulesBuilder_ == null) { rules_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); } else { + rules_ = null; rulesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000002); managingAuthority_ = ""; return this; @@ -1430,7 +1262,7 @@ public Builder mergeFrom(com.google.iam.v2.Policy other) { managingAuthority_ = other.managingAuthority_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1445,17 +1277,108 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v2.Policy 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: + { + uid_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + kind_ = input.readStringRequireUtf8(); + + break; + } // case 26 + case 34: + { + displayName_ = input.readStringRequireUtf8(); + + break; + } // case 34 + case 42: + { + com.google.protobuf.MapEntry annotations__ = + input.readMessage( + AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAnnotations() + .getMutableMap() + .put(annotations__.getKey(), annotations__.getValue()); + break; + } // case 42 + case 50: + { + etag_ = input.readStringRequireUtf8(); + + break; + } // case 50 + case 58: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 58 + case 66: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 66 + case 74: + { + input.readMessage(getDeleteTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 74 + case 82: + { + com.google.iam.v2.PolicyRule m = + input.readMessage(com.google.iam.v2.PolicyRule.parser(), extensionRegistry); + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(m); + } else { + rulesBuilder_.addMessage(m); + } + break; + } // case 82 + case 90: + { + managingAuthority_ = input.readStringRequireUtf8(); + + break; + } // case 90 + 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.iam.v2.Policy) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1612,8 +1535,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * * *
-     * Immutable. The globally unique ID of the `Policy`. Assigned automatically
-     * when the `Policy` is created.
+     * Immutable. The globally unique ID of the `Policy`. Assigned automatically when the
+     * `Policy` is created.
      * 
* * string uid = 2 [(.google.api.field_behavior) = IMMUTABLE]; @@ -1635,8 +1558,8 @@ public java.lang.String getUid() { * * *
-     * Immutable. The globally unique ID of the `Policy`. Assigned automatically
-     * when the `Policy` is created.
+     * Immutable. The globally unique ID of the `Policy`. Assigned automatically when the
+     * `Policy` is created.
      * 
* * string uid = 2 [(.google.api.field_behavior) = IMMUTABLE]; @@ -1658,8 +1581,8 @@ public com.google.protobuf.ByteString getUidBytes() { * * *
-     * Immutable. The globally unique ID of the `Policy`. Assigned automatically
-     * when the `Policy` is created.
+     * Immutable. The globally unique ID of the `Policy`. Assigned automatically when the
+     * `Policy` is created.
      * 
* * string uid = 2 [(.google.api.field_behavior) = IMMUTABLE]; @@ -1680,8 +1603,8 @@ public Builder setUid(java.lang.String value) { * * *
-     * Immutable. The globally unique ID of the `Policy`. Assigned automatically
-     * when the `Policy` is created.
+     * Immutable. The globally unique ID of the `Policy`. Assigned automatically when the
+     * `Policy` is created.
      * 
* * string uid = 2 [(.google.api.field_behavior) = IMMUTABLE]; @@ -1698,8 +1621,8 @@ public Builder clearUid() { * * *
-     * Immutable. The globally unique ID of the `Policy`. Assigned automatically
-     * when the `Policy` is created.
+     * Immutable. The globally unique ID of the `Policy`. Assigned automatically when the
+     * `Policy` is created.
      * 
* * string uid = 2 [(.google.api.field_behavior) = IMMUTABLE]; @@ -1723,8 +1646,7 @@ public Builder setUidBytes(com.google.protobuf.ByteString value) { * * *
-     * Output only. The kind of the `Policy`. Always contains the value
-     * `DenyPolicy`.
+     * Output only. The kind of the `Policy`. Always contains the value `DenyPolicy`.
      * 
* * string kind = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1746,8 +1668,7 @@ public java.lang.String getKind() { * * *
-     * Output only. The kind of the `Policy`. Always contains the value
-     * `DenyPolicy`.
+     * Output only. The kind of the `Policy`. Always contains the value `DenyPolicy`.
      * 
* * string kind = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1769,8 +1690,7 @@ public com.google.protobuf.ByteString getKindBytes() { * * *
-     * Output only. The kind of the `Policy`. Always contains the value
-     * `DenyPolicy`.
+     * Output only. The kind of the `Policy`. Always contains the value `DenyPolicy`.
      * 
* * string kind = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1791,8 +1711,7 @@ public Builder setKind(java.lang.String value) { * * *
-     * Output only. The kind of the `Policy`. Always contains the value
-     * `DenyPolicy`.
+     * Output only. The kind of the `Policy`. Always contains the value `DenyPolicy`.
      * 
* * string kind = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -1809,8 +1728,7 @@ public Builder clearKind() { * * *
-     * Output only. The kind of the `Policy`. Always contains the value
-     * `DenyPolicy`.
+     * Output only. The kind of the `Policy`. Always contains the value `DenyPolicy`.
      * 
* * string kind = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -2646,8 +2564,7 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { * * *
-     * Output only. The time when the `Policy` was deleted. Empty if the policy is
-     * not deleted.
+     * Output only. The time when the `Policy` was deleted. Empty if the policy is not deleted.
      * 
* * @@ -2663,8 +2580,7 @@ public boolean hasDeleteTime() { * * *
-     * Output only. The time when the `Policy` was deleted. Empty if the policy is
-     * not deleted.
+     * Output only. The time when the `Policy` was deleted. Empty if the policy is not deleted.
      * 
* * @@ -2686,8 +2602,7 @@ public com.google.protobuf.Timestamp getDeleteTime() { * * *
-     * Output only. The time when the `Policy` was deleted. Empty if the policy is
-     * not deleted.
+     * Output only. The time when the `Policy` was deleted. Empty if the policy is not deleted.
      * 
* * @@ -2711,8 +2626,7 @@ public Builder setDeleteTime(com.google.protobuf.Timestamp value) { * * *
-     * Output only. The time when the `Policy` was deleted. Empty if the policy is
-     * not deleted.
+     * Output only. The time when the `Policy` was deleted. Empty if the policy is not deleted.
      * 
* * @@ -2733,8 +2647,7 @@ public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForVal * * *
-     * Output only. The time when the `Policy` was deleted. Empty if the policy is
-     * not deleted.
+     * Output only. The time when the `Policy` was deleted. Empty if the policy is not deleted.
      * 
* * @@ -2760,8 +2673,7 @@ public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) { * * *
-     * Output only. The time when the `Policy` was deleted. Empty if the policy is
-     * not deleted.
+     * Output only. The time when the `Policy` was deleted. Empty if the policy is not deleted.
      * 
* * @@ -2783,8 +2695,7 @@ public Builder clearDeleteTime() { * * *
-     * Output only. The time when the `Policy` was deleted. Empty if the policy is
-     * not deleted.
+     * Output only. The time when the `Policy` was deleted. Empty if the policy is not deleted.
      * 
* * @@ -2800,8 +2711,7 @@ public com.google.protobuf.Timestamp.Builder getDeleteTimeBuilder() { * * *
-     * Output only. The time when the `Policy` was deleted. Empty if the policy is
-     * not deleted.
+     * Output only. The time when the `Policy` was deleted. Empty if the policy is not deleted.
      * 
* * @@ -2821,8 +2731,7 @@ public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { * * *
-     * Output only. The time when the `Policy` was deleted. Empty if the policy is
-     * not deleted.
+     * Output only. The time when the `Policy` was deleted. Empty if the policy is not deleted.
      * 
* * @@ -3211,8 +3120,8 @@ public java.util.List getRulesBuilderList( * * *
-     * Immutable. Specifies that this policy is managed by an authority and can
-     * only be modified by that authority. Usage is restricted.
+     * Immutable. Specifies that this policy is managed by an authority and can only be
+     * modified by that authority. Usage is restricted.
      * 
* * string managing_authority = 11 [(.google.api.field_behavior) = IMMUTABLE]; @@ -3234,8 +3143,8 @@ public java.lang.String getManagingAuthority() { * * *
-     * Immutable. Specifies that this policy is managed by an authority and can
-     * only be modified by that authority. Usage is restricted.
+     * Immutable. Specifies that this policy is managed by an authority and can only be
+     * modified by that authority. Usage is restricted.
      * 
* * string managing_authority = 11 [(.google.api.field_behavior) = IMMUTABLE]; @@ -3257,8 +3166,8 @@ public com.google.protobuf.ByteString getManagingAuthorityBytes() { * * *
-     * Immutable. Specifies that this policy is managed by an authority and can
-     * only be modified by that authority. Usage is restricted.
+     * Immutable. Specifies that this policy is managed by an authority and can only be
+     * modified by that authority. Usage is restricted.
      * 
* * string managing_authority = 11 [(.google.api.field_behavior) = IMMUTABLE]; @@ -3279,8 +3188,8 @@ public Builder setManagingAuthority(java.lang.String value) { * * *
-     * Immutable. Specifies that this policy is managed by an authority and can
-     * only be modified by that authority. Usage is restricted.
+     * Immutable. Specifies that this policy is managed by an authority and can only be
+     * modified by that authority. Usage is restricted.
      * 
* * string managing_authority = 11 [(.google.api.field_behavior) = IMMUTABLE]; @@ -3297,8 +3206,8 @@ public Builder clearManagingAuthority() { * * *
-     * Immutable. Specifies that this policy is managed by an authority and can
-     * only be modified by that authority. Usage is restricted.
+     * Immutable. Specifies that this policy is managed by an authority and can only be
+     * modified by that authority. Usage is restricted.
      * 
* * string managing_authority = 11 [(.google.api.field_behavior) = IMMUTABLE]; @@ -3349,7 +3258,18 @@ public Policy parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Policy(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-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOperationMetadata.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOperationMetadata.java index 3f3b95fce283..b8aae544718e 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOperationMetadata.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOperationMetadata.java @@ -50,60 +50,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private PolicyOperationMetadata( - 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; - } - 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.iam.v2.PolicyProto .internal_static_google_iam_v2_PolicyOperationMetadata_descriptor; @@ -182,7 +128,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (createTime_ != null) { output.writeMessage(1, getCreateTime()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -194,7 +140,7 @@ public int getSerializedSize() { if (createTime_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -214,7 +160,7 @@ public boolean equals(final java.lang.Object obj) { if (hasCreateTime()) { if (!getCreateTime().equals(other.getCreateTime())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -229,7 +175,7 @@ public int hashCode() { hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; hash = (53 * hash) + getCreateTime().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -358,17 +304,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v2.PolicyOperationMetadata.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 @@ -464,7 +403,7 @@ public Builder mergeFrom(com.google.iam.v2.PolicyOperationMetadata other) { if (other.hasCreateTime()) { mergeCreateTime(other.getCreateTime()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -479,17 +418,37 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v2.PolicyOperationMetadata 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 + 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.iam.v2.PolicyOperationMetadata) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -708,7 +667,18 @@ public PolicyOperationMetadata parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new PolicyOperationMetadata(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-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOrBuilder.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOrBuilder.java index 276617f9182a..84433497c536 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOrBuilder.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOrBuilder.java @@ -68,8 +68,8 @@ public interface PolicyOrBuilder * * *
-   * Immutable. The globally unique ID of the `Policy`. Assigned automatically
-   * when the `Policy` is created.
+   * Immutable. The globally unique ID of the `Policy`. Assigned automatically when the
+   * `Policy` is created.
    * 
* * string uid = 2 [(.google.api.field_behavior) = IMMUTABLE]; @@ -81,8 +81,8 @@ public interface PolicyOrBuilder * * *
-   * Immutable. The globally unique ID of the `Policy`. Assigned automatically
-   * when the `Policy` is created.
+   * Immutable. The globally unique ID of the `Policy`. Assigned automatically when the
+   * `Policy` is created.
    * 
* * string uid = 2 [(.google.api.field_behavior) = IMMUTABLE]; @@ -95,8 +95,7 @@ public interface PolicyOrBuilder * * *
-   * Output only. The kind of the `Policy`. Always contains the value
-   * `DenyPolicy`.
+   * Output only. The kind of the `Policy`. Always contains the value `DenyPolicy`.
    * 
* * string kind = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -108,8 +107,7 @@ public interface PolicyOrBuilder * * *
-   * Output only. The kind of the `Policy`. Always contains the value
-   * `DenyPolicy`.
+   * Output only. The kind of the `Policy`. Always contains the value `DenyPolicy`.
    * 
* * string kind = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -322,8 +320,7 @@ java.lang.String getAnnotationsOrDefault( * * *
-   * Output only. The time when the `Policy` was deleted. Empty if the policy is
-   * not deleted.
+   * Output only. The time when the `Policy` was deleted. Empty if the policy is not deleted.
    * 
* * .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -336,8 +333,7 @@ java.lang.String getAnnotationsOrDefault( * * *
-   * Output only. The time when the `Policy` was deleted. Empty if the policy is
-   * not deleted.
+   * Output only. The time when the `Policy` was deleted. Empty if the policy is not deleted.
    * 
* * .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -350,8 +346,7 @@ java.lang.String getAnnotationsOrDefault( * * *
-   * Output only. The time when the `Policy` was deleted. Empty if the policy is
-   * not deleted.
+   * Output only. The time when the `Policy` was deleted. Empty if the policy is not deleted.
    * 
* * .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; @@ -419,8 +414,8 @@ java.lang.String getAnnotationsOrDefault( * * *
-   * Immutable. Specifies that this policy is managed by an authority and can
-   * only be modified by that authority. Usage is restricted.
+   * Immutable. Specifies that this policy is managed by an authority and can only be
+   * modified by that authority. Usage is restricted.
    * 
* * string managing_authority = 11 [(.google.api.field_behavior) = IMMUTABLE]; @@ -432,8 +427,8 @@ java.lang.String getAnnotationsOrDefault( * * *
-   * Immutable. Specifies that this policy is managed by an authority and can
-   * only be modified by that authority. Usage is restricted.
+   * Immutable. Specifies that this policy is managed by an authority and can only be
+   * modified by that authority. Usage is restricted.
    * 
* * string managing_authority = 11 [(.google.api.field_behavior) = IMMUTABLE]; diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyProto.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyProto.java index 7b921a99fee1..9cbab0338506 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyProto.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyProto.java @@ -63,14 +63,6 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_iam_v2_DeletePolicyRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_iam_v2_DeletePolicyRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_iam_v2_ListApplicablePoliciesRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_iam_v2_ListApplicablePoliciesRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_iam_v2_ListApplicablePoliciesResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_iam_v2_ListApplicablePoliciesResponse_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v2_PolicyOperationMetadata_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -114,44 +106,34 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "id\030\003 \001(\t\"A\n\023UpdatePolicyRequest\022*\n\006polic" + "y\030\001 \001(\0132\025.google.iam.v2.PolicyB\003\340A\002\";\n\023D" + "eletePolicyRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\021\n" - + "\004etag\030\002 \001(\tB\003\340A\001\"u\n\035ListApplicablePolici" - + "esRequest\022\035\n\020attachment_point\030\001 \001(\tB\003\340A\002" - + "\022\016\n\006filter\030\002 \001(\t\022\022\n\npage_token\030\003 \001(\t\022\021\n\t" - + "page_size\030\004 \001(\005\"x\n\036ListApplicablePolicie" - + "sResponse\022\'\n\010policies\030\001 \003(\0132\025.google.iam" - + ".v2.Policy\022\024\n\014inaccessible\030\002 \003(\t\022\027\n\017next" - + "_page_token\030\003 \001(\t\"J\n\027PolicyOperationMeta" - + "data\022/\n\013create_time\030\001 \001(\0132\032.google.proto" - + "buf.Timestamp2\224\010\n\010Policies\022\203\001\n\014ListPolic" - + "ies\022\".google.iam.v2.ListPoliciesRequest\032" - + "#.google.iam.v2.ListPoliciesResponse\"*\202\323" - + "\344\223\002\033\022\031/v2/{parent=policies/*/*}\332A\006parent" - + "\022m\n\tGetPolicy\022\037.google.iam.v2.GetPolicyR" - + "equest\032\025.google.iam.v2.Policy\"(\202\323\344\223\002\033\022\031/" - + "v2/{name=policies/*/*/*}\332A\004name\022\272\001\n\014Crea" - + "tePolicy\022\".google.iam.v2.CreatePolicyReq" - + "uest\032\035.google.longrunning.Operation\"g\202\323\344" - + "\223\002#\"\031/v2/{parent=policies/*/*}:\006policy\332A" - + "\027parent,policy,policy_id\312A!\n\006Policy\022\027Pol" - + "icyOperationMetadata\022\247\001\n\014UpdatePolicy\022\"." - + "google.iam.v2.UpdatePolicyRequest\032\035.goog" - + "le.longrunning.Operation\"T\202\323\344\223\002*\032 /v2/{p" - + "olicy.name=policies/*/*/*}:\006policy\312A!\n\006P" - + "olicy\022\027PolicyOperationMetadata\022\237\001\n\014Delet" - + "ePolicy\022\".google.iam.v2.DeletePolicyRequ" - + "est\032\035.google.longrunning.Operation\"L\202\323\344\223" - + "\002\033*\031/v2/{name=policies/*/*/*}\332A\004name\312A!\n" - + "\006Policy\022\027PolicyOperationMetadata\022\301\001\n\026Lis" - + "tApplicablePolicies\022,.google.iam.v2.List" - + "ApplicablePoliciesRequest\032-.google.iam.v" - + "2.ListApplicablePoliciesResponse\"J\202\323\344\223\0021" - + "\022//v2/{attachment_point=*}:listApplicabl" - + "ePolicies\332A\020attachment_point\032F\312A\022iam.goo" - + "gleapis.com\322A.https://www.googleapis.com" - + "/auth/cloud-platformB\200\001\n\021com.google.iam." - + "v2B\013PolicyProtoP\001Z0google.golang.org/gen" - + "proto/googleapis/iam/v2;iam\252\002\023Google.Clo" - + "ud.Iam.V2\312\002\023Google\\Cloud\\Iam\\V2b\006proto3" + + "\004etag\030\002 \001(\tB\003\340A\001\"J\n\027PolicyOperationMetad" + + "ata\022/\n\013create_time\030\001 \001(\0132\032.google.protob" + + "uf.Timestamp2\320\006\n\010Policies\022\203\001\n\014ListPolici" + + "es\022\".google.iam.v2.ListPoliciesRequest\032#" + + ".google.iam.v2.ListPoliciesResponse\"*\202\323\344" + + "\223\002\033\022\031/v2/{parent=policies/*/*}\332A\006parent\022" + + "m\n\tGetPolicy\022\037.google.iam.v2.GetPolicyRe" + + "quest\032\025.google.iam.v2.Policy\"(\202\323\344\223\002\033\022\031/v" + + "2/{name=policies/*/*/*}\332A\004name\022\272\001\n\014Creat" + + "ePolicy\022\".google.iam.v2.CreatePolicyRequ" + + "est\032\035.google.longrunning.Operation\"g\202\323\344\223" + + "\002#\"\031/v2/{parent=policies/*/*}:\006policy\332A\027" + + "parent,policy,policy_id\312A!\n\006Policy\022\027Poli" + + "cyOperationMetadata\022\247\001\n\014UpdatePolicy\022\".g" + + "oogle.iam.v2.UpdatePolicyRequest\032\035.googl" + + "e.longrunning.Operation\"T\202\323\344\223\002*\032 /v2/{po" + + "licy.name=policies/*/*/*}:\006policy\312A!\n\006Po" + + "licy\022\027PolicyOperationMetadata\022\237\001\n\014Delete" + + "Policy\022\".google.iam.v2.DeletePolicyReque" + + "st\032\035.google.longrunning.Operation\"L\202\323\344\223\002" + + "\033*\031/v2/{name=policies/*/*/*}\332A\004name\312A!\n\006" + + "Policy\022\027PolicyOperationMetadata\032F\312A\022iam." + + "googleapis.com\322A.https://www.googleapis." + + "com/auth/cloud-platformB\200\001\n\021com.google.i" + + "am.v2B\013PolicyProtoP\001Z0google.golang.org/" + + "genproto/googleapis/iam/v2;iam\252\002\023Google." + + "Cloud.Iam.V2\312\002\023Google\\Cloud\\Iam\\V2b\006prot" + + "o3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -244,24 +226,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Name", "Etag", }); - internal_static_google_iam_v2_ListApplicablePoliciesRequest_descriptor = - getDescriptor().getMessageTypes().get(8); - internal_static_google_iam_v2_ListApplicablePoliciesRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_iam_v2_ListApplicablePoliciesRequest_descriptor, - new java.lang.String[] { - "AttachmentPoint", "Filter", "PageToken", "PageSize", - }); - internal_static_google_iam_v2_ListApplicablePoliciesResponse_descriptor = - getDescriptor().getMessageTypes().get(9); - internal_static_google_iam_v2_ListApplicablePoliciesResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_iam_v2_ListApplicablePoliciesResponse_descriptor, - new java.lang.String[] { - "Policies", "Inaccessible", "NextPageToken", - }); internal_static_google_iam_v2_PolicyOperationMetadata_descriptor = - getDescriptor().getMessageTypes().get(10); + getDescriptor().getMessageTypes().get(8); internal_static_google_iam_v2_PolicyOperationMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_iam_v2_PolicyOperationMetadata_descriptor, diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyRule.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyRule.java index c1de50c95fc5..032fa2bba220 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyRule.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyRule.java @@ -52,66 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private PolicyRule( - 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(); - - description_ = s; - break; - } - case 18: - { - com.google.iam.v2.DenyRule.Builder subBuilder = null; - if (kindCase_ == 2) { - subBuilder = ((com.google.iam.v2.DenyRule) kind_).toBuilder(); - } - kind_ = input.readMessage(com.google.iam.v2.DenyRule.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.iam.v2.DenyRule) kind_); - kind_ = subBuilder.buildPartial(); - } - kindCase_ = 2; - 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.iam.v2.PolicyProto.internal_static_google_iam_v2_PolicyRule_descriptor; } @@ -290,7 +230,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (kindCase_ == 2) { output.writeMessage(2, (com.google.iam.v2.DenyRule) kind_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -307,7 +247,7 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 2, (com.google.iam.v2.DenyRule) kind_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -331,7 +271,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; } @@ -352,7 +292,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -478,22 +418,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v2.PolicyRule.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 public Builder clear() { super.clear(); + if (denyRuleBuilder_ != null) { + denyRuleBuilder_.clear(); + } description_ = ""; kindCase_ = 0; @@ -596,7 +532,7 @@ public Builder mergeFrom(com.google.iam.v2.PolicyRule other) { break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -611,17 +547,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v2.PolicyRule 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: + { + description_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getDenyRuleFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 2; + 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.iam.v2.PolicyRule) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -987,7 +949,18 @@ public PolicyRule parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new PolicyRule(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-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/UpdatePolicyRequest.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/UpdatePolicyRequest.java index d9f857e33104..d7810fed39ed 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/UpdatePolicyRequest.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/UpdatePolicyRequest.java @@ -50,59 +50,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private UpdatePolicyRequest( - 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.iam.v2.Policy.Builder subBuilder = null; - if (policy_ != null) { - subBuilder = policy_.toBuilder(); - } - policy_ = input.readMessage(com.google.iam.v2.Policy.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(policy_); - policy_ = 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.iam.v2.PolicyProto .internal_static_google_iam_v2_UpdatePolicyRequest_descriptor; @@ -190,7 +137,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (policy_ != null) { output.writeMessage(1, getPolicy()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -202,7 +149,7 @@ public int getSerializedSize() { if (policy_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPolicy()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -221,7 +168,7 @@ public boolean equals(final java.lang.Object obj) { if (hasPolicy()) { if (!getPolicy().equals(other.getPolicy())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -236,7 +183,7 @@ public int hashCode() { hash = (37 * hash) + POLICY_FIELD_NUMBER; hash = (53 * hash) + getPolicy().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -364,17 +311,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v2.UpdatePolicyRequest.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 @@ -470,7 +410,7 @@ public Builder mergeFrom(com.google.iam.v2.UpdatePolicyRequest other) { if (other.hasPolicy()) { mergePolicy(other.getPolicy()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -485,17 +425,37 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v2.UpdatePolicyRequest 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(getPolicyFieldBuilder().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.iam.v2.UpdatePolicyRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -735,7 +695,18 @@ public UpdatePolicyRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new UpdatePolicyRequest(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-iam/proto-google-iam-v2/src/main/proto/google/iam/v2/policy.proto b/java-iam/proto-google-iam-v2/src/main/proto/google/iam/v2/policy.proto index b21d44fabbf7..d8923d3b8337 100644 --- a/java-iam/proto-google-iam-v2/src/main/proto/google/iam/v2/policy.proto +++ b/java-iam/proto-google-iam-v2/src/main/proto/google/iam/v2/policy.proto @@ -33,8 +33,7 @@ option php_namespace = "Google\\Cloud\\Iam\\V2"; // An interface for managing Identity and Access Management (IAM) policies. service Policies { option (google.api.default_host) = "iam.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"; // Retrieves the policies of the specified kind that are attached to a // resource. @@ -75,8 +74,7 @@ service Policies { // // To update a policy, you should use a read-modify-write loop: // - // 1. Use [GetPolicy][google.iam.v2.Policies.GetPolicy] to read the current - // version of the policy. + // 1. Use [GetPolicy][google.iam.v2.Policies.GetPolicy] to read the current version of the policy. // 2. Modify the policy as needed. // 3. Use `UpdatePolicy` to write the updated policy. // @@ -103,24 +101,6 @@ service Policies { metadata_type: "PolicyOperationMetadata" }; } - - // Retrieves all the policies that are attached to the specified resource, - // or anywhere in the ancestry of the resource. For example, for a project - // this endpoint would return all the `denyPolicy` kind policies attached to - // the project, its parent folder (if any), and its parent organization (if - // any). - // The endpoint requires the same permissions that it would take to call - // `ListPolicies` or `GetPolicy`. - // - // The main reason to use this endpoint is as a policy admin to debug access - // issues for a resource. - rpc ListApplicablePolicies(ListApplicablePoliciesRequest) - returns (ListApplicablePoliciesResponse) { - option (google.api.http) = { - get: "/v2/{attachment_point=*}:listApplicablePolicies" - }; - option (google.api.method_signature) = "attachment_point"; - } } // Data for an IAM policy. @@ -139,12 +119,11 @@ message Policy { // Responses always contain the numeric ID. string name = 1 [(google.api.field_behavior) = IMMUTABLE]; - // Immutable. The globally unique ID of the `Policy`. Assigned automatically - // when the `Policy` is created. + // Immutable. The globally unique ID of the `Policy`. Assigned automatically when the + // `Policy` is created. string uid = 2 [(google.api.field_behavior) = IMMUTABLE]; - // Output only. The kind of the `Policy`. Always contains the value - // `DenyPolicy`. + // Output only. The kind of the `Policy`. Always contains the value `DenyPolicy`. string kind = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; // A user-specified description of the `Policy`. This value can be up to 63 @@ -164,24 +143,20 @@ message Policy { string etag = 6; // Output only. The time when the `Policy` was created. - google.protobuf.Timestamp create_time = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The time when the `Policy` was last updated. - google.protobuf.Timestamp update_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. The time when the `Policy` was deleted. Empty if the policy is - // not deleted. - google.protobuf.Timestamp delete_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. The time when the `Policy` was deleted. Empty if the policy is not deleted. + google.protobuf.Timestamp delete_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; // A list of rules that specify the behavior of the `Policy`. All of the rules // should be of the `kind` specified in the `Policy`. repeated PolicyRule rules = 10; - // Immutable. Specifies that this policy is managed by an authority and can - // only be modified by that authority. Usage is restricted. + // Immutable. Specifies that this policy is managed by an authority and can only be + // modified by that authority. Usage is restricted. string managing_authority = 11 [(google.api.field_behavior) = IMMUTABLE]; } @@ -199,8 +174,9 @@ message PolicyRule { // Request message for `ListPolicies`. message ListPoliciesRequest { - // Required. The resource that the policy is attached to, along with the kind - // of policy to list. Format: `policies/{attachment_point}/denypolicies` + // Required. The resource that the policy is attached to, along with the kind of policy + // to list. Format: + // `policies/{attachment_point}/denypolicies` // // // The attachment point is identified by its URL-encoded full resource name, @@ -216,9 +192,8 @@ message ListPoliciesRequest { // the value 1000. int32 page_size = 2; - // A page token received in a - // [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this - // token to retrieve the next page. + // A page token received in a [ListPoliciesResponse][google.iam.v2.ListPoliciesResponse]. Provide this token to + // retrieve the next page. string page_token = 3; } @@ -227,8 +202,7 @@ message ListPoliciesResponse { // Metadata for the policies that are attached to the resource. repeated Policy policies = 1; - // A page token that you can use in a - // [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the + // A page token that you can use in a [ListPoliciesRequest][google.iam.v2.ListPoliciesRequest] to retrieve the // next page. If this field is omitted, there are no additional pages. string next_page_token = 2; } @@ -250,8 +224,8 @@ message GetPolicyRequest { // Request message for `CreatePolicy`. message CreatePolicyRequest { - // Required. The resource that the policy is attached to, along with the kind - // of policy to create. Format: `policies/{attachment_point}/denypolicies` + // Required. The resource that the policy is attached to, along with the kind of policy + // to create. Format: `policies/{attachment_point}/denypolicies` // // // The attachment point is identified by its URL-encoded full resource name, @@ -297,78 +271,15 @@ message DeletePolicyRequest { // name. For projects, you can use the alphanumeric or the numeric ID. string name = 1 [(google.api.field_behavior) = REQUIRED]; - // Optional. The expected `etag` of the policy to delete. If the value does - // not match the value that is stored in IAM, the request fails with a `409` - // error code and `ABORTED` status. + // Optional. The expected `etag` of the policy to delete. If the value does not match + // the value that is stored in IAM, the request fails with a `409` error code + // and `ABORTED` status. // // If you omit this field, the policy is deleted regardless of its current // `etag`. string etag = 2 [(google.api.field_behavior) = OPTIONAL]; } -// `ListApplicablePoliciesRequest` represents the Request message for the -// `ListApplicablePolicies` method. It provides the input for a filterable query -// of Policies that apply to a certain GCP Resource, specified by the field -// `attachment_point`, found on this message. -// Example: -// ``` -// { -// attachment_point: -// 'cloudresourcemanager.googleapis.com%2Forganizations%2F212345678901' -// filter: 'kind:denyPolicies' -// } -// ``` -message ListApplicablePoliciesRequest { - // Required. The Cloud resource at which the applicable policies are to be - // retrieved. Format: `{attachment-point}` Use the URL-encoded full resource - // name, which means that the forward-slash character, `/`, must be written as - // `%2F`. For example, - // `cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project`. - string attachment_point = 1 [(google.api.field_behavior) = REQUIRED]; - - // Filtering currently only supports the kind of policies to return, and - // must be in the format “kind:[policyKind1] OR kind:[policyKind2]”. New - // policy kinds may be added in the future without notice. - // - // Example value: “kind:denyPolicies” - string filter = 2; - - // If present, then retrieve the batch of results following the results from - // the preceding call to this method. `page_token` must be the value of - // `next_page_token` - // [ListApplicablePoliciesResponse.next_page_token][google.iam.v2.ListApplicablePoliciesResponse.next_page_token] - // from the previous response. The values of other method parameters should - // be identical to those in the previous call. - string page_token = 3; - - // Limit on the number of policies to include in the response. - // Further policies can subsequently be obtained by including the - // [ListApplicablePoliciesResponse.next_page_token][google.iam.admin.v1.ListApplicablePoliciesResponse.next_page_token] - // in a subsequent request. - // The minimum is 25, and the maximum is 100. - int32 page_size = 4; -} - -// Response message for [ListApplicablePolicies][] method. -message ListApplicablePoliciesResponse { - // Ordered list starting from the resource on which this API was called - // then proceeding up the hierarchy. Policies for the same attachment point - // will be grouped, but no further ordering is guaranteed. - repeated Policy policies = 1; - - // A list of resources that the caller does not have permission to retrieve. - // List or Get can be used to get detailed error messages. - // Get: `policies/{attachment-point}/denypolicies/{policy-id}` - // List: `policies/{attachment-point}/denypolicies` - repeated string inaccessible = 2; - - // A page token that can be used in a - // [ListApplicablePoliciesRequest][google.iam.v2.ListApplicablePoliciesRequest] - // to retrieve the next page. If this field is blank, there are no additional - // pages. - string next_page_token = 3; -} - // Metadata for long-running `Policy` operations. message PolicyOperationMetadata { // Timestamp when the `google.longrunning.Operation` was created. diff --git a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/CreatePolicyRequest.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/CreatePolicyRequest.java index dc8b15dae3d3..4c91193e2d46 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/CreatePolicyRequest.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/CreatePolicyRequest.java @@ -53,73 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private CreatePolicyRequest( - 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.iam.v2beta.Policy.Builder subBuilder = null; - if (policy_ != null) { - subBuilder = policy_.toBuilder(); - } - policy_ = input.readMessage(com.google.iam.v2beta.Policy.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(policy_); - policy_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - policyId_ = 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.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_CreatePolicyRequest_descriptor; @@ -322,7 +255,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(policyId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, policyId_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -340,7 +273,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(policyId_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, policyId_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -362,7 +295,7 @@ public boolean equals(final java.lang.Object obj) { if (!getPolicy().equals(other.getPolicy())) return false; } if (!getPolicyId().equals(other.getPolicyId())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -381,7 +314,7 @@ public int hashCode() { } hash = (37 * hash) + POLICY_ID_FIELD_NUMBER; hash = (53 * hash) + getPolicyId().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -510,17 +443,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v2beta.CreatePolicyRequest.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 @@ -630,7 +556,7 @@ public Builder mergeFrom(com.google.iam.v2beta.CreatePolicyRequest other) { policyId_ = other.policyId_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -645,17 +571,49 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v2beta.CreatePolicyRequest 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(getPolicyFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 26: + { + policyId_ = 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.iam.v2beta.CreatePolicyRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1132,7 +1090,18 @@ public CreatePolicyRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new CreatePolicyRequest(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-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DeletePolicyRequest.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DeletePolicyRequest.java index 9899a5c37fb3..255a71ece498 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DeletePolicyRequest.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DeletePolicyRequest.java @@ -53,59 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private DeletePolicyRequest( - 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.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_DeletePolicyRequest_descriptor; @@ -259,7 +206,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 @@ -274,7 +221,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; } @@ -292,7 +239,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; } @@ -307,7 +254,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; } @@ -436,17 +383,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v2beta.DeletePolicyRequest.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 @@ -542,7 +482,7 @@ public Builder mergeFrom(com.google.iam.v2beta.DeletePolicyRequest other) { etag_ = other.etag_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -557,17 +497,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v2beta.DeletePolicyRequest 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.iam.v2beta.DeletePolicyRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -865,7 +831,18 @@ public DeletePolicyRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DeletePolicyRequest(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-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DenyRule.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DenyRule.java index d7af806bb1df..b776f7b169fe 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DenyRule.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DenyRule.java @@ -55,113 +55,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private DenyRule( - 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)) { - deniedPrincipals_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - deniedPrincipals_.add(s); - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - exceptionPrincipals_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000002; - } - exceptionPrincipals_.add(s); - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - deniedPermissions_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000004; - } - deniedPermissions_.add(s); - break; - } - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000008) != 0)) { - exceptionPermissions_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000008; - } - exceptionPermissions_.add(s); - break; - } - case 42: - { - com.google.type.Expr.Builder subBuilder = null; - if (denialCondition_ != null) { - subBuilder = denialCondition_.toBuilder(); - } - denialCondition_ = - input.readMessage(com.google.type.Expr.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(denialCondition_); - denialCondition_ = 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)) { - deniedPrincipals_ = deniedPrincipals_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - exceptionPrincipals_ = exceptionPrincipals_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - deniedPermissions_ = deniedPermissions_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000008) != 0)) { - exceptionPermissions_ = exceptionPermissions_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v2beta.DenyRuleProto .internal_static_google_iam_v2beta_DenyRule_descriptor; @@ -700,7 +593,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (denialCondition_ != null) { output.writeMessage(5, getDenialCondition()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -744,7 +637,7 @@ public int getSerializedSize() { if (denialCondition_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getDenialCondition()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -767,7 +660,7 @@ public boolean equals(final java.lang.Object obj) { if (hasDenialCondition()) { if (!getDenialCondition().equals(other.getDenialCondition())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -798,7 +691,7 @@ public int hashCode() { hash = (37 * hash) + DENIAL_CONDITION_FIELD_NUMBER; hash = (53 * hash) + getDenialCondition().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -925,17 +818,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v2beta.DenyRule.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 @@ -1099,7 +985,7 @@ public Builder mergeFrom(com.google.iam.v2beta.DenyRule other) { if (other.hasDenialCondition()) { mergeDenialCondition(other.getDenialCondition()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1114,17 +1000,65 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v2beta.DenyRule 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(); + ensureDeniedPrincipalsIsMutable(); + deniedPrincipals_.add(s); + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureExceptionPrincipalsIsMutable(); + exceptionPrincipals_.add(s); + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDeniedPermissionsIsMutable(); + deniedPermissions_.add(s); + break; + } // case 26 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureExceptionPermissionsIsMutable(); + exceptionPermissions_.add(s); + break; + } // case 34 + case 42: + { + input.readMessage(getDenialConditionFieldBuilder().getBuilder(), extensionRegistry); + + 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.iam.v2beta.DenyRule) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -2488,7 +2422,18 @@ public DenyRule parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DenyRule(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-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/GetPolicyRequest.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/GetPolicyRequest.java index 2775a53c7393..b579600e9134 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/GetPolicyRequest.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/GetPolicyRequest.java @@ -52,52 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private GetPolicyRequest( - 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.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_GetPolicyRequest_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; } @@ -219,7 +173,7 @@ public boolean equals(final java.lang.Object obj) { com.google.iam.v2beta.GetPolicyRequest other = (com.google.iam.v2beta.GetPolicyRequest) obj; if (!getName().equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -232,7 +186,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; } @@ -361,17 +315,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v2beta.GetPolicyRequest.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 @@ -460,7 +407,7 @@ public Builder mergeFrom(com.google.iam.v2beta.GetPolicyRequest other) { name_ = other.name_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -475,17 +422,37 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v2beta.GetPolicyRequest 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.iam.v2beta.GetPolicyRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -657,7 +624,18 @@ public GetPolicyRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new GetPolicyRequest(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-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/ListPoliciesRequest.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/ListPoliciesRequest.java index 5f6f150c5624..c66f7d36cd79 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/ListPoliciesRequest.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/ListPoliciesRequest.java @@ -53,64 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private ListPoliciesRequest( - 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; - } - 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.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_ListPoliciesRequest_descriptor; @@ -284,7 +226,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -302,7 +244,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -321,7 +263,7 @@ public boolean equals(final java.lang.Object obj) { if (!getParent().equals(other.getParent())) return false; if (getPageSize() != other.getPageSize()) return false; if (!getPageToken().equals(other.getPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -338,7 +280,7 @@ public int hashCode() { hash = (53 * hash) + getPageSize(); hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -467,17 +409,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v2beta.ListPoliciesRequest.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 @@ -579,7 +514,7 @@ public Builder mergeFrom(com.google.iam.v2beta.ListPoliciesRequest other) { pageToken_ = other.pageToken_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -594,17 +529,49 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v2beta.ListPoliciesRequest 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 + 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.iam.v2beta.ListPoliciesRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -952,7 +919,18 @@ public ListPoliciesRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ListPoliciesRequest(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-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/ListPoliciesResponse.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/ListPoliciesResponse.java index 68ede72d6561..b7559c504544 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/ListPoliciesResponse.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/ListPoliciesResponse.java @@ -53,66 +53,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private ListPoliciesResponse( - 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)) { - policies_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - policies_.add( - input.readMessage(com.google.iam.v2beta.Policy.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)) { - policies_ = java.util.Collections.unmodifiableList(policies_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_ListPoliciesResponse_descriptor; @@ -268,7 +208,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 +223,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 +241,7 @@ public boolean equals(final java.lang.Object obj) { if (!getPoliciesList().equals(other.getPoliciesList())) 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 +258,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; } @@ -447,19 +387,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v2beta.ListPoliciesResponse.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) { - getPoliciesFieldBuilder(); - } } @java.lang.Override @@ -467,10 +398,11 @@ public Builder clear() { super.clear(); if (policiesBuilder_ == null) { policies_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + policies_ = null; policiesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); nextPageToken_ = ""; return this; @@ -591,7 +523,7 @@ public Builder mergeFrom(com.google.iam.v2beta.ListPoliciesResponse other) { nextPageToken_ = other.nextPageToken_; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -606,17 +538,49 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v2beta.ListPoliciesResponse 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.iam.v2beta.Policy m = + input.readMessage(com.google.iam.v2beta.Policy.parser(), extensionRegistry); + if (policiesBuilder_ == null) { + ensurePoliciesIsMutable(); + policies_.add(m); + } else { + policiesBuilder_.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.iam.v2beta.ListPoliciesResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1111,7 +1075,18 @@ public ListPoliciesResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ListPoliciesResponse(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-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/Policy.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/Policy.java index 08ae40c81c0d..a2e1a8b7dcdc 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/Policy.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/Policy.java @@ -57,154 +57,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private Policy( - 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(); - - uid_ = s; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - kind_ = s; - break; - } - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); - - displayName_ = s; - break; - } - case 42: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - annotations_ = - com.google.protobuf.MapField.newMapField( - AnnotationsDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry annotations__ = - input.readMessage( - AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), - extensionRegistry); - annotations_.getMutableMap().put(annotations__.getKey(), annotations__.getValue()); - break; - } - case 50: - { - java.lang.String s = input.readStringRequireUtf8(); - - etag_ = s; - break; - } - case 58: - { - 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 66: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (updateTime_ != null) { - subBuilder = updateTime_.toBuilder(); - } - updateTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateTime_); - updateTime_ = subBuilder.buildPartial(); - } - - break; - } - case 74: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (deleteTime_ != null) { - subBuilder = deleteTime_.toBuilder(); - } - deleteTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(deleteTime_); - deleteTime_ = subBuilder.buildPartial(); - } - - break; - } - case 82: - { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - rules_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - rules_.add( - input.readMessage(com.google.iam.v2beta.PolicyRule.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_ & 0x00000002) != 0)) { - rules_ = java.util.Collections.unmodifiableList(rules_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v2beta.PolicyProto.internal_static_google_iam_v2beta_Policy_descriptor; } @@ -870,7 +722,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < rules_.size(); i++) { output.writeMessage(10, rules_.get(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -916,7 +768,7 @@ public int getSerializedSize() { for (int i = 0; i < rules_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, rules_.get(i)); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -950,7 +802,7 @@ public boolean equals(final java.lang.Object obj) { if (!getDeleteTime().equals(other.getDeleteTime())) return false; } if (!getRulesList().equals(other.getRulesList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -991,7 +843,7 @@ public int hashCode() { hash = (37 * hash) + RULES_FIELD_NUMBER; hash = (53 * hash) + getRulesList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -1137,19 +989,10 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } // Construct using com.google.iam.v2beta.Policy.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) { - getRulesFieldBuilder(); - } } @java.lang.Override @@ -1186,10 +1029,11 @@ public Builder clear() { } if (rulesBuilder_ == null) { rules_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); } else { + rules_ = null; rulesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000002); return this; } @@ -1353,7 +1197,7 @@ public Builder mergeFrom(com.google.iam.v2beta.Policy other) { } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1368,17 +1212,102 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v2beta.Policy 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: + { + uid_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + kind_ = input.readStringRequireUtf8(); + + break; + } // case 26 + case 34: + { + displayName_ = input.readStringRequireUtf8(); + + break; + } // case 34 + case 42: + { + com.google.protobuf.MapEntry annotations__ = + input.readMessage( + AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAnnotations() + .getMutableMap() + .put(annotations__.getKey(), annotations__.getValue()); + break; + } // case 42 + case 50: + { + etag_ = input.readStringRequireUtf8(); + + break; + } // case 50 + case 58: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 58 + case 66: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 66 + case 74: + { + input.readMessage(getDeleteTimeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 74 + case 82: + { + com.google.iam.v2beta.PolicyRule m = + input.readMessage(com.google.iam.v2beta.PolicyRule.parser(), extensionRegistry); + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(m); + } else { + rulesBuilder_.addMessage(m); + } + break; + } // case 82 + 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.iam.v2beta.Policy) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -3151,7 +3080,18 @@ public Policy parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Policy(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-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyOperationMetadata.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyOperationMetadata.java index c1bdb7b3d7b4..766a87f7cb95 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyOperationMetadata.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyOperationMetadata.java @@ -50,60 +50,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private PolicyOperationMetadata( - 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; - } - 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.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_PolicyOperationMetadata_descriptor; @@ -182,7 +128,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (createTime_ != null) { output.writeMessage(1, getCreateTime()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -194,7 +140,7 @@ public int getSerializedSize() { if (createTime_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -214,7 +160,7 @@ public boolean equals(final java.lang.Object obj) { if (hasCreateTime()) { if (!getCreateTime().equals(other.getCreateTime())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -229,7 +175,7 @@ public int hashCode() { hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; hash = (53 * hash) + getCreateTime().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -358,17 +304,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v2beta.PolicyOperationMetadata.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 @@ -464,7 +403,7 @@ public Builder mergeFrom(com.google.iam.v2beta.PolicyOperationMetadata other) { if (other.hasCreateTime()) { mergeCreateTime(other.getCreateTime()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -479,17 +418,37 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v2beta.PolicyOperationMetadata 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 + 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.iam.v2beta.PolicyOperationMetadata) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -708,7 +667,18 @@ public PolicyOperationMetadata parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new PolicyOperationMetadata(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-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyRule.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyRule.java index d58b2590c74b..27084c7ca398 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyRule.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyRule.java @@ -52,66 +52,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private PolicyRule( - 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(); - - description_ = s; - break; - } - case 18: - { - com.google.iam.v2beta.DenyRule.Builder subBuilder = null; - if (kindCase_ == 2) { - subBuilder = ((com.google.iam.v2beta.DenyRule) kind_).toBuilder(); - } - kind_ = input.readMessage(com.google.iam.v2beta.DenyRule.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.iam.v2beta.DenyRule) kind_); - kind_ = subBuilder.buildPartial(); - } - kindCase_ = 2; - 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.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_PolicyRule_descriptor; @@ -292,7 +232,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (kindCase_ == 2) { output.writeMessage(2, (com.google.iam.v2beta.DenyRule) kind_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -309,7 +249,7 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 2, (com.google.iam.v2beta.DenyRule) kind_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -333,7 +273,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; } @@ -354,7 +294,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -482,22 +422,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v2beta.PolicyRule.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 public Builder clear() { super.clear(); + if (denyRuleBuilder_ != null) { + denyRuleBuilder_.clear(); + } description_ = ""; kindCase_ = 0; @@ -601,7 +537,7 @@ public Builder mergeFrom(com.google.iam.v2beta.PolicyRule other) { break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -616,17 +552,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v2beta.PolicyRule 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: + { + description_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getDenyRuleFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 2; + 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.iam.v2beta.PolicyRule) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -992,7 +954,18 @@ public PolicyRule parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new PolicyRule(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-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/UpdatePolicyRequest.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/UpdatePolicyRequest.java index 5904fc841c62..95eabcdd8ba9 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/UpdatePolicyRequest.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/UpdatePolicyRequest.java @@ -50,59 +50,6 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private UpdatePolicyRequest( - 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.iam.v2beta.Policy.Builder subBuilder = null; - if (policy_ != null) { - subBuilder = policy_.toBuilder(); - } - policy_ = input.readMessage(com.google.iam.v2beta.Policy.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(policy_); - policy_ = 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.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_UpdatePolicyRequest_descriptor; @@ -190,7 +137,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (policy_ != null) { output.writeMessage(1, getPolicy()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -202,7 +149,7 @@ public int getSerializedSize() { if (policy_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPolicy()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -222,7 +169,7 @@ public boolean equals(final java.lang.Object obj) { if (hasPolicy()) { if (!getPolicy().equals(other.getPolicy())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -237,7 +184,7 @@ public int hashCode() { hash = (37 * hash) + POLICY_FIELD_NUMBER; hash = (53 * hash) + getPolicy().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -366,17 +313,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v2beta.UpdatePolicyRequest.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 @@ -472,7 +412,7 @@ public Builder mergeFrom(com.google.iam.v2beta.UpdatePolicyRequest other) { if (other.hasPolicy()) { mergePolicy(other.getPolicy()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -487,17 +427,37 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v2beta.UpdatePolicyRequest 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(getPolicyFieldBuilder().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.iam.v2beta.UpdatePolicyRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -739,7 +699,18 @@ public UpdatePolicyRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new UpdatePolicyRequest(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(); } };