Skip to content

Commit

Permalink
fix: [tpu] proper http bindings for v2 API (#9035)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Feb 2, 2023
1 parent 20c36b2 commit ec05dad
Show file tree
Hide file tree
Showing 24 changed files with 225 additions and 203 deletions.
6 changes: 3 additions & 3 deletions java-tpu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ If you are using Maven, add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-tpu</artifactId>
<version>2.9.0</version>
<version>2.10.0</version>
</dependency>
```

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

```Groovy
implementation 'com.google.cloud:google-cloud-tpu:2.9.0'
implementation 'com.google.cloud:google-cloud-tpu:2.10.0'
```

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

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-tpu" % "2.9.0"
libraryDependencies += "com.google.cloud" % "google-cloud-tpu" % "2.10.0"
```

## Authentication
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,18 +585,14 @@ public class HttpJsonTpuStub extends TpuStub {
.setRequestFormatter(
ProtoMessageRequestFormatter.<ListLocationsRequest>newBuilder()
.setPath(
"/v1alpha1/{name=projects/*}/locations",
"/v2/{name=projects/*}/locations",
request -> {
Map<String, String> fields = new HashMap<>();
ProtoRestSerializer<ListLocationsRequest> serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "name", request.getName());
return fields;
})
.setAdditionalPaths(
"/v1/{name=projects/*}/locations",
"/v2alpha1/{name=projects/*}/locations",
"/v2/{name=projects/*}/locations")
.setQueryParamsExtractor(
request -> {
Map<String, List<String>> fields = new HashMap<>();
Expand All @@ -623,18 +619,14 @@ public class HttpJsonTpuStub extends TpuStub {
.setRequestFormatter(
ProtoMessageRequestFormatter.<GetLocationRequest>newBuilder()
.setPath(
"/v1alpha1/{name=projects/*/locations/*}",
"/v2/{name=projects/*/locations/*}",
request -> {
Map<String, String> fields = new HashMap<>();
ProtoRestSerializer<GetLocationRequest> serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "name", request.getName());
return fields;
})
.setAdditionalPaths(
"/v1/{name=projects/*/locations/*}",
"/v2alpha1/{name=projects/*/locations/*}",
"/v2/{name=projects/*/locations/*}")
.setQueryParamsExtractor(
request -> {
Map<String, List<String>> fields = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,7 @@ public final UnaryCallable<GetQueuedResourceRequest, QueuedResource> getQueuedRe
*
* @param parent Required. The parent resource name.
* @param queuedResource Required. The queued resource.
* @param queuedResourceId The unqualified resource name. Should follow the `^[A-Za-z0-9_.~+%-]+$`
* @param queuedResourceId The unqualified resource name. Should follow the ^[A-Za-z0-9_.~+%-]+$
* regex format.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
Expand Down Expand Up @@ -1374,7 +1374,7 @@ public final OperationFuture<QueuedResource, OperationMetadata> createQueuedReso
*
* @param parent Required. The parent resource name.
* @param queuedResource Required. The queued resource.
* @param queuedResourceId The unqualified resource name. Should follow the `^[A-Za-z0-9_.~+%-]+$`
* @param queuedResourceId The unqualified resource name. Should follow the ^[A-Za-z0-9_.~+%-]+$
* regex format.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
*
*
* <pre>
* Request for [GetTensorFlowVersion][google.cloud.tpu.v1.Tpu.GetTensorFlowVersion].
* Request for
* [GetTensorFlowVersion][google.cloud.tpu.v1.Tpu.GetTensorFlowVersion].
* </pre>
*
* Protobuf type {@code google.cloud.tpu.v1.GetTensorFlowVersionRequest}
Expand Down Expand Up @@ -285,7 +286,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
*
*
* <pre>
* Request for [GetTensorFlowVersion][google.cloud.tpu.v1.Tpu.GetTensorFlowVersion].
* Request for
* [GetTensorFlowVersion][google.cloud.tpu.v1.Tpu.GetTensorFlowVersion].
* </pre>
*
* Protobuf type {@code google.cloud.tpu.v1.GetTensorFlowVersionRequest}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
*
*
* <pre>
* Request for [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
* Request for
* [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
* </pre>
*
* Protobuf type {@code google.cloud.tpu.v1.ListAcceleratorTypesRequest}
Expand Down Expand Up @@ -495,7 +496,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
*
*
* <pre>
* Request for [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
* Request for
* [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
* </pre>
*
* Protobuf type {@code google.cloud.tpu.v1.ListAcceleratorTypesRequest}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
*
*
* <pre>
* Response for [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
* Response for
* [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
* </pre>
*
* Protobuf type {@code google.cloud.tpu.v1.ListAcceleratorTypesResponse}
Expand Down Expand Up @@ -444,7 +445,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
*
*
* <pre>
* Response for [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
* Response for
* [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
* </pre>
*
* Protobuf type {@code google.cloud.tpu.v1.ListAcceleratorTypesResponse}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
*
*
* <pre>
* Request for [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
* Request for
* [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
* </pre>
*
* Protobuf type {@code google.cloud.tpu.v1.ListTensorFlowVersionsRequest}
Expand Down Expand Up @@ -496,7 +497,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
*
*
* <pre>
* Request for [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
* Request for
* [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
* </pre>
*
* Protobuf type {@code google.cloud.tpu.v1.ListTensorFlowVersionsRequest}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
*
*
* <pre>
* Response for [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
* Response for
* [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
* </pre>
*
* Protobuf type {@code google.cloud.tpu.v1.ListTensorFlowVersionsResponse}
Expand Down Expand Up @@ -448,7 +449,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
*
*
* <pre>
* Response for [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
* Response for
* [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
* </pre>
*
* Protobuf type {@code google.cloud.tpu.v1.ListTensorFlowVersionsResponse}
Expand Down
Loading

0 comments on commit ec05dad

Please sign in to comment.