From 68065745adb7535fe95819d172afb67dc9692d38 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 18 Apr 2022 22:00:18 +0000 Subject: [PATCH] feat: AuditConfig for IAM v1 (#747) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 439356405 Source-Link: https://github.com/googleapis/googleapis/commit/afa2ba156bd5c83ad8168030ab801a8ca84ac819 Source-Link: https://github.com/googleapis/googleapis-gen/commit/3e40c17e1510c95fab58fc2143ccb61cceca5989 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiM2U0MGMxN2UxNTEwYzk1ZmFiNThmYzIxNDNjY2I2MWNjZWNhNTk4OSJ9 --- java-resourcemanager/README.md | 4 ++-- .../com/google/cloud/resourcemanager/v3/FoldersClient.java | 2 ++ .../google/cloud/resourcemanager/v3/OrganizationsClient.java | 2 ++ .../com/google/cloud/resourcemanager/v3/ProjectsClient.java | 2 ++ .../com/google/cloud/resourcemanager/v3/TagKeysClient.java | 2 ++ .../com/google/cloud/resourcemanager/v3/TagValuesClient.java | 2 ++ .../google/cloud/resourcemanager/v3/FoldersClientTest.java | 5 +++++ .../cloud/resourcemanager/v3/OrganizationsClientTest.java | 5 +++++ .../google/cloud/resourcemanager/v3/ProjectsClientTest.java | 5 +++++ .../google/cloud/resourcemanager/v3/TagKeysClientTest.java | 5 +++++ .../google/cloud/resourcemanager/v3/TagValuesClientTest.java | 5 +++++ 11 files changed, 37 insertions(+), 2 deletions(-) diff --git a/java-resourcemanager/README.md b/java-resourcemanager/README.md index 684e167c101e..f9bbe9426d67 100644 --- a/java-resourcemanager/README.md +++ b/java-resourcemanager/README.md @@ -56,13 +56,13 @@ implementation 'com.google.cloud:google-cloud-resourcemanager' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-resourcemanager:1.2.10' +implementation 'com.google.cloud:google-cloud-resourcemanager:1.2.11' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-resourcemanager" % "1.2.10" +libraryDependencies += "com.google.cloud" % "google-cloud-resourcemanager" % "1.2.11" ``` ## Authentication diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/FoldersClient.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/FoldersClient.java index cfcc9700f771..102c0e83c377 100644 --- a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/FoldersClient.java +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/FoldersClient.java @@ -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); * } @@ -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 future = foldersClient.setIamPolicyCallable().futureCall(request); * // Do something. diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/OrganizationsClient.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/OrganizationsClient.java index ead303d1965c..7cb910050600 100644 --- a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/OrganizationsClient.java +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/OrganizationsClient.java @@ -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); * } @@ -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 future = organizationsClient.setIamPolicyCallable().futureCall(request); * // Do something. diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/ProjectsClient.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/ProjectsClient.java index 4d6eab5d1680..77713c4439e7 100644 --- a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/ProjectsClient.java +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/ProjectsClient.java @@ -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); * } @@ -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 future = projectsClient.setIamPolicyCallable().futureCall(request); * // Do something. diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagKeysClient.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagKeysClient.java index f6e452153023..d2b2e41d9e22 100644 --- a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagKeysClient.java +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagKeysClient.java @@ -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); * } @@ -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 future = tagKeysClient.setIamPolicyCallable().futureCall(request); * // Do something. diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagValuesClient.java b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagValuesClient.java index 2ddd3f4693d8..d9fe06ea96e7 100644 --- a/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagValuesClient.java +++ b/java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/v3/TagValuesClient.java @@ -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); * } @@ -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 future = tagValuesClient.setIamPolicyCallable().futureCall(request); * // Do something. diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/FoldersClientTest.java b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/FoldersClientTest.java index 3cf974cfc7e9..5de6b071b158 100644 --- a/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/FoldersClientTest.java +++ b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/FoldersClientTest.java @@ -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; @@ -855,6 +856,7 @@ public void getIamPolicyTest() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockFolders.addResponse(expectedResponse); @@ -895,6 +897,7 @@ public void getIamPolicyTest2() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockFolders.addResponse(expectedResponse); @@ -935,6 +938,7 @@ public void setIamPolicyTest() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockFolders.addResponse(expectedResponse); @@ -978,6 +982,7 @@ public void setIamPolicyTest2() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockFolders.addResponse(expectedResponse); diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/OrganizationsClientTest.java b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/OrganizationsClientTest.java index 1f6c7605ef43..f6e67fe108a1 100644 --- a/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/OrganizationsClientTest.java +++ b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/OrganizationsClientTest.java @@ -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; @@ -224,6 +225,7 @@ public void getIamPolicyTest() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockOrganizations.addResponse(expectedResponse); @@ -264,6 +266,7 @@ public void getIamPolicyTest2() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockOrganizations.addResponse(expectedResponse); @@ -304,6 +307,7 @@ public void setIamPolicyTest() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockOrganizations.addResponse(expectedResponse); @@ -344,6 +348,7 @@ public void setIamPolicyTest2() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockOrganizations.addResponse(expectedResponse); diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/ProjectsClientTest.java b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/ProjectsClientTest.java index 3a64b0bcd541..d4f9d5c977cf 100644 --- a/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/ProjectsClientTest.java +++ b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/ProjectsClientTest.java @@ -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; @@ -880,6 +881,7 @@ public void getIamPolicyTest() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockProjects.addResponse(expectedResponse); @@ -920,6 +922,7 @@ public void getIamPolicyTest2() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockProjects.addResponse(expectedResponse); @@ -960,6 +963,7 @@ public void setIamPolicyTest() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockProjects.addResponse(expectedResponse); @@ -1003,6 +1007,7 @@ public void setIamPolicyTest2() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockProjects.addResponse(expectedResponse); diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/TagKeysClientTest.java b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/TagKeysClientTest.java index 1cc628b5f959..62da1cf6163b 100644 --- a/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/TagKeysClientTest.java +++ b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/TagKeysClientTest.java @@ -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; @@ -492,6 +493,7 @@ public void getIamPolicyTest() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockTagKeys.addResponse(expectedResponse); @@ -532,6 +534,7 @@ public void getIamPolicyTest2() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockTagKeys.addResponse(expectedResponse); @@ -572,6 +575,7 @@ public void setIamPolicyTest() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockTagKeys.addResponse(expectedResponse); @@ -615,6 +619,7 @@ public void setIamPolicyTest2() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockTagKeys.addResponse(expectedResponse); diff --git a/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/TagValuesClientTest.java b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/TagValuesClientTest.java index 55b77898743d..ff597723b711 100644 --- a/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/TagValuesClientTest.java +++ b/java-resourcemanager/google-cloud-resourcemanager/src/test/java/com/google/cloud/resourcemanager/v3/TagValuesClientTest.java @@ -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; @@ -492,6 +493,7 @@ public void getIamPolicyTest() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockTagValues.addResponse(expectedResponse); @@ -532,6 +534,7 @@ public void getIamPolicyTest2() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockTagValues.addResponse(expectedResponse); @@ -572,6 +575,7 @@ public void setIamPolicyTest() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockTagValues.addResponse(expectedResponse); @@ -615,6 +619,7 @@ public void setIamPolicyTest2() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockTagValues.addResponse(expectedResponse);