Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(do not merge): testing branch for request id autopopulation #2388

Closed
wants to merge 2 commits into from
Closed
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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@ If you are using Maven without the BOM, add this to your dependencies:
If you are using Gradle 5.x or later, add this to your dependencies:

```Groovy
implementation platform('com.google.cloud:libraries-bom:26.30.0')
implementation platform('com.google.cloud:libraries-bom:26.31.0')

implementation 'com.google.cloud:google-cloud-storage'
```
If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-storage:2.32.0'
implementation 'com.google.cloud:google-cloud-storage:2.32.1'
```

If you are using SBT, add this to your dependencies:

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-storage" % "2.32.0"
libraryDependencies += "com.google.cloud" % "google-cloud-storage" % "2.32.1"
```
<!-- {x-version-update-end} -->

Expand Down Expand Up @@ -428,7 +428,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-storage/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-storage.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-storage/2.32.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-storage/2.32.1
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.google.api.gax.rpc.RequestParamsBuilder;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.api.pathtemplate.PathTemplate;
import com.google.common.base.Strings;
import com.google.longrunning.Operation;
import com.google.longrunning.stub.GrpcOperationsStub;
import com.google.protobuf.Empty;
Expand All @@ -43,6 +44,7 @@
import io.grpc.MethodDescriptor;
import io.grpc.protobuf.ProtoUtils;
import java.io.IOException;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;

Expand Down Expand Up @@ -184,6 +186,14 @@ protected GrpcStorageControlStub(
builder.add(request.getParent(), "bucket", CREATE_FOLDER_0_PATH_TEMPLATE);
return builder.build();
})
.setRequestMutator(
request -> {
CreateFolderRequest.Builder requestBuilder = request.toBuilder();
if (Strings.isNullOrEmpty(request.getRequestId())) {
requestBuilder.setRequestId(UUID.randomUUID().toString());
}
return requestBuilder.build();
})
.build();
GrpcCallSettings<DeleteFolderRequest, Empty> deleteFolderTransportSettings =
GrpcCallSettings.<DeleteFolderRequest, Empty>newBuilder()
Expand All @@ -194,6 +204,14 @@ protected GrpcStorageControlStub(
builder.add(request.getName(), "bucket", DELETE_FOLDER_0_PATH_TEMPLATE);
return builder.build();
})
.setRequestMutator(
request -> {
DeleteFolderRequest.Builder requestBuilder = request.toBuilder();
if (Strings.isNullOrEmpty(request.getRequestId())) {
requestBuilder.setRequestId(UUID.randomUUID().toString());
}
return requestBuilder.build();
})
.build();
GrpcCallSettings<GetFolderRequest, Folder> getFolderTransportSettings =
GrpcCallSettings.<GetFolderRequest, Folder>newBuilder()
Expand All @@ -204,6 +222,14 @@ protected GrpcStorageControlStub(
builder.add(request.getName(), "bucket", GET_FOLDER_0_PATH_TEMPLATE);
return builder.build();
})
.setRequestMutator(
request -> {
GetFolderRequest.Builder requestBuilder = request.toBuilder();
if (Strings.isNullOrEmpty(request.getRequestId())) {
requestBuilder.setRequestId(UUID.randomUUID().toString());
}
return requestBuilder.build();
})
.build();
GrpcCallSettings<ListFoldersRequest, ListFoldersResponse> listFoldersTransportSettings =
GrpcCallSettings.<ListFoldersRequest, ListFoldersResponse>newBuilder()
Expand All @@ -224,6 +250,14 @@ protected GrpcStorageControlStub(
builder.add(request.getName(), "bucket", RENAME_FOLDER_0_PATH_TEMPLATE);
return builder.build();
})
.setRequestMutator(
request -> {
RenameFolderRequest.Builder requestBuilder = request.toBuilder();
if (Strings.isNullOrEmpty(request.getRequestId())) {
requestBuilder.setRequestId(UUID.randomUUID().toString());
}
return requestBuilder.build();
})
.build();
GrpcCallSettings<GetStorageLayoutRequest, StorageLayout> getStorageLayoutTransportSettings =
GrpcCallSettings.<GetStorageLayoutRequest, StorageLayout>newBuilder()
Expand All @@ -234,6 +268,14 @@ protected GrpcStorageControlStub(
builder.add(request.getName(), "bucket", GET_STORAGE_LAYOUT_0_PATH_TEMPLATE);
return builder.build();
})
.setRequestMutator(
request -> {
GetStorageLayoutRequest.Builder requestBuilder = request.toBuilder();
if (Strings.isNullOrEmpty(request.getRequestId())) {
requestBuilder.setRequestId(UUID.randomUUID().toString());
}
return requestBuilder.build();
})
.build();

this.createFolderCallable =
Expand Down
16 changes: 15 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,21 @@
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax</artifactId>
<version>2.41.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-grpc</artifactId>
<version>2.41.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-httpjson</artifactId>
<version>2.41.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-storage</artifactId>
Expand Down
Loading