Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

feat: AuditConfig for IAM v1 #747

Merged
merged 5 commits into from
Apr 18, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -1614,6 +1614,7 @@ public final Policy setIamPolicy(String resource, Policy policy) {
* SetIamPolicyRequest.newBuilder()
* .setResource(FolderName.of("[FOLDER]").toString())
* .setPolicy(Policy.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* Policy response = foldersClient.setIamPolicy(request);
* }
Expand All @@ -1640,6 +1641,7 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
* SetIamPolicyRequest.newBuilder()
* .setResource(FolderName.of("[FOLDER]").toString())
* .setPolicy(Policy.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* ApiFuture<Policy> future = foldersClient.setIamPolicyCallable().futureCall(request);
* // Do something.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ public final Policy setIamPolicy(String resource) {
* SetIamPolicyRequest.newBuilder()
* .setResource(FolderName.of("[FOLDER]").toString())
* .setPolicy(Policy.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* Policy response = organizationsClient.setIamPolicy(request);
* }
Expand Down Expand Up @@ -607,6 +608,7 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
* SetIamPolicyRequest.newBuilder()
* .setResource(FolderName.of("[FOLDER]").toString())
* .setPolicy(Policy.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* ApiFuture<Policy> future = organizationsClient.setIamPolicyCallable().futureCall(request);
* // Do something.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1682,6 +1682,7 @@ public final Policy setIamPolicy(String resource, Policy policy) {
* SetIamPolicyRequest.newBuilder()
* .setResource(FolderName.of("[FOLDER]").toString())
* .setPolicy(Policy.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* Policy response = projectsClient.setIamPolicy(request);
* }
Expand Down Expand Up @@ -1744,6 +1745,7 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
* SetIamPolicyRequest.newBuilder()
* .setResource(FolderName.of("[FOLDER]").toString())
* .setPolicy(Policy.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* ApiFuture<Policy> future = projectsClient.setIamPolicyCallable().futureCall(request);
* // Do something.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,7 @@ public final Policy setIamPolicy(String resource, Policy policy) {
* SetIamPolicyRequest.newBuilder()
* .setResource(FolderName.of("[FOLDER]").toString())
* .setPolicy(Policy.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* Policy response = tagKeysClient.setIamPolicy(request);
* }
Expand All @@ -928,6 +929,7 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
* SetIamPolicyRequest.newBuilder()
* .setResource(FolderName.of("[FOLDER]").toString())
* .setPolicy(Policy.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* ApiFuture<Policy> future = tagKeysClient.setIamPolicyCallable().futureCall(request);
* // Do something.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,7 @@ public final Policy setIamPolicy(String resource, Policy policy) {
* SetIamPolicyRequest.newBuilder()
* .setResource(FolderName.of("[FOLDER]").toString())
* .setPolicy(Policy.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* Policy response = tagValuesClient.setIamPolicy(request);
* }
Expand All @@ -936,6 +937,7 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
* SetIamPolicyRequest.newBuilder()
* .setResource(FolderName.of("[FOLDER]").toString())
* .setPolicy(Policy.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* ApiFuture<Policy> future = tagValuesClient.setIamPolicyCallable().futureCall(request);
* // Do something.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.google.api.gax.rpc.StatusCode;
import com.google.api.resourcenames.ResourceName;
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.Policy;
Expand Down Expand Up @@ -855,6 +856,7 @@ public void getIamPolicyTest() throws Exception {
Policy.newBuilder()
.setVersion(351608024)
.addAllBindings(new ArrayList<Binding>())
.addAllAuditConfigs(new ArrayList<AuditConfig>())
.setEtag(ByteString.EMPTY)
.build();
mockFolders.addResponse(expectedResponse);
Expand Down Expand Up @@ -895,6 +897,7 @@ public void getIamPolicyTest2() throws Exception {
Policy.newBuilder()
.setVersion(351608024)
.addAllBindings(new ArrayList<Binding>())
.addAllAuditConfigs(new ArrayList<AuditConfig>())
.setEtag(ByteString.EMPTY)
.build();
mockFolders.addResponse(expectedResponse);
Expand Down Expand Up @@ -935,6 +938,7 @@ public void setIamPolicyTest() throws Exception {
Policy.newBuilder()
.setVersion(351608024)
.addAllBindings(new ArrayList<Binding>())
.addAllAuditConfigs(new ArrayList<AuditConfig>())
.setEtag(ByteString.EMPTY)
.build();
mockFolders.addResponse(expectedResponse);
Expand Down Expand Up @@ -978,6 +982,7 @@ public void setIamPolicyTest2() throws Exception {
Policy.newBuilder()
.setVersion(351608024)
.addAllBindings(new ArrayList<Binding>())
.addAllAuditConfigs(new ArrayList<AuditConfig>())
.setEtag(ByteString.EMPTY)
.build();
mockFolders.addResponse(expectedResponse);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.google.api.gax.rpc.InvalidArgumentException;
import com.google.api.resourcenames.ResourceName;
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.Policy;
Expand Down Expand Up @@ -224,6 +225,7 @@ public void getIamPolicyTest() throws Exception {
Policy.newBuilder()
.setVersion(351608024)
.addAllBindings(new ArrayList<Binding>())
.addAllAuditConfigs(new ArrayList<AuditConfig>())
.setEtag(ByteString.EMPTY)
.build();
mockOrganizations.addResponse(expectedResponse);
Expand Down Expand Up @@ -264,6 +266,7 @@ public void getIamPolicyTest2() throws Exception {
Policy.newBuilder()
.setVersion(351608024)
.addAllBindings(new ArrayList<Binding>())
.addAllAuditConfigs(new ArrayList<AuditConfig>())
.setEtag(ByteString.EMPTY)
.build();
mockOrganizations.addResponse(expectedResponse);
Expand Down Expand Up @@ -304,6 +307,7 @@ public void setIamPolicyTest() throws Exception {
Policy.newBuilder()
.setVersion(351608024)
.addAllBindings(new ArrayList<Binding>())
.addAllAuditConfigs(new ArrayList<AuditConfig>())
.setEtag(ByteString.EMPTY)
.build();
mockOrganizations.addResponse(expectedResponse);
Expand Down Expand Up @@ -344,6 +348,7 @@ public void setIamPolicyTest2() throws Exception {
Policy.newBuilder()
.setVersion(351608024)
.addAllBindings(new ArrayList<Binding>())
.addAllAuditConfigs(new ArrayList<AuditConfig>())
.setEtag(ByteString.EMPTY)
.build();
mockOrganizations.addResponse(expectedResponse);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.google.api.gax.rpc.StatusCode;
import com.google.api.resourcenames.ResourceName;
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.Policy;
Expand Down Expand Up @@ -880,6 +881,7 @@ public void getIamPolicyTest() throws Exception {
Policy.newBuilder()
.setVersion(351608024)
.addAllBindings(new ArrayList<Binding>())
.addAllAuditConfigs(new ArrayList<AuditConfig>())
.setEtag(ByteString.EMPTY)
.build();
mockProjects.addResponse(expectedResponse);
Expand Down Expand Up @@ -920,6 +922,7 @@ public void getIamPolicyTest2() throws Exception {
Policy.newBuilder()
.setVersion(351608024)
.addAllBindings(new ArrayList<Binding>())
.addAllAuditConfigs(new ArrayList<AuditConfig>())
.setEtag(ByteString.EMPTY)
.build();
mockProjects.addResponse(expectedResponse);
Expand Down Expand Up @@ -960,6 +963,7 @@ public void setIamPolicyTest() throws Exception {
Policy.newBuilder()
.setVersion(351608024)
.addAllBindings(new ArrayList<Binding>())
.addAllAuditConfigs(new ArrayList<AuditConfig>())
.setEtag(ByteString.EMPTY)
.build();
mockProjects.addResponse(expectedResponse);
Expand Down Expand Up @@ -1003,6 +1007,7 @@ public void setIamPolicyTest2() throws Exception {
Policy.newBuilder()
.setVersion(351608024)
.addAllBindings(new ArrayList<Binding>())
.addAllAuditConfigs(new ArrayList<AuditConfig>())
.setEtag(ByteString.EMPTY)
.build();
mockProjects.addResponse(expectedResponse);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import com.google.api.gax.rpc.StatusCode;
import com.google.api.resourcenames.ResourceName;
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.Policy;
Expand Down Expand Up @@ -492,6 +493,7 @@ public void getIamPolicyTest() throws Exception {
Policy.newBuilder()
.setVersion(351608024)
.addAllBindings(new ArrayList<Binding>())
.addAllAuditConfigs(new ArrayList<AuditConfig>())
.setEtag(ByteString.EMPTY)
.build();
mockTagKeys.addResponse(expectedResponse);
Expand Down Expand Up @@ -532,6 +534,7 @@ public void getIamPolicyTest2() throws Exception {
Policy.newBuilder()
.setVersion(351608024)
.addAllBindings(new ArrayList<Binding>())
.addAllAuditConfigs(new ArrayList<AuditConfig>())
.setEtag(ByteString.EMPTY)
.build();
mockTagKeys.addResponse(expectedResponse);
Expand Down Expand Up @@ -572,6 +575,7 @@ public void setIamPolicyTest() throws Exception {
Policy.newBuilder()
.setVersion(351608024)
.addAllBindings(new ArrayList<Binding>())
.addAllAuditConfigs(new ArrayList<AuditConfig>())
.setEtag(ByteString.EMPTY)
.build();
mockTagKeys.addResponse(expectedResponse);
Expand Down Expand Up @@ -615,6 +619,7 @@ public void setIamPolicyTest2() throws Exception {
Policy.newBuilder()
.setVersion(351608024)
.addAllBindings(new ArrayList<Binding>())
.addAllAuditConfigs(new ArrayList<AuditConfig>())
.setEtag(ByteString.EMPTY)
.build();
mockTagKeys.addResponse(expectedResponse);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import com.google.api.gax.rpc.StatusCode;
import com.google.api.resourcenames.ResourceName;
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.Policy;
Expand Down Expand Up @@ -492,6 +493,7 @@ public void getIamPolicyTest() throws Exception {
Policy.newBuilder()
.setVersion(351608024)
.addAllBindings(new ArrayList<Binding>())
.addAllAuditConfigs(new ArrayList<AuditConfig>())
.setEtag(ByteString.EMPTY)
.build();
mockTagValues.addResponse(expectedResponse);
Expand Down Expand Up @@ -532,6 +534,7 @@ public void getIamPolicyTest2() throws Exception {
Policy.newBuilder()
.setVersion(351608024)
.addAllBindings(new ArrayList<Binding>())
.addAllAuditConfigs(new ArrayList<AuditConfig>())
.setEtag(ByteString.EMPTY)
.build();
mockTagValues.addResponse(expectedResponse);
Expand Down Expand Up @@ -572,6 +575,7 @@ public void setIamPolicyTest() throws Exception {
Policy.newBuilder()
.setVersion(351608024)
.addAllBindings(new ArrayList<Binding>())
.addAllAuditConfigs(new ArrayList<AuditConfig>())
.setEtag(ByteString.EMPTY)
.build();
mockTagValues.addResponse(expectedResponse);
Expand Down Expand Up @@ -615,6 +619,7 @@ public void setIamPolicyTest2() throws Exception {
Policy.newBuilder()
.setVersion(351608024)
.addAllBindings(new ArrayList<Binding>())
.addAllAuditConfigs(new ArrayList<AuditConfig>())
.setEtag(ByteString.EMPTY)
.build();
mockTagValues.addResponse(expectedResponse);
Expand Down