Skip to content

Commit ec05dad

Browse files
fix: [tpu] proper http bindings for v2 API (#9035)
* chore: reformat protos PiperOrigin-RevId: 504359717 Source-Link: googleapis/googleapis@1266905 Source-Link: https://github.com/googleapis/googleapis-gen/commit/881ee780389ca57235403e308065690b8478fe24 Copy-Tag: eyJwIjoiamF2YS10cHUvLk93bEJvdC55YW1sIiwiaCI6Ijg4MWVlNzgwMzg5Y2E1NzIzNTQwM2UzMDgwNjU2OTBiODQ3OGZlMjQifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs: update comment fix: update http bindings for alpha API PiperOrigin-RevId: 504360226 Source-Link: googleapis/googleapis@44f176c Source-Link: https://github.com/googleapis/googleapis-gen/commit/c2c886b4989b35ab7a50824c2c67353a95ed89a7 Copy-Tag: eyJwIjoiamF2YS10cHUvLk93bEJvdC55YW1sIiwiaCI6ImMyYzg4NmI0OTg5YjM1YWI3YTUwODI0YzJjNjczNTNhOTVlZDg5YTcifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix: proper http bindings for v2 API chore: reformat protos PiperOrigin-RevId: 504361887 Source-Link: googleapis/googleapis@1230a6b Source-Link: https://github.com/googleapis/googleapis-gen/commit/51e8944ff6525b7dc567323617a9131c7dcbc544 Copy-Tag: eyJwIjoiamF2YS10cHUvLk93bEJvdC55YW1sIiwiaCI6IjUxZTg5NDRmZjY1MjViN2RjNTY3MzIzNjE3YTkxMzFjN2RjYmM1NDQifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 20c36b2 commit ec05dad

24 files changed

Lines changed: 225 additions & 203 deletions

File tree

java-tpu/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ If you are using Maven, add this to your pom.xml file:
1919
<dependency>
2020
<groupId>com.google.cloud</groupId>
2121
<artifactId>google-cloud-tpu</artifactId>
22-
<version>2.9.0</version>
22+
<version>2.10.0</version>
2323
</dependency>
2424
```
2525

2626
If you are using Gradle without BOM, add this to your dependencies:
2727

2828
```Groovy
29-
implementation 'com.google.cloud:google-cloud-tpu:2.9.0'
29+
implementation 'com.google.cloud:google-cloud-tpu:2.10.0'
3030
```
3131

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

3434
```Scala
35-
libraryDependencies += "com.google.cloud" % "google-cloud-tpu" % "2.9.0"
35+
libraryDependencies += "com.google.cloud" % "google-cloud-tpu" % "2.10.0"
3636
```
3737

3838
## Authentication

java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/stub/HttpJsonTpuStub.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -585,18 +585,14 @@ public class HttpJsonTpuStub extends TpuStub {
585585
.setRequestFormatter(
586586
ProtoMessageRequestFormatter.<ListLocationsRequest>newBuilder()
587587
.setPath(
588-
"/v1alpha1/{name=projects/*}/locations",
588+
"/v2/{name=projects/*}/locations",
589589
request -> {
590590
Map<String, String> fields = new HashMap<>();
591591
ProtoRestSerializer<ListLocationsRequest> serializer =
592592
ProtoRestSerializer.create();
593593
serializer.putPathParam(fields, "name", request.getName());
594594
return fields;
595595
})
596-
.setAdditionalPaths(
597-
"/v1/{name=projects/*}/locations",
598-
"/v2alpha1/{name=projects/*}/locations",
599-
"/v2/{name=projects/*}/locations")
600596
.setQueryParamsExtractor(
601597
request -> {
602598
Map<String, List<String>> fields = new HashMap<>();
@@ -623,18 +619,14 @@ public class HttpJsonTpuStub extends TpuStub {
623619
.setRequestFormatter(
624620
ProtoMessageRequestFormatter.<GetLocationRequest>newBuilder()
625621
.setPath(
626-
"/v1alpha1/{name=projects/*/locations/*}",
622+
"/v2/{name=projects/*/locations/*}",
627623
request -> {
628624
Map<String, String> fields = new HashMap<>();
629625
ProtoRestSerializer<GetLocationRequest> serializer =
630626
ProtoRestSerializer.create();
631627
serializer.putPathParam(fields, "name", request.getName());
632628
return fields;
633629
})
634-
.setAdditionalPaths(
635-
"/v1/{name=projects/*/locations/*}",
636-
"/v2alpha1/{name=projects/*/locations/*}",
637-
"/v2/{name=projects/*/locations/*}")
638630
.setQueryParamsExtractor(
639631
request -> {
640632
Map<String, List<String>> fields = new HashMap<>();

java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/TpuClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,7 +1336,7 @@ public final UnaryCallable<GetQueuedResourceRequest, QueuedResource> getQueuedRe
13361336
*
13371337
* @param parent Required. The parent resource name.
13381338
* @param queuedResource Required. The queued resource.
1339-
* @param queuedResourceId The unqualified resource name. Should follow the `^[A-Za-z0-9_.~+%-]+$`
1339+
* @param queuedResourceId The unqualified resource name. Should follow the ^[A-Za-z0-9_.~+%-]+$
13401340
* regex format.
13411341
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
13421342
*/
@@ -1374,7 +1374,7 @@ public final OperationFuture<QueuedResource, OperationMetadata> createQueuedReso
13741374
*
13751375
* @param parent Required. The parent resource name.
13761376
* @param queuedResource Required. The queued resource.
1377-
* @param queuedResourceId The unqualified resource name. Should follow the `^[A-Za-z0-9_.~+%-]+$`
1377+
* @param queuedResourceId The unqualified resource name. Should follow the ^[A-Za-z0-9_.~+%-]+$
13781378
* regex format.
13791379
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
13801380
*/

java-tpu/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/GetTensorFlowVersionRequest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
*
2323
*
2424
* <pre>
25-
* Request for [GetTensorFlowVersion][google.cloud.tpu.v1.Tpu.GetTensorFlowVersion].
25+
* Request for
26+
* [GetTensorFlowVersion][google.cloud.tpu.v1.Tpu.GetTensorFlowVersion].
2627
* </pre>
2728
*
2829
* Protobuf type {@code google.cloud.tpu.v1.GetTensorFlowVersionRequest}
@@ -285,7 +286,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
285286
*
286287
*
287288
* <pre>
288-
* Request for [GetTensorFlowVersion][google.cloud.tpu.v1.Tpu.GetTensorFlowVersion].
289+
* Request for
290+
* [GetTensorFlowVersion][google.cloud.tpu.v1.Tpu.GetTensorFlowVersion].
289291
* </pre>
290292
*
291293
* Protobuf type {@code google.cloud.tpu.v1.GetTensorFlowVersionRequest}

java-tpu/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesRequest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
*
2323
*
2424
* <pre>
25-
* Request for [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
25+
* Request for
26+
* [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
2627
* </pre>
2728
*
2829
* Protobuf type {@code google.cloud.tpu.v1.ListAcceleratorTypesRequest}
@@ -495,7 +496,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
495496
*
496497
*
497498
* <pre>
498-
* Request for [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
499+
* Request for
500+
* [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
499501
* </pre>
500502
*
501503
* Protobuf type {@code google.cloud.tpu.v1.ListAcceleratorTypesRequest}

java-tpu/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListAcceleratorTypesResponse.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
*
2323
*
2424
* <pre>
25-
* Response for [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
25+
* Response for
26+
* [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
2627
* </pre>
2728
*
2829
* Protobuf type {@code google.cloud.tpu.v1.ListAcceleratorTypesResponse}
@@ -444,7 +445,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
444445
*
445446
*
446447
* <pre>
447-
* Response for [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
448+
* Response for
449+
* [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
448450
* </pre>
449451
*
450452
* Protobuf type {@code google.cloud.tpu.v1.ListAcceleratorTypesResponse}

java-tpu/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsRequest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
*
2323
*
2424
* <pre>
25-
* Request for [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
25+
* Request for
26+
* [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
2627
* </pre>
2728
*
2829
* Protobuf type {@code google.cloud.tpu.v1.ListTensorFlowVersionsRequest}
@@ -496,7 +497,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
496497
*
497498
*
498499
* <pre>
499-
* Request for [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
500+
* Request for
501+
* [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
500502
* </pre>
501503
*
502504
* Protobuf type {@code google.cloud.tpu.v1.ListTensorFlowVersionsRequest}

java-tpu/proto-google-cloud-tpu-v1/src/main/java/com/google/cloud/tpu/v1/ListTensorFlowVersionsResponse.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
*
2323
*
2424
* <pre>
25-
* Response for [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
25+
* Response for
26+
* [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
2627
* </pre>
2728
*
2829
* Protobuf type {@code google.cloud.tpu.v1.ListTensorFlowVersionsResponse}
@@ -448,7 +449,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
448449
*
449450
*
450451
* <pre>
451-
* Response for [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
452+
* Response for
453+
* [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
452454
* </pre>
453455
*
454456
* Protobuf type {@code google.cloud.tpu.v1.ListTensorFlowVersionsResponse}

0 commit comments

Comments
 (0)