Skip to content
This repository was archived by the owner on Sep 16, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,7 @@ public final UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() {
* SetIamPolicyRequest.newBuilder()
* .setResource(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setPolicy(Policy.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* Policy response = servicesClient.setIamPolicy(request);
* }
Expand All @@ -855,6 +856,7 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
* SetIamPolicyRequest.newBuilder()
* .setResource(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setPolicy(Policy.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* ApiFuture<Policy> future = servicesClient.setIamPolicyCallable().futureCall(request);
* // Do something.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import com.google.api.gax.rpc.InvalidArgumentException;
import com.google.api.gax.rpc.StatusCode;
import com.google.common.collect.Lists;
import com.google.iam.v1.AuditConfig;
import com.google.iam.v1.Binding;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.GetPolicyOptions;
Expand Down Expand Up @@ -713,6 +714,7 @@ public void getIamPolicyTest() throws Exception {
Policy.newBuilder()
.setVersion(351608024)
.addAllBindings(new ArrayList<Binding>())
.addAllAuditConfigs(new ArrayList<AuditConfig>())
.setEtag(ByteString.EMPTY)
.build();
mockServices.addResponse(expectedResponse);
Expand Down Expand Up @@ -762,6 +764,7 @@ public void setIamPolicyTest() throws Exception {
Policy.newBuilder()
.setVersion(351608024)
.addAllBindings(new ArrayList<Binding>())
.addAllAuditConfigs(new ArrayList<AuditConfig>())
.setEtag(ByteString.EMPTY)
.build();
mockServices.addResponse(expectedResponse);
Expand All @@ -770,6 +773,7 @@ public void setIamPolicyTest() throws Exception {
SetIamPolicyRequest.newBuilder()
.setResource(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();

Policy actualResponse = client.setIamPolicy(request);
Expand All @@ -781,6 +785,7 @@ public void setIamPolicyTest() throws Exception {

Assert.assertEquals(request.getResource(), actualRequest.getResource());
Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy());
Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask());
Assert.assertTrue(
channelProvider.isHeaderSent(
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
Expand All @@ -797,6 +802,7 @@ public void setIamPolicyExceptionTest() throws Exception {
SetIamPolicyRequest.newBuilder()
.setResource(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
client.setIamPolicy(request);
Assert.fail("No exception raised");
Expand Down