diff --git a/java-service-management/README.md b/java-service-management/README.md index 8d56bf562a47..9e233b666b09 100644 --- a/java-service-management/README.md +++ b/java-service-management/README.md @@ -19,20 +19,20 @@ If you are using Maven, add this to your pom.xml file: com.google.cloud google-cloud-service-management - 3.3.0 + 3.4.0 ``` 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 @@ -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 @@ -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 diff --git a/java-service-management/google-cloud-service-management/src/main/java/com/google/cloud/api/servicemanagement/v1/stub/HttpJsonServiceManagerStub.java b/java-service-management/google-cloud-service-management/src/main/java/com/google/cloud/api/servicemanagement/v1/stub/HttpJsonServiceManagerStub.java index b3156c79834a..d5edc9fffeb3 100644 --- a/java-service-management/google-cloud-service-management/src/main/java/com/google/cloud/api/servicemanagement/v1/stub/HttpJsonServiceManagerStub.java +++ b/java-service-management/google-cloud-service-management/src/main/java/com/google/cloud/api/servicemanagement/v1/stub/HttpJsonServiceManagerStub.java @@ -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) @@ -148,6 +149,7 @@ public class HttpJsonServiceManagerStub extends ServiceManagerStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -180,12 +182,13 @@ public class HttpJsonServiceManagerStub extends ServiceManagerStub { Map> fields = new HashMap<>(); ProtoRestSerializer 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.newBuilder() @@ -220,6 +223,7 @@ public class HttpJsonServiceManagerStub extends ServiceManagerStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -257,6 +261,7 @@ public class HttpJsonServiceManagerStub extends ServiceManagerStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -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) @@ -334,6 +340,7 @@ public class HttpJsonServiceManagerStub extends ServiceManagerStub { ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "view", request.getViewValue()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -369,12 +376,13 @@ public class HttpJsonServiceManagerStub extends ServiceManagerStub { Map> fields = new HashMap<>(); ProtoRestSerializer 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.newBuilder() @@ -407,13 +415,14 @@ public class HttpJsonServiceManagerStub extends ServiceManagerStub { Map> fields = new HashMap<>(); ProtoRestSerializer 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.newBuilder() @@ -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) @@ -487,6 +497,7 @@ public class HttpJsonServiceManagerStub extends ServiceManagerStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) @@ -522,12 +533,13 @@ public class HttpJsonServiceManagerStub extends ServiceManagerStub { Map> fields = new HashMap<>(); ProtoRestSerializer 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.newBuilder() @@ -563,12 +575,13 @@ public class HttpJsonServiceManagerStub extends ServiceManagerStub { Map> fields = new HashMap<>(); ProtoRestSerializer 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.newBuilder() diff --git a/java-service-management/google-cloud-service-management/src/test/java/com/google/cloud/api/servicemanagement/v1/ServiceManagerClientHttpJsonTest.java b/java-service-management/google-cloud-service-management/src/test/java/com/google/cloud/api/servicemanagement/v1/ServiceManagerClientHttpJsonTest.java index 1f8abc45f08c..7806202d886b 100644 --- a/java-service-management/google-cloud-service-management/src/test/java/com/google/cloud/api/servicemanagement/v1/ServiceManagerClientHttpJsonTest.java +++ b/java-service-management/google-cloud-service-management/src/test/java/com/google/cloud/api/servicemanagement/v1/ServiceManagerClientHttpJsonTest.java @@ -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; @@ -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); @@ -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); diff --git a/java-service-management/google-cloud-service-management/src/test/java/com/google/cloud/api/servicemanagement/v1/ServiceManagerClientTest.java b/java-service-management/google-cloud-service-management/src/test/java/com/google/cloud/api/servicemanagement/v1/ServiceManagerClientTest.java index 506b657a0d16..4475d9b77260 100644 --- a/java-service-management/google-cloud-service-management/src/test/java/com/google/cloud/api/servicemanagement/v1/ServiceManagerClientTest.java +++ b/java-service-management/google-cloud-service-management/src/test/java/com/google/cloud/api/servicemanagement/v1/ServiceManagerClientTest.java @@ -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; @@ -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); @@ -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);