Skip to content

Commit

Permalink
chore: [servicemanagement] Enable requesting numeric enums in "transp…
Browse files Browse the repository at this point in the history
…ort=rest" responses for services supporting this (Java, Go, Python, PHP, TypeScript, C#, and Ruby), even if they do not yet turn on REST transport (#8785)

* chore: Enable requesting numeric enums in "transport=rest" responses for services supporting this (Java, Go, Python, PHP, TypeScript, C#, and Ruby), even if they do not yet turn on REST transport

chore: disallow "transport=rest" for services where numeric enums are not confirmed to be supported (except in PHP and Java)
PiperOrigin-RevId: 493113566

Source-Link: googleapis/googleapis@758f0d1

Source-Link: https://github.com/googleapis/googleapis-gen/commit/78bd8f05e1276363eb14eae70e91fe4bc20703ab
Copy-Tag: eyJwIjoiamF2YS1zZXJ2aWNlLW1hbmFnZW1lbnQvLk93bEJvdC55YW1sIiwiaCI6Ijc4YmQ4ZjA1ZTEyNzYzNjNlYjE0ZWFlNzBlOTFmZTRiYzIwNzAzYWIifQ==

feat: added google.api.Service.publishing and client libraries settings
feat: added google.api.JwtLocation.cookie
feat: new fields in enum google.api.ErrorReason
fix: deprecate google.api.Endpoint.aliases
fix: deprecate google.api.BackendRule.min_deadline
docs: minor updates to comments

PiperOrigin-RevId: 488484261

Source-Link: googleapis/googleapis@bd9aa78

Source-Link: https://github.com/googleapis/googleapis-gen/commit/019a6095f9c08c339a15b88088bf9625c2cd1de0
Copy-Tag: eyJwIjoiamF2YS1zZXJ2aWNlLW1hbmFnZW1lbnQvLk93bEJvdC55YW1sIiwiaCI6IjAxOWE2MDk1ZjljMDhjMzM5YTE1Yjg4MDg4YmY5NjI1YzJjZDFkZTAifQ==

* 🦉 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 Dec 6, 2022
1 parent 21c9fdb commit 3334870
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 21 deletions.
32 changes: 16 additions & 16 deletions java-service-management/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-service-management</artifactId>
<version>3.3.0</version>
<version>3.4.0</version>
</dependency>
```

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

```Groovy
implementation 'com.google.cloud:google-cloud-service-management:3.3.0'
implementation 'com.google.cloud:google-cloud-service-management:3.4.0'
```

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

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-service-management" % "3.3.0"
libraryDependencies += "com.google.cloud" % "google-cloud-service-management" % "3.4.0"
```

## Authentication
Expand Down Expand Up @@ -159,16 +159,16 @@ Java is a registered trademark of Oracle and/or its affiliates.

[product-docs]: https://cloud.google.com/service-infrastructure/docs/overview/
[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-service-management/latest/overview
[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-service-management/java7.svg
[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-service-management/java7.html
[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-service-management/java8.svg
[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-service-management/java8.html
[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-service-management/java8-osx.svg
[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-service-management/java8-osx.html
[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-service-management/java8-win.svg
[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-service-management/java8-win.html
[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-service-management/java11.svg
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-service-management/java11.html
[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.svg
[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.html
[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.svg
[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.html
[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.svg
[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.html
[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.svg
[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.html
[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.svg
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/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-service-management.svg
[maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-service-management&core=gav
Expand All @@ -180,9 +180,9 @@ Java is a registered trademark of Oracle and/or its affiliates.
[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects
[cloud-sdk]: https://cloud.google.com/sdk/
[troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/main/troubleshooting/readme.md#troubleshooting
[contributing]: https://github.com/googleapis/java-service-management/blob/main/CONTRIBUTING.md
[code-of-conduct]: https://github.com/googleapis/java-service-management/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct
[license]: https://github.com/googleapis/java-service-management/blob/main/LICENSE
[contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md
[code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct
[license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE
[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing
[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=service-management.googleapis.com
[libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public class HttpJsonServiceManagerStub extends ServiceManagerStub {
serializer.putQueryParam(fields, "pageToken", request.getPageToken());
serializer.putQueryParam(
fields, "producerProjectId", request.getProducerProjectId());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
Expand Down Expand Up @@ -148,6 +149,7 @@ public class HttpJsonServiceManagerStub extends ServiceManagerStub {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<GetServiceRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
Expand Down Expand Up @@ -180,12 +182,13 @@ public class HttpJsonServiceManagerStub extends ServiceManagerStub {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<CreateServiceRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("service", request.getService(), false))
.toBody("service", request.getService(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.<Operation>newBuilder()
Expand Down Expand Up @@ -220,6 +223,7 @@ public class HttpJsonServiceManagerStub extends ServiceManagerStub {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<DeleteServiceRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
Expand Down Expand Up @@ -257,6 +261,7 @@ public class HttpJsonServiceManagerStub extends ServiceManagerStub {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<UndeleteServiceRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
Expand Down Expand Up @@ -297,6 +302,7 @@ public class HttpJsonServiceManagerStub extends ServiceManagerStub {
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "pageSize", request.getPageSize());
serializer.putQueryParam(fields, "pageToken", request.getPageToken());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
Expand Down Expand Up @@ -334,6 +340,7 @@ public class HttpJsonServiceManagerStub extends ServiceManagerStub {
ProtoRestSerializer<GetServiceConfigRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "view", request.getViewValue());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
Expand Down Expand Up @@ -369,12 +376,13 @@ public class HttpJsonServiceManagerStub extends ServiceManagerStub {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<CreateServiceConfigRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("serviceConfig", request.getServiceConfig(), false))
.toBody("serviceConfig", request.getServiceConfig(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.<Service>newBuilder()
Expand Down Expand Up @@ -407,13 +415,14 @@ public class HttpJsonServiceManagerStub extends ServiceManagerStub {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<SubmitConfigSourceRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody(
"*", request.toBuilder().clearServiceName().build(), false))
"*", request.toBuilder().clearServiceName().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.<Operation>newBuilder()
Expand Down Expand Up @@ -452,6 +461,7 @@ public class HttpJsonServiceManagerStub extends ServiceManagerStub {
serializer.putQueryParam(fields, "filter", request.getFilter());
serializer.putQueryParam(fields, "pageSize", request.getPageSize());
serializer.putQueryParam(fields, "pageToken", request.getPageToken());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
Expand Down Expand Up @@ -487,6 +497,7 @@ public class HttpJsonServiceManagerStub extends ServiceManagerStub {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<GetServiceRolloutRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
Expand Down Expand Up @@ -522,12 +533,13 @@ public class HttpJsonServiceManagerStub extends ServiceManagerStub {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<CreateServiceRolloutRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("rollout", request.getRollout(), false))
.toBody("rollout", request.getRollout(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.<Operation>newBuilder()
Expand Down Expand Up @@ -563,12 +575,13 @@ public class HttpJsonServiceManagerStub extends ServiceManagerStub {
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<GenerateConfigReportRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("*", request.toBuilder().build(), false))
.toBody("*", request.toBuilder().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.<GenerateConfigReportResponse>newBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import com.google.api.MetricDescriptor;
import com.google.api.MonitoredResourceDescriptor;
import com.google.api.Monitoring;
import com.google.api.Publishing;
import com.google.api.Quota;
import com.google.api.Service;
import com.google.api.SourceInfo;
Expand Down Expand Up @@ -437,6 +438,7 @@ public void getServiceConfigTest() throws Exception {
.setMonitoring(Monitoring.newBuilder().build())
.setSystemParameters(SystemParameters.newBuilder().build())
.setSourceInfo(SourceInfo.newBuilder().build())
.setPublishing(Publishing.newBuilder().build())
.setConfigVersion(UInt32Value.newBuilder().build())
.build();
mockService.addResponse(expectedResponse);
Expand Down Expand Up @@ -509,6 +511,7 @@ public void createServiceConfigTest() throws Exception {
.setMonitoring(Monitoring.newBuilder().build())
.setSystemParameters(SystemParameters.newBuilder().build())
.setSourceInfo(SourceInfo.newBuilder().build())
.setPublishing(Publishing.newBuilder().build())
.setConfigVersion(UInt32Value.newBuilder().build())
.build();
mockService.addResponse(expectedResponse);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import com.google.api.MetricDescriptor;
import com.google.api.MonitoredResourceDescriptor;
import com.google.api.Monitoring;
import com.google.api.Publishing;
import com.google.api.Quota;
import com.google.api.Service;
import com.google.api.SourceInfo;
Expand Down Expand Up @@ -427,6 +428,7 @@ public void getServiceConfigTest() throws Exception {
.setMonitoring(Monitoring.newBuilder().build())
.setSystemParameters(SystemParameters.newBuilder().build())
.setSourceInfo(SourceInfo.newBuilder().build())
.setPublishing(Publishing.newBuilder().build())
.setConfigVersion(UInt32Value.newBuilder().build())
.build();
mockServiceManager.addResponse(expectedResponse);
Expand Down Expand Up @@ -495,6 +497,7 @@ public void createServiceConfigTest() throws Exception {
.setMonitoring(Monitoring.newBuilder().build())
.setSystemParameters(SystemParameters.newBuilder().build())
.setSourceInfo(SourceInfo.newBuilder().build())
.setPublishing(Publishing.newBuilder().build())
.setConfigVersion(UInt32Value.newBuilder().build())
.build();
mockServiceManager.addResponse(expectedResponse);
Expand Down

0 comments on commit 3334870

Please sign in to comment.