From 21034826643dd874f2008093694f4f78ba08b05b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 10 Aug 2021 03:04:17 +0000 Subject: [PATCH] feat!: release gapic-generator-java v2.0.0 (#28) Committer: @miraleung PiperOrigin-RevId: 388535346 Source-Link: https://github.com/googleapis/googleapis/commit/d9eaf41de44d953458b18712a3f240bb4c564e48 Source-Link: https://github.com/googleapis/googleapis-gen/commit/976c5ab6f24b58c91fe04847ead1953f99d19e6a --- .../v1/ReachabilityServiceClient.java | 8 +- .../v1/ReachabilityServiceSettings.java | 3 +- .../v1/stub/GrpcReachabilityServiceStub.java | 69 +++---- .../stub/ReachabilityServiceStubSettings.java | 3 +- .../v1beta1/ReachabilityServiceClient.java | 8 +- .../v1beta1/ReachabilityServiceSettings.java | 3 +- .../stub/GrpcReachabilityServiceStub.java | 69 +++---- .../stub/ReachabilityServiceStubSettings.java | 3 +- .../v1/ReachabilityServiceClientTest.java | 8 +- .../ReachabilityServiceClientTest.java | 8 +- .../clirr-ignored-differences.xml | 4 + .../pom.xml | 8 - .../v1/ConnectivityTestName.java | 192 ------------------ .../clirr-ignored-differences.xml | 4 + .../pom.xml | 8 - .../v1beta1/ConnectivityTestName.java | 192 ------------------ 16 files changed, 70 insertions(+), 520 deletions(-) delete mode 100644 proto-google-cloud-network-management-v1/src/main/java/com/google/cloud/networkmanagement/v1/ConnectivityTestName.java delete mode 100644 proto-google-cloud-network-management-v1beta1/src/main/java/com/google/cloud/networkmanagement/v1beta1/ConnectivityTestName.java diff --git a/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1/ReachabilityServiceClient.java b/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1/ReachabilityServiceClient.java index 34c0111a..429911eb 100644 --- a/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1/ReachabilityServiceClient.java +++ b/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1/ReachabilityServiceClient.java @@ -16,7 +16,6 @@ package com.google.cloud.networkmanagement.v1; -import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.ApiFutures; import com.google.api.core.BetaApi; @@ -904,12 +903,7 @@ public static ApiFuture createAsync( ListConnectivityTestsPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction() { - @Override - public ListConnectivityTestsPagedResponse apply(ListConnectivityTestsPage input) { - return new ListConnectivityTestsPagedResponse(input); - } - }, + input -> new ListConnectivityTestsPagedResponse(input), MoreExecutors.directExecutor()); } diff --git a/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1/ReachabilityServiceSettings.java b/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1/ReachabilityServiceSettings.java index 3eee7a21..f287f598 100644 --- a/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1/ReachabilityServiceSettings.java +++ b/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1/ReachabilityServiceSettings.java @@ -226,14 +226,13 @@ public ReachabilityServiceStubSettings.Builder getStubSettingsBuilder() { return ((ReachabilityServiceStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * *

Note: This method does not support applying settings to streaming methods. */ public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) throws Exception { + ApiFunction, Void> settingsUpdater) { super.applyToAllUnaryMethods( getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; diff --git a/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1/stub/GrpcReachabilityServiceStub.java b/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1/stub/GrpcReachabilityServiceStub.java index f9becd18..6fbb8466 100644 --- a/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1/stub/GrpcReachabilityServiceStub.java +++ b/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1/stub/GrpcReachabilityServiceStub.java @@ -24,7 +24,6 @@ import com.google.api.gax.grpc.GrpcStubCallableFactory; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.networkmanagement.v1.ConnectivityTest; import com.google.cloud.networkmanagement.v1.CreateConnectivityTestRequest; @@ -42,7 +41,6 @@ import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; import java.io.IOException; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -196,13 +194,10 @@ protected GrpcReachabilityServiceStub( .newBuilder() .setMethodDescriptor(listConnectivityTestsMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(ListConnectivityTestsRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); }) .build(); GrpcCallSettings @@ -210,13 +205,10 @@ public Map extract(ListConnectivityTestsRequest request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(getConnectivityTestMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetConnectivityTestRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); }) .build(); GrpcCallSettings @@ -224,13 +216,10 @@ public Map extract(GetConnectivityTestRequest request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(createConnectivityTestMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(CreateConnectivityTestRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); }) .build(); GrpcCallSettings @@ -238,14 +227,10 @@ public Map extract(CreateConnectivityTestRequest request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(updateConnectivityTestMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(UpdateConnectivityTestRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put( - "resource.name", String.valueOf(request.getResource().getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource.name", String.valueOf(request.getResource().getName())); + return params.build(); }) .build(); GrpcCallSettings @@ -253,13 +238,10 @@ public Map extract(UpdateConnectivityTestRequest request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(rerunConnectivityTestMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(RerunConnectivityTestRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); }) .build(); GrpcCallSettings @@ -267,13 +249,10 @@ public Map extract(RerunConnectivityTestRequest request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteConnectivityTestMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(DeleteConnectivityTestRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); }) .build(); diff --git a/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1/stub/ReachabilityServiceStubSettings.java b/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1/stub/ReachabilityServiceStubSettings.java index d509bf8d..85d80dfd 100644 --- a/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1/stub/ReachabilityServiceStubSettings.java +++ b/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1/stub/ReachabilityServiceStubSettings.java @@ -608,14 +608,13 @@ private static Builder initDefaults(Builder builder) { return builder; } - // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * *

Note: This method does not support applying settings to streaming methods. */ public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) throws Exception { + ApiFunction, Void> settingsUpdater) { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } diff --git a/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1beta1/ReachabilityServiceClient.java b/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1beta1/ReachabilityServiceClient.java index bb18ac8b..7f6cb324 100644 --- a/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1beta1/ReachabilityServiceClient.java +++ b/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1beta1/ReachabilityServiceClient.java @@ -16,7 +16,6 @@ package com.google.cloud.networkmanagement.v1beta1; -import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.ApiFutures; import com.google.api.core.BetaApi; @@ -740,12 +739,7 @@ public static ApiFuture createAsync( ListConnectivityTestsPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction() { - @Override - public ListConnectivityTestsPagedResponse apply(ListConnectivityTestsPage input) { - return new ListConnectivityTestsPagedResponse(input); - } - }, + input -> new ListConnectivityTestsPagedResponse(input), MoreExecutors.directExecutor()); } diff --git a/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1beta1/ReachabilityServiceSettings.java b/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1beta1/ReachabilityServiceSettings.java index 087e4f51..73c1a3bf 100644 --- a/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1beta1/ReachabilityServiceSettings.java +++ b/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1beta1/ReachabilityServiceSettings.java @@ -227,14 +227,13 @@ public ReachabilityServiceStubSettings.Builder getStubSettingsBuilder() { return ((ReachabilityServiceStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * *

Note: This method does not support applying settings to streaming methods. */ public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) throws Exception { + ApiFunction, Void> settingsUpdater) { super.applyToAllUnaryMethods( getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; diff --git a/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1beta1/stub/GrpcReachabilityServiceStub.java b/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1beta1/stub/GrpcReachabilityServiceStub.java index 9fe5a981..9935c994 100644 --- a/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1beta1/stub/GrpcReachabilityServiceStub.java +++ b/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1beta1/stub/GrpcReachabilityServiceStub.java @@ -25,7 +25,6 @@ import com.google.api.gax.grpc.GrpcStubCallableFactory; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.networkmanagement.v1beta1.ConnectivityTest; import com.google.cloud.networkmanagement.v1beta1.CreateConnectivityTestRequest; @@ -43,7 +42,6 @@ import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; import java.io.IOException; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -198,13 +196,10 @@ protected GrpcReachabilityServiceStub( .newBuilder() .setMethodDescriptor(listConnectivityTestsMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(ListConnectivityTestsRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); }) .build(); GrpcCallSettings @@ -212,13 +207,10 @@ public Map extract(ListConnectivityTestsRequest request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(getConnectivityTestMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetConnectivityTestRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); }) .build(); GrpcCallSettings @@ -226,13 +218,10 @@ public Map extract(GetConnectivityTestRequest request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(createConnectivityTestMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(CreateConnectivityTestRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); }) .build(); GrpcCallSettings @@ -240,14 +229,10 @@ public Map extract(CreateConnectivityTestRequest request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(updateConnectivityTestMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(UpdateConnectivityTestRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put( - "resource.name", String.valueOf(request.getResource().getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource.name", String.valueOf(request.getResource().getName())); + return params.build(); }) .build(); GrpcCallSettings @@ -255,13 +240,10 @@ public Map extract(UpdateConnectivityTestRequest request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(rerunConnectivityTestMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(RerunConnectivityTestRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); }) .build(); GrpcCallSettings @@ -269,13 +251,10 @@ public Map extract(RerunConnectivityTestRequest request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteConnectivityTestMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(DeleteConnectivityTestRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); }) .build(); diff --git a/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1beta1/stub/ReachabilityServiceStubSettings.java b/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1beta1/stub/ReachabilityServiceStubSettings.java index 1ede6a5a..83e35304 100644 --- a/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1beta1/stub/ReachabilityServiceStubSettings.java +++ b/google-cloud-network-management/src/main/java/com/google/cloud/networkmanagement/v1beta1/stub/ReachabilityServiceStubSettings.java @@ -609,14 +609,13 @@ private static Builder initDefaults(Builder builder) { return builder; } - // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * *

Note: This method does not support applying settings to streaming methods. */ public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) throws Exception { + ApiFunction, Void> settingsUpdater) { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } diff --git a/google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1/ReachabilityServiceClientTest.java b/google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1/ReachabilityServiceClientTest.java index dc5b58be..382ad256 100644 --- a/google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1/ReachabilityServiceClientTest.java +++ b/google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1/ReachabilityServiceClientTest.java @@ -136,7 +136,7 @@ public void listConnectivityTestsExceptionTest() throws Exception { public void getConnectivityTestTest() throws Exception { ConnectivityTest expectedResponse = ConnectivityTest.newBuilder() - .setName(ConnectivityTestName.of("[PROJECT]", "[TEST]").toString()) + .setName("name3373707") .setDescription("description-1724546052") .setSource(Endpoint.newBuilder().build()) .setDestination(Endpoint.newBuilder().build()) @@ -184,7 +184,7 @@ public void getConnectivityTestExceptionTest() throws Exception { public void createConnectivityTestTest() throws Exception { ConnectivityTest expectedResponse = ConnectivityTest.newBuilder() - .setName(ConnectivityTestName.of("[PROJECT]", "[TEST]").toString()) + .setName("name3373707") .setDescription("description-1724546052") .setSource(Endpoint.newBuilder().build()) .setDestination(Endpoint.newBuilder().build()) @@ -248,7 +248,7 @@ public void createConnectivityTestExceptionTest() throws Exception { public void updateConnectivityTestTest() throws Exception { ConnectivityTest expectedResponse = ConnectivityTest.newBuilder() - .setName(ConnectivityTestName.of("[PROJECT]", "[TEST]").toString()) + .setName("name3373707") .setDescription("description-1724546052") .setSource(Endpoint.newBuilder().build()) .setDestination(Endpoint.newBuilder().build()) @@ -309,7 +309,7 @@ public void updateConnectivityTestExceptionTest() throws Exception { public void rerunConnectivityTestTest() throws Exception { ConnectivityTest expectedResponse = ConnectivityTest.newBuilder() - .setName(ConnectivityTestName.of("[PROJECT]", "[TEST]").toString()) + .setName("name3373707") .setDescription("description-1724546052") .setSource(Endpoint.newBuilder().build()) .setDestination(Endpoint.newBuilder().build()) diff --git a/google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1beta1/ReachabilityServiceClientTest.java b/google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1beta1/ReachabilityServiceClientTest.java index 18ded698..e234c03e 100644 --- a/google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1beta1/ReachabilityServiceClientTest.java +++ b/google-cloud-network-management/src/test/java/com/google/cloud/networkmanagement/v1beta1/ReachabilityServiceClientTest.java @@ -154,7 +154,7 @@ public void listConnectivityTestsExceptionTest() throws Exception { public void getConnectivityTestTest() throws Exception { ConnectivityTest expectedResponse = ConnectivityTest.newBuilder() - .setName(ConnectivityTestName.of("[PROJECT]", "[TEST]").toString()) + .setName("name3373707") .setDescription("description-1724546052") .setSource(Endpoint.newBuilder().build()) .setDestination(Endpoint.newBuilder().build()) @@ -205,7 +205,7 @@ public void getConnectivityTestExceptionTest() throws Exception { public void createConnectivityTestTest() throws Exception { ConnectivityTest expectedResponse = ConnectivityTest.newBuilder() - .setName(ConnectivityTestName.of("[PROJECT]", "[TEST]").toString()) + .setName("name3373707") .setDescription("description-1724546052") .setSource(Endpoint.newBuilder().build()) .setDestination(Endpoint.newBuilder().build()) @@ -275,7 +275,7 @@ public void createConnectivityTestExceptionTest() throws Exception { public void updateConnectivityTestTest() throws Exception { ConnectivityTest expectedResponse = ConnectivityTest.newBuilder() - .setName(ConnectivityTestName.of("[PROJECT]", "[TEST]").toString()) + .setName("name3373707") .setDescription("description-1724546052") .setSource(Endpoint.newBuilder().build()) .setDestination(Endpoint.newBuilder().build()) @@ -342,7 +342,7 @@ public void updateConnectivityTestExceptionTest() throws Exception { public void rerunConnectivityTestTest() throws Exception { ConnectivityTest expectedResponse = ConnectivityTest.newBuilder() - .setName(ConnectivityTestName.of("[PROJECT]", "[TEST]").toString()) + .setName("name3373707") .setDescription("description-1724546052") .setSource(Endpoint.newBuilder().build()) .setDestination(Endpoint.newBuilder().build()) diff --git a/proto-google-cloud-network-management-v1/clirr-ignored-differences.xml b/proto-google-cloud-network-management-v1/clirr-ignored-differences.xml index 8b51d97e..b74a8683 100644 --- a/proto-google-cloud-network-management-v1/clirr-ignored-differences.xml +++ b/proto-google-cloud-network-management-v1/clirr-ignored-differences.xml @@ -16,4 +16,8 @@ com/google/cloud/networkmanagement/v1/*OrBuilder boolean has*(*) + + 8001 + com/google/cloud/networkmanagement/v1/ConnectivityTestName* + diff --git a/proto-google-cloud-network-management-v1/pom.xml b/proto-google-cloud-network-management-v1/pom.xml index 01af2b50..a8be482a 100644 --- a/proto-google-cloud-network-management-v1/pom.xml +++ b/proto-google-cloud-network-management-v1/pom.xml @@ -21,14 +21,6 @@ com.google.api.grpc proto-google-common-protos - - com.google.api - api-common - - - com.google.guava - guava - diff --git a/proto-google-cloud-network-management-v1/src/main/java/com/google/cloud/networkmanagement/v1/ConnectivityTestName.java b/proto-google-cloud-network-management-v1/src/main/java/com/google/cloud/networkmanagement/v1/ConnectivityTestName.java deleted file mode 100644 index 26b4008c..00000000 --- a/proto-google-cloud-network-management-v1/src/main/java/com/google/cloud/networkmanagement/v1/ConnectivityTestName.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.networkmanagement.v1; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class ConnectivityTestName implements ResourceName { - private static final PathTemplate PROJECT_TEST = - PathTemplate.createWithoutUrlEncoding( - "projects/{project}/locations/global/connectivityTests/{test}"); - private volatile Map fieldValuesMap; - private final String project; - private final String test; - - @Deprecated - protected ConnectivityTestName() { - project = null; - test = null; - } - - private ConnectivityTestName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - test = Preconditions.checkNotNull(builder.getTest()); - } - - public String getProject() { - return project; - } - - public String getTest() { - return test; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static ConnectivityTestName of(String project, String test) { - return newBuilder().setProject(project).setTest(test).build(); - } - - public static String format(String project, String test) { - return newBuilder().setProject(project).setTest(test).build().toString(); - } - - public static ConnectivityTestName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - PROJECT_TEST.validatedMatch( - formattedString, "ConnectivityTestName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("test")); - } - - public static List parseList(List formattedStrings) { - List list = new ArrayList<>(formattedStrings.size()); - for (String formattedString : formattedStrings) { - list.add(parse(formattedString)); - } - return list; - } - - public static List toStringList(List values) { - List list = new ArrayList<>(values.size()); - for (ConnectivityTestName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PROJECT_TEST.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (project != null) { - fieldMapBuilder.put("project", project); - } - if (test != null) { - fieldMapBuilder.put("test", test); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PROJECT_TEST.instantiate("project", project, "test", test); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - ConnectivityTestName that = ((ConnectivityTestName) o); - return Objects.equals(this.project, that.project) && Objects.equals(this.test, that.test); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(project); - h *= 1000003; - h ^= Objects.hashCode(test); - return h; - } - - /** Builder for projects/{project}/locations/global/connectivityTests/{test}. */ - public static class Builder { - private String project; - private String test; - - protected Builder() {} - - public String getProject() { - return project; - } - - public String getTest() { - return test; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - public Builder setTest(String test) { - this.test = test; - return this; - } - - private Builder(ConnectivityTestName connectivityTestName) { - this.project = connectivityTestName.project; - this.test = connectivityTestName.test; - } - - public ConnectivityTestName build() { - return new ConnectivityTestName(this); - } - } -} diff --git a/proto-google-cloud-network-management-v1beta1/clirr-ignored-differences.xml b/proto-google-cloud-network-management-v1beta1/clirr-ignored-differences.xml index b38e8a09..e0accd1a 100644 --- a/proto-google-cloud-network-management-v1beta1/clirr-ignored-differences.xml +++ b/proto-google-cloud-network-management-v1beta1/clirr-ignored-differences.xml @@ -16,4 +16,8 @@ com/google/cloud/networkmanagement/v1beta1/*OrBuilder boolean has*(*) + + 8001 + com/google/cloud/networkmanagement/v1beta1/ConnectivityTestName* + diff --git a/proto-google-cloud-network-management-v1beta1/pom.xml b/proto-google-cloud-network-management-v1beta1/pom.xml index 4d445c67..9fd4a9ed 100644 --- a/proto-google-cloud-network-management-v1beta1/pom.xml +++ b/proto-google-cloud-network-management-v1beta1/pom.xml @@ -21,14 +21,6 @@ com.google.api.grpc proto-google-common-protos - - com.google.api - api-common - - - com.google.guava - guava - diff --git a/proto-google-cloud-network-management-v1beta1/src/main/java/com/google/cloud/networkmanagement/v1beta1/ConnectivityTestName.java b/proto-google-cloud-network-management-v1beta1/src/main/java/com/google/cloud/networkmanagement/v1beta1/ConnectivityTestName.java deleted file mode 100644 index 56b81992..00000000 --- a/proto-google-cloud-network-management-v1beta1/src/main/java/com/google/cloud/networkmanagement/v1beta1/ConnectivityTestName.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.networkmanagement.v1beta1; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class ConnectivityTestName implements ResourceName { - private static final PathTemplate PROJECT_TEST = - PathTemplate.createWithoutUrlEncoding( - "projects/{project}/locations/global/connectivityTests/{test}"); - private volatile Map fieldValuesMap; - private final String project; - private final String test; - - @Deprecated - protected ConnectivityTestName() { - project = null; - test = null; - } - - private ConnectivityTestName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - test = Preconditions.checkNotNull(builder.getTest()); - } - - public String getProject() { - return project; - } - - public String getTest() { - return test; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static ConnectivityTestName of(String project, String test) { - return newBuilder().setProject(project).setTest(test).build(); - } - - public static String format(String project, String test) { - return newBuilder().setProject(project).setTest(test).build().toString(); - } - - public static ConnectivityTestName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - PROJECT_TEST.validatedMatch( - formattedString, "ConnectivityTestName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("test")); - } - - public static List parseList(List formattedStrings) { - List list = new ArrayList<>(formattedStrings.size()); - for (String formattedString : formattedStrings) { - list.add(parse(formattedString)); - } - return list; - } - - public static List toStringList(List values) { - List list = new ArrayList<>(values.size()); - for (ConnectivityTestName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PROJECT_TEST.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (project != null) { - fieldMapBuilder.put("project", project); - } - if (test != null) { - fieldMapBuilder.put("test", test); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PROJECT_TEST.instantiate("project", project, "test", test); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - ConnectivityTestName that = ((ConnectivityTestName) o); - return Objects.equals(this.project, that.project) && Objects.equals(this.test, that.test); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(project); - h *= 1000003; - h ^= Objects.hashCode(test); - return h; - } - - /** Builder for projects/{project}/locations/global/connectivityTests/{test}. */ - public static class Builder { - private String project; - private String test; - - protected Builder() {} - - public String getProject() { - return project; - } - - public String getTest() { - return test; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - public Builder setTest(String test) { - this.test = test; - return this; - } - - private Builder(ConnectivityTestName connectivityTestName) { - this.project = connectivityTestName.project; - this.test = connectivityTestName.test; - } - - public ConnectivityTestName build() { - return new ConnectivityTestName(this); - } - } -}