Skip to content
This repository was archived by the owner on Sep 16, 2023. It is now read-only.

Commit 0b3c7ea

Browse files
feat: AuditConfig for IAM v1
PiperOrigin-RevId: 439356405 Source-Link: googleapis/googleapis@afa2ba1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/3e40c17e1510c95fab58fc2143ccb61cceca5989 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiM2U0MGMxN2UxNTEwYzk1ZmFiNThmYzIxNDNjY2I2MWNjZWNhNTk4OSJ9
1 parent 95897b7 commit 0b3c7ea

File tree

66 files changed

+6569
-10435
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+6569
-10435
lines changed

google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceClient.java renamed to owl-bot-staging/v1/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceClient.java

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@
6666
* methods:
6767
*
6868
* <ol>
69-
* <li>A "flattened" method. With this type of method, the fields of the request type have been
69+
* <li> A "flattened" method. With this type of method, the fields of the request type have been
7070
* converted into function parameters. It may be the case that not all fields are available as
7171
* parameters, and not every API method will have a flattened method entry point.
72-
* <li>A "request object" method. This type of method only takes one parameter, a request object,
72+
* <li> A "request object" method. This type of method only takes one parameter, a request object,
7373
* which must be constructed before the call. Not every API method will have a request object
7474
* method.
75-
* <li>A "callable" method. This type of method takes no parameters and returns an immutable API
75+
* <li> A "callable" method. This type of method takes no parameters and returns an immutable API
7676
* callable object, which can be used to initiate calls to the service.
7777
* </ol>
7878
*
@@ -845,9 +845,9 @@ public final UnaryCallable<CallFunctionRequest, CallFunctionResponse> callFuncti
845845
* <p>When uploading source code to the generated signed URL, please follow these restrictions:
846846
*
847847
* <ul>
848-
* <li>Source file type should be a zip file.
849-
* <li>Source file size should not exceed 100MB limit.
850-
* <li>No credentials should be attached - the signed URLs provide access to the target bucket
848+
* <li> Source file type should be a zip file.
849+
* <li> Source file size should not exceed 100MB limit.
850+
* <li> No credentials should be attached - the signed URLs provide access to the target bucket
851851
* using internal service identity; if credentials were attached, the identity from the
852852
* credentials would be used, but that identity does not have permissions to upload files to
853853
* the URL.
@@ -856,14 +856,14 @@ public final UnaryCallable<CallFunctionRequest, CallFunctionResponse> callFuncti
856856
* <p>When making a HTTP PUT request, these two headers need to be specified:
857857
*
858858
* <ul>
859-
* <li>`content-type: application/zip`
860-
* <li>`x-goog-content-length-range: 0,104857600`
859+
* <li> `content-type: application/zip`
860+
* <li> `x-goog-content-length-range: 0,104857600`
861861
* </ul>
862862
*
863863
* <p>And this header SHOULD NOT be specified:
864864
*
865865
* <ul>
866-
* <li>`Authorization: Bearer YOUR_TOKEN`
866+
* <li> `Authorization: Bearer YOUR_TOKEN`
867867
* </ul>
868868
*
869869
* <p>Sample code:
@@ -894,9 +894,9 @@ public final GenerateUploadUrlResponse generateUploadUrl(GenerateUploadUrlReques
894894
* <p>When uploading source code to the generated signed URL, please follow these restrictions:
895895
*
896896
* <ul>
897-
* <li>Source file type should be a zip file.
898-
* <li>Source file size should not exceed 100MB limit.
899-
* <li>No credentials should be attached - the signed URLs provide access to the target bucket
897+
* <li> Source file type should be a zip file.
898+
* <li> Source file size should not exceed 100MB limit.
899+
* <li> No credentials should be attached - the signed URLs provide access to the target bucket
900900
* using internal service identity; if credentials were attached, the identity from the
901901
* credentials would be used, but that identity does not have permissions to upload files to
902902
* the URL.
@@ -905,14 +905,14 @@ public final GenerateUploadUrlResponse generateUploadUrl(GenerateUploadUrlReques
905905
* <p>When making a HTTP PUT request, these two headers need to be specified:
906906
*
907907
* <ul>
908-
* <li>`content-type: application/zip`
909-
* <li>`x-goog-content-length-range: 0,104857600`
908+
* <li> `content-type: application/zip`
909+
* <li> `x-goog-content-length-range: 0,104857600`
910910
* </ul>
911911
*
912912
* <p>And this header SHOULD NOT be specified:
913913
*
914914
* <ul>
915-
* <li>`Authorization: Bearer YOUR_TOKEN`
915+
* <li> `Authorization: Bearer YOUR_TOKEN`
916916
* </ul>
917917
*
918918
* <p>Sample code:
@@ -1003,6 +1003,7 @@ public final GenerateDownloadUrlResponse generateDownloadUrl(GenerateDownloadUrl
10031003
* SetIamPolicyRequest.newBuilder()
10041004
* .setResource(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
10051005
* .setPolicy(Policy.newBuilder().build())
1006+
* .setUpdateMask(FieldMask.newBuilder().build())
10061007
* .build();
10071008
* Policy response = cloudFunctionsServiceClient.setIamPolicy(request);
10081009
* }
@@ -1028,6 +1029,7 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
10281029
* SetIamPolicyRequest.newBuilder()
10291030
* .setResource(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
10301031
* .setPolicy(Policy.newBuilder().build())
1032+
* .setUpdateMask(FieldMask.newBuilder().build())
10311033
* .build();
10321034
* ApiFuture<Policy> future =
10331035
* cloudFunctionsServiceClient.setIamPolicyCallable().futureCall(request);
@@ -1177,10 +1179,7 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted
11771179

11781180
public static class ListFunctionsPagedResponse
11791181
extends AbstractPagedListResponse<
1180-
ListFunctionsRequest,
1181-
ListFunctionsResponse,
1182-
CloudFunction,
1183-
ListFunctionsPage,
1182+
ListFunctionsRequest, ListFunctionsResponse, CloudFunction, ListFunctionsPage,
11841183
ListFunctionsFixedSizeCollection> {
11851184

11861185
public static ApiFuture<ListFunctionsPagedResponse> createAsync(
@@ -1230,10 +1229,7 @@ public ApiFuture<ListFunctionsPage> createPageAsync(
12301229

12311230
public static class ListFunctionsFixedSizeCollection
12321231
extends AbstractFixedSizeCollection<
1233-
ListFunctionsRequest,
1234-
ListFunctionsResponse,
1235-
CloudFunction,
1236-
ListFunctionsPage,
1232+
ListFunctionsRequest, ListFunctionsResponse, CloudFunction, ListFunctionsPage,
12371233
ListFunctionsFixedSizeCollection> {
12381234

12391235
private ListFunctionsFixedSizeCollection(List<ListFunctionsPage> pages, int collectionSize) {

google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceSettings.java renamed to owl-bot-staging/v1/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceSettings.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import com.google.api.gax.rpc.ClientSettings;
2929
import com.google.api.gax.rpc.OperationCallSettings;
3030
import com.google.api.gax.rpc.PagedCallSettings;
31+
import com.google.api.gax.rpc.StubSettings;
3132
import com.google.api.gax.rpc.TransportChannelProvider;
3233
import com.google.api.gax.rpc.UnaryCallSettings;
3334
import com.google.cloud.functions.v1.stub.CloudFunctionsServiceStubSettings;
@@ -49,10 +50,10 @@
4950
* <p>The default instance has everything set to sensible defaults:
5051
*
5152
* <ul>
52-
* <li>The default service address (cloudfunctions.googleapis.com) and default port (443) are
53+
* <li> The default service address (cloudfunctions.googleapis.com) and default port (443) are
5354
* used.
54-
* <li>Credentials are acquired automatically through Application Default Credentials.
55-
* <li>Retries are configured for idempotent methods but not for non-idempotent methods.
55+
* <li> Credentials are acquired automatically through Application Default Credentials.
56+
* <li> Retries are configured for idempotent methods but not for non-idempotent methods.
5657
* </ul>
5758
*
5859
* <p>The builder of this class is recursive, so contained classes are themselves builders. When

google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/CloudFunctionsServiceStubSettings.java renamed to owl-bot-staging/v1/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/CloudFunctionsServiceStubSettings.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@
8181
* <p>The default instance has everything set to sensible defaults:
8282
*
8383
* <ul>
84-
* <li>The default service address (cloudfunctions.googleapis.com) and default port (443) are
84+
* <li> The default service address (cloudfunctions.googleapis.com) and default port (443) are
8585
* used.
86-
* <li>Credentials are acquired automatically through Application Default Credentials.
87-
* <li>Retries are configured for idempotent methods but not for non-idempotent methods.
86+
* <li> Credentials are acquired automatically through Application Default Credentials.
87+
* <li> Retries are configured for idempotent methods but not for non-idempotent methods.
8888
* </ul>
8989
*
9090
* <p>The builder of this class is recursive, so contained classes are themselves builders. When

google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/GrpcCloudFunctionsServiceStub.java renamed to owl-bot-staging/v1/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/GrpcCloudFunctionsServiceStub.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
import io.grpc.MethodDescriptor;
5252
import io.grpc.protobuf.ProtoUtils;
5353
import java.io.IOException;
54+
import java.util.Map;
5455
import java.util.concurrent.TimeUnit;
5556
import javax.annotation.Generated;
5657

google-cloud-functions/src/test/java/com/google/cloud/functions/v1/CloudFunctionsServiceClientTest.java renamed to owl-bot-staging/v1/google-cloud-functions/src/test/java/com/google/cloud/functions/v1/CloudFunctionsServiceClientTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import com.google.api.gax.rpc.InvalidArgumentException;
2828
import com.google.api.gax.rpc.StatusCode;
2929
import com.google.common.collect.Lists;
30+
import com.google.iam.v1.AuditConfig;
3031
import com.google.iam.v1.Binding;
3132
import com.google.iam.v1.GetIamPolicyRequest;
3233
import com.google.iam.v1.GetPolicyOptions;
@@ -40,6 +41,7 @@
4041
import com.google.protobuf.ByteString;
4142
import com.google.protobuf.Duration;
4243
import com.google.protobuf.Empty;
44+
import com.google.protobuf.FieldMask;
4345
import com.google.protobuf.Timestamp;
4446
import io.grpc.StatusRuntimeException;
4547
import java.io.IOException;
@@ -751,6 +753,7 @@ public void setIamPolicyTest() throws Exception {
751753
Policy.newBuilder()
752754
.setVersion(351608024)
753755
.addAllBindings(new ArrayList<Binding>())
756+
.addAllAuditConfigs(new ArrayList<AuditConfig>())
754757
.setEtag(ByteString.EMPTY)
755758
.build();
756759
mockCloudFunctionsService.addResponse(expectedResponse);
@@ -759,6 +762,7 @@ public void setIamPolicyTest() throws Exception {
759762
SetIamPolicyRequest.newBuilder()
760763
.setResource(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
761764
.setPolicy(Policy.newBuilder().build())
765+
.setUpdateMask(FieldMask.newBuilder().build())
762766
.build();
763767

764768
Policy actualResponse = client.setIamPolicy(request);
@@ -770,6 +774,7 @@ public void setIamPolicyTest() throws Exception {
770774

771775
Assert.assertEquals(request.getResource(), actualRequest.getResource());
772776
Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy());
777+
Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask());
773778
Assert.assertTrue(
774779
channelProvider.isHeaderSent(
775780
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -786,6 +791,7 @@ public void setIamPolicyExceptionTest() throws Exception {
786791
SetIamPolicyRequest.newBuilder()
787792
.setResource(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
788793
.setPolicy(Policy.newBuilder().build())
794+
.setUpdateMask(FieldMask.newBuilder().build())
789795
.build();
790796
client.setIamPolicy(request);
791797
Assert.fail("No exception raised");
@@ -800,6 +806,7 @@ public void getIamPolicyTest() throws Exception {
800806
Policy.newBuilder()
801807
.setVersion(351608024)
802808
.addAllBindings(new ArrayList<Binding>())
809+
.addAllAuditConfigs(new ArrayList<AuditConfig>())
803810
.setEtag(ByteString.EMPTY)
804811
.build();
805812
mockCloudFunctionsService.addResponse(expectedResponse);

0 commit comments

Comments
 (0)