From 20c36b2df369868f5a07db98a40e8d2a7432f6e7 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 2 Feb 2023 11:15:29 -0500 Subject: [PATCH] fix!: [networkconnectivity] remove policy based routing API (#9036) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add policy based routing" will work PiperOrigin-RevId: 504360042 Source-Link: https://github.com/googleapis/googleapis/commit/f6427904e82d032dc58ead51662108ff824b75ca Source-Link: https://github.com/googleapis/googleapis-gen/commit/91163ea61de47bda6d30d2dee4a49be27b60aa33 Copy-Tag: eyJwIjoiamF2YS1uZXR3b3JrY29ubmVjdGl2aXR5Ly5Pd2xCb3QueWFtbCIsImgiOiI5MTE2M2VhNjFkZTQ3YmRhNmQzMGQyZGVlNGE0OWJlMjdiNjBhYTMzIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: Update Hub API PiperOrigin-RevId: 504700327 Source-Link: https://github.com/googleapis/googleapis/commit/91b494f124b2f88e70a7e89aa6457ba53423b595 Source-Link: https://github.com/googleapis/googleapis-gen/commit/9af0d4fe79b60c9fcb8539497d18a14f5917d952 Copy-Tag: eyJwIjoiamF2YS1uZXR3b3JrY29ubmVjdGl2aXR5Ly5Pd2xCb3QueWFtbCIsImgiOiI5YWYwZDRmZTc5YjYwYzlmY2I4NTM5NDk3ZDE4YTE0ZjU5MTdkOTUyIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix!: remove policy based routing API PiperOrigin-RevId: 505139690 Source-Link: https://github.com/googleapis/googleapis/commit/183d61a81691cb57a68d1d0f871414c1cc12d526 Source-Link: https://github.com/googleapis/googleapis-gen/commit/58af86ac496b5d1a0c0f5ba4019149f9d66b5663 Copy-Tag: eyJwIjoiamF2YS1uZXR3b3JrY29ubmVjdGl2aXR5Ly5Pd2xCb3QueWFtbCIsImgiOiI1OGFmODZhYzQ5NmI1ZDFhMGMwZjViYTQwMTkxNDlmOWQ2NmI1NjYzIn0= * 🦉 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 --- java-networkconnectivity/README.md | 6 +- .../v1/PolicyBasedRoutingServiceClient.java | 944 -- .../v1/PolicyBasedRoutingServiceSettings.java | 271 - .../v1/gapic_metadata.json | 21 - .../networkconnectivity/v1/package-info.java | 21 - ...icyBasedRoutingServiceCallableFactory.java | 113 - .../GrpcPolicyBasedRoutingServiceStub.java | 325 - .../stub/PolicyBasedRoutingServiceStub.java | 86 - ...PolicyBasedRoutingServiceStubSettings.java | 572 -- .../v1/MockPolicyBasedRoutingService.java | 59 - .../v1/MockPolicyBasedRoutingServiceImpl.java | 146 - .../PolicyBasedRoutingServiceClientTest.java | 501 - .../v1/PolicyBasedRoutingServiceGrpc.java | 757 -- .../v1/CreatePolicyBasedRouteRequest.java | 1386 --- ...reatePolicyBasedRouteRequestOrBuilder.java | 165 - .../v1/DeletePolicyBasedRouteRequest.java | 907 -- ...eletePolicyBasedRouteRequestOrBuilder.java | 99 - .../v1/GetPolicyBasedRouteRequest.java | 655 -- .../GetPolicyBasedRouteRequestOrBuilder.java | 54 - .../v1/ListPolicyBasedRoutesRequest.java | 1294 --- ...ListPolicyBasedRoutesRequestOrBuilder.java | 142 - .../v1/ListPolicyBasedRoutesResponse.java | 1462 --- ...istPolicyBasedRoutesResponseOrBuilder.java | 162 - .../v1/PolicyBasedRoute.java | 8859 ----------------- .../v1/PolicyBasedRouteName.java | 228 - .../v1/PolicyBasedRouteOrBuilder.java | 556 -- .../v1/PolicyBasedRoutingProto.java | 349 - .../v1/policy_based_routing.proto | 338 - .../SyncCreateSetCredentialsProvider.java | 45 - .../create/SyncCreateSetEndpoint.java | 42 - .../AsyncCreatePolicyBasedRoute.java | 55 - .../AsyncCreatePolicyBasedRouteLRO.java | 57 - .../SyncCreatePolicyBasedRoute.java | 51 - ...uteLocationnamePolicybasedrouteString.java | 49 - ...asedRouteStringPolicybasedrouteString.java | 48 - .../AsyncDeletePolicyBasedRoute.java | 54 - .../AsyncDeletePolicyBasedRouteLRO.java | 57 - .../SyncDeletePolicyBasedRoute.java | 50 - ...ePolicyBasedRoutePolicybasedroutename.java | 44 - .../SyncDeletePolicyBasedRouteString.java | 44 - .../AsyncGetPolicyBasedRoute.java | 53 - .../SyncGetPolicyBasedRoute.java | 49 - ...tPolicyBasedRoutePolicybasedroutename.java | 44 - .../SyncGetPolicyBasedRouteString.java | 44 - .../AsyncListPolicyBasedRoutes.java | 57 - .../AsyncListPolicyBasedRoutesPaged.java | 65 - .../SyncListPolicyBasedRoutes.java | 54 - ...SyncListPolicyBasedRoutesLocationname.java | 46 - .../SyncListPolicyBasedRoutesString.java | 46 - .../SyncGetPolicyBasedRoute.java | 50 - .../SyncGetPolicyBasedRoute.java | 50 - 51 files changed, 3 insertions(+), 21629 deletions(-) delete mode 100644 java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRoutingServiceClient.java delete mode 100644 java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRoutingServiceSettings.java delete mode 100644 java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/stub/GrpcPolicyBasedRoutingServiceCallableFactory.java delete mode 100644 java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/stub/GrpcPolicyBasedRoutingServiceStub.java delete mode 100644 java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/stub/PolicyBasedRoutingServiceStub.java delete mode 100644 java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/stub/PolicyBasedRoutingServiceStubSettings.java delete mode 100644 java-networkconnectivity/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1/MockPolicyBasedRoutingService.java delete mode 100644 java-networkconnectivity/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1/MockPolicyBasedRoutingServiceImpl.java delete mode 100644 java-networkconnectivity/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRoutingServiceClientTest.java delete mode 100644 java-networkconnectivity/grpc-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRoutingServiceGrpc.java delete mode 100644 java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/CreatePolicyBasedRouteRequest.java delete mode 100644 java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/CreatePolicyBasedRouteRequestOrBuilder.java delete mode 100644 java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/DeletePolicyBasedRouteRequest.java delete mode 100644 java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/DeletePolicyBasedRouteRequestOrBuilder.java delete mode 100644 java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/GetPolicyBasedRouteRequest.java delete mode 100644 java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/GetPolicyBasedRouteRequestOrBuilder.java delete mode 100644 java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListPolicyBasedRoutesRequest.java delete mode 100644 java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListPolicyBasedRoutesRequestOrBuilder.java delete mode 100644 java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListPolicyBasedRoutesResponse.java delete mode 100644 java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListPolicyBasedRoutesResponseOrBuilder.java delete mode 100644 java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRoute.java delete mode 100644 java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRouteName.java delete mode 100644 java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRouteOrBuilder.java delete mode 100644 java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRoutingProto.java delete mode 100644 java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/proto/google/cloud/networkconnectivity/v1/policy_based_routing.proto delete mode 100644 java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/create/SyncCreateSetCredentialsProvider.java delete mode 100644 java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/create/SyncCreateSetEndpoint.java delete mode 100644 java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/createpolicybasedroute/AsyncCreatePolicyBasedRoute.java delete mode 100644 java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/createpolicybasedroute/AsyncCreatePolicyBasedRouteLRO.java delete mode 100644 java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/createpolicybasedroute/SyncCreatePolicyBasedRoute.java delete mode 100644 java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/createpolicybasedroute/SyncCreatePolicyBasedRouteLocationnamePolicybasedrouteString.java delete mode 100644 java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/createpolicybasedroute/SyncCreatePolicyBasedRouteStringPolicybasedrouteString.java delete mode 100644 java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/deletepolicybasedroute/AsyncDeletePolicyBasedRoute.java delete mode 100644 java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/deletepolicybasedroute/AsyncDeletePolicyBasedRouteLRO.java delete mode 100644 java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/deletepolicybasedroute/SyncDeletePolicyBasedRoute.java delete mode 100644 java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/deletepolicybasedroute/SyncDeletePolicyBasedRoutePolicybasedroutename.java delete mode 100644 java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/deletepolicybasedroute/SyncDeletePolicyBasedRouteString.java delete mode 100644 java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/getpolicybasedroute/AsyncGetPolicyBasedRoute.java delete mode 100644 java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/getpolicybasedroute/SyncGetPolicyBasedRoute.java delete mode 100644 java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/getpolicybasedroute/SyncGetPolicyBasedRoutePolicybasedroutename.java delete mode 100644 java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/getpolicybasedroute/SyncGetPolicyBasedRouteString.java delete mode 100644 java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/listpolicybasedroutes/AsyncListPolicyBasedRoutes.java delete mode 100644 java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/listpolicybasedroutes/AsyncListPolicyBasedRoutesPaged.java delete mode 100644 java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/listpolicybasedroutes/SyncListPolicyBasedRoutes.java delete mode 100644 java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/listpolicybasedroutes/SyncListPolicyBasedRoutesLocationname.java delete mode 100644 java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/listpolicybasedroutes/SyncListPolicyBasedRoutesString.java delete mode 100644 java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservicesettings/getpolicybasedroute/SyncGetPolicyBasedRoute.java delete mode 100644 java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/stub/policybasedroutingservicestubsettings/getpolicybasedroute/SyncGetPolicyBasedRoute.java diff --git a/java-networkconnectivity/README.md b/java-networkconnectivity/README.md index ea5b5131532a..b1ac9e796315 100644 --- a/java-networkconnectivity/README.md +++ b/java-networkconnectivity/README.md @@ -19,20 +19,20 @@ If you are using Maven, add this to your pom.xml file: com.google.cloud google-cloud-networkconnectivity - 1.7.0 + 1.8.0 ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-networkconnectivity:1.7.0' +implementation 'com.google.cloud:google-cloud-networkconnectivity:1.8.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-networkconnectivity" % "1.7.0" +libraryDependencies += "com.google.cloud" % "google-cloud-networkconnectivity" % "1.8.0" ``` ## Authentication diff --git a/java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRoutingServiceClient.java b/java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRoutingServiceClient.java deleted file mode 100644 index c006579e4952..000000000000 --- a/java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRoutingServiceClient.java +++ /dev/null @@ -1,944 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1; - -import com.google.api.core.ApiFuture; -import com.google.api.core.ApiFutures; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.longrunning.OperationFuture; -import com.google.api.gax.paging.AbstractFixedSizeCollection; -import com.google.api.gax.paging.AbstractPage; -import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PageContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.networkconnectivity.v1.stub.PolicyBasedRoutingServiceStub; -import com.google.cloud.networkconnectivity.v1.stub.PolicyBasedRoutingServiceStubSettings; -import com.google.common.util.concurrent.MoreExecutors; -import com.google.longrunning.Operation; -import com.google.longrunning.OperationsClient; -import com.google.protobuf.Empty; -import java.io.IOException; -import java.util.List; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Service Description: Policy-Based Routing allows GCP customers to specify flexibile routing - * policies for Layer 4 traffic traversing through the connected service. - * - *

This class provides the ability to make remote calls to the backing service through method - * calls that map to API methods. Sample code to get started: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient =
- *     PolicyBasedRoutingServiceClient.create()) {
- *   PolicyBasedRouteName name =
- *       PolicyBasedRouteName.of("[PROJECT]", "[LOCATION]", "[POLICY_BASED_ROUTE]");
- *   PolicyBasedRoute response = policyBasedRoutingServiceClient.getPolicyBasedRoute(name);
- * }
- * }
- * - *

Note: close() needs to be called on the PolicyBasedRoutingServiceClient object to clean up - * resources such as threads. In the example above, try-with-resources is used, which automatically - * calls close(). - * - *

The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
- * - *

See the individual methods for example code. - * - *

Many parameters require resource names to be formatted in a particular way. To assist with - * these names, this class includes a format method for each type of name, and additionally a parse - * method to extract the individual identifiers contained within names that are returned. - * - *

This class can be customized by passing in a custom instance of - * PolicyBasedRoutingServiceSettings to create(). For example: - * - *

To customize credentials: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * PolicyBasedRoutingServiceSettings policyBasedRoutingServiceSettings =
- *     PolicyBasedRoutingServiceSettings.newBuilder()
- *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
- *         .build();
- * PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient =
- *     PolicyBasedRoutingServiceClient.create(policyBasedRoutingServiceSettings);
- * }
- * - *

To customize the endpoint: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * PolicyBasedRoutingServiceSettings policyBasedRoutingServiceSettings =
- *     PolicyBasedRoutingServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
- * PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient =
- *     PolicyBasedRoutingServiceClient.create(policyBasedRoutingServiceSettings);
- * }
- * - *

Please refer to the GitHub repository's samples for more quickstart code snippets. - */ -@Generated("by gapic-generator-java") -public class PolicyBasedRoutingServiceClient implements BackgroundResource { - private final PolicyBasedRoutingServiceSettings settings; - private final PolicyBasedRoutingServiceStub stub; - private final OperationsClient operationsClient; - - /** Constructs an instance of PolicyBasedRoutingServiceClient with default settings. */ - public static final PolicyBasedRoutingServiceClient create() throws IOException { - return create(PolicyBasedRoutingServiceSettings.newBuilder().build()); - } - - /** - * Constructs an instance of PolicyBasedRoutingServiceClient, using the given settings. The - * channels are created based on the settings passed in, or defaults for any settings that are not - * set. - */ - public static final PolicyBasedRoutingServiceClient create( - PolicyBasedRoutingServiceSettings settings) throws IOException { - return new PolicyBasedRoutingServiceClient(settings); - } - - /** - * Constructs an instance of PolicyBasedRoutingServiceClient, using the given stub for making - * calls. This is for advanced usage - prefer using create(PolicyBasedRoutingServiceSettings). - */ - public static final PolicyBasedRoutingServiceClient create(PolicyBasedRoutingServiceStub stub) { - return new PolicyBasedRoutingServiceClient(stub); - } - - /** - * Constructs an instance of PolicyBasedRoutingServiceClient, using the given settings. This is - * protected so that it is easy to make a subclass, but otherwise, the static factory methods - * should be preferred. - */ - protected PolicyBasedRoutingServiceClient(PolicyBasedRoutingServiceSettings settings) - throws IOException { - this.settings = settings; - this.stub = ((PolicyBasedRoutingServiceStubSettings) settings.getStubSettings()).createStub(); - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); - } - - protected PolicyBasedRoutingServiceClient(PolicyBasedRoutingServiceStub stub) { - this.settings = null; - this.stub = stub; - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); - } - - public final PolicyBasedRoutingServiceSettings getSettings() { - return settings; - } - - public PolicyBasedRoutingServiceStub getStub() { - return stub; - } - - /** - * Returns the OperationsClient that can be used to query the status of a long-running operation - * returned by another API method call. - */ - public final OperationsClient getOperationsClient() { - return operationsClient; - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists PolicyBasedRoutes in a given project and location. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient =
-   *     PolicyBasedRoutingServiceClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   for (PolicyBasedRoute element :
-   *       policyBasedRoutingServiceClient.listPolicyBasedRoutes(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param parent Required. The parent resource's name. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPolicyBasedRoutesPagedResponse listPolicyBasedRoutes(LocationName parent) { - ListPolicyBasedRoutesRequest request = - ListPolicyBasedRoutesRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); - return listPolicyBasedRoutes(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists PolicyBasedRoutes in a given project and location. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient =
-   *     PolicyBasedRoutingServiceClient.create()) {
-   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
-   *   for (PolicyBasedRoute element :
-   *       policyBasedRoutingServiceClient.listPolicyBasedRoutes(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param parent Required. The parent resource's name. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPolicyBasedRoutesPagedResponse listPolicyBasedRoutes(String parent) { - ListPolicyBasedRoutesRequest request = - ListPolicyBasedRoutesRequest.newBuilder().setParent(parent).build(); - return listPolicyBasedRoutes(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists PolicyBasedRoutes in a given project and location. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient =
-   *     PolicyBasedRoutingServiceClient.create()) {
-   *   ListPolicyBasedRoutesRequest request =
-   *       ListPolicyBasedRoutesRequest.newBuilder()
-   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .setFilter("filter-1274492040")
-   *           .setOrderBy("orderBy-1207110587")
-   *           .build();
-   *   for (PolicyBasedRoute element :
-   *       policyBasedRoutingServiceClient.listPolicyBasedRoutes(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPolicyBasedRoutesPagedResponse listPolicyBasedRoutes( - ListPolicyBasedRoutesRequest request) { - return listPolicyBasedRoutesPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists PolicyBasedRoutes in a given project and location. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient =
-   *     PolicyBasedRoutingServiceClient.create()) {
-   *   ListPolicyBasedRoutesRequest request =
-   *       ListPolicyBasedRoutesRequest.newBuilder()
-   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .setFilter("filter-1274492040")
-   *           .setOrderBy("orderBy-1207110587")
-   *           .build();
-   *   ApiFuture future =
-   *       policyBasedRoutingServiceClient.listPolicyBasedRoutesPagedCallable().futureCall(request);
-   *   // Do something.
-   *   for (PolicyBasedRoute element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable - listPolicyBasedRoutesPagedCallable() { - return stub.listPolicyBasedRoutesPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists PolicyBasedRoutes in a given project and location. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient =
-   *     PolicyBasedRoutingServiceClient.create()) {
-   *   ListPolicyBasedRoutesRequest request =
-   *       ListPolicyBasedRoutesRequest.newBuilder()
-   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .setFilter("filter-1274492040")
-   *           .setOrderBy("orderBy-1207110587")
-   *           .build();
-   *   while (true) {
-   *     ListPolicyBasedRoutesResponse response =
-   *         policyBasedRoutingServiceClient.listPolicyBasedRoutesCallable().call(request);
-   *     for (PolicyBasedRoute element : response.getPolicyBasedRoutesList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable - listPolicyBasedRoutesCallable() { - return stub.listPolicyBasedRoutesCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets details of a single PolicyBasedRoute. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient =
-   *     PolicyBasedRoutingServiceClient.create()) {
-   *   PolicyBasedRouteName name =
-   *       PolicyBasedRouteName.of("[PROJECT]", "[LOCATION]", "[POLICY_BASED_ROUTE]");
-   *   PolicyBasedRoute response = policyBasedRoutingServiceClient.getPolicyBasedRoute(name);
-   * }
-   * }
- * - * @param name Required. Name of the PolicyBasedRoute resource to get. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final PolicyBasedRoute getPolicyBasedRoute(PolicyBasedRouteName name) { - GetPolicyBasedRouteRequest request = - GetPolicyBasedRouteRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); - return getPolicyBasedRoute(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets details of a single PolicyBasedRoute. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient =
-   *     PolicyBasedRoutingServiceClient.create()) {
-   *   String name =
-   *       PolicyBasedRouteName.of("[PROJECT]", "[LOCATION]", "[POLICY_BASED_ROUTE]").toString();
-   *   PolicyBasedRoute response = policyBasedRoutingServiceClient.getPolicyBasedRoute(name);
-   * }
-   * }
- * - * @param name Required. Name of the PolicyBasedRoute resource to get. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final PolicyBasedRoute getPolicyBasedRoute(String name) { - GetPolicyBasedRouteRequest request = - GetPolicyBasedRouteRequest.newBuilder().setName(name).build(); - return getPolicyBasedRoute(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets details of a single PolicyBasedRoute. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient =
-   *     PolicyBasedRoutingServiceClient.create()) {
-   *   GetPolicyBasedRouteRequest request =
-   *       GetPolicyBasedRouteRequest.newBuilder()
-   *           .setName(
-   *               PolicyBasedRouteName.of("[PROJECT]", "[LOCATION]", "[POLICY_BASED_ROUTE]")
-   *                   .toString())
-   *           .build();
-   *   PolicyBasedRoute response = policyBasedRoutingServiceClient.getPolicyBasedRoute(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final PolicyBasedRoute getPolicyBasedRoute(GetPolicyBasedRouteRequest request) { - return getPolicyBasedRouteCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets details of a single PolicyBasedRoute. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient =
-   *     PolicyBasedRoutingServiceClient.create()) {
-   *   GetPolicyBasedRouteRequest request =
-   *       GetPolicyBasedRouteRequest.newBuilder()
-   *           .setName(
-   *               PolicyBasedRouteName.of("[PROJECT]", "[LOCATION]", "[POLICY_BASED_ROUTE]")
-   *                   .toString())
-   *           .build();
-   *   ApiFuture future =
-   *       policyBasedRoutingServiceClient.getPolicyBasedRouteCallable().futureCall(request);
-   *   // Do something.
-   *   PolicyBasedRoute response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable - getPolicyBasedRouteCallable() { - return stub.getPolicyBasedRouteCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a new PolicyBasedRoute in a given project and location. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient =
-   *     PolicyBasedRoutingServiceClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   PolicyBasedRoute policyBasedRoute = PolicyBasedRoute.newBuilder().build();
-   *   String policyBasedRouteId = "policyBasedRouteId-18034589";
-   *   PolicyBasedRoute response =
-   *       policyBasedRoutingServiceClient
-   *           .createPolicyBasedRouteAsync(parent, policyBasedRoute, policyBasedRouteId)
-   *           .get();
-   * }
-   * }
- * - * @param parent Required. The parent resource's name of the PolicyBasedRoute. - * @param policyBasedRoute Required. Initial values for a new Policy Based Route. - * @param policyBasedRouteId Optional. Unique id for the Policy Based Route to create. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final OperationFuture createPolicyBasedRouteAsync( - LocationName parent, PolicyBasedRoute policyBasedRoute, String policyBasedRouteId) { - CreatePolicyBasedRouteRequest request = - CreatePolicyBasedRouteRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setPolicyBasedRoute(policyBasedRoute) - .setPolicyBasedRouteId(policyBasedRouteId) - .build(); - return createPolicyBasedRouteAsync(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a new PolicyBasedRoute in a given project and location. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient =
-   *     PolicyBasedRoutingServiceClient.create()) {
-   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
-   *   PolicyBasedRoute policyBasedRoute = PolicyBasedRoute.newBuilder().build();
-   *   String policyBasedRouteId = "policyBasedRouteId-18034589";
-   *   PolicyBasedRoute response =
-   *       policyBasedRoutingServiceClient
-   *           .createPolicyBasedRouteAsync(parent, policyBasedRoute, policyBasedRouteId)
-   *           .get();
-   * }
-   * }
- * - * @param parent Required. The parent resource's name of the PolicyBasedRoute. - * @param policyBasedRoute Required. Initial values for a new Policy Based Route. - * @param policyBasedRouteId Optional. Unique id for the Policy Based Route to create. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final OperationFuture createPolicyBasedRouteAsync( - String parent, PolicyBasedRoute policyBasedRoute, String policyBasedRouteId) { - CreatePolicyBasedRouteRequest request = - CreatePolicyBasedRouteRequest.newBuilder() - .setParent(parent) - .setPolicyBasedRoute(policyBasedRoute) - .setPolicyBasedRouteId(policyBasedRouteId) - .build(); - return createPolicyBasedRouteAsync(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a new PolicyBasedRoute in a given project and location. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient =
-   *     PolicyBasedRoutingServiceClient.create()) {
-   *   CreatePolicyBasedRouteRequest request =
-   *       CreatePolicyBasedRouteRequest.newBuilder()
-   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
-   *           .setPolicyBasedRouteId("policyBasedRouteId-18034589")
-   *           .setPolicyBasedRoute(PolicyBasedRoute.newBuilder().build())
-   *           .setRequestId("requestId693933066")
-   *           .build();
-   *   PolicyBasedRoute response =
-   *       policyBasedRoutingServiceClient.createPolicyBasedRouteAsync(request).get();
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final OperationFuture createPolicyBasedRouteAsync( - CreatePolicyBasedRouteRequest request) { - return createPolicyBasedRouteOperationCallable().futureCall(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a new PolicyBasedRoute in a given project and location. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient =
-   *     PolicyBasedRoutingServiceClient.create()) {
-   *   CreatePolicyBasedRouteRequest request =
-   *       CreatePolicyBasedRouteRequest.newBuilder()
-   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
-   *           .setPolicyBasedRouteId("policyBasedRouteId-18034589")
-   *           .setPolicyBasedRoute(PolicyBasedRoute.newBuilder().build())
-   *           .setRequestId("requestId693933066")
-   *           .build();
-   *   OperationFuture future =
-   *       policyBasedRoutingServiceClient
-   *           .createPolicyBasedRouteOperationCallable()
-   *           .futureCall(request);
-   *   // Do something.
-   *   PolicyBasedRoute response = future.get();
-   * }
-   * }
- */ - public final OperationCallable - createPolicyBasedRouteOperationCallable() { - return stub.createPolicyBasedRouteOperationCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a new PolicyBasedRoute in a given project and location. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient =
-   *     PolicyBasedRoutingServiceClient.create()) {
-   *   CreatePolicyBasedRouteRequest request =
-   *       CreatePolicyBasedRouteRequest.newBuilder()
-   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
-   *           .setPolicyBasedRouteId("policyBasedRouteId-18034589")
-   *           .setPolicyBasedRoute(PolicyBasedRoute.newBuilder().build())
-   *           .setRequestId("requestId693933066")
-   *           .build();
-   *   ApiFuture future =
-   *       policyBasedRoutingServiceClient.createPolicyBasedRouteCallable().futureCall(request);
-   *   // Do something.
-   *   Operation response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable - createPolicyBasedRouteCallable() { - return stub.createPolicyBasedRouteCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a single PolicyBasedRoute. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient =
-   *     PolicyBasedRoutingServiceClient.create()) {
-   *   PolicyBasedRouteName name =
-   *       PolicyBasedRouteName.of("[PROJECT]", "[LOCATION]", "[POLICY_BASED_ROUTE]");
-   *   policyBasedRoutingServiceClient.deletePolicyBasedRouteAsync(name).get();
-   * }
-   * }
- * - * @param name Required. Name of the PolicyBasedRoute resource to delete. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final OperationFuture deletePolicyBasedRouteAsync( - PolicyBasedRouteName name) { - DeletePolicyBasedRouteRequest request = - DeletePolicyBasedRouteRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); - return deletePolicyBasedRouteAsync(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a single PolicyBasedRoute. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient =
-   *     PolicyBasedRoutingServiceClient.create()) {
-   *   String name =
-   *       PolicyBasedRouteName.of("[PROJECT]", "[LOCATION]", "[POLICY_BASED_ROUTE]").toString();
-   *   policyBasedRoutingServiceClient.deletePolicyBasedRouteAsync(name).get();
-   * }
-   * }
- * - * @param name Required. Name of the PolicyBasedRoute resource to delete. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final OperationFuture deletePolicyBasedRouteAsync(String name) { - DeletePolicyBasedRouteRequest request = - DeletePolicyBasedRouteRequest.newBuilder().setName(name).build(); - return deletePolicyBasedRouteAsync(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a single PolicyBasedRoute. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient =
-   *     PolicyBasedRoutingServiceClient.create()) {
-   *   DeletePolicyBasedRouteRequest request =
-   *       DeletePolicyBasedRouteRequest.newBuilder()
-   *           .setName(
-   *               PolicyBasedRouteName.of("[PROJECT]", "[LOCATION]", "[POLICY_BASED_ROUTE]")
-   *                   .toString())
-   *           .setRequestId("requestId693933066")
-   *           .build();
-   *   policyBasedRoutingServiceClient.deletePolicyBasedRouteAsync(request).get();
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final OperationFuture deletePolicyBasedRouteAsync( - DeletePolicyBasedRouteRequest request) { - return deletePolicyBasedRouteOperationCallable().futureCall(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a single PolicyBasedRoute. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient =
-   *     PolicyBasedRoutingServiceClient.create()) {
-   *   DeletePolicyBasedRouteRequest request =
-   *       DeletePolicyBasedRouteRequest.newBuilder()
-   *           .setName(
-   *               PolicyBasedRouteName.of("[PROJECT]", "[LOCATION]", "[POLICY_BASED_ROUTE]")
-   *                   .toString())
-   *           .setRequestId("requestId693933066")
-   *           .build();
-   *   OperationFuture future =
-   *       policyBasedRoutingServiceClient
-   *           .deletePolicyBasedRouteOperationCallable()
-   *           .futureCall(request);
-   *   // Do something.
-   *   future.get();
-   * }
-   * }
- */ - public final OperationCallable - deletePolicyBasedRouteOperationCallable() { - return stub.deletePolicyBasedRouteOperationCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a single PolicyBasedRoute. - * - *

Sample code: - * - *

{@code
-   * // This snippet has been automatically generated and should be regarded as a code template only.
-   * // It will require modifications to work:
-   * // - It may require correct/in-range values for request initialization.
-   * // - It may require specifying regional endpoints when creating the service client as shown in
-   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient =
-   *     PolicyBasedRoutingServiceClient.create()) {
-   *   DeletePolicyBasedRouteRequest request =
-   *       DeletePolicyBasedRouteRequest.newBuilder()
-   *           .setName(
-   *               PolicyBasedRouteName.of("[PROJECT]", "[LOCATION]", "[POLICY_BASED_ROUTE]")
-   *                   .toString())
-   *           .setRequestId("requestId693933066")
-   *           .build();
-   *   ApiFuture future =
-   *       policyBasedRoutingServiceClient.deletePolicyBasedRouteCallable().futureCall(request);
-   *   // Do something.
-   *   future.get();
-   * }
-   * }
- */ - public final UnaryCallable - deletePolicyBasedRouteCallable() { - return stub.deletePolicyBasedRouteCallable(); - } - - @Override - public final void close() { - stub.close(); - } - - @Override - public void shutdown() { - stub.shutdown(); - } - - @Override - public boolean isShutdown() { - return stub.isShutdown(); - } - - @Override - public boolean isTerminated() { - return stub.isTerminated(); - } - - @Override - public void shutdownNow() { - stub.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return stub.awaitTermination(duration, unit); - } - - public static class ListPolicyBasedRoutesPagedResponse - extends AbstractPagedListResponse< - ListPolicyBasedRoutesRequest, - ListPolicyBasedRoutesResponse, - PolicyBasedRoute, - ListPolicyBasedRoutesPage, - ListPolicyBasedRoutesFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext - context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListPolicyBasedRoutesPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, - input -> new ListPolicyBasedRoutesPagedResponse(input), - MoreExecutors.directExecutor()); - } - - private ListPolicyBasedRoutesPagedResponse(ListPolicyBasedRoutesPage page) { - super(page, ListPolicyBasedRoutesFixedSizeCollection.createEmptyCollection()); - } - } - - public static class ListPolicyBasedRoutesPage - extends AbstractPage< - ListPolicyBasedRoutesRequest, - ListPolicyBasedRoutesResponse, - PolicyBasedRoute, - ListPolicyBasedRoutesPage> { - - private ListPolicyBasedRoutesPage( - PageContext - context, - ListPolicyBasedRoutesResponse response) { - super(context, response); - } - - private static ListPolicyBasedRoutesPage createEmptyPage() { - return new ListPolicyBasedRoutesPage(null, null); - } - - @Override - protected ListPolicyBasedRoutesPage createPage( - PageContext - context, - ListPolicyBasedRoutesResponse response) { - return new ListPolicyBasedRoutesPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext - context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class ListPolicyBasedRoutesFixedSizeCollection - extends AbstractFixedSizeCollection< - ListPolicyBasedRoutesRequest, - ListPolicyBasedRoutesResponse, - PolicyBasedRoute, - ListPolicyBasedRoutesPage, - ListPolicyBasedRoutesFixedSizeCollection> { - - private ListPolicyBasedRoutesFixedSizeCollection( - List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListPolicyBasedRoutesFixedSizeCollection createEmptyCollection() { - return new ListPolicyBasedRoutesFixedSizeCollection(null, 0); - } - - @Override - protected ListPolicyBasedRoutesFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListPolicyBasedRoutesFixedSizeCollection(pages, collectionSize); - } - } -} diff --git a/java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRoutingServiceSettings.java b/java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRoutingServiceSettings.java deleted file mode 100644 index b88372c68322..000000000000 --- a/java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRoutingServiceSettings.java +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1; - -import static com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient.ListPolicyBasedRoutesPagedResponse; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.cloud.networkconnectivity.v1.stub.PolicyBasedRoutingServiceStubSettings; -import com.google.longrunning.Operation; -import com.google.protobuf.Empty; -import java.io.IOException; -import java.util.List; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Settings class to configure an instance of {@link PolicyBasedRoutingServiceClient}. - * - *

The default instance has everything set to sensible defaults: - * - *

    - *
  • The default service address (networkconnectivity.googleapis.com) and default port (443) are - * used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. - *
- * - *

The builder of this class is recursive, so contained classes are themselves builders. When - * build() is called, the tree of builders is called to create the complete settings object. - * - *

For example, to set the total timeout of getPolicyBasedRoute to 30 seconds: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * PolicyBasedRoutingServiceSettings.Builder policyBasedRoutingServiceSettingsBuilder =
- *     PolicyBasedRoutingServiceSettings.newBuilder();
- * policyBasedRoutingServiceSettingsBuilder
- *     .getPolicyBasedRouteSettings()
- *     .setRetrySettings(
- *         policyBasedRoutingServiceSettingsBuilder
- *             .getPolicyBasedRouteSettings()
- *             .getRetrySettings()
- *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * PolicyBasedRoutingServiceSettings policyBasedRoutingServiceSettings =
- *     policyBasedRoutingServiceSettingsBuilder.build();
- * }
- */ -@Generated("by gapic-generator-java") -public class PolicyBasedRoutingServiceSettings - extends ClientSettings { - - /** Returns the object with the settings used for calls to listPolicyBasedRoutes. */ - public PagedCallSettings< - ListPolicyBasedRoutesRequest, - ListPolicyBasedRoutesResponse, - ListPolicyBasedRoutesPagedResponse> - listPolicyBasedRoutesSettings() { - return ((PolicyBasedRoutingServiceStubSettings) getStubSettings()) - .listPolicyBasedRoutesSettings(); - } - - /** Returns the object with the settings used for calls to getPolicyBasedRoute. */ - public UnaryCallSettings - getPolicyBasedRouteSettings() { - return ((PolicyBasedRoutingServiceStubSettings) getStubSettings()) - .getPolicyBasedRouteSettings(); - } - - /** Returns the object with the settings used for calls to createPolicyBasedRoute. */ - public UnaryCallSettings - createPolicyBasedRouteSettings() { - return ((PolicyBasedRoutingServiceStubSettings) getStubSettings()) - .createPolicyBasedRouteSettings(); - } - - /** Returns the object with the settings used for calls to createPolicyBasedRoute. */ - public OperationCallSettings - createPolicyBasedRouteOperationSettings() { - return ((PolicyBasedRoutingServiceStubSettings) getStubSettings()) - .createPolicyBasedRouteOperationSettings(); - } - - /** Returns the object with the settings used for calls to deletePolicyBasedRoute. */ - public UnaryCallSettings - deletePolicyBasedRouteSettings() { - return ((PolicyBasedRoutingServiceStubSettings) getStubSettings()) - .deletePolicyBasedRouteSettings(); - } - - /** Returns the object with the settings used for calls to deletePolicyBasedRoute. */ - public OperationCallSettings - deletePolicyBasedRouteOperationSettings() { - return ((PolicyBasedRoutingServiceStubSettings) getStubSettings()) - .deletePolicyBasedRouteOperationSettings(); - } - - public static final PolicyBasedRoutingServiceSettings create( - PolicyBasedRoutingServiceStubSettings stub) throws IOException { - return new PolicyBasedRoutingServiceSettings.Builder(stub.toBuilder()).build(); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return PolicyBasedRoutingServiceStubSettings.defaultExecutorProviderBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return PolicyBasedRoutingServiceStubSettings.getDefaultEndpoint(); - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return PolicyBasedRoutingServiceStubSettings.getDefaultServiceScopes(); - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return PolicyBasedRoutingServiceStubSettings.defaultCredentialsProviderBuilder(); - } - - /** Returns a builder for the default ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return PolicyBasedRoutingServiceStubSettings.defaultGrpcTransportProviderBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return PolicyBasedRoutingServiceStubSettings.defaultTransportChannelProvider(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return PolicyBasedRoutingServiceStubSettings.defaultApiClientHeaderProviderBuilder(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected PolicyBasedRoutingServiceSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - } - - /** Builder for PolicyBasedRoutingServiceSettings. */ - public static class Builder - extends ClientSettings.Builder { - - protected Builder() throws IOException { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(PolicyBasedRoutingServiceStubSettings.newBuilder(clientContext)); - } - - protected Builder(PolicyBasedRoutingServiceSettings settings) { - super(settings.getStubSettings().toBuilder()); - } - - protected Builder(PolicyBasedRoutingServiceStubSettings.Builder stubSettings) { - super(stubSettings); - } - - private static Builder createDefault() { - return new Builder(PolicyBasedRoutingServiceStubSettings.newBuilder()); - } - - public PolicyBasedRoutingServiceStubSettings.Builder getStubSettingsBuilder() { - return ((PolicyBasedRoutingServiceStubSettings.Builder) getStubSettings()); - } - - /** - * 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) { - super.applyToAllUnaryMethods( - getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); - return this; - } - - /** Returns the builder for the settings used for calls to listPolicyBasedRoutes. */ - public PagedCallSettings.Builder< - ListPolicyBasedRoutesRequest, - ListPolicyBasedRoutesResponse, - ListPolicyBasedRoutesPagedResponse> - listPolicyBasedRoutesSettings() { - return getStubSettingsBuilder().listPolicyBasedRoutesSettings(); - } - - /** Returns the builder for the settings used for calls to getPolicyBasedRoute. */ - public UnaryCallSettings.Builder - getPolicyBasedRouteSettings() { - return getStubSettingsBuilder().getPolicyBasedRouteSettings(); - } - - /** Returns the builder for the settings used for calls to createPolicyBasedRoute. */ - public UnaryCallSettings.Builder - createPolicyBasedRouteSettings() { - return getStubSettingsBuilder().createPolicyBasedRouteSettings(); - } - - /** Returns the builder for the settings used for calls to createPolicyBasedRoute. */ - public OperationCallSettings.Builder< - CreatePolicyBasedRouteRequest, PolicyBasedRoute, OperationMetadata> - createPolicyBasedRouteOperationSettings() { - return getStubSettingsBuilder().createPolicyBasedRouteOperationSettings(); - } - - /** Returns the builder for the settings used for calls to deletePolicyBasedRoute. */ - public UnaryCallSettings.Builder - deletePolicyBasedRouteSettings() { - return getStubSettingsBuilder().deletePolicyBasedRouteSettings(); - } - - /** Returns the builder for the settings used for calls to deletePolicyBasedRoute. */ - public OperationCallSettings.Builder - deletePolicyBasedRouteOperationSettings() { - return getStubSettingsBuilder().deletePolicyBasedRouteOperationSettings(); - } - - @Override - public PolicyBasedRoutingServiceSettings build() throws IOException { - return new PolicyBasedRoutingServiceSettings(this); - } - } -} diff --git a/java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/gapic_metadata.json b/java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/gapic_metadata.json index c2a68318d1b1..466ca6374aa6 100644 --- a/java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/gapic_metadata.json +++ b/java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/gapic_metadata.json @@ -43,27 +43,6 @@ } } } - }, - "PolicyBasedRoutingService": { - "clients": { - "grpc": { - "libraryClient": "PolicyBasedRoutingServiceClient", - "rpcs": { - "CreatePolicyBasedRoute": { - "methods": ["createPolicyBasedRouteAsync", "createPolicyBasedRouteAsync", "createPolicyBasedRouteAsync", "createPolicyBasedRouteOperationCallable", "createPolicyBasedRouteCallable"] - }, - "DeletePolicyBasedRoute": { - "methods": ["deletePolicyBasedRouteAsync", "deletePolicyBasedRouteAsync", "deletePolicyBasedRouteAsync", "deletePolicyBasedRouteOperationCallable", "deletePolicyBasedRouteCallable"] - }, - "GetPolicyBasedRoute": { - "methods": ["getPolicyBasedRoute", "getPolicyBasedRoute", "getPolicyBasedRoute", "getPolicyBasedRouteCallable"] - }, - "ListPolicyBasedRoutes": { - "methods": ["listPolicyBasedRoutes", "listPolicyBasedRoutes", "listPolicyBasedRoutes", "listPolicyBasedRoutesPagedCallable", "listPolicyBasedRoutesCallable"] - } - } - } - } } } } \ No newline at end of file diff --git a/java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/package-info.java b/java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/package-info.java index daeb8017fa34..0aa0afcf4e1a 100644 --- a/java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/package-info.java +++ b/java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/package-info.java @@ -38,27 +38,6 @@ * Hub response = hubServiceClient.getHub(name); * } * } - * - *

======================= PolicyBasedRoutingServiceClient ======================= - * - *

Service Description: Policy-Based Routing allows GCP customers to specify flexibile routing - * policies for Layer 4 traffic traversing through the connected service. - * - *

Sample for PolicyBasedRoutingServiceClient: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient =
- *     PolicyBasedRoutingServiceClient.create()) {
- *   PolicyBasedRouteName name =
- *       PolicyBasedRouteName.of("[PROJECT]", "[LOCATION]", "[POLICY_BASED_ROUTE]");
- *   PolicyBasedRoute response = policyBasedRoutingServiceClient.getPolicyBasedRoute(name);
- * }
- * }
*/ @Generated("by gapic-generator-java") package com.google.cloud.networkconnectivity.v1; diff --git a/java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/stub/GrpcPolicyBasedRoutingServiceCallableFactory.java b/java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/stub/GrpcPolicyBasedRoutingServiceCallableFactory.java deleted file mode 100644 index 30603bafc32f..000000000000 --- a/java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/stub/GrpcPolicyBasedRoutingServiceCallableFactory.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1.stub; - -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcCallableFactory; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.OperationsStub; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC callable factory implementation for the PolicyBasedRoutingService service API. - * - *

This class is for advanced usage. - */ -@Generated("by gapic-generator-java") -public class GrpcPolicyBasedRoutingServiceCallableFactory implements GrpcStubCallableFactory { - - @Override - public UnaryCallable createUnaryCallable( - GrpcCallSettings grpcCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - GrpcCallSettings grpcCallSettings, - PagedCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - GrpcCallSettings grpcCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, callSettings, clientContext, operationsStub); - } - - @Override - public - BidiStreamingCallable createBidiStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - ClientStreamingCallable createClientStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } -} diff --git a/java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/stub/GrpcPolicyBasedRoutingServiceStub.java b/java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/stub/GrpcPolicyBasedRoutingServiceStub.java deleted file mode 100644 index db36eab6cc86..000000000000 --- a/java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/stub/GrpcPolicyBasedRoutingServiceStub.java +++ /dev/null @@ -1,325 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1.stub; - -import static com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient.ListPolicyBasedRoutesPagedResponse; - -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.grpc.GrpcCallSettings; -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.UnaryCallable; -import com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest; -import com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest; -import com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest; -import com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest; -import com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse; -import com.google.cloud.networkconnectivity.v1.OperationMetadata; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoute; -import com.google.common.collect.ImmutableMap; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.GrpcOperationsStub; -import com.google.protobuf.Empty; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC stub implementation for the PolicyBasedRoutingService service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator-java") -public class GrpcPolicyBasedRoutingServiceStub extends PolicyBasedRoutingServiceStub { - private static final MethodDescriptor - listPolicyBasedRoutesMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - "google.cloud.networkconnectivity.v1.PolicyBasedRoutingService/ListPolicyBasedRoutes") - .setRequestMarshaller( - ProtoUtils.marshaller(ListPolicyBasedRoutesRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(ListPolicyBasedRoutesResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - getPolicyBasedRouteMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - "google.cloud.networkconnectivity.v1.PolicyBasedRoutingService/GetPolicyBasedRoute") - .setRequestMarshaller( - ProtoUtils.marshaller(GetPolicyBasedRouteRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(PolicyBasedRoute.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - createPolicyBasedRouteMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - "google.cloud.networkconnectivity.v1.PolicyBasedRoutingService/CreatePolicyBasedRoute") - .setRequestMarshaller( - ProtoUtils.marshaller(CreatePolicyBasedRouteRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - deletePolicyBasedRouteMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - "google.cloud.networkconnectivity.v1.PolicyBasedRoutingService/DeletePolicyBasedRoute") - .setRequestMarshaller( - ProtoUtils.marshaller(DeletePolicyBasedRouteRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) - .build(); - - private final UnaryCallable - listPolicyBasedRoutesCallable; - private final UnaryCallable - listPolicyBasedRoutesPagedCallable; - private final UnaryCallable - getPolicyBasedRouteCallable; - private final UnaryCallable - createPolicyBasedRouteCallable; - private final OperationCallable< - CreatePolicyBasedRouteRequest, PolicyBasedRoute, OperationMetadata> - createPolicyBasedRouteOperationCallable; - private final UnaryCallable - deletePolicyBasedRouteCallable; - private final OperationCallable - deletePolicyBasedRouteOperationCallable; - - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final GrpcStubCallableFactory callableFactory; - - public static final GrpcPolicyBasedRoutingServiceStub create( - PolicyBasedRoutingServiceStubSettings settings) throws IOException { - return new GrpcPolicyBasedRoutingServiceStub(settings, ClientContext.create(settings)); - } - - public static final GrpcPolicyBasedRoutingServiceStub create(ClientContext clientContext) - throws IOException { - return new GrpcPolicyBasedRoutingServiceStub( - PolicyBasedRoutingServiceStubSettings.newBuilder().build(), clientContext); - } - - public static final GrpcPolicyBasedRoutingServiceStub create( - ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcPolicyBasedRoutingServiceStub( - PolicyBasedRoutingServiceStubSettings.newBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of GrpcPolicyBasedRoutingServiceStub, using the given settings. This is - * protected so that it is easy to make a subclass, but otherwise, the static factory methods - * should be preferred. - */ - protected GrpcPolicyBasedRoutingServiceStub( - PolicyBasedRoutingServiceStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new GrpcPolicyBasedRoutingServiceCallableFactory()); - } - - /** - * Constructs an instance of GrpcPolicyBasedRoutingServiceStub, using the given settings. This is - * protected so that it is easy to make a subclass, but otherwise, the static factory methods - * should be preferred. - */ - protected GrpcPolicyBasedRoutingServiceStub( - PolicyBasedRoutingServiceStubSettings settings, - ClientContext clientContext, - GrpcStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - - GrpcCallSettings - listPolicyBasedRoutesTransportSettings = - GrpcCallSettings - .newBuilder() - .setMethodDescriptor(listPolicyBasedRoutesMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - }) - .build(); - GrpcCallSettings - getPolicyBasedRouteTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getPolicyBasedRouteMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings - createPolicyBasedRouteTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createPolicyBasedRouteMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - }) - .build(); - GrpcCallSettings - deletePolicyBasedRouteTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deletePolicyBasedRouteMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - - this.listPolicyBasedRoutesCallable = - callableFactory.createUnaryCallable( - listPolicyBasedRoutesTransportSettings, - settings.listPolicyBasedRoutesSettings(), - clientContext); - this.listPolicyBasedRoutesPagedCallable = - callableFactory.createPagedCallable( - listPolicyBasedRoutesTransportSettings, - settings.listPolicyBasedRoutesSettings(), - clientContext); - this.getPolicyBasedRouteCallable = - callableFactory.createUnaryCallable( - getPolicyBasedRouteTransportSettings, - settings.getPolicyBasedRouteSettings(), - clientContext); - this.createPolicyBasedRouteCallable = - callableFactory.createUnaryCallable( - createPolicyBasedRouteTransportSettings, - settings.createPolicyBasedRouteSettings(), - clientContext); - this.createPolicyBasedRouteOperationCallable = - callableFactory.createOperationCallable( - createPolicyBasedRouteTransportSettings, - settings.createPolicyBasedRouteOperationSettings(), - clientContext, - operationsStub); - this.deletePolicyBasedRouteCallable = - callableFactory.createUnaryCallable( - deletePolicyBasedRouteTransportSettings, - settings.deletePolicyBasedRouteSettings(), - clientContext); - this.deletePolicyBasedRouteOperationCallable = - callableFactory.createOperationCallable( - deletePolicyBasedRouteTransportSettings, - settings.deletePolicyBasedRouteOperationSettings(), - clientContext, - operationsStub); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - public GrpcOperationsStub getOperationsStub() { - return operationsStub; - } - - @Override - public UnaryCallable - listPolicyBasedRoutesCallable() { - return listPolicyBasedRoutesCallable; - } - - @Override - public UnaryCallable - listPolicyBasedRoutesPagedCallable() { - return listPolicyBasedRoutesPagedCallable; - } - - @Override - public UnaryCallable getPolicyBasedRouteCallable() { - return getPolicyBasedRouteCallable; - } - - @Override - public UnaryCallable createPolicyBasedRouteCallable() { - return createPolicyBasedRouteCallable; - } - - @Override - public OperationCallable - createPolicyBasedRouteOperationCallable() { - return createPolicyBasedRouteOperationCallable; - } - - @Override - public UnaryCallable deletePolicyBasedRouteCallable() { - return deletePolicyBasedRouteCallable; - } - - @Override - public OperationCallable - deletePolicyBasedRouteOperationCallable() { - return deletePolicyBasedRouteOperationCallable; - } - - @Override - public final void close() { - try { - backgroundResources.close(); - } catch (RuntimeException e) { - throw e; - } catch (Exception e) { - throw new IllegalStateException("Failed to close resource", e); - } - } - - @Override - public void shutdown() { - backgroundResources.shutdown(); - } - - @Override - public boolean isShutdown() { - return backgroundResources.isShutdown(); - } - - @Override - public boolean isTerminated() { - return backgroundResources.isTerminated(); - } - - @Override - public void shutdownNow() { - backgroundResources.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return backgroundResources.awaitTermination(duration, unit); - } -} diff --git a/java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/stub/PolicyBasedRoutingServiceStub.java b/java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/stub/PolicyBasedRoutingServiceStub.java deleted file mode 100644 index d1cb115a8e14..000000000000 --- a/java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/stub/PolicyBasedRoutingServiceStub.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1.stub; - -import static com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient.ListPolicyBasedRoutesPagedResponse; - -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest; -import com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest; -import com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest; -import com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest; -import com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse; -import com.google.cloud.networkconnectivity.v1.OperationMetadata; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoute; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.OperationsStub; -import com.google.protobuf.Empty; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Base stub class for the PolicyBasedRoutingService service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator-java") -public abstract class PolicyBasedRoutingServiceStub implements BackgroundResource { - - public OperationsStub getOperationsStub() { - throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); - } - - public UnaryCallable - listPolicyBasedRoutesPagedCallable() { - throw new UnsupportedOperationException( - "Not implemented: listPolicyBasedRoutesPagedCallable()"); - } - - public UnaryCallable - listPolicyBasedRoutesCallable() { - throw new UnsupportedOperationException("Not implemented: listPolicyBasedRoutesCallable()"); - } - - public UnaryCallable getPolicyBasedRouteCallable() { - throw new UnsupportedOperationException("Not implemented: getPolicyBasedRouteCallable()"); - } - - public OperationCallable - createPolicyBasedRouteOperationCallable() { - throw new UnsupportedOperationException( - "Not implemented: createPolicyBasedRouteOperationCallable()"); - } - - public UnaryCallable createPolicyBasedRouteCallable() { - throw new UnsupportedOperationException("Not implemented: createPolicyBasedRouteCallable()"); - } - - public OperationCallable - deletePolicyBasedRouteOperationCallable() { - throw new UnsupportedOperationException( - "Not implemented: deletePolicyBasedRouteOperationCallable()"); - } - - public UnaryCallable deletePolicyBasedRouteCallable() { - throw new UnsupportedOperationException("Not implemented: deletePolicyBasedRouteCallable()"); - } - - @Override - public abstract void close(); -} diff --git a/java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/stub/PolicyBasedRoutingServiceStubSettings.java b/java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/stub/PolicyBasedRoutingServiceStubSettings.java deleted file mode 100644 index e113fcb8d78d..000000000000 --- a/java-networkconnectivity/google-cloud-networkconnectivity/src/main/java/com/google/cloud/networkconnectivity/v1/stub/PolicyBasedRoutingServiceStubSettings.java +++ /dev/null @@ -1,572 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1.stub; - -import static com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient.ListPolicyBasedRoutesPagedResponse; - -import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GaxProperties; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.GrpcTransportChannel; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.grpc.ProtoOperationTransformers; -import com.google.api.gax.longrunning.OperationSnapshot; -import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.PageContext; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest; -import com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest; -import com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest; -import com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest; -import com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse; -import com.google.cloud.networkconnectivity.v1.OperationMetadata; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoute; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.longrunning.Operation; -import com.google.protobuf.Empty; -import java.io.IOException; -import java.util.List; -import javax.annotation.Generated; -import org.threeten.bp.Duration; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Settings class to configure an instance of {@link PolicyBasedRoutingServiceStub}. - * - *

The default instance has everything set to sensible defaults: - * - *

    - *
  • The default service address (networkconnectivity.googleapis.com) and default port (443) are - * used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. - *
- * - *

The builder of this class is recursive, so contained classes are themselves builders. When - * build() is called, the tree of builders is called to create the complete settings object. - * - *

For example, to set the total timeout of getPolicyBasedRoute to 30 seconds: - * - *

{@code
- * // This snippet has been automatically generated and should be regarded as a code template only.
- * // It will require modifications to work:
- * // - It may require correct/in-range values for request initialization.
- * // - It may require specifying regional endpoints when creating the service client as shown in
- * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * PolicyBasedRoutingServiceStubSettings.Builder policyBasedRoutingServiceSettingsBuilder =
- *     PolicyBasedRoutingServiceStubSettings.newBuilder();
- * policyBasedRoutingServiceSettingsBuilder
- *     .getPolicyBasedRouteSettings()
- *     .setRetrySettings(
- *         policyBasedRoutingServiceSettingsBuilder
- *             .getPolicyBasedRouteSettings()
- *             .getRetrySettings()
- *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * PolicyBasedRoutingServiceStubSettings policyBasedRoutingServiceSettings =
- *     policyBasedRoutingServiceSettingsBuilder.build();
- * }
- */ -@Generated("by gapic-generator-java") -public class PolicyBasedRoutingServiceStubSettings - extends StubSettings { - /** The default scopes of the service. */ - private static final ImmutableList DEFAULT_SERVICE_SCOPES = - ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); - - private final PagedCallSettings< - ListPolicyBasedRoutesRequest, - ListPolicyBasedRoutesResponse, - ListPolicyBasedRoutesPagedResponse> - listPolicyBasedRoutesSettings; - private final UnaryCallSettings - getPolicyBasedRouteSettings; - private final UnaryCallSettings - createPolicyBasedRouteSettings; - private final OperationCallSettings< - CreatePolicyBasedRouteRequest, PolicyBasedRoute, OperationMetadata> - createPolicyBasedRouteOperationSettings; - private final UnaryCallSettings - deletePolicyBasedRouteSettings; - private final OperationCallSettings - deletePolicyBasedRouteOperationSettings; - - private static final PagedListDescriptor< - ListPolicyBasedRoutesRequest, ListPolicyBasedRoutesResponse, PolicyBasedRoute> - LIST_POLICY_BASED_ROUTES_PAGE_STR_DESC = - new PagedListDescriptor< - ListPolicyBasedRoutesRequest, ListPolicyBasedRoutesResponse, PolicyBasedRoute>() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListPolicyBasedRoutesRequest injectToken( - ListPolicyBasedRoutesRequest payload, String token) { - return ListPolicyBasedRoutesRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListPolicyBasedRoutesRequest injectPageSize( - ListPolicyBasedRoutesRequest payload, int pageSize) { - return ListPolicyBasedRoutesRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListPolicyBasedRoutesRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListPolicyBasedRoutesResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources( - ListPolicyBasedRoutesResponse payload) { - return payload.getPolicyBasedRoutesList() == null - ? ImmutableList.of() - : payload.getPolicyBasedRoutesList(); - } - }; - - private static final PagedListResponseFactory< - ListPolicyBasedRoutesRequest, - ListPolicyBasedRoutesResponse, - ListPolicyBasedRoutesPagedResponse> - LIST_POLICY_BASED_ROUTES_PAGE_STR_FACT = - new PagedListResponseFactory< - ListPolicyBasedRoutesRequest, - ListPolicyBasedRoutesResponse, - ListPolicyBasedRoutesPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListPolicyBasedRoutesRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext< - ListPolicyBasedRoutesRequest, ListPolicyBasedRoutesResponse, PolicyBasedRoute> - pageContext = - PageContext.create( - callable, LIST_POLICY_BASED_ROUTES_PAGE_STR_DESC, request, context); - return ListPolicyBasedRoutesPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - /** Returns the object with the settings used for calls to listPolicyBasedRoutes. */ - public PagedCallSettings< - ListPolicyBasedRoutesRequest, - ListPolicyBasedRoutesResponse, - ListPolicyBasedRoutesPagedResponse> - listPolicyBasedRoutesSettings() { - return listPolicyBasedRoutesSettings; - } - - /** Returns the object with the settings used for calls to getPolicyBasedRoute. */ - public UnaryCallSettings - getPolicyBasedRouteSettings() { - return getPolicyBasedRouteSettings; - } - - /** Returns the object with the settings used for calls to createPolicyBasedRoute. */ - public UnaryCallSettings - createPolicyBasedRouteSettings() { - return createPolicyBasedRouteSettings; - } - - /** Returns the object with the settings used for calls to createPolicyBasedRoute. */ - public OperationCallSettings - createPolicyBasedRouteOperationSettings() { - return createPolicyBasedRouteOperationSettings; - } - - /** Returns the object with the settings used for calls to deletePolicyBasedRoute. */ - public UnaryCallSettings - deletePolicyBasedRouteSettings() { - return deletePolicyBasedRouteSettings; - } - - /** Returns the object with the settings used for calls to deletePolicyBasedRoute. */ - public OperationCallSettings - deletePolicyBasedRouteOperationSettings() { - return deletePolicyBasedRouteOperationSettings; - } - - public PolicyBasedRoutingServiceStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcPolicyBasedRoutingServiceStub.create(this); - } - throw new UnsupportedOperationException( - String.format( - "Transport not supported: %s", getTransportChannelProvider().getTransportName())); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return InstantiatingExecutorProvider.newBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return "networkconnectivity.googleapis.com:443"; - } - - /** Returns the default mTLS service endpoint. */ - public static String getDefaultMtlsEndpoint() { - return "networkconnectivity.mtls.googleapis.com:443"; - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return DEFAULT_SERVICE_SCOPES; - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder() - .setScopesToApply(DEFAULT_SERVICE_SCOPES) - .setUseJwtAccessWithScope(true); - } - - /** Returns a builder for the default ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return defaultGrpcTransportProviderBuilder().build(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken( - "gapic", GaxProperties.getLibraryVersion(PolicyBasedRoutingServiceStubSettings.class)) - .setTransportToken( - GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected PolicyBasedRoutingServiceStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - - listPolicyBasedRoutesSettings = settingsBuilder.listPolicyBasedRoutesSettings().build(); - getPolicyBasedRouteSettings = settingsBuilder.getPolicyBasedRouteSettings().build(); - createPolicyBasedRouteSettings = settingsBuilder.createPolicyBasedRouteSettings().build(); - createPolicyBasedRouteOperationSettings = - settingsBuilder.createPolicyBasedRouteOperationSettings().build(); - deletePolicyBasedRouteSettings = settingsBuilder.deletePolicyBasedRouteSettings().build(); - deletePolicyBasedRouteOperationSettings = - settingsBuilder.deletePolicyBasedRouteOperationSettings().build(); - } - - /** Builder for PolicyBasedRoutingServiceStubSettings. */ - public static class Builder - extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; - private final PagedCallSettings.Builder< - ListPolicyBasedRoutesRequest, - ListPolicyBasedRoutesResponse, - ListPolicyBasedRoutesPagedResponse> - listPolicyBasedRoutesSettings; - private final UnaryCallSettings.Builder - getPolicyBasedRouteSettings; - private final UnaryCallSettings.Builder - createPolicyBasedRouteSettings; - private final OperationCallSettings.Builder< - CreatePolicyBasedRouteRequest, PolicyBasedRoute, OperationMetadata> - createPolicyBasedRouteOperationSettings; - private final UnaryCallSettings.Builder - deletePolicyBasedRouteSettings; - private final OperationCallSettings.Builder< - DeletePolicyBasedRouteRequest, Empty, OperationMetadata> - deletePolicyBasedRouteOperationSettings; - private static final ImmutableMap> - RETRYABLE_CODE_DEFINITIONS; - - static { - ImmutableMap.Builder> definitions = - ImmutableMap.builder(); - definitions.put( - "retry_policy_0_codes", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); - RETRYABLE_CODE_DEFINITIONS = definitions.build(); - } - - private static final ImmutableMap RETRY_PARAM_DEFINITIONS; - - static { - ImmutableMap.Builder definitions = ImmutableMap.builder(); - RetrySettings settings = null; - settings = - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(1000L)) - .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(10000L)) - .setInitialRpcTimeout(Duration.ofMillis(60000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(60000L)) - .setTotalTimeout(Duration.ofMillis(60000L)) - .build(); - definitions.put("retry_policy_0_params", settings); - settings = - RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(60000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(60000L)) - .setTotalTimeout(Duration.ofMillis(60000L)) - .build(); - definitions.put("no_retry_1_params", settings); - RETRY_PARAM_DEFINITIONS = definitions.build(); - } - - protected Builder() { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(clientContext); - - listPolicyBasedRoutesSettings = - PagedCallSettings.newBuilder(LIST_POLICY_BASED_ROUTES_PAGE_STR_FACT); - getPolicyBasedRouteSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - createPolicyBasedRouteSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - createPolicyBasedRouteOperationSettings = OperationCallSettings.newBuilder(); - deletePolicyBasedRouteSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - deletePolicyBasedRouteOperationSettings = OperationCallSettings.newBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - listPolicyBasedRoutesSettings, - getPolicyBasedRouteSettings, - createPolicyBasedRouteSettings, - deletePolicyBasedRouteSettings); - initDefaults(this); - } - - protected Builder(PolicyBasedRoutingServiceStubSettings settings) { - super(settings); - - listPolicyBasedRoutesSettings = settings.listPolicyBasedRoutesSettings.toBuilder(); - getPolicyBasedRouteSettings = settings.getPolicyBasedRouteSettings.toBuilder(); - createPolicyBasedRouteSettings = settings.createPolicyBasedRouteSettings.toBuilder(); - createPolicyBasedRouteOperationSettings = - settings.createPolicyBasedRouteOperationSettings.toBuilder(); - deletePolicyBasedRouteSettings = settings.deletePolicyBasedRouteSettings.toBuilder(); - deletePolicyBasedRouteOperationSettings = - settings.deletePolicyBasedRouteOperationSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - listPolicyBasedRoutesSettings, - getPolicyBasedRouteSettings, - createPolicyBasedRouteSettings, - deletePolicyBasedRouteSettings); - } - - private static Builder createDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - builder - .listPolicyBasedRoutesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .getPolicyBasedRouteSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .createPolicyBasedRouteSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); - - builder - .deletePolicyBasedRouteSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); - - builder - .createPolicyBasedRouteOperationSettings() - .setInitialCallSettings( - UnaryCallSettings - .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) - .build()) - .setResponseTransformer( - ProtoOperationTransformers.ResponseTransformer.create(PolicyBasedRoute.class)) - .setMetadataTransformer( - ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) - .setPollingAlgorithm( - OperationTimedPollAlgorithm.create( - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(5000L)) - .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(45000L)) - .setInitialRpcTimeout(Duration.ZERO) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ZERO) - .setTotalTimeout(Duration.ofMillis(300000L)) - .build())); - - builder - .deletePolicyBasedRouteOperationSettings() - .setInitialCallSettings( - UnaryCallSettings - .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) - .build()) - .setResponseTransformer( - ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) - .setMetadataTransformer( - ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) - .setPollingAlgorithm( - OperationTimedPollAlgorithm.create( - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(5000L)) - .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(45000L)) - .setInitialRpcTimeout(Duration.ZERO) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ZERO) - .setTotalTimeout(Duration.ofMillis(300000L)) - .build())); - - return builder; - } - - /** - * 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) { - super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); - return this; - } - - public ImmutableList> unaryMethodSettingsBuilders() { - return unaryMethodSettingsBuilders; - } - - /** Returns the builder for the settings used for calls to listPolicyBasedRoutes. */ - public PagedCallSettings.Builder< - ListPolicyBasedRoutesRequest, - ListPolicyBasedRoutesResponse, - ListPolicyBasedRoutesPagedResponse> - listPolicyBasedRoutesSettings() { - return listPolicyBasedRoutesSettings; - } - - /** Returns the builder for the settings used for calls to getPolicyBasedRoute. */ - public UnaryCallSettings.Builder - getPolicyBasedRouteSettings() { - return getPolicyBasedRouteSettings; - } - - /** Returns the builder for the settings used for calls to createPolicyBasedRoute. */ - public UnaryCallSettings.Builder - createPolicyBasedRouteSettings() { - return createPolicyBasedRouteSettings; - } - - /** Returns the builder for the settings used for calls to createPolicyBasedRoute. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings.Builder< - CreatePolicyBasedRouteRequest, PolicyBasedRoute, OperationMetadata> - createPolicyBasedRouteOperationSettings() { - return createPolicyBasedRouteOperationSettings; - } - - /** Returns the builder for the settings used for calls to deletePolicyBasedRoute. */ - public UnaryCallSettings.Builder - deletePolicyBasedRouteSettings() { - return deletePolicyBasedRouteSettings; - } - - /** Returns the builder for the settings used for calls to deletePolicyBasedRoute. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings.Builder - deletePolicyBasedRouteOperationSettings() { - return deletePolicyBasedRouteOperationSettings; - } - - @Override - public PolicyBasedRoutingServiceStubSettings build() throws IOException { - return new PolicyBasedRoutingServiceStubSettings(this); - } - } -} diff --git a/java-networkconnectivity/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1/MockPolicyBasedRoutingService.java b/java-networkconnectivity/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1/MockPolicyBasedRoutingService.java deleted file mode 100644 index 14c65288159c..000000000000 --- a/java-networkconnectivity/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1/MockPolicyBasedRoutingService.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.protobuf.AbstractMessage; -import io.grpc.ServerServiceDefinition; -import java.util.List; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockPolicyBasedRoutingService implements MockGrpcService { - private final MockPolicyBasedRoutingServiceImpl serviceImpl; - - public MockPolicyBasedRoutingService() { - serviceImpl = new MockPolicyBasedRoutingServiceImpl(); - } - - @Override - public List getRequests() { - return serviceImpl.getRequests(); - } - - @Override - public void addResponse(AbstractMessage response) { - serviceImpl.addResponse(response); - } - - @Override - public void addException(Exception exception) { - serviceImpl.addException(exception); - } - - @Override - public ServerServiceDefinition getServiceDefinition() { - return serviceImpl.bindService(); - } - - @Override - public void reset() { - serviceImpl.reset(); - } -} diff --git a/java-networkconnectivity/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1/MockPolicyBasedRoutingServiceImpl.java b/java-networkconnectivity/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1/MockPolicyBasedRoutingServiceImpl.java deleted file mode 100644 index a57877e4d35a..000000000000 --- a/java-networkconnectivity/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1/MockPolicyBasedRoutingServiceImpl.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1; - -import com.google.api.core.BetaApi; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceGrpc.PolicyBasedRoutingServiceImplBase; -import com.google.longrunning.Operation; -import com.google.protobuf.AbstractMessage; -import io.grpc.stub.StreamObserver; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.Queue; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockPolicyBasedRoutingServiceImpl extends PolicyBasedRoutingServiceImplBase { - private List requests; - private Queue responses; - - public MockPolicyBasedRoutingServiceImpl() { - requests = new ArrayList<>(); - responses = new LinkedList<>(); - } - - public List getRequests() { - return requests; - } - - public void addResponse(AbstractMessage response) { - responses.add(response); - } - - public void setResponses(List responses) { - this.responses = new LinkedList(responses); - } - - public void addException(Exception exception) { - responses.add(exception); - } - - public void reset() { - requests = new ArrayList<>(); - responses = new LinkedList<>(); - } - - @Override - public void listPolicyBasedRoutes( - ListPolicyBasedRoutesRequest request, - StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof ListPolicyBasedRoutesResponse) { - requests.add(request); - responseObserver.onNext(((ListPolicyBasedRoutesResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method ListPolicyBasedRoutes, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ListPolicyBasedRoutesResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getPolicyBasedRoute( - GetPolicyBasedRouteRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof PolicyBasedRoute) { - requests.add(request); - responseObserver.onNext(((PolicyBasedRoute) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method GetPolicyBasedRoute, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - PolicyBasedRoute.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void createPolicyBasedRoute( - CreatePolicyBasedRouteRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Operation) { - requests.add(request); - responseObserver.onNext(((Operation) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method CreatePolicyBasedRoute, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Operation.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void deletePolicyBasedRoute( - DeletePolicyBasedRouteRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Operation) { - requests.add(request); - responseObserver.onNext(((Operation) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method DeletePolicyBasedRoute, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Operation.class.getName(), - Exception.class.getName()))); - } - } -} diff --git a/java-networkconnectivity/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRoutingServiceClientTest.java b/java-networkconnectivity/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRoutingServiceClientTest.java deleted file mode 100644 index eb5fa73866eb..000000000000 --- a/java-networkconnectivity/google-cloud-networkconnectivity/src/test/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRoutingServiceClientTest.java +++ /dev/null @@ -1,501 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1; - -import static com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient.ListPolicyBasedRoutesPagedResponse; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.testing.LocalChannelProvider; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.api.gax.grpc.testing.MockServiceHelper; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode; -import com.google.common.collect.Lists; -import com.google.longrunning.Operation; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.Any; -import com.google.protobuf.Empty; -import com.google.protobuf.Timestamp; -import io.grpc.StatusRuntimeException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.UUID; -import java.util.concurrent.ExecutionException; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class PolicyBasedRoutingServiceClientTest { - private static MockPolicyBasedRoutingService mockPolicyBasedRoutingService; - private static MockServiceHelper mockServiceHelper; - private LocalChannelProvider channelProvider; - private PolicyBasedRoutingServiceClient client; - - @BeforeClass - public static void startStaticServer() { - mockPolicyBasedRoutingService = new MockPolicyBasedRoutingService(); - mockServiceHelper = - new MockServiceHelper( - UUID.randomUUID().toString(), - Arrays.asList(mockPolicyBasedRoutingService)); - mockServiceHelper.start(); - } - - @AfterClass - public static void stopServer() { - mockServiceHelper.stop(); - } - - @Before - public void setUp() throws IOException { - mockServiceHelper.reset(); - channelProvider = mockServiceHelper.createChannelProvider(); - PolicyBasedRoutingServiceSettings settings = - PolicyBasedRoutingServiceSettings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = PolicyBasedRoutingServiceClient.create(settings); - } - - @After - public void tearDown() throws Exception { - client.close(); - } - - @Test - public void listPolicyBasedRoutesTest() throws Exception { - PolicyBasedRoute responsesElement = PolicyBasedRoute.newBuilder().build(); - ListPolicyBasedRoutesResponse expectedResponse = - ListPolicyBasedRoutesResponse.newBuilder() - .setNextPageToken("") - .addAllPolicyBasedRoutes(Arrays.asList(responsesElement)) - .build(); - mockPolicyBasedRoutingService.addResponse(expectedResponse); - - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - - ListPolicyBasedRoutesPagedResponse pagedListResponse = client.listPolicyBasedRoutes(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getPolicyBasedRoutesList().get(0), resources.get(0)); - - List actualRequests = mockPolicyBasedRoutingService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListPolicyBasedRoutesRequest actualRequest = - ((ListPolicyBasedRoutesRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listPolicyBasedRoutesExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockPolicyBasedRoutingService.addException(exception); - - try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - client.listPolicyBasedRoutes(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listPolicyBasedRoutesTest2() throws Exception { - PolicyBasedRoute responsesElement = PolicyBasedRoute.newBuilder().build(); - ListPolicyBasedRoutesResponse expectedResponse = - ListPolicyBasedRoutesResponse.newBuilder() - .setNextPageToken("") - .addAllPolicyBasedRoutes(Arrays.asList(responsesElement)) - .build(); - mockPolicyBasedRoutingService.addResponse(expectedResponse); - - String parent = "parent-995424086"; - - ListPolicyBasedRoutesPagedResponse pagedListResponse = client.listPolicyBasedRoutes(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getPolicyBasedRoutesList().get(0), resources.get(0)); - - List actualRequests = mockPolicyBasedRoutingService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListPolicyBasedRoutesRequest actualRequest = - ((ListPolicyBasedRoutesRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listPolicyBasedRoutesExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockPolicyBasedRoutingService.addException(exception); - - try { - String parent = "parent-995424086"; - client.listPolicyBasedRoutes(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getPolicyBasedRouteTest() throws Exception { - PolicyBasedRoute expectedResponse = - PolicyBasedRoute.newBuilder() - .setName( - PolicyBasedRouteName.of("[PROJECT]", "[LOCATION]", "[POLICY_BASED_ROUTE]") - .toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .putAllLabels(new HashMap()) - .setDescription("description-1724546052") - .setNetwork("network1843485230") - .setFilter(PolicyBasedRoute.Filter.newBuilder().build()) - .setPriority(-1165461084) - .addAllWarnings(new ArrayList()) - .setSelfLink("selfLink1191800166") - .setKind("kind3292052") - .build(); - mockPolicyBasedRoutingService.addResponse(expectedResponse); - - PolicyBasedRouteName name = - PolicyBasedRouteName.of("[PROJECT]", "[LOCATION]", "[POLICY_BASED_ROUTE]"); - - PolicyBasedRoute actualResponse = client.getPolicyBasedRoute(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockPolicyBasedRoutingService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetPolicyBasedRouteRequest actualRequest = ((GetPolicyBasedRouteRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getPolicyBasedRouteExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockPolicyBasedRoutingService.addException(exception); - - try { - PolicyBasedRouteName name = - PolicyBasedRouteName.of("[PROJECT]", "[LOCATION]", "[POLICY_BASED_ROUTE]"); - client.getPolicyBasedRoute(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getPolicyBasedRouteTest2() throws Exception { - PolicyBasedRoute expectedResponse = - PolicyBasedRoute.newBuilder() - .setName( - PolicyBasedRouteName.of("[PROJECT]", "[LOCATION]", "[POLICY_BASED_ROUTE]") - .toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .putAllLabels(new HashMap()) - .setDescription("description-1724546052") - .setNetwork("network1843485230") - .setFilter(PolicyBasedRoute.Filter.newBuilder().build()) - .setPriority(-1165461084) - .addAllWarnings(new ArrayList()) - .setSelfLink("selfLink1191800166") - .setKind("kind3292052") - .build(); - mockPolicyBasedRoutingService.addResponse(expectedResponse); - - String name = "name3373707"; - - PolicyBasedRoute actualResponse = client.getPolicyBasedRoute(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockPolicyBasedRoutingService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetPolicyBasedRouteRequest actualRequest = ((GetPolicyBasedRouteRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getPolicyBasedRouteExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockPolicyBasedRoutingService.addException(exception); - - try { - String name = "name3373707"; - client.getPolicyBasedRoute(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createPolicyBasedRouteTest() throws Exception { - PolicyBasedRoute expectedResponse = - PolicyBasedRoute.newBuilder() - .setName( - PolicyBasedRouteName.of("[PROJECT]", "[LOCATION]", "[POLICY_BASED_ROUTE]") - .toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .putAllLabels(new HashMap()) - .setDescription("description-1724546052") - .setNetwork("network1843485230") - .setFilter(PolicyBasedRoute.Filter.newBuilder().build()) - .setPriority(-1165461084) - .addAllWarnings(new ArrayList()) - .setSelfLink("selfLink1191800166") - .setKind("kind3292052") - .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("createPolicyBasedRouteTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockPolicyBasedRoutingService.addResponse(resultOperation); - - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - PolicyBasedRoute policyBasedRoute = PolicyBasedRoute.newBuilder().build(); - String policyBasedRouteId = "policyBasedRouteId-18034589"; - - PolicyBasedRoute actualResponse = - client.createPolicyBasedRouteAsync(parent, policyBasedRoute, policyBasedRouteId).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockPolicyBasedRoutingService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreatePolicyBasedRouteRequest actualRequest = - ((CreatePolicyBasedRouteRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(policyBasedRoute, actualRequest.getPolicyBasedRoute()); - Assert.assertEquals(policyBasedRouteId, actualRequest.getPolicyBasedRouteId()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createPolicyBasedRouteExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockPolicyBasedRoutingService.addException(exception); - - try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - PolicyBasedRoute policyBasedRoute = PolicyBasedRoute.newBuilder().build(); - String policyBasedRouteId = "policyBasedRouteId-18034589"; - client.createPolicyBasedRouteAsync(parent, policyBasedRoute, policyBasedRouteId).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - @Test - public void createPolicyBasedRouteTest2() throws Exception { - PolicyBasedRoute expectedResponse = - PolicyBasedRoute.newBuilder() - .setName( - PolicyBasedRouteName.of("[PROJECT]", "[LOCATION]", "[POLICY_BASED_ROUTE]") - .toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .putAllLabels(new HashMap()) - .setDescription("description-1724546052") - .setNetwork("network1843485230") - .setFilter(PolicyBasedRoute.Filter.newBuilder().build()) - .setPriority(-1165461084) - .addAllWarnings(new ArrayList()) - .setSelfLink("selfLink1191800166") - .setKind("kind3292052") - .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("createPolicyBasedRouteTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockPolicyBasedRoutingService.addResponse(resultOperation); - - String parent = "parent-995424086"; - PolicyBasedRoute policyBasedRoute = PolicyBasedRoute.newBuilder().build(); - String policyBasedRouteId = "policyBasedRouteId-18034589"; - - PolicyBasedRoute actualResponse = - client.createPolicyBasedRouteAsync(parent, policyBasedRoute, policyBasedRouteId).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockPolicyBasedRoutingService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreatePolicyBasedRouteRequest actualRequest = - ((CreatePolicyBasedRouteRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertEquals(policyBasedRoute, actualRequest.getPolicyBasedRoute()); - Assert.assertEquals(policyBasedRouteId, actualRequest.getPolicyBasedRouteId()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createPolicyBasedRouteExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockPolicyBasedRoutingService.addException(exception); - - try { - String parent = "parent-995424086"; - PolicyBasedRoute policyBasedRoute = PolicyBasedRoute.newBuilder().build(); - String policyBasedRouteId = "policyBasedRouteId-18034589"; - client.createPolicyBasedRouteAsync(parent, policyBasedRoute, policyBasedRouteId).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - @Test - public void deletePolicyBasedRouteTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - Operation resultOperation = - Operation.newBuilder() - .setName("deletePolicyBasedRouteTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockPolicyBasedRoutingService.addResponse(resultOperation); - - PolicyBasedRouteName name = - PolicyBasedRouteName.of("[PROJECT]", "[LOCATION]", "[POLICY_BASED_ROUTE]"); - - client.deletePolicyBasedRouteAsync(name).get(); - - List actualRequests = mockPolicyBasedRoutingService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeletePolicyBasedRouteRequest actualRequest = - ((DeletePolicyBasedRouteRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deletePolicyBasedRouteExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockPolicyBasedRoutingService.addException(exception); - - try { - PolicyBasedRouteName name = - PolicyBasedRouteName.of("[PROJECT]", "[LOCATION]", "[POLICY_BASED_ROUTE]"); - client.deletePolicyBasedRouteAsync(name).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - @Test - public void deletePolicyBasedRouteTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - Operation resultOperation = - Operation.newBuilder() - .setName("deletePolicyBasedRouteTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockPolicyBasedRoutingService.addResponse(resultOperation); - - String name = "name3373707"; - - client.deletePolicyBasedRouteAsync(name).get(); - - List actualRequests = mockPolicyBasedRoutingService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeletePolicyBasedRouteRequest actualRequest = - ((DeletePolicyBasedRouteRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deletePolicyBasedRouteExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockPolicyBasedRoutingService.addException(exception); - - try { - String name = "name3373707"; - client.deletePolicyBasedRouteAsync(name).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } -} diff --git a/java-networkconnectivity/grpc-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRoutingServiceGrpc.java b/java-networkconnectivity/grpc-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRoutingServiceGrpc.java deleted file mode 100644 index 40eca2fa82af..000000000000 --- a/java-networkconnectivity/grpc-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRoutingServiceGrpc.java +++ /dev/null @@ -1,757 +0,0 @@ -/* - * Copyright 2020 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.networkconnectivity.v1; - -import static io.grpc.MethodDescriptor.generateFullMethodName; - -/** - * - * - *
- * Policy-Based Routing allows GCP customers to specify flexibile routing
- * policies for Layer 4 traffic traversing through the connected service.
- * 
- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: google/cloud/networkconnectivity/v1/policy_based_routing.proto") -@io.grpc.stub.annotations.GrpcGenerated -public final class PolicyBasedRoutingServiceGrpc { - - private PolicyBasedRoutingServiceGrpc() {} - - public static final String SERVICE_NAME = - "google.cloud.networkconnectivity.v1.PolicyBasedRoutingService"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest, - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse> - getListPolicyBasedRoutesMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ListPolicyBasedRoutes", - requestType = com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest.class, - responseType = com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest, - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse> - getListPolicyBasedRoutesMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest, - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse> - getListPolicyBasedRoutesMethod; - if ((getListPolicyBasedRoutesMethod = - PolicyBasedRoutingServiceGrpc.getListPolicyBasedRoutesMethod) - == null) { - synchronized (PolicyBasedRoutingServiceGrpc.class) { - if ((getListPolicyBasedRoutesMethod = - PolicyBasedRoutingServiceGrpc.getListPolicyBasedRoutesMethod) - == null) { - PolicyBasedRoutingServiceGrpc.getListPolicyBasedRoutesMethod = - getListPolicyBasedRoutesMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - generateFullMethodName(SERVICE_NAME, "ListPolicyBasedRoutes")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse - .getDefaultInstance())) - .setSchemaDescriptor( - new PolicyBasedRoutingServiceMethodDescriptorSupplier( - "ListPolicyBasedRoutes")) - .build(); - } - } - } - return getListPolicyBasedRoutesMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute> - getGetPolicyBasedRouteMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetPolicyBasedRoute", - requestType = com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest.class, - responseType = com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute> - getGetPolicyBasedRouteMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute> - getGetPolicyBasedRouteMethod; - if ((getGetPolicyBasedRouteMethod = PolicyBasedRoutingServiceGrpc.getGetPolicyBasedRouteMethod) - == null) { - synchronized (PolicyBasedRoutingServiceGrpc.class) { - if ((getGetPolicyBasedRouteMethod = - PolicyBasedRoutingServiceGrpc.getGetPolicyBasedRouteMethod) - == null) { - PolicyBasedRoutingServiceGrpc.getGetPolicyBasedRouteMethod = - getGetPolicyBasedRouteMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - generateFullMethodName(SERVICE_NAME, "GetPolicyBasedRoute")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute - .getDefaultInstance())) - .setSchemaDescriptor( - new PolicyBasedRoutingServiceMethodDescriptorSupplier( - "GetPolicyBasedRoute")) - .build(); - } - } - } - return getGetPolicyBasedRouteMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest, - com.google.longrunning.Operation> - getCreatePolicyBasedRouteMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "CreatePolicyBasedRoute", - requestType = com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest.class, - responseType = com.google.longrunning.Operation.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest, - com.google.longrunning.Operation> - getCreatePolicyBasedRouteMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest, - com.google.longrunning.Operation> - getCreatePolicyBasedRouteMethod; - if ((getCreatePolicyBasedRouteMethod = - PolicyBasedRoutingServiceGrpc.getCreatePolicyBasedRouteMethod) - == null) { - synchronized (PolicyBasedRoutingServiceGrpc.class) { - if ((getCreatePolicyBasedRouteMethod = - PolicyBasedRoutingServiceGrpc.getCreatePolicyBasedRouteMethod) - == null) { - PolicyBasedRoutingServiceGrpc.getCreatePolicyBasedRouteMethod = - getCreatePolicyBasedRouteMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - generateFullMethodName(SERVICE_NAME, "CreatePolicyBasedRoute")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.longrunning.Operation.getDefaultInstance())) - .setSchemaDescriptor( - new PolicyBasedRoutingServiceMethodDescriptorSupplier( - "CreatePolicyBasedRoute")) - .build(); - } - } - } - return getCreatePolicyBasedRouteMethod; - } - - private static volatile io.grpc.MethodDescriptor< - com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest, - com.google.longrunning.Operation> - getDeletePolicyBasedRouteMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "DeletePolicyBasedRoute", - requestType = com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest.class, - responseType = com.google.longrunning.Operation.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor< - com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest, - com.google.longrunning.Operation> - getDeletePolicyBasedRouteMethod() { - io.grpc.MethodDescriptor< - com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest, - com.google.longrunning.Operation> - getDeletePolicyBasedRouteMethod; - if ((getDeletePolicyBasedRouteMethod = - PolicyBasedRoutingServiceGrpc.getDeletePolicyBasedRouteMethod) - == null) { - synchronized (PolicyBasedRoutingServiceGrpc.class) { - if ((getDeletePolicyBasedRouteMethod = - PolicyBasedRoutingServiceGrpc.getDeletePolicyBasedRouteMethod) - == null) { - PolicyBasedRoutingServiceGrpc.getDeletePolicyBasedRouteMethod = - getDeletePolicyBasedRouteMethod = - io.grpc.MethodDescriptor - . - newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - generateFullMethodName(SERVICE_NAME, "DeletePolicyBasedRoute")) - .setSampledToLocalTracing(true) - .setRequestMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest - .getDefaultInstance())) - .setResponseMarshaller( - io.grpc.protobuf.ProtoUtils.marshaller( - com.google.longrunning.Operation.getDefaultInstance())) - .setSchemaDescriptor( - new PolicyBasedRoutingServiceMethodDescriptorSupplier( - "DeletePolicyBasedRoute")) - .build(); - } - } - } - return getDeletePolicyBasedRouteMethod; - } - - /** Creates a new async stub that supports all call types for the service */ - public static PolicyBasedRoutingServiceStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public PolicyBasedRoutingServiceStub newStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new PolicyBasedRoutingServiceStub(channel, callOptions); - } - }; - return PolicyBasedRoutingServiceStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static PolicyBasedRoutingServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public PolicyBasedRoutingServiceBlockingStub newStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new PolicyBasedRoutingServiceBlockingStub(channel, callOptions); - } - }; - return PolicyBasedRoutingServiceBlockingStub.newStub(factory, channel); - } - - /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ - public static PolicyBasedRoutingServiceFutureStub newFutureStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public PolicyBasedRoutingServiceFutureStub newStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new PolicyBasedRoutingServiceFutureStub(channel, callOptions); - } - }; - return PolicyBasedRoutingServiceFutureStub.newStub(factory, channel); - } - - /** - * - * - *
-   * Policy-Based Routing allows GCP customers to specify flexibile routing
-   * policies for Layer 4 traffic traversing through the connected service.
-   * 
- */ - public abstract static class PolicyBasedRoutingServiceImplBase - implements io.grpc.BindableService { - - /** - * - * - *
-     * Lists PolicyBasedRoutes in a given project and location.
-     * 
- */ - public void listPolicyBasedRoutes( - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest request, - io.grpc.stub.StreamObserver< - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse> - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getListPolicyBasedRoutesMethod(), responseObserver); - } - - /** - * - * - *
-     * Gets details of a single PolicyBasedRoute.
-     * 
- */ - public void getPolicyBasedRoute( - com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getGetPolicyBasedRouteMethod(), responseObserver); - } - - /** - * - * - *
-     * Creates a new PolicyBasedRoute in a given project and location.
-     * 
- */ - public void createPolicyBasedRoute( - com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getCreatePolicyBasedRouteMethod(), responseObserver); - } - - /** - * - * - *
-     * Deletes a single PolicyBasedRoute.
-     * 
- */ - public void deletePolicyBasedRoute( - com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( - getDeletePolicyBasedRouteMethod(), responseObserver); - } - - @java.lang.Override - public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getListPolicyBasedRoutesMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest, - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse>( - this, METHODID_LIST_POLICY_BASED_ROUTES))) - .addMethod( - getGetPolicyBasedRouteMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute>( - this, METHODID_GET_POLICY_BASED_ROUTE))) - .addMethod( - getCreatePolicyBasedRouteMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest, - com.google.longrunning.Operation>(this, METHODID_CREATE_POLICY_BASED_ROUTE))) - .addMethod( - getDeletePolicyBasedRouteMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest, - com.google.longrunning.Operation>(this, METHODID_DELETE_POLICY_BASED_ROUTE))) - .build(); - } - } - - /** - * - * - *
-   * Policy-Based Routing allows GCP customers to specify flexibile routing
-   * policies for Layer 4 traffic traversing through the connected service.
-   * 
- */ - public static final class PolicyBasedRoutingServiceStub - extends io.grpc.stub.AbstractAsyncStub { - private PolicyBasedRoutingServiceStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected PolicyBasedRoutingServiceStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new PolicyBasedRoutingServiceStub(channel, callOptions); - } - - /** - * - * - *
-     * Lists PolicyBasedRoutes in a given project and location.
-     * 
- */ - public void listPolicyBasedRoutes( - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest request, - io.grpc.stub.StreamObserver< - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse> - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListPolicyBasedRoutesMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Gets details of a single PolicyBasedRoute.
-     * 
- */ - public void getPolicyBasedRoute( - com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetPolicyBasedRouteMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Creates a new PolicyBasedRoute in a given project and location.
-     * 
- */ - public void createPolicyBasedRoute( - com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCreatePolicyBasedRouteMethod(), getCallOptions()), - request, - responseObserver); - } - - /** - * - * - *
-     * Deletes a single PolicyBasedRoute.
-     * 
- */ - public void deletePolicyBasedRoute( - com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDeletePolicyBasedRouteMethod(), getCallOptions()), - request, - responseObserver); - } - } - - /** - * - * - *
-   * Policy-Based Routing allows GCP customers to specify flexibile routing
-   * policies for Layer 4 traffic traversing through the connected service.
-   * 
- */ - public static final class PolicyBasedRoutingServiceBlockingStub - extends io.grpc.stub.AbstractBlockingStub { - private PolicyBasedRoutingServiceBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected PolicyBasedRoutingServiceBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new PolicyBasedRoutingServiceBlockingStub(channel, callOptions); - } - - /** - * - * - *
-     * Lists PolicyBasedRoutes in a given project and location.
-     * 
- */ - public com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse - listPolicyBasedRoutes( - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListPolicyBasedRoutesMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Gets details of a single PolicyBasedRoute.
-     * 
- */ - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute getPolicyBasedRoute( - com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetPolicyBasedRouteMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Creates a new PolicyBasedRoute in a given project and location.
-     * 
- */ - public com.google.longrunning.Operation createPolicyBasedRoute( - com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getCreatePolicyBasedRouteMethod(), getCallOptions(), request); - } - - /** - * - * - *
-     * Deletes a single PolicyBasedRoute.
-     * 
- */ - public com.google.longrunning.Operation deletePolicyBasedRoute( - com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDeletePolicyBasedRouteMethod(), getCallOptions(), request); - } - } - - /** - * - * - *
-   * Policy-Based Routing allows GCP customers to specify flexibile routing
-   * policies for Layer 4 traffic traversing through the connected service.
-   * 
- */ - public static final class PolicyBasedRoutingServiceFutureStub - extends io.grpc.stub.AbstractFutureStub { - private PolicyBasedRoutingServiceFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected PolicyBasedRoutingServiceFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new PolicyBasedRoutingServiceFutureStub(channel, callOptions); - } - - /** - * - * - *
-     * Lists PolicyBasedRoutes in a given project and location.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse> - listPolicyBasedRoutes( - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListPolicyBasedRoutesMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Gets details of a single PolicyBasedRoute.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture< - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute> - getPolicyBasedRoute( - com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetPolicyBasedRouteMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Creates a new PolicyBasedRoute in a given project and location.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - createPolicyBasedRoute( - com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getCreatePolicyBasedRouteMethod(), getCallOptions()), request); - } - - /** - * - * - *
-     * Deletes a single PolicyBasedRoute.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture - deletePolicyBasedRoute( - com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDeletePolicyBasedRouteMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_LIST_POLICY_BASED_ROUTES = 0; - private static final int METHODID_GET_POLICY_BASED_ROUTE = 1; - private static final int METHODID_CREATE_POLICY_BASED_ROUTE = 2; - private static final int METHODID_DELETE_POLICY_BASED_ROUTE = 3; - - private static final class MethodHandlers - implements io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final PolicyBasedRoutingServiceImplBase serviceImpl; - private final int methodId; - - MethodHandlers(PolicyBasedRoutingServiceImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_LIST_POLICY_BASED_ROUTES: - serviceImpl.listPolicyBasedRoutes( - (com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest) request, - (io.grpc.stub.StreamObserver< - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse>) - responseObserver); - break; - case METHODID_GET_POLICY_BASED_ROUTE: - serviceImpl.getPolicyBasedRoute( - (com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest) request, - (io.grpc.stub.StreamObserver< - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute>) - responseObserver); - break; - case METHODID_CREATE_POLICY_BASED_ROUTE: - serviceImpl.createPolicyBasedRoute( - (com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DELETE_POLICY_BASED_ROUTE: - serviceImpl.deletePolicyBasedRoute( - (com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - default: - throw new AssertionError(); - } - } - } - - private abstract static class PolicyBasedRoutingServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, - io.grpc.protobuf.ProtoServiceDescriptorSupplier { - PolicyBasedRoutingServiceBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("PolicyBasedRoutingService"); - } - } - - private static final class PolicyBasedRoutingServiceFileDescriptorSupplier - extends PolicyBasedRoutingServiceBaseDescriptorSupplier { - PolicyBasedRoutingServiceFileDescriptorSupplier() {} - } - - private static final class PolicyBasedRoutingServiceMethodDescriptorSupplier - extends PolicyBasedRoutingServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - PolicyBasedRoutingServiceMethodDescriptorSupplier(String methodName) { - this.methodName = methodName; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { - return getServiceDescriptor().findMethodByName(methodName); - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (PolicyBasedRoutingServiceGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = - result = - io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new PolicyBasedRoutingServiceFileDescriptorSupplier()) - .addMethod(getListPolicyBasedRoutesMethod()) - .addMethod(getGetPolicyBasedRouteMethod()) - .addMethod(getCreatePolicyBasedRouteMethod()) - .addMethod(getDeletePolicyBasedRouteMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/CreatePolicyBasedRouteRequest.java b/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/CreatePolicyBasedRouteRequest.java deleted file mode 100644 index 655d49d58a4d..000000000000 --- a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/CreatePolicyBasedRouteRequest.java +++ /dev/null @@ -1,1386 +0,0 @@ -/* - * Copyright 2020 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. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/networkconnectivity/v1/policy_based_routing.proto - -package com.google.cloud.networkconnectivity.v1; - -/** - * - * - *
- * Request for [PolicyBasedRouting.CreatePolicyBasedRoute][] method.
- * 
- * - * Protobuf type {@code google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest} - */ -public final class CreatePolicyBasedRouteRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest) - CreatePolicyBasedRouteRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use CreatePolicyBasedRouteRequest.newBuilder() to construct. - private CreatePolicyBasedRouteRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private CreatePolicyBasedRouteRequest() { - parent_ = ""; - policyBasedRouteId_ = ""; - requestId_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CreatePolicyBasedRouteRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_CreatePolicyBasedRouteRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_CreatePolicyBasedRouteRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest.class, - com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest.Builder.class); - } - - public static final int PARENT_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object parent_ = ""; - /** - * - * - *
-   * Required. The parent resource's name of the PolicyBasedRoute.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - @java.lang.Override - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The parent resource's name of the PolicyBasedRoute.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - @java.lang.Override - public com.google.protobuf.ByteString getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int POLICY_BASED_ROUTE_ID_FIELD_NUMBER = 2; - - @SuppressWarnings("serial") - private volatile java.lang.Object policyBasedRouteId_ = ""; - /** - * - * - *
-   * Optional. Unique id for the Policy Based Route to create.
-   * 
- * - * string policy_based_route_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The policyBasedRouteId. - */ - @java.lang.Override - public java.lang.String getPolicyBasedRouteId() { - java.lang.Object ref = policyBasedRouteId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - policyBasedRouteId_ = s; - return s; - } - } - /** - * - * - *
-   * Optional. Unique id for the Policy Based Route to create.
-   * 
- * - * string policy_based_route_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for policyBasedRouteId. - */ - @java.lang.Override - public com.google.protobuf.ByteString getPolicyBasedRouteIdBytes() { - java.lang.Object ref = policyBasedRouteId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - policyBasedRouteId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int POLICY_BASED_ROUTE_FIELD_NUMBER = 3; - private com.google.cloud.networkconnectivity.v1.PolicyBasedRoute policyBasedRoute_; - /** - * - * - *
-   * Required. Initial values for a new Policy Based Route.
-   * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_route = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the policyBasedRoute field is set. - */ - @java.lang.Override - public boolean hasPolicyBasedRoute() { - return policyBasedRoute_ != null; - } - /** - * - * - *
-   * Required. Initial values for a new Policy Based Route.
-   * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_route = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The policyBasedRoute. - */ - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute getPolicyBasedRoute() { - return policyBasedRoute_ == null - ? com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.getDefaultInstance() - : policyBasedRoute_; - } - /** - * - * - *
-   * Required. Initial values for a new Policy Based Route.
-   * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_route = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRouteOrBuilder - getPolicyBasedRouteOrBuilder() { - return policyBasedRoute_ == null - ? com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.getDefaultInstance() - : policyBasedRoute_; - } - - public static final int REQUEST_ID_FIELD_NUMBER = 4; - - @SuppressWarnings("serial") - private volatile java.lang.Object requestId_ = ""; - /** - * - * - *
-   * Optional. An optional request ID to identify requests. Specify a unique request ID
-   * so that if you must retry your request, the server will know to ignore
-   * the request if it has already been completed. The server will guarantee
-   * that for at least 60 minutes since the first request.
-   * For example, consider a situation where you make an initial request and t
-   * he request times out. If you make the request again with the same request
-   * ID, the server can check if original operation with the same request ID
-   * was received, and if so, will ignore the second request. This prevents
-   * clients from accidentally creating duplicate commitments.
-   * The request ID must be a valid UUID with the exception that zero UUID is
-   * not supported (00000000-0000-0000-0000-000000000000).
-   * 
- * - * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The requestId. - */ - @java.lang.Override - public java.lang.String getRequestId() { - java.lang.Object ref = requestId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - requestId_ = s; - return s; - } - } - /** - * - * - *
-   * Optional. An optional request ID to identify requests. Specify a unique request ID
-   * so that if you must retry your request, the server will know to ignore
-   * the request if it has already been completed. The server will guarantee
-   * that for at least 60 minutes since the first request.
-   * For example, consider a situation where you make an initial request and t
-   * he request times out. If you make the request again with the same request
-   * ID, the server can check if original operation with the same request ID
-   * was received, and if so, will ignore the second request. This prevents
-   * clients from accidentally creating duplicate commitments.
-   * The request ID must be a valid UUID with the exception that zero UUID is
-   * not supported (00000000-0000-0000-0000-000000000000).
-   * 
- * - * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for requestId. - */ - @java.lang.Override - public com.google.protobuf.ByteString getRequestIdBytes() { - java.lang.Object ref = requestId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - requestId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(policyBasedRouteId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, policyBasedRouteId_); - } - if (policyBasedRoute_ != null) { - output.writeMessage(3, getPolicyBasedRoute()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, requestId_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(policyBasedRouteId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, policyBasedRouteId_); - } - if (policyBasedRoute_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getPolicyBasedRoute()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, requestId_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest)) { - return super.equals(obj); - } - com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest other = - (com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest) obj; - - if (!getParent().equals(other.getParent())) return false; - if (!getPolicyBasedRouteId().equals(other.getPolicyBasedRouteId())) return false; - if (hasPolicyBasedRoute() != other.hasPolicyBasedRoute()) return false; - if (hasPolicyBasedRoute()) { - if (!getPolicyBasedRoute().equals(other.getPolicyBasedRoute())) return false; - } - if (!getRequestId().equals(other.getRequestId())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PARENT_FIELD_NUMBER; - hash = (53 * hash) + getParent().hashCode(); - hash = (37 * hash) + POLICY_BASED_ROUTE_ID_FIELD_NUMBER; - hash = (53 * hash) + getPolicyBasedRouteId().hashCode(); - if (hasPolicyBasedRoute()) { - hash = (37 * hash) + POLICY_BASED_ROUTE_FIELD_NUMBER; - hash = (53 * hash) + getPolicyBasedRoute().hashCode(); - } - hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; - hash = (53 * hash) + getRequestId().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Request for [PolicyBasedRouting.CreatePolicyBasedRoute][] method.
-   * 
- * - * Protobuf type {@code google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest) - com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_CreatePolicyBasedRouteRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_CreatePolicyBasedRouteRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest.class, - com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest.Builder.class); - } - - // Construct using - // com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - parent_ = ""; - policyBasedRouteId_ = ""; - policyBasedRoute_ = null; - if (policyBasedRouteBuilder_ != null) { - policyBasedRouteBuilder_.dispose(); - policyBasedRouteBuilder_ = null; - } - requestId_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_CreatePolicyBasedRouteRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest - getDefaultInstanceForType() { - return com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest build() { - com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest buildPartial() { - com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest result = - new com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0( - com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.parent_ = parent_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.policyBasedRouteId_ = policyBasedRouteId_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.policyBasedRoute_ = - policyBasedRouteBuilder_ == null ? policyBasedRoute_ : policyBasedRouteBuilder_.build(); - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.requestId_ = requestId_; - } - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest) { - return mergeFrom( - (com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest other) { - if (other - == com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest - .getDefaultInstance()) return this; - if (!other.getParent().isEmpty()) { - parent_ = other.parent_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (!other.getPolicyBasedRouteId().isEmpty()) { - policyBasedRouteId_ = other.policyBasedRouteId_; - bitField0_ |= 0x00000002; - onChanged(); - } - if (other.hasPolicyBasedRoute()) { - mergePolicyBasedRoute(other.getPolicyBasedRoute()); - } - if (!other.getRequestId().isEmpty()) { - requestId_ = other.requestId_; - bitField0_ |= 0x00000008; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - parent_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - policyBasedRouteId_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000002; - break; - } // case 18 - case 26: - { - input.readMessage( - getPolicyBasedRouteFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000004; - break; - } // case 26 - case 34: - { - requestId_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000008; - break; - } // case 34 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object parent_ = ""; - /** - * - * - *
-     * Required. The parent resource's name of the PolicyBasedRoute.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The parent resource's name of the PolicyBasedRoute.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - public com.google.protobuf.ByteString getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The parent resource's name of the PolicyBasedRoute.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The parent to set. - * @return This builder for chaining. - */ - public Builder setParent(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - parent_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The parent resource's name of the PolicyBasedRoute.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearParent() { - parent_ = getDefaultInstance().getParent(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The parent resource's name of the PolicyBasedRoute.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for parent to set. - * @return This builder for chaining. - */ - public Builder setParentBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - parent_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private java.lang.Object policyBasedRouteId_ = ""; - /** - * - * - *
-     * Optional. Unique id for the Policy Based Route to create.
-     * 
- * - * string policy_based_route_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The policyBasedRouteId. - */ - public java.lang.String getPolicyBasedRouteId() { - java.lang.Object ref = policyBasedRouteId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - policyBasedRouteId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Optional. Unique id for the Policy Based Route to create.
-     * 
- * - * string policy_based_route_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for policyBasedRouteId. - */ - public com.google.protobuf.ByteString getPolicyBasedRouteIdBytes() { - java.lang.Object ref = policyBasedRouteId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - policyBasedRouteId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Optional. Unique id for the Policy Based Route to create.
-     * 
- * - * string policy_based_route_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The policyBasedRouteId to set. - * @return This builder for chaining. - */ - public Builder setPolicyBasedRouteId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - policyBasedRouteId_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. Unique id for the Policy Based Route to create.
-     * 
- * - * string policy_based_route_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return This builder for chaining. - */ - public Builder clearPolicyBasedRouteId() { - policyBasedRouteId_ = getDefaultInstance().getPolicyBasedRouteId(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. Unique id for the Policy Based Route to create.
-     * 
- * - * string policy_based_route_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The bytes for policyBasedRouteId to set. - * @return This builder for chaining. - */ - public Builder setPolicyBasedRouteIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - policyBasedRouteId_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - private com.google.cloud.networkconnectivity.v1.PolicyBasedRoute policyBasedRoute_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Builder, - com.google.cloud.networkconnectivity.v1.PolicyBasedRouteOrBuilder> - policyBasedRouteBuilder_; - /** - * - * - *
-     * Required. Initial values for a new Policy Based Route.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_route = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the policyBasedRoute field is set. - */ - public boolean hasPolicyBasedRoute() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - * - * - *
-     * Required. Initial values for a new Policy Based Route.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_route = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The policyBasedRoute. - */ - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute getPolicyBasedRoute() { - if (policyBasedRouteBuilder_ == null) { - return policyBasedRoute_ == null - ? com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.getDefaultInstance() - : policyBasedRoute_; - } else { - return policyBasedRouteBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. Initial values for a new Policy Based Route.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_route = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setPolicyBasedRoute( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute value) { - if (policyBasedRouteBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - policyBasedRoute_ = value; - } else { - policyBasedRouteBuilder_.setMessage(value); - } - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Initial values for a new Policy Based Route.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_route = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setPolicyBasedRoute( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Builder builderForValue) { - if (policyBasedRouteBuilder_ == null) { - policyBasedRoute_ = builderForValue.build(); - } else { - policyBasedRouteBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Initial values for a new Policy Based Route.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_route = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergePolicyBasedRoute( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute value) { - if (policyBasedRouteBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0) - && policyBasedRoute_ != null - && policyBasedRoute_ - != com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.getDefaultInstance()) { - getPolicyBasedRouteBuilder().mergeFrom(value); - } else { - policyBasedRoute_ = value; - } - } else { - policyBasedRouteBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Initial values for a new Policy Based Route.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_route = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearPolicyBasedRoute() { - bitField0_ = (bitField0_ & ~0x00000004); - policyBasedRoute_ = null; - if (policyBasedRouteBuilder_ != null) { - policyBasedRouteBuilder_.dispose(); - policyBasedRouteBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Initial values for a new Policy Based Route.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_route = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Builder - getPolicyBasedRouteBuilder() { - bitField0_ |= 0x00000004; - onChanged(); - return getPolicyBasedRouteFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. Initial values for a new Policy Based Route.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_route = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.networkconnectivity.v1.PolicyBasedRouteOrBuilder - getPolicyBasedRouteOrBuilder() { - if (policyBasedRouteBuilder_ != null) { - return policyBasedRouteBuilder_.getMessageOrBuilder(); - } else { - return policyBasedRoute_ == null - ? com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.getDefaultInstance() - : policyBasedRoute_; - } - } - /** - * - * - *
-     * Required. Initial values for a new Policy Based Route.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_route = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Builder, - com.google.cloud.networkconnectivity.v1.PolicyBasedRouteOrBuilder> - getPolicyBasedRouteFieldBuilder() { - if (policyBasedRouteBuilder_ == null) { - policyBasedRouteBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Builder, - com.google.cloud.networkconnectivity.v1.PolicyBasedRouteOrBuilder>( - getPolicyBasedRoute(), getParentForChildren(), isClean()); - policyBasedRoute_ = null; - } - return policyBasedRouteBuilder_; - } - - private java.lang.Object requestId_ = ""; - /** - * - * - *
-     * Optional. An optional request ID to identify requests. Specify a unique request ID
-     * so that if you must retry your request, the server will know to ignore
-     * the request if it has already been completed. The server will guarantee
-     * that for at least 60 minutes since the first request.
-     * For example, consider a situation where you make an initial request and t
-     * he request times out. If you make the request again with the same request
-     * ID, the server can check if original operation with the same request ID
-     * was received, and if so, will ignore the second request. This prevents
-     * clients from accidentally creating duplicate commitments.
-     * The request ID must be a valid UUID with the exception that zero UUID is
-     * not supported (00000000-0000-0000-0000-000000000000).
-     * 
- * - * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The requestId. - */ - public java.lang.String getRequestId() { - java.lang.Object ref = requestId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - requestId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Optional. An optional request ID to identify requests. Specify a unique request ID
-     * so that if you must retry your request, the server will know to ignore
-     * the request if it has already been completed. The server will guarantee
-     * that for at least 60 minutes since the first request.
-     * For example, consider a situation where you make an initial request and t
-     * he request times out. If you make the request again with the same request
-     * ID, the server can check if original operation with the same request ID
-     * was received, and if so, will ignore the second request. This prevents
-     * clients from accidentally creating duplicate commitments.
-     * The request ID must be a valid UUID with the exception that zero UUID is
-     * not supported (00000000-0000-0000-0000-000000000000).
-     * 
- * - * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for requestId. - */ - public com.google.protobuf.ByteString getRequestIdBytes() { - java.lang.Object ref = requestId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - requestId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Optional. An optional request ID to identify requests. Specify a unique request ID
-     * so that if you must retry your request, the server will know to ignore
-     * the request if it has already been completed. The server will guarantee
-     * that for at least 60 minutes since the first request.
-     * For example, consider a situation where you make an initial request and t
-     * he request times out. If you make the request again with the same request
-     * ID, the server can check if original operation with the same request ID
-     * was received, and if so, will ignore the second request. This prevents
-     * clients from accidentally creating duplicate commitments.
-     * The request ID must be a valid UUID with the exception that zero UUID is
-     * not supported (00000000-0000-0000-0000-000000000000).
-     * 
- * - * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The requestId to set. - * @return This builder for chaining. - */ - public Builder setRequestId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - requestId_ = value; - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. An optional request ID to identify requests. Specify a unique request ID
-     * so that if you must retry your request, the server will know to ignore
-     * the request if it has already been completed. The server will guarantee
-     * that for at least 60 minutes since the first request.
-     * For example, consider a situation where you make an initial request and t
-     * he request times out. If you make the request again with the same request
-     * ID, the server can check if original operation with the same request ID
-     * was received, and if so, will ignore the second request. This prevents
-     * clients from accidentally creating duplicate commitments.
-     * The request ID must be a valid UUID with the exception that zero UUID is
-     * not supported (00000000-0000-0000-0000-000000000000).
-     * 
- * - * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return This builder for chaining. - */ - public Builder clearRequestId() { - requestId_ = getDefaultInstance().getRequestId(); - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. An optional request ID to identify requests. Specify a unique request ID
-     * so that if you must retry your request, the server will know to ignore
-     * the request if it has already been completed. The server will guarantee
-     * that for at least 60 minutes since the first request.
-     * For example, consider a situation where you make an initial request and t
-     * he request times out. If you make the request again with the same request
-     * ID, the server can check if original operation with the same request ID
-     * was received, and if so, will ignore the second request. This prevents
-     * clients from accidentally creating duplicate commitments.
-     * The request ID must be a valid UUID with the exception that zero UUID is
-     * not supported (00000000-0000-0000-0000-000000000000).
-     * 
- * - * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The bytes for requestId to set. - * @return This builder for chaining. - */ - public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - requestId_ = value; - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest) - private static final com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest(); - } - - public static com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CreatePolicyBasedRouteRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/CreatePolicyBasedRouteRequestOrBuilder.java b/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/CreatePolicyBasedRouteRequestOrBuilder.java deleted file mode 100644 index f67bf3a1716d..000000000000 --- a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/CreatePolicyBasedRouteRequestOrBuilder.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright 2020 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. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/networkconnectivity/v1/policy_based_routing.proto - -package com.google.cloud.networkconnectivity.v1; - -public interface CreatePolicyBasedRouteRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The parent resource's name of the PolicyBasedRoute.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - java.lang.String getParent(); - /** - * - * - *
-   * Required. The parent resource's name of the PolicyBasedRoute.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - com.google.protobuf.ByteString getParentBytes(); - - /** - * - * - *
-   * Optional. Unique id for the Policy Based Route to create.
-   * 
- * - * string policy_based_route_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The policyBasedRouteId. - */ - java.lang.String getPolicyBasedRouteId(); - /** - * - * - *
-   * Optional. Unique id for the Policy Based Route to create.
-   * 
- * - * string policy_based_route_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for policyBasedRouteId. - */ - com.google.protobuf.ByteString getPolicyBasedRouteIdBytes(); - - /** - * - * - *
-   * Required. Initial values for a new Policy Based Route.
-   * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_route = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the policyBasedRoute field is set. - */ - boolean hasPolicyBasedRoute(); - /** - * - * - *
-   * Required. Initial values for a new Policy Based Route.
-   * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_route = 3 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The policyBasedRoute. - */ - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute getPolicyBasedRoute(); - /** - * - * - *
-   * Required. Initial values for a new Policy Based Route.
-   * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_route = 3 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.cloud.networkconnectivity.v1.PolicyBasedRouteOrBuilder getPolicyBasedRouteOrBuilder(); - - /** - * - * - *
-   * Optional. An optional request ID to identify requests. Specify a unique request ID
-   * so that if you must retry your request, the server will know to ignore
-   * the request if it has already been completed. The server will guarantee
-   * that for at least 60 minutes since the first request.
-   * For example, consider a situation where you make an initial request and t
-   * he request times out. If you make the request again with the same request
-   * ID, the server can check if original operation with the same request ID
-   * was received, and if so, will ignore the second request. This prevents
-   * clients from accidentally creating duplicate commitments.
-   * The request ID must be a valid UUID with the exception that zero UUID is
-   * not supported (00000000-0000-0000-0000-000000000000).
-   * 
- * - * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The requestId. - */ - java.lang.String getRequestId(); - /** - * - * - *
-   * Optional. An optional request ID to identify requests. Specify a unique request ID
-   * so that if you must retry your request, the server will know to ignore
-   * the request if it has already been completed. The server will guarantee
-   * that for at least 60 minutes since the first request.
-   * For example, consider a situation where you make an initial request and t
-   * he request times out. If you make the request again with the same request
-   * ID, the server can check if original operation with the same request ID
-   * was received, and if so, will ignore the second request. This prevents
-   * clients from accidentally creating duplicate commitments.
-   * The request ID must be a valid UUID with the exception that zero UUID is
-   * not supported (00000000-0000-0000-0000-000000000000).
-   * 
- * - * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for requestId. - */ - com.google.protobuf.ByteString getRequestIdBytes(); -} diff --git a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/DeletePolicyBasedRouteRequest.java b/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/DeletePolicyBasedRouteRequest.java deleted file mode 100644 index 02c6a215f7ff..000000000000 --- a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/DeletePolicyBasedRouteRequest.java +++ /dev/null @@ -1,907 +0,0 @@ -/* - * Copyright 2020 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. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/networkconnectivity/v1/policy_based_routing.proto - -package com.google.cloud.networkconnectivity.v1; - -/** - * - * - *
- * Request for [PolicyBasedRouting.DeletePolicyBasedRoute][] method.
- * 
- * - * Protobuf type {@code google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest} - */ -public final class DeletePolicyBasedRouteRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest) - DeletePolicyBasedRouteRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use DeletePolicyBasedRouteRequest.newBuilder() to construct. - private DeletePolicyBasedRouteRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private DeletePolicyBasedRouteRequest() { - name_ = ""; - requestId_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DeletePolicyBasedRouteRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_DeletePolicyBasedRouteRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_DeletePolicyBasedRouteRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest.class, - com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object name_ = ""; - /** - * - * - *
-   * Required. Name of the PolicyBasedRoute resource to delete.
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * - * - *
-   * Required. Name of the PolicyBasedRoute resource to delete.
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int REQUEST_ID_FIELD_NUMBER = 2; - - @SuppressWarnings("serial") - private volatile java.lang.Object requestId_ = ""; - /** - * - * - *
-   * Optional. An optional request ID to identify requests. Specify a unique request ID
-   * so that if you must retry your request, the server will know to ignore
-   * the request if it has already been completed. The server will guarantee
-   * that for at least 60 minutes after the first request.
-   * For example, consider a situation where you make an initial request and t
-   * he request times out. If you make the request again with the same request
-   * ID, the server can check if original operation with the same request ID
-   * was received, and if so, will ignore the second request. This prevents
-   * clients from accidentally creating duplicate commitments.
-   * The request ID must be a valid UUID with the exception that zero UUID is
-   * not supported (00000000-0000-0000-0000-000000000000).
-   * 
- * - * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The requestId. - */ - @java.lang.Override - public java.lang.String getRequestId() { - java.lang.Object ref = requestId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - requestId_ = s; - return s; - } - } - /** - * - * - *
-   * Optional. An optional request ID to identify requests. Specify a unique request ID
-   * so that if you must retry your request, the server will know to ignore
-   * the request if it has already been completed. The server will guarantee
-   * that for at least 60 minutes after the first request.
-   * For example, consider a situation where you make an initial request and t
-   * he request times out. If you make the request again with the same request
-   * ID, the server can check if original operation with the same request ID
-   * was received, and if so, will ignore the second request. This prevents
-   * clients from accidentally creating duplicate commitments.
-   * The request ID must be a valid UUID with the exception that zero UUID is
-   * not supported (00000000-0000-0000-0000-000000000000).
-   * 
- * - * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for requestId. - */ - @java.lang.Override - public com.google.protobuf.ByteString getRequestIdBytes() { - java.lang.Object ref = requestId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - requestId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestId_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestId_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest)) { - return super.equals(obj); - } - com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest other = - (com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest) obj; - - if (!getName().equals(other.getName())) return false; - if (!getRequestId().equals(other.getRequestId())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; - hash = (53 * hash) + getRequestId().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Request for [PolicyBasedRouting.DeletePolicyBasedRoute][] method.
-   * 
- * - * Protobuf type {@code google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest) - com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_DeletePolicyBasedRouteRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_DeletePolicyBasedRouteRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest.class, - com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest.Builder.class); - } - - // Construct using - // com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - name_ = ""; - requestId_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_DeletePolicyBasedRouteRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest - getDefaultInstanceForType() { - return com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest build() { - com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest buildPartial() { - com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest result = - new com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0( - com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.name_ = name_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.requestId_ = requestId_; - } - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest) { - return mergeFrom( - (com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest other) { - if (other - == com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest - .getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (!other.getRequestId().isEmpty()) { - requestId_ = other.requestId_; - bitField0_ |= 0x00000002; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - name_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - requestId_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000002; - break; - } // case 18 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * - * - *
-     * Required. Name of the PolicyBasedRoute resource to delete.
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. Name of the PolicyBasedRoute resource to delete.
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. Name of the PolicyBasedRoute resource to delete.
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - name_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Name of the PolicyBasedRoute resource to delete.
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearName() { - name_ = getDefaultInstance().getName(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Name of the PolicyBasedRoute resource to delete.
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - name_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private java.lang.Object requestId_ = ""; - /** - * - * - *
-     * Optional. An optional request ID to identify requests. Specify a unique request ID
-     * so that if you must retry your request, the server will know to ignore
-     * the request if it has already been completed. The server will guarantee
-     * that for at least 60 minutes after the first request.
-     * For example, consider a situation where you make an initial request and t
-     * he request times out. If you make the request again with the same request
-     * ID, the server can check if original operation with the same request ID
-     * was received, and if so, will ignore the second request. This prevents
-     * clients from accidentally creating duplicate commitments.
-     * The request ID must be a valid UUID with the exception that zero UUID is
-     * not supported (00000000-0000-0000-0000-000000000000).
-     * 
- * - * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The requestId. - */ - public java.lang.String getRequestId() { - java.lang.Object ref = requestId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - requestId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Optional. An optional request ID to identify requests. Specify a unique request ID
-     * so that if you must retry your request, the server will know to ignore
-     * the request if it has already been completed. The server will guarantee
-     * that for at least 60 minutes after the first request.
-     * For example, consider a situation where you make an initial request and t
-     * he request times out. If you make the request again with the same request
-     * ID, the server can check if original operation with the same request ID
-     * was received, and if so, will ignore the second request. This prevents
-     * clients from accidentally creating duplicate commitments.
-     * The request ID must be a valid UUID with the exception that zero UUID is
-     * not supported (00000000-0000-0000-0000-000000000000).
-     * 
- * - * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for requestId. - */ - public com.google.protobuf.ByteString getRequestIdBytes() { - java.lang.Object ref = requestId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - requestId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Optional. An optional request ID to identify requests. Specify a unique request ID
-     * so that if you must retry your request, the server will know to ignore
-     * the request if it has already been completed. The server will guarantee
-     * that for at least 60 minutes after the first request.
-     * For example, consider a situation where you make an initial request and t
-     * he request times out. If you make the request again with the same request
-     * ID, the server can check if original operation with the same request ID
-     * was received, and if so, will ignore the second request. This prevents
-     * clients from accidentally creating duplicate commitments.
-     * The request ID must be a valid UUID with the exception that zero UUID is
-     * not supported (00000000-0000-0000-0000-000000000000).
-     * 
- * - * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The requestId to set. - * @return This builder for chaining. - */ - public Builder setRequestId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - requestId_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. An optional request ID to identify requests. Specify a unique request ID
-     * so that if you must retry your request, the server will know to ignore
-     * the request if it has already been completed. The server will guarantee
-     * that for at least 60 minutes after the first request.
-     * For example, consider a situation where you make an initial request and t
-     * he request times out. If you make the request again with the same request
-     * ID, the server can check if original operation with the same request ID
-     * was received, and if so, will ignore the second request. This prevents
-     * clients from accidentally creating duplicate commitments.
-     * The request ID must be a valid UUID with the exception that zero UUID is
-     * not supported (00000000-0000-0000-0000-000000000000).
-     * 
- * - * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return This builder for chaining. - */ - public Builder clearRequestId() { - requestId_ = getDefaultInstance().getRequestId(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. An optional request ID to identify requests. Specify a unique request ID
-     * so that if you must retry your request, the server will know to ignore
-     * the request if it has already been completed. The server will guarantee
-     * that for at least 60 minutes after the first request.
-     * For example, consider a situation where you make an initial request and t
-     * he request times out. If you make the request again with the same request
-     * ID, the server can check if original operation with the same request ID
-     * was received, and if so, will ignore the second request. This prevents
-     * clients from accidentally creating duplicate commitments.
-     * The request ID must be a valid UUID with the exception that zero UUID is
-     * not supported (00000000-0000-0000-0000-000000000000).
-     * 
- * - * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The bytes for requestId to set. - * @return This builder for chaining. - */ - public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - requestId_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest) - private static final com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest(); - } - - public static com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DeletePolicyBasedRouteRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/DeletePolicyBasedRouteRequestOrBuilder.java b/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/DeletePolicyBasedRouteRequestOrBuilder.java deleted file mode 100644 index 829c45f69a4b..000000000000 --- a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/DeletePolicyBasedRouteRequestOrBuilder.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2020 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. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/networkconnectivity/v1/policy_based_routing.proto - -package com.google.cloud.networkconnectivity.v1; - -public interface DeletePolicyBasedRouteRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. Name of the PolicyBasedRoute resource to delete.
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-   * Required. Name of the PolicyBasedRoute resource to delete.
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * - * - *
-   * Optional. An optional request ID to identify requests. Specify a unique request ID
-   * so that if you must retry your request, the server will know to ignore
-   * the request if it has already been completed. The server will guarantee
-   * that for at least 60 minutes after the first request.
-   * For example, consider a situation where you make an initial request and t
-   * he request times out. If you make the request again with the same request
-   * ID, the server can check if original operation with the same request ID
-   * was received, and if so, will ignore the second request. This prevents
-   * clients from accidentally creating duplicate commitments.
-   * The request ID must be a valid UUID with the exception that zero UUID is
-   * not supported (00000000-0000-0000-0000-000000000000).
-   * 
- * - * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The requestId. - */ - java.lang.String getRequestId(); - /** - * - * - *
-   * Optional. An optional request ID to identify requests. Specify a unique request ID
-   * so that if you must retry your request, the server will know to ignore
-   * the request if it has already been completed. The server will guarantee
-   * that for at least 60 minutes after the first request.
-   * For example, consider a situation where you make an initial request and t
-   * he request times out. If you make the request again with the same request
-   * ID, the server can check if original operation with the same request ID
-   * was received, and if so, will ignore the second request. This prevents
-   * clients from accidentally creating duplicate commitments.
-   * The request ID must be a valid UUID with the exception that zero UUID is
-   * not supported (00000000-0000-0000-0000-000000000000).
-   * 
- * - * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for requestId. - */ - com.google.protobuf.ByteString getRequestIdBytes(); -} diff --git a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/GetPolicyBasedRouteRequest.java b/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/GetPolicyBasedRouteRequest.java deleted file mode 100644 index 845b618e3a6f..000000000000 --- a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/GetPolicyBasedRouteRequest.java +++ /dev/null @@ -1,655 +0,0 @@ -/* - * Copyright 2020 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. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/networkconnectivity/v1/policy_based_routing.proto - -package com.google.cloud.networkconnectivity.v1; - -/** - * - * - *
- * Request for [PolicyBasedRouting.GetPolicyBasedRoute][] method.
- * 
- * - * Protobuf type {@code google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest} - */ -public final class GetPolicyBasedRouteRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest) - GetPolicyBasedRouteRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use GetPolicyBasedRouteRequest.newBuilder() to construct. - private GetPolicyBasedRouteRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private GetPolicyBasedRouteRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new GetPolicyBasedRouteRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_GetPolicyBasedRouteRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_GetPolicyBasedRouteRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest.class, - com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object name_ = ""; - /** - * - * - *
-   * Required. Name of the PolicyBasedRoute resource to get.
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * - * - *
-   * Required. Name of the PolicyBasedRoute resource to get.
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest)) { - return super.equals(obj); - } - com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest other = - (com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest) obj; - - if (!getName().equals(other.getName())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Request for [PolicyBasedRouting.GetPolicyBasedRoute][] method.
-   * 
- * - * Protobuf type {@code google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest) - com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_GetPolicyBasedRouteRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_GetPolicyBasedRouteRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest.class, - com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest.Builder.class); - } - - // Construct using - // com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - name_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_GetPolicyBasedRouteRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest - getDefaultInstanceForType() { - return com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest build() { - com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest buildPartial() { - com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest result = - new com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0( - com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.name_ = name_; - } - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest) { - return mergeFrom( - (com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest other) { - if (other - == com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest - .getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - bitField0_ |= 0x00000001; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - name_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * - * - *
-     * Required. Name of the PolicyBasedRoute resource to get.
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. Name of the PolicyBasedRoute resource to get.
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. Name of the PolicyBasedRoute resource to get.
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - name_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Name of the PolicyBasedRoute resource to get.
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearName() { - name_ = getDefaultInstance().getName(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Name of the PolicyBasedRoute resource to get.
-     * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - name_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest) - private static final com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest(); - } - - public static com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GetPolicyBasedRouteRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/GetPolicyBasedRouteRequestOrBuilder.java b/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/GetPolicyBasedRouteRequestOrBuilder.java deleted file mode 100644 index 6622d3957f44..000000000000 --- a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/GetPolicyBasedRouteRequestOrBuilder.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2020 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. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/networkconnectivity/v1/policy_based_routing.proto - -package com.google.cloud.networkconnectivity.v1; - -public interface GetPolicyBasedRouteRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. Name of the PolicyBasedRoute resource to get.
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-   * Required. Name of the PolicyBasedRoute resource to get.
-   * 
- * - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); -} diff --git a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListPolicyBasedRoutesRequest.java b/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListPolicyBasedRoutesRequest.java deleted file mode 100644 index 9b8eb43b32e7..000000000000 --- a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListPolicyBasedRoutesRequest.java +++ /dev/null @@ -1,1294 +0,0 @@ -/* - * Copyright 2020 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. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/networkconnectivity/v1/policy_based_routing.proto - -package com.google.cloud.networkconnectivity.v1; - -/** - * - * - *
- * Request for [PolicyBasedRouting.ListPolicyBasedRoutes][] method.
- * 
- * - * Protobuf type {@code google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest} - */ -public final class ListPolicyBasedRoutesRequest extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest) - ListPolicyBasedRoutesRequestOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListPolicyBasedRoutesRequest.newBuilder() to construct. - private ListPolicyBasedRoutesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListPolicyBasedRoutesRequest() { - parent_ = ""; - pageToken_ = ""; - filter_ = ""; - orderBy_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListPolicyBasedRoutesRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_ListPolicyBasedRoutesRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_ListPolicyBasedRoutesRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest.class, - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest.Builder.class); - } - - public static final int PARENT_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object parent_ = ""; - /** - * - * - *
-   * Required. The parent resource's name.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - @java.lang.Override - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } - } - /** - * - * - *
-   * Required. The parent resource's name.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - @java.lang.Override - public com.google.protobuf.ByteString getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PAGE_SIZE_FIELD_NUMBER = 2; - private int pageSize_ = 0; - /** - * - * - *
-   * The maximum number of results per page that should be returned.
-   * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 3; - - @SuppressWarnings("serial") - private volatile java.lang.Object pageToken_ = ""; - /** - * - * - *
-   * The page token.
-   * 
- * - * string page_token = 3; - * - * @return The pageToken. - */ - @java.lang.Override - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } - } - /** - * - * - *
-   * The page token.
-   * 
- * - * string page_token = 3; - * - * @return The bytes for pageToken. - */ - @java.lang.Override - public com.google.protobuf.ByteString getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int FILTER_FIELD_NUMBER = 4; - - @SuppressWarnings("serial") - private volatile java.lang.Object filter_ = ""; - /** - * - * - *
-   * A filter expression that filters the results listed in the response.
-   * 
- * - * string filter = 4; - * - * @return The filter. - */ - @java.lang.Override - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - filter_ = s; - return s; - } - } - /** - * - * - *
-   * A filter expression that filters the results listed in the response.
-   * 
- * - * string filter = 4; - * - * @return The bytes for filter. - */ - @java.lang.Override - public com.google.protobuf.ByteString getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - filter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ORDER_BY_FIELD_NUMBER = 5; - - @SuppressWarnings("serial") - private volatile java.lang.Object orderBy_ = ""; - /** - * - * - *
-   * Sort the results by a certain order.
-   * 
- * - * string order_by = 5; - * - * @return The orderBy. - */ - @java.lang.Override - public java.lang.String getOrderBy() { - java.lang.Object ref = orderBy_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - orderBy_ = s; - return s; - } - } - /** - * - * - *
-   * Sort the results by a certain order.
-   * 
- * - * string order_by = 5; - * - * @return The bytes for orderBy. - */ - @java.lang.Override - public com.google.protobuf.ByteString getOrderByBytes() { - java.lang.Object ref = orderBy_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - orderBy_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); - } - if (pageSize_ != 0) { - output.writeInt32(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); - } - if (pageSize_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest)) { - return super.equals(obj); - } - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest other = - (com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest) obj; - - if (!getParent().equals(other.getParent())) return false; - if (getPageSize() != other.getPageSize()) return false; - if (!getPageToken().equals(other.getPageToken())) return false; - if (!getFilter().equals(other.getFilter())) return false; - if (!getOrderBy().equals(other.getOrderBy())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PARENT_FIELD_NUMBER; - hash = (53 * hash) + getParent().hashCode(); - hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; - hash = (53 * hash) + getPageSize(); - hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getPageToken().hashCode(); - hash = (37 * hash) + FILTER_FIELD_NUMBER; - hash = (53 * hash) + getFilter().hashCode(); - hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; - hash = (53 * hash) + getOrderBy().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Request for [PolicyBasedRouting.ListPolicyBasedRoutes][] method.
-   * 
- * - * Protobuf type {@code google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest) - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_ListPolicyBasedRoutesRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_ListPolicyBasedRoutesRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest.class, - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest.Builder.class); - } - - // Construct using - // com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - parent_ = ""; - pageSize_ = 0; - pageToken_ = ""; - filter_ = ""; - orderBy_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_ListPolicyBasedRoutesRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest - getDefaultInstanceForType() { - return com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest build() { - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest buildPartial() { - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest result = - new com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0( - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.parent_ = parent_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.pageSize_ = pageSize_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.pageToken_ = pageToken_; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.filter_ = filter_; - } - if (((from_bitField0_ & 0x00000010) != 0)) { - result.orderBy_ = orderBy_; - } - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest) { - return mergeFrom( - (com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest other) { - if (other - == com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest - .getDefaultInstance()) return this; - if (!other.getParent().isEmpty()) { - parent_ = other.parent_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - bitField0_ |= 0x00000004; - onChanged(); - } - if (!other.getFilter().isEmpty()) { - filter_ = other.filter_; - bitField0_ |= 0x00000008; - onChanged(); - } - if (!other.getOrderBy().isEmpty()) { - orderBy_ = other.orderBy_; - bitField0_ |= 0x00000010; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - parent_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 16: - { - pageSize_ = input.readInt32(); - bitField0_ |= 0x00000002; - break; - } // case 16 - case 26: - { - pageToken_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000004; - break; - } // case 26 - case 34: - { - filter_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000008; - break; - } // case 34 - case 42: - { - orderBy_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000010; - break; - } // case 42 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object parent_ = ""; - /** - * - * - *
-     * Required. The parent resource's name.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. The parent resource's name.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - public com.google.protobuf.ByteString getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. The parent resource's name.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The parent to set. - * @return This builder for chaining. - */ - public Builder setParent(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - parent_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The parent resource's name.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearParent() { - parent_ = getDefaultInstance().getParent(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The parent resource's name.
-     * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for parent to set. - * @return This builder for chaining. - */ - public Builder setParentBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - parent_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private int pageSize_; - /** - * - * - *
-     * The maximum number of results per page that should be returned.
-     * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - /** - * - * - *
-     * The maximum number of results per page that should be returned.
-     * 
- * - * int32 page_size = 2; - * - * @param value The pageSize to set. - * @return This builder for chaining. - */ - public Builder setPageSize(int value) { - - pageSize_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * The maximum number of results per page that should be returned.
-     * 
- * - * int32 page_size = 2; - * - * @return This builder for chaining. - */ - public Builder clearPageSize() { - bitField0_ = (bitField0_ & ~0x00000002); - pageSize_ = 0; - onChanged(); - return this; - } - - private java.lang.Object pageToken_ = ""; - /** - * - * - *
-     * The page token.
-     * 
- * - * string page_token = 3; - * - * @return The pageToken. - */ - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The page token.
-     * 
- * - * string page_token = 3; - * - * @return The bytes for pageToken. - */ - public com.google.protobuf.ByteString getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The page token.
-     * 
- * - * string page_token = 3; - * - * @param value The pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageToken(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - pageToken_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-     * The page token.
-     * 
- * - * string page_token = 3; - * - * @return This builder for chaining. - */ - public Builder clearPageToken() { - pageToken_ = getDefaultInstance().getPageToken(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - /** - * - * - *
-     * The page token.
-     * 
- * - * string page_token = 3; - * - * @param value The bytes for pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - pageToken_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - private java.lang.Object filter_ = ""; - /** - * - * - *
-     * A filter expression that filters the results listed in the response.
-     * 
- * - * string filter = 4; - * - * @return The filter. - */ - public java.lang.String getFilter() { - java.lang.Object ref = filter_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - filter_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * A filter expression that filters the results listed in the response.
-     * 
- * - * string filter = 4; - * - * @return The bytes for filter. - */ - public com.google.protobuf.ByteString getFilterBytes() { - java.lang.Object ref = filter_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - filter_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * A filter expression that filters the results listed in the response.
-     * 
- * - * string filter = 4; - * - * @param value The filter to set. - * @return This builder for chaining. - */ - public Builder setFilter(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - filter_ = value; - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - /** - * - * - *
-     * A filter expression that filters the results listed in the response.
-     * 
- * - * string filter = 4; - * - * @return This builder for chaining. - */ - public Builder clearFilter() { - filter_ = getDefaultInstance().getFilter(); - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - return this; - } - /** - * - * - *
-     * A filter expression that filters the results listed in the response.
-     * 
- * - * string filter = 4; - * - * @param value The bytes for filter to set. - * @return This builder for chaining. - */ - public Builder setFilterBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - filter_ = value; - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - - private java.lang.Object orderBy_ = ""; - /** - * - * - *
-     * Sort the results by a certain order.
-     * 
- * - * string order_by = 5; - * - * @return The orderBy. - */ - public java.lang.String getOrderBy() { - java.lang.Object ref = orderBy_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - orderBy_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Sort the results by a certain order.
-     * 
- * - * string order_by = 5; - * - * @return The bytes for orderBy. - */ - public com.google.protobuf.ByteString getOrderByBytes() { - java.lang.Object ref = orderBy_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - orderBy_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Sort the results by a certain order.
-     * 
- * - * string order_by = 5; - * - * @param value The orderBy to set. - * @return This builder for chaining. - */ - public Builder setOrderBy(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - orderBy_ = value; - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - /** - * - * - *
-     * Sort the results by a certain order.
-     * 
- * - * string order_by = 5; - * - * @return This builder for chaining. - */ - public Builder clearOrderBy() { - orderBy_ = getDefaultInstance().getOrderBy(); - bitField0_ = (bitField0_ & ~0x00000010); - onChanged(); - return this; - } - /** - * - * - *
-     * Sort the results by a certain order.
-     * 
- * - * string order_by = 5; - * - * @param value The bytes for orderBy to set. - * @return This builder for chaining. - */ - public Builder setOrderByBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - orderBy_ = value; - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest) - private static final com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest(); - } - - public static com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListPolicyBasedRoutesRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListPolicyBasedRoutesRequestOrBuilder.java b/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListPolicyBasedRoutesRequestOrBuilder.java deleted file mode 100644 index 40cc72dd34cc..000000000000 --- a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListPolicyBasedRoutesRequestOrBuilder.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright 2020 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. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/networkconnectivity/v1/policy_based_routing.proto - -package com.google.cloud.networkconnectivity.v1; - -public interface ListPolicyBasedRoutesRequestOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Required. The parent resource's name.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The parent. - */ - java.lang.String getParent(); - /** - * - * - *
-   * Required. The parent resource's name.
-   * 
- * - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for parent. - */ - com.google.protobuf.ByteString getParentBytes(); - - /** - * - * - *
-   * The maximum number of results per page that should be returned.
-   * 
- * - * int32 page_size = 2; - * - * @return The pageSize. - */ - int getPageSize(); - - /** - * - * - *
-   * The page token.
-   * 
- * - * string page_token = 3; - * - * @return The pageToken. - */ - java.lang.String getPageToken(); - /** - * - * - *
-   * The page token.
-   * 
- * - * string page_token = 3; - * - * @return The bytes for pageToken. - */ - com.google.protobuf.ByteString getPageTokenBytes(); - - /** - * - * - *
-   * A filter expression that filters the results listed in the response.
-   * 
- * - * string filter = 4; - * - * @return The filter. - */ - java.lang.String getFilter(); - /** - * - * - *
-   * A filter expression that filters the results listed in the response.
-   * 
- * - * string filter = 4; - * - * @return The bytes for filter. - */ - com.google.protobuf.ByteString getFilterBytes(); - - /** - * - * - *
-   * Sort the results by a certain order.
-   * 
- * - * string order_by = 5; - * - * @return The orderBy. - */ - java.lang.String getOrderBy(); - /** - * - * - *
-   * Sort the results by a certain order.
-   * 
- * - * string order_by = 5; - * - * @return The bytes for orderBy. - */ - com.google.protobuf.ByteString getOrderByBytes(); -} diff --git a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListPolicyBasedRoutesResponse.java b/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListPolicyBasedRoutesResponse.java deleted file mode 100644 index 3d4543567852..000000000000 --- a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListPolicyBasedRoutesResponse.java +++ /dev/null @@ -1,1462 +0,0 @@ -/* - * Copyright 2020 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. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/networkconnectivity/v1/policy_based_routing.proto - -package com.google.cloud.networkconnectivity.v1; - -/** - * - * - *
- * Response for [PolicyBasedRouting.ListPolicyBasedRoutes][] method.
- * 
- * - * Protobuf type {@code google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse} - */ -public final class ListPolicyBasedRoutesResponse extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse) - ListPolicyBasedRoutesResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use ListPolicyBasedRoutesResponse.newBuilder() to construct. - private ListPolicyBasedRoutesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ListPolicyBasedRoutesResponse() { - policyBasedRoutes_ = java.util.Collections.emptyList(); - nextPageToken_ = ""; - unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListPolicyBasedRoutesResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_ListPolicyBasedRoutesResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_ListPolicyBasedRoutesResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse.class, - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse.Builder.class); - } - - public static final int POLICY_BASED_ROUTES_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private java.util.List - policyBasedRoutes_; - /** - * - * - *
-   * Policy based routes to be returned.
-   * 
- * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_routes = 1; - * - */ - @java.lang.Override - public java.util.List - getPolicyBasedRoutesList() { - return policyBasedRoutes_; - } - /** - * - * - *
-   * Policy based routes to be returned.
-   * 
- * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_routes = 1; - * - */ - @java.lang.Override - public java.util.List - getPolicyBasedRoutesOrBuilderList() { - return policyBasedRoutes_; - } - /** - * - * - *
-   * Policy based routes to be returned.
-   * 
- * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_routes = 1; - * - */ - @java.lang.Override - public int getPolicyBasedRoutesCount() { - return policyBasedRoutes_.size(); - } - /** - * - * - *
-   * Policy based routes to be returned.
-   * 
- * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_routes = 1; - * - */ - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute getPolicyBasedRoutes(int index) { - return policyBasedRoutes_.get(index); - } - /** - * - * - *
-   * Policy based routes to be returned.
-   * 
- * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_routes = 1; - * - */ - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRouteOrBuilder - getPolicyBasedRoutesOrBuilder(int index) { - return policyBasedRoutes_.get(index); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - - @SuppressWarnings("serial") - private volatile java.lang.Object nextPageToken_ = ""; - /** - * - * - *
-   * The next pagination token in the List response. It should be used as
-   * page_token for the following request. An empty value means no more result.
-   * 
- * - * string next_page_token = 2; - * - * @return The nextPageToken. - */ - @java.lang.Override - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } - } - /** - * - * - *
-   * The next pagination token in the List response. It should be used as
-   * page_token for the following request. An empty value means no more result.
-   * 
- * - * string next_page_token = 2; - * - * @return The bytes for nextPageToken. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int UNREACHABLE_FIELD_NUMBER = 3; - - @SuppressWarnings("serial") - private com.google.protobuf.LazyStringList unreachable_; - /** - * - * - *
-   * Locations that could not be reached.
-   * 
- * - * repeated string unreachable = 3; - * - * @return A list containing the unreachable. - */ - public com.google.protobuf.ProtocolStringList getUnreachableList() { - return unreachable_; - } - /** - * - * - *
-   * Locations that could not be reached.
-   * 
- * - * repeated string unreachable = 3; - * - * @return The count of unreachable. - */ - public int getUnreachableCount() { - return unreachable_.size(); - } - /** - * - * - *
-   * Locations that could not be reached.
-   * 
- * - * repeated string unreachable = 3; - * - * @param index The index of the element to return. - * @return The unreachable at the given index. - */ - public java.lang.String getUnreachable(int index) { - return unreachable_.get(index); - } - /** - * - * - *
-   * Locations that could not be reached.
-   * 
- * - * repeated string unreachable = 3; - * - * @param index The index of the value to return. - * @return The bytes of the unreachable at the given index. - */ - public com.google.protobuf.ByteString getUnreachableBytes(int index) { - return unreachable_.getByteString(index); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < policyBasedRoutes_.size(); i++) { - output.writeMessage(1, policyBasedRoutes_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); - } - for (int i = 0; i < unreachable_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < policyBasedRoutes_.size(); i++) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize(1, policyBasedRoutes_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); - } - { - int dataSize = 0; - for (int i = 0; i < unreachable_.size(); i++) { - dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); - } - size += dataSize; - size += 1 * getUnreachableList().size(); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse)) { - return super.equals(obj); - } - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse other = - (com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse) obj; - - if (!getPolicyBasedRoutesList().equals(other.getPolicyBasedRoutesList())) return false; - if (!getNextPageToken().equals(other.getNextPageToken())) return false; - if (!getUnreachableList().equals(other.getUnreachableList())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getPolicyBasedRoutesCount() > 0) { - hash = (37 * hash) + POLICY_BASED_ROUTES_FIELD_NUMBER; - hash = (53 * hash) + getPolicyBasedRoutesList().hashCode(); - } - hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getNextPageToken().hashCode(); - if (getUnreachableCount() > 0) { - hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; - hash = (53 * hash) + getUnreachableList().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Response for [PolicyBasedRouting.ListPolicyBasedRoutes][] method.
-   * 
- * - * Protobuf type {@code google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse) - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_ListPolicyBasedRoutesResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_ListPolicyBasedRoutesResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse.class, - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse.Builder.class); - } - - // Construct using - // com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - if (policyBasedRoutesBuilder_ == null) { - policyBasedRoutes_ = java.util.Collections.emptyList(); - } else { - policyBasedRoutes_ = null; - policyBasedRoutesBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - nextPageToken_ = ""; - unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_ListPolicyBasedRoutesResponse_descriptor; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse - getDefaultInstanceForType() { - return com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse build() { - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse buildPartial() { - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse result = - new com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartialRepeatedFields( - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse result) { - if (policyBasedRoutesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - policyBasedRoutes_ = java.util.Collections.unmodifiableList(policyBasedRoutes_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.policyBasedRoutes_ = policyBasedRoutes_; - } else { - result.policyBasedRoutes_ = policyBasedRoutesBuilder_.build(); - } - if (((bitField0_ & 0x00000004) != 0)) { - unreachable_ = unreachable_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.unreachable_ = unreachable_; - } - - private void buildPartial0( - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000002) != 0)) { - result.nextPageToken_ = nextPageToken_; - } - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse) { - return mergeFrom( - (com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse other) { - if (other - == com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse - .getDefaultInstance()) return this; - if (policyBasedRoutesBuilder_ == null) { - if (!other.policyBasedRoutes_.isEmpty()) { - if (policyBasedRoutes_.isEmpty()) { - policyBasedRoutes_ = other.policyBasedRoutes_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePolicyBasedRoutesIsMutable(); - policyBasedRoutes_.addAll(other.policyBasedRoutes_); - } - onChanged(); - } - } else { - if (!other.policyBasedRoutes_.isEmpty()) { - if (policyBasedRoutesBuilder_.isEmpty()) { - policyBasedRoutesBuilder_.dispose(); - policyBasedRoutesBuilder_ = null; - policyBasedRoutes_ = other.policyBasedRoutes_; - bitField0_ = (bitField0_ & ~0x00000001); - policyBasedRoutesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getPolicyBasedRoutesFieldBuilder() - : null; - } else { - policyBasedRoutesBuilder_.addAllMessages(other.policyBasedRoutes_); - } - } - } - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - bitField0_ |= 0x00000002; - onChanged(); - } - if (!other.unreachable_.isEmpty()) { - if (unreachable_.isEmpty()) { - unreachable_ = other.unreachable_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureUnreachableIsMutable(); - unreachable_.addAll(other.unreachable_); - } - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute m = - input.readMessage( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.parser(), - extensionRegistry); - if (policyBasedRoutesBuilder_ == null) { - ensurePolicyBasedRoutesIsMutable(); - policyBasedRoutes_.add(m); - } else { - policyBasedRoutesBuilder_.addMessage(m); - } - break; - } // case 10 - case 18: - { - nextPageToken_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000002; - break; - } // case 18 - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - ensureUnreachableIsMutable(); - unreachable_.add(s); - break; - } // case 26 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.util.List - policyBasedRoutes_ = java.util.Collections.emptyList(); - - private void ensurePolicyBasedRoutesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - policyBasedRoutes_ = - new java.util.ArrayList( - policyBasedRoutes_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Builder, - com.google.cloud.networkconnectivity.v1.PolicyBasedRouteOrBuilder> - policyBasedRoutesBuilder_; - - /** - * - * - *
-     * Policy based routes to be returned.
-     * 
- * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_routes = 1; - * - */ - public java.util.List - getPolicyBasedRoutesList() { - if (policyBasedRoutesBuilder_ == null) { - return java.util.Collections.unmodifiableList(policyBasedRoutes_); - } else { - return policyBasedRoutesBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * Policy based routes to be returned.
-     * 
- * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_routes = 1; - * - */ - public int getPolicyBasedRoutesCount() { - if (policyBasedRoutesBuilder_ == null) { - return policyBasedRoutes_.size(); - } else { - return policyBasedRoutesBuilder_.getCount(); - } - } - /** - * - * - *
-     * Policy based routes to be returned.
-     * 
- * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_routes = 1; - * - */ - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute getPolicyBasedRoutes( - int index) { - if (policyBasedRoutesBuilder_ == null) { - return policyBasedRoutes_.get(index); - } else { - return policyBasedRoutesBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * Policy based routes to be returned.
-     * 
- * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_routes = 1; - * - */ - public Builder setPolicyBasedRoutes( - int index, com.google.cloud.networkconnectivity.v1.PolicyBasedRoute value) { - if (policyBasedRoutesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePolicyBasedRoutesIsMutable(); - policyBasedRoutes_.set(index, value); - onChanged(); - } else { - policyBasedRoutesBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Policy based routes to be returned.
-     * 
- * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_routes = 1; - * - */ - public Builder setPolicyBasedRoutes( - int index, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Builder builderForValue) { - if (policyBasedRoutesBuilder_ == null) { - ensurePolicyBasedRoutesIsMutable(); - policyBasedRoutes_.set(index, builderForValue.build()); - onChanged(); - } else { - policyBasedRoutesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Policy based routes to be returned.
-     * 
- * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_routes = 1; - * - */ - public Builder addPolicyBasedRoutes( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute value) { - if (policyBasedRoutesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePolicyBasedRoutesIsMutable(); - policyBasedRoutes_.add(value); - onChanged(); - } else { - policyBasedRoutesBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * Policy based routes to be returned.
-     * 
- * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_routes = 1; - * - */ - public Builder addPolicyBasedRoutes( - int index, com.google.cloud.networkconnectivity.v1.PolicyBasedRoute value) { - if (policyBasedRoutesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePolicyBasedRoutesIsMutable(); - policyBasedRoutes_.add(index, value); - onChanged(); - } else { - policyBasedRoutesBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Policy based routes to be returned.
-     * 
- * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_routes = 1; - * - */ - public Builder addPolicyBasedRoutes( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Builder builderForValue) { - if (policyBasedRoutesBuilder_ == null) { - ensurePolicyBasedRoutesIsMutable(); - policyBasedRoutes_.add(builderForValue.build()); - onChanged(); - } else { - policyBasedRoutesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Policy based routes to be returned.
-     * 
- * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_routes = 1; - * - */ - public Builder addPolicyBasedRoutes( - int index, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Builder builderForValue) { - if (policyBasedRoutesBuilder_ == null) { - ensurePolicyBasedRoutesIsMutable(); - policyBasedRoutes_.add(index, builderForValue.build()); - onChanged(); - } else { - policyBasedRoutesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Policy based routes to be returned.
-     * 
- * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_routes = 1; - * - */ - public Builder addAllPolicyBasedRoutes( - java.lang.Iterable - values) { - if (policyBasedRoutesBuilder_ == null) { - ensurePolicyBasedRoutesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, policyBasedRoutes_); - onChanged(); - } else { - policyBasedRoutesBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * Policy based routes to be returned.
-     * 
- * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_routes = 1; - * - */ - public Builder clearPolicyBasedRoutes() { - if (policyBasedRoutesBuilder_ == null) { - policyBasedRoutes_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - policyBasedRoutesBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Policy based routes to be returned.
-     * 
- * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_routes = 1; - * - */ - public Builder removePolicyBasedRoutes(int index) { - if (policyBasedRoutesBuilder_ == null) { - ensurePolicyBasedRoutesIsMutable(); - policyBasedRoutes_.remove(index); - onChanged(); - } else { - policyBasedRoutesBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * Policy based routes to be returned.
-     * 
- * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_routes = 1; - * - */ - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Builder - getPolicyBasedRoutesBuilder(int index) { - return getPolicyBasedRoutesFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * Policy based routes to be returned.
-     * 
- * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_routes = 1; - * - */ - public com.google.cloud.networkconnectivity.v1.PolicyBasedRouteOrBuilder - getPolicyBasedRoutesOrBuilder(int index) { - if (policyBasedRoutesBuilder_ == null) { - return policyBasedRoutes_.get(index); - } else { - return policyBasedRoutesBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * Policy based routes to be returned.
-     * 
- * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_routes = 1; - * - */ - public java.util.List< - ? extends com.google.cloud.networkconnectivity.v1.PolicyBasedRouteOrBuilder> - getPolicyBasedRoutesOrBuilderList() { - if (policyBasedRoutesBuilder_ != null) { - return policyBasedRoutesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(policyBasedRoutes_); - } - } - /** - * - * - *
-     * Policy based routes to be returned.
-     * 
- * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_routes = 1; - * - */ - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Builder - addPolicyBasedRoutesBuilder() { - return getPolicyBasedRoutesFieldBuilder() - .addBuilder( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.getDefaultInstance()); - } - /** - * - * - *
-     * Policy based routes to be returned.
-     * 
- * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_routes = 1; - * - */ - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Builder - addPolicyBasedRoutesBuilder(int index) { - return getPolicyBasedRoutesFieldBuilder() - .addBuilder( - index, com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.getDefaultInstance()); - } - /** - * - * - *
-     * Policy based routes to be returned.
-     * 
- * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_routes = 1; - * - */ - public java.util.List - getPolicyBasedRoutesBuilderList() { - return getPolicyBasedRoutesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Builder, - com.google.cloud.networkconnectivity.v1.PolicyBasedRouteOrBuilder> - getPolicyBasedRoutesFieldBuilder() { - if (policyBasedRoutesBuilder_ == null) { - policyBasedRoutesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Builder, - com.google.cloud.networkconnectivity.v1.PolicyBasedRouteOrBuilder>( - policyBasedRoutes_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - policyBasedRoutes_ = null; - } - return policyBasedRoutesBuilder_; - } - - private java.lang.Object nextPageToken_ = ""; - /** - * - * - *
-     * The next pagination token in the List response. It should be used as
-     * page_token for the following request. An empty value means no more result.
-     * 
- * - * string next_page_token = 2; - * - * @return The nextPageToken. - */ - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The next pagination token in the List response. It should be used as
-     * page_token for the following request. An empty value means no more result.
-     * 
- * - * string next_page_token = 2; - * - * @return The bytes for nextPageToken. - */ - public com.google.protobuf.ByteString getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The next pagination token in the List response. It should be used as
-     * page_token for the following request. An empty value means no more result.
-     * 
- * - * string next_page_token = 2; - * - * @param value The nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageToken(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - nextPageToken_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-     * The next pagination token in the List response. It should be used as
-     * page_token for the following request. An empty value means no more result.
-     * 
- * - * string next_page_token = 2; - * - * @return This builder for chaining. - */ - public Builder clearNextPageToken() { - nextPageToken_ = getDefaultInstance().getNextPageToken(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - * - * - *
-     * The next pagination token in the List response. It should be used as
-     * page_token for the following request. An empty value means no more result.
-     * 
- * - * string next_page_token = 2; - * - * @param value The bytes for nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - nextPageToken_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList unreachable_ = - com.google.protobuf.LazyStringArrayList.EMPTY; - - private void ensureUnreachableIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); - bitField0_ |= 0x00000004; - } - } - /** - * - * - *
-     * Locations that could not be reached.
-     * 
- * - * repeated string unreachable = 3; - * - * @return A list containing the unreachable. - */ - public com.google.protobuf.ProtocolStringList getUnreachableList() { - return unreachable_.getUnmodifiableView(); - } - /** - * - * - *
-     * Locations that could not be reached.
-     * 
- * - * repeated string unreachable = 3; - * - * @return The count of unreachable. - */ - public int getUnreachableCount() { - return unreachable_.size(); - } - /** - * - * - *
-     * Locations that could not be reached.
-     * 
- * - * repeated string unreachable = 3; - * - * @param index The index of the element to return. - * @return The unreachable at the given index. - */ - public java.lang.String getUnreachable(int index) { - return unreachable_.get(index); - } - /** - * - * - *
-     * Locations that could not be reached.
-     * 
- * - * repeated string unreachable = 3; - * - * @param index The index of the value to return. - * @return The bytes of the unreachable at the given index. - */ - public com.google.protobuf.ByteString getUnreachableBytes(int index) { - return unreachable_.getByteString(index); - } - /** - * - * - *
-     * Locations that could not be reached.
-     * 
- * - * repeated string unreachable = 3; - * - * @param index The index to set the value at. - * @param value The unreachable to set. - * @return This builder for chaining. - */ - public Builder setUnreachable(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureUnreachableIsMutable(); - unreachable_.set(index, value); - onChanged(); - return this; - } - /** - * - * - *
-     * Locations that could not be reached.
-     * 
- * - * repeated string unreachable = 3; - * - * @param value The unreachable to add. - * @return This builder for chaining. - */ - public Builder addUnreachable(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureUnreachableIsMutable(); - unreachable_.add(value); - onChanged(); - return this; - } - /** - * - * - *
-     * Locations that could not be reached.
-     * 
- * - * repeated string unreachable = 3; - * - * @param values The unreachable to add. - * @return This builder for chaining. - */ - public Builder addAllUnreachable(java.lang.Iterable values) { - ensureUnreachableIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); - onChanged(); - return this; - } - /** - * - * - *
-     * Locations that could not be reached.
-     * 
- * - * repeated string unreachable = 3; - * - * @return This builder for chaining. - */ - public Builder clearUnreachable() { - unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - /** - * - * - *
-     * Locations that could not be reached.
-     * 
- * - * repeated string unreachable = 3; - * - * @param value The bytes of the unreachable to add. - * @return This builder for chaining. - */ - public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureUnreachableIsMutable(); - unreachable_.add(value); - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse) - } - - // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse) - private static final com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse(); - } - - public static com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListPolicyBasedRoutesResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListPolicyBasedRoutesResponseOrBuilder.java b/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListPolicyBasedRoutesResponseOrBuilder.java deleted file mode 100644 index 876654c552f5..000000000000 --- a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/ListPolicyBasedRoutesResponseOrBuilder.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright 2020 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. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/networkconnectivity/v1/policy_based_routing.proto - -package com.google.cloud.networkconnectivity.v1; - -public interface ListPolicyBasedRoutesResponseOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Policy based routes to be returned.
-   * 
- * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_routes = 1; - * - */ - java.util.List - getPolicyBasedRoutesList(); - /** - * - * - *
-   * Policy based routes to be returned.
-   * 
- * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_routes = 1; - * - */ - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute getPolicyBasedRoutes(int index); - /** - * - * - *
-   * Policy based routes to be returned.
-   * 
- * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_routes = 1; - * - */ - int getPolicyBasedRoutesCount(); - /** - * - * - *
-   * Policy based routes to be returned.
-   * 
- * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_routes = 1; - * - */ - java.util.List - getPolicyBasedRoutesOrBuilderList(); - /** - * - * - *
-   * Policy based routes to be returned.
-   * 
- * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute policy_based_routes = 1; - * - */ - com.google.cloud.networkconnectivity.v1.PolicyBasedRouteOrBuilder getPolicyBasedRoutesOrBuilder( - int index); - - /** - * - * - *
-   * The next pagination token in the List response. It should be used as
-   * page_token for the following request. An empty value means no more result.
-   * 
- * - * string next_page_token = 2; - * - * @return The nextPageToken. - */ - java.lang.String getNextPageToken(); - /** - * - * - *
-   * The next pagination token in the List response. It should be used as
-   * page_token for the following request. An empty value means no more result.
-   * 
- * - * string next_page_token = 2; - * - * @return The bytes for nextPageToken. - */ - com.google.protobuf.ByteString getNextPageTokenBytes(); - - /** - * - * - *
-   * Locations that could not be reached.
-   * 
- * - * repeated string unreachable = 3; - * - * @return A list containing the unreachable. - */ - java.util.List getUnreachableList(); - /** - * - * - *
-   * Locations that could not be reached.
-   * 
- * - * repeated string unreachable = 3; - * - * @return The count of unreachable. - */ - int getUnreachableCount(); - /** - * - * - *
-   * Locations that could not be reached.
-   * 
- * - * repeated string unreachable = 3; - * - * @param index The index of the element to return. - * @return The unreachable at the given index. - */ - java.lang.String getUnreachable(int index); - /** - * - * - *
-   * Locations that could not be reached.
-   * 
- * - * repeated string unreachable = 3; - * - * @param index The index of the value to return. - * @return The bytes of the unreachable at the given index. - */ - com.google.protobuf.ByteString getUnreachableBytes(int index); -} diff --git a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRoute.java b/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRoute.java deleted file mode 100644 index 0d5216a57065..000000000000 --- a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRoute.java +++ /dev/null @@ -1,8859 +0,0 @@ -/* - * Copyright 2020 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. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/networkconnectivity/v1/policy_based_routing.proto - -package com.google.cloud.networkconnectivity.v1; - -/** - * - * - *
- * Policy Based Routes (PBR) are more powerful routes that allows GCP customers
- * to route their L4 network traffic based on not just destination IP, but also
- * source IP, protocol and more. A PBR always take precedence when it conflicts
- * with other types of routes.
- * Next id: 19
- * 
- * - * Protobuf type {@code google.cloud.networkconnectivity.v1.PolicyBasedRoute} - */ -public final class PolicyBasedRoute extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.PolicyBasedRoute) - PolicyBasedRouteOrBuilder { - private static final long serialVersionUID = 0L; - // Use PolicyBasedRoute.newBuilder() to construct. - private PolicyBasedRoute(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private PolicyBasedRoute() { - name_ = ""; - description_ = ""; - network_ = ""; - warnings_ = java.util.Collections.emptyList(); - selfLink_ = ""; - kind_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new PolicyBasedRoute(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 4: - return internalGetLabels(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.class, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Builder.class); - } - - public interface VirtualMachineOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Optional. A list of VM instance tags to which this policy based route applies to.
-     * VM instances that have ANY of tags specified here will install this
-     * PBR.
-     * 
- * - * repeated string tags = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return A list containing the tags. - */ - java.util.List getTagsList(); - /** - * - * - *
-     * Optional. A list of VM instance tags to which this policy based route applies to.
-     * VM instances that have ANY of tags specified here will install this
-     * PBR.
-     * 
- * - * repeated string tags = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The count of tags. - */ - int getTagsCount(); - /** - * - * - *
-     * Optional. A list of VM instance tags to which this policy based route applies to.
-     * VM instances that have ANY of tags specified here will install this
-     * PBR.
-     * 
- * - * repeated string tags = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param index The index of the element to return. - * @return The tags at the given index. - */ - java.lang.String getTags(int index); - /** - * - * - *
-     * Optional. A list of VM instance tags to which this policy based route applies to.
-     * VM instances that have ANY of tags specified here will install this
-     * PBR.
-     * 
- * - * repeated string tags = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param index The index of the value to return. - * @return The bytes of the tags at the given index. - */ - com.google.protobuf.ByteString getTagsBytes(int index); - } - /** - * - * - *
-   * VM instances to which this policy based route applies to.
-   * 
- * - * Protobuf type {@code google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine} - */ - public static final class VirtualMachine extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine) - VirtualMachineOrBuilder { - private static final long serialVersionUID = 0L; - // Use VirtualMachine.newBuilder() to construct. - private VirtualMachine(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private VirtualMachine() { - tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new VirtualMachine(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_VirtualMachine_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_VirtualMachine_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine.class, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine.Builder - .class); - } - - public static final int TAGS_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private com.google.protobuf.LazyStringList tags_; - /** - * - * - *
-     * Optional. A list of VM instance tags to which this policy based route applies to.
-     * VM instances that have ANY of tags specified here will install this
-     * PBR.
-     * 
- * - * repeated string tags = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return A list containing the tags. - */ - public com.google.protobuf.ProtocolStringList getTagsList() { - return tags_; - } - /** - * - * - *
-     * Optional. A list of VM instance tags to which this policy based route applies to.
-     * VM instances that have ANY of tags specified here will install this
-     * PBR.
-     * 
- * - * repeated string tags = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The count of tags. - */ - public int getTagsCount() { - return tags_.size(); - } - /** - * - * - *
-     * Optional. A list of VM instance tags to which this policy based route applies to.
-     * VM instances that have ANY of tags specified here will install this
-     * PBR.
-     * 
- * - * repeated string tags = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param index The index of the element to return. - * @return The tags at the given index. - */ - public java.lang.String getTags(int index) { - return tags_.get(index); - } - /** - * - * - *
-     * Optional. A list of VM instance tags to which this policy based route applies to.
-     * VM instances that have ANY of tags specified here will install this
-     * PBR.
-     * 
- * - * repeated string tags = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param index The index of the value to return. - * @return The bytes of the tags at the given index. - */ - public com.google.protobuf.ByteString getTagsBytes(int index) { - return tags_.getByteString(index); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < tags_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, tags_.getRaw(i)); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < tags_.size(); i++) { - dataSize += computeStringSizeNoTag(tags_.getRaw(i)); - } - size += dataSize; - size += 1 * getTagsList().size(); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj - instanceof com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine)) { - return super.equals(obj); - } - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine other = - (com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine) obj; - - if (!getTagsList().equals(other.getTagsList())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getTagsCount() > 0) { - hash = (37 * hash) + TAGS_FIELD_NUMBER; - hash = (53 * hash) + getTagsList().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * VM instances to which this policy based route applies to.
-     * 
- * - * Protobuf type {@code google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine) - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachineOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_VirtualMachine_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_VirtualMachine_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine.class, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine.Builder - .class); - } - - // Construct using - // com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_VirtualMachine_descriptor; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine - getDefaultInstanceForType() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine build() { - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine result = - buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine - buildPartial() { - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine result = - new com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartialRepeatedFields( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine result) { - if (((bitField0_ & 0x00000001) != 0)) { - tags_ = tags_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.tags_ = tags_; - } - - private void buildPartial0( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine result) { - int from_bitField0_ = bitField0_; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine) { - return mergeFrom( - (com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine other) { - if (other - == com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine - .getDefaultInstance()) return this; - if (!other.tags_.isEmpty()) { - if (tags_.isEmpty()) { - tags_ = other.tags_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureTagsIsMutable(); - tags_.addAll(other.tags_); - } - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - ensureTagsIsMutable(); - tags_.add(s); - break; - } // case 10 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private com.google.protobuf.LazyStringList tags_ = - com.google.protobuf.LazyStringArrayList.EMPTY; - - private void ensureTagsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - tags_ = new com.google.protobuf.LazyStringArrayList(tags_); - bitField0_ |= 0x00000001; - } - } - /** - * - * - *
-       * Optional. A list of VM instance tags to which this policy based route applies to.
-       * VM instances that have ANY of tags specified here will install this
-       * PBR.
-       * 
- * - * repeated string tags = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return A list containing the tags. - */ - public com.google.protobuf.ProtocolStringList getTagsList() { - return tags_.getUnmodifiableView(); - } - /** - * - * - *
-       * Optional. A list of VM instance tags to which this policy based route applies to.
-       * VM instances that have ANY of tags specified here will install this
-       * PBR.
-       * 
- * - * repeated string tags = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The count of tags. - */ - public int getTagsCount() { - return tags_.size(); - } - /** - * - * - *
-       * Optional. A list of VM instance tags to which this policy based route applies to.
-       * VM instances that have ANY of tags specified here will install this
-       * PBR.
-       * 
- * - * repeated string tags = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param index The index of the element to return. - * @return The tags at the given index. - */ - public java.lang.String getTags(int index) { - return tags_.get(index); - } - /** - * - * - *
-       * Optional. A list of VM instance tags to which this policy based route applies to.
-       * VM instances that have ANY of tags specified here will install this
-       * PBR.
-       * 
- * - * repeated string tags = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param index The index of the value to return. - * @return The bytes of the tags at the given index. - */ - public com.google.protobuf.ByteString getTagsBytes(int index) { - return tags_.getByteString(index); - } - /** - * - * - *
-       * Optional. A list of VM instance tags to which this policy based route applies to.
-       * VM instances that have ANY of tags specified here will install this
-       * PBR.
-       * 
- * - * repeated string tags = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param index The index to set the value at. - * @param value The tags to set. - * @return This builder for chaining. - */ - public Builder setTags(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTagsIsMutable(); - tags_.set(index, value); - onChanged(); - return this; - } - /** - * - * - *
-       * Optional. A list of VM instance tags to which this policy based route applies to.
-       * VM instances that have ANY of tags specified here will install this
-       * PBR.
-       * 
- * - * repeated string tags = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The tags to add. - * @return This builder for chaining. - */ - public Builder addTags(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureTagsIsMutable(); - tags_.add(value); - onChanged(); - return this; - } - /** - * - * - *
-       * Optional. A list of VM instance tags to which this policy based route applies to.
-       * VM instances that have ANY of tags specified here will install this
-       * PBR.
-       * 
- * - * repeated string tags = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param values The tags to add. - * @return This builder for chaining. - */ - public Builder addAllTags(java.lang.Iterable values) { - ensureTagsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tags_); - onChanged(); - return this; - } - /** - * - * - *
-       * Optional. A list of VM instance tags to which this policy based route applies to.
-       * VM instances that have ANY of tags specified here will install this
-       * PBR.
-       * 
- * - * repeated string tags = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return This builder for chaining. - */ - public Builder clearTags() { - tags_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-       * Optional. A list of VM instance tags to which this policy based route applies to.
-       * VM instances that have ANY of tags specified here will install this
-       * PBR.
-       * 
- * - * repeated string tags = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The bytes of the tags to add. - * @return This builder for chaining. - */ - public Builder addTagsBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureTagsIsMutable(); - tags_.add(value); - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine) - } - - // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine) - private static final com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine(); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public VirtualMachine parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException() - .setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface InterconnectAttachmentOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Optional. Cloud region to install this policy based route on interconnect
-     * attachment. Use `all` to install it on all interconnect attachments.
-     * 
- * - * string region = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The region. - */ - java.lang.String getRegion(); - /** - * - * - *
-     * Optional. Cloud region to install this policy based route on interconnect
-     * attachment. Use `all` to install it on all interconnect attachments.
-     * 
- * - * string region = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for region. - */ - com.google.protobuf.ByteString getRegionBytes(); - } - /** - * - * - *
-   * InterconnectAttachment to which this route applies to.
-   * 
- * - * Protobuf type {@code - * google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment} - */ - public static final class InterconnectAttachment extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment) - InterconnectAttachmentOrBuilder { - private static final long serialVersionUID = 0L; - // Use InterconnectAttachment.newBuilder() to construct. - private InterconnectAttachment(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private InterconnectAttachment() { - region_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new InterconnectAttachment(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_InterconnectAttachment_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_InterconnectAttachment_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment.class, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - .Builder.class); - } - - public static final int REGION_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object region_ = ""; - /** - * - * - *
-     * Optional. Cloud region to install this policy based route on interconnect
-     * attachment. Use `all` to install it on all interconnect attachments.
-     * 
- * - * string region = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The region. - */ - @java.lang.Override - public java.lang.String getRegion() { - java.lang.Object ref = region_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - region_ = s; - return s; - } - } - /** - * - * - *
-     * Optional. Cloud region to install this policy based route on interconnect
-     * attachment. Use `all` to install it on all interconnect attachments.
-     * 
- * - * string region = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for region. - */ - @java.lang.Override - public com.google.protobuf.ByteString getRegionBytes() { - java.lang.Object ref = region_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - region_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(region_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, region_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(region_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, region_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj - instanceof - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment)) { - return super.equals(obj); - } - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment other = - (com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment) obj; - - if (!getRegion().equals(other.getRegion())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + REGION_FIELD_NUMBER; - hash = (53 * hash) + getRegion().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * InterconnectAttachment to which this route applies to.
-     * 
- * - * Protobuf type {@code - * google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment) - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachmentOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_InterconnectAttachment_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_InterconnectAttachment_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - .class, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - .Builder.class); - } - - // Construct using - // com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - region_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_InterconnectAttachment_descriptor; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - getDefaultInstanceForType() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - build() { - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment result = - buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - buildPartial() { - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment result = - new com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment( - this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.region_ = region_; - } - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment) { - return mergeFrom( - (com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment) - other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment other) { - if (other - == com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - .getDefaultInstance()) return this; - if (!other.getRegion().isEmpty()) { - region_ = other.region_; - bitField0_ |= 0x00000001; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - region_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object region_ = ""; - /** - * - * - *
-       * Optional. Cloud region to install this policy based route on interconnect
-       * attachment. Use `all` to install it on all interconnect attachments.
-       * 
- * - * string region = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The region. - */ - public java.lang.String getRegion() { - java.lang.Object ref = region_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - region_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * Optional. Cloud region to install this policy based route on interconnect
-       * attachment. Use `all` to install it on all interconnect attachments.
-       * 
- * - * string region = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for region. - */ - public com.google.protobuf.ByteString getRegionBytes() { - java.lang.Object ref = region_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - region_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * Optional. Cloud region to install this policy based route on interconnect
-       * attachment. Use `all` to install it on all interconnect attachments.
-       * 
- * - * string region = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The region to set. - * @return This builder for chaining. - */ - public Builder setRegion(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - region_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-       * Optional. Cloud region to install this policy based route on interconnect
-       * attachment. Use `all` to install it on all interconnect attachments.
-       * 
- * - * string region = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return This builder for chaining. - */ - public Builder clearRegion() { - region_ = getDefaultInstance().getRegion(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-       * Optional. Cloud region to install this policy based route on interconnect
-       * attachment. Use `all` to install it on all interconnect attachments.
-       * 
- * - * string region = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The bytes for region to set. - * @return This builder for chaining. - */ - public Builder setRegionBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - region_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment) - } - - // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment) - private static final com.google.cloud.networkconnectivity.v1.PolicyBasedRoute - .InterconnectAttachment - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment(); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public InterconnectAttachment parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException() - .setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface FilterOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Optional. The IP protocol that this policy based route applies to. Valid values are
-     * 'TCP', 'UDP', and 'ALL'. Default is 'ALL'.
-     * 
- * - * string ip_protocol = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The ipProtocol. - */ - java.lang.String getIpProtocol(); - /** - * - * - *
-     * Optional. The IP protocol that this policy based route applies to. Valid values are
-     * 'TCP', 'UDP', and 'ALL'. Default is 'ALL'.
-     * 
- * - * string ip_protocol = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for ipProtocol. - */ - com.google.protobuf.ByteString getIpProtocolBytes(); - - /** - * - * - *
-     * Optional. The source IP range of outgoing packets that this policy based route
-     * applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
-     * 
- * - * string src_range = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The srcRange. - */ - java.lang.String getSrcRange(); - /** - * - * - *
-     * Optional. The source IP range of outgoing packets that this policy based route
-     * applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
-     * 
- * - * string src_range = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for srcRange. - */ - com.google.protobuf.ByteString getSrcRangeBytes(); - - /** - * - * - *
-     * Optional. The destination IP range of outgoing packets that this policy based route
-     * applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
-     * 
- * - * string dest_range = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The destRange. - */ - java.lang.String getDestRange(); - /** - * - * - *
-     * Optional. The destination IP range of outgoing packets that this policy based route
-     * applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
-     * 
- * - * string dest_range = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for destRange. - */ - com.google.protobuf.ByteString getDestRangeBytes(); - - /** - * - * - *
-     * Required. Internet protocol versions this policy based route applies to. For this
-     * version, only IPV4 is supported.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion protocol_version = 6 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The enum numeric value on the wire for protocolVersion. - */ - int getProtocolVersionValue(); - /** - * - * - *
-     * Required. Internet protocol versions this policy based route applies to. For this
-     * version, only IPV4 is supported.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion protocol_version = 6 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The protocolVersion. - */ - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion - getProtocolVersion(); - } - /** - * - * - *
-   * Filter matches L4 traffic.
-   * 
- * - * Protobuf type {@code google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter} - */ - public static final class Filter extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter) - FilterOrBuilder { - private static final long serialVersionUID = 0L; - // Use Filter.newBuilder() to construct. - private Filter(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Filter() { - ipProtocol_ = ""; - srcRange_ = ""; - destRange_ = ""; - protocolVersion_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Filter(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_Filter_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_Filter_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.class, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.Builder.class); - } - - /** - * - * - *
-     * The internet protocol version.
-     * 
- * - * Protobuf enum {@code - * google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion} - */ - public enum ProtocolVersion implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-       * Default value.
-       * 
- * - * PROTOCOL_VERSION_UNSPECIFIED = 0; - */ - PROTOCOL_VERSION_UNSPECIFIED(0), - /** - * - * - *
-       * The PBR is for IPv4 internet protocol traffic.
-       * 
- * - * IPV4 = 1; - */ - IPV4(1), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-       * Default value.
-       * 
- * - * PROTOCOL_VERSION_UNSPECIFIED = 0; - */ - public static final int PROTOCOL_VERSION_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-       * The PBR is for IPv4 internet protocol traffic.
-       * 
- * - * IPV4 = 1; - */ - public static final int IPV4_VALUE = 1; - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static ProtocolVersion valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static ProtocolVersion forNumber(int value) { - switch (value) { - case 0: - return PROTOCOL_VERSION_UNSPECIFIED; - case 1: - return IPV4; - default: - return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - - private static final com.google.protobuf.Internal.EnumLiteMap - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public ProtocolVersion findValueByNumber(int number) { - return ProtocolVersion.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - - public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { - return getDescriptor(); - } - - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.getDescriptor() - .getEnumTypes() - .get(0); - } - - private static final ProtocolVersion[] VALUES = values(); - - public static ProtocolVersion valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private ProtocolVersion(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion) - } - - public static final int IP_PROTOCOL_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object ipProtocol_ = ""; - /** - * - * - *
-     * Optional. The IP protocol that this policy based route applies to. Valid values are
-     * 'TCP', 'UDP', and 'ALL'. Default is 'ALL'.
-     * 
- * - * string ip_protocol = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The ipProtocol. - */ - @java.lang.Override - public java.lang.String getIpProtocol() { - java.lang.Object ref = ipProtocol_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - ipProtocol_ = s; - return s; - } - } - /** - * - * - *
-     * Optional. The IP protocol that this policy based route applies to. Valid values are
-     * 'TCP', 'UDP', and 'ALL'. Default is 'ALL'.
-     * 
- * - * string ip_protocol = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for ipProtocol. - */ - @java.lang.Override - public com.google.protobuf.ByteString getIpProtocolBytes() { - java.lang.Object ref = ipProtocol_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - ipProtocol_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SRC_RANGE_FIELD_NUMBER = 2; - - @SuppressWarnings("serial") - private volatile java.lang.Object srcRange_ = ""; - /** - * - * - *
-     * Optional. The source IP range of outgoing packets that this policy based route
-     * applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
-     * 
- * - * string src_range = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The srcRange. - */ - @java.lang.Override - public java.lang.String getSrcRange() { - java.lang.Object ref = srcRange_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - srcRange_ = s; - return s; - } - } - /** - * - * - *
-     * Optional. The source IP range of outgoing packets that this policy based route
-     * applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
-     * 
- * - * string src_range = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for srcRange. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSrcRangeBytes() { - java.lang.Object ref = srcRange_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - srcRange_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DEST_RANGE_FIELD_NUMBER = 3; - - @SuppressWarnings("serial") - private volatile java.lang.Object destRange_ = ""; - /** - * - * - *
-     * Optional. The destination IP range of outgoing packets that this policy based route
-     * applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
-     * 
- * - * string dest_range = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The destRange. - */ - @java.lang.Override - public java.lang.String getDestRange() { - java.lang.Object ref = destRange_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - destRange_ = s; - return s; - } - } - /** - * - * - *
-     * Optional. The destination IP range of outgoing packets that this policy based route
-     * applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
-     * 
- * - * string dest_range = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for destRange. - */ - @java.lang.Override - public com.google.protobuf.ByteString getDestRangeBytes() { - java.lang.Object ref = destRange_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - destRange_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PROTOCOL_VERSION_FIELD_NUMBER = 6; - private int protocolVersion_ = 0; - /** - * - * - *
-     * Required. Internet protocol versions this policy based route applies to. For this
-     * version, only IPV4 is supported.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion protocol_version = 6 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The enum numeric value on the wire for protocolVersion. - */ - @java.lang.Override - public int getProtocolVersionValue() { - return protocolVersion_; - } - /** - * - * - *
-     * Required. Internet protocol versions this policy based route applies to. For this
-     * version, only IPV4 is supported.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion protocol_version = 6 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The protocolVersion. - */ - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion - getProtocolVersion() { - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion result = - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion.forNumber( - protocolVersion_); - return result == null - ? com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion - .UNRECOGNIZED - : result; - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ipProtocol_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ipProtocol_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(srcRange_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, srcRange_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destRange_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, destRange_); - } - if (protocolVersion_ - != com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion - .PROTOCOL_VERSION_UNSPECIFIED - .getNumber()) { - output.writeEnum(6, protocolVersion_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ipProtocol_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, ipProtocol_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(srcRange_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, srcRange_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destRange_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, destRange_); - } - if (protocolVersion_ - != com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion - .PROTOCOL_VERSION_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, protocolVersion_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter)) { - return super.equals(obj); - } - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter other = - (com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter) obj; - - if (!getIpProtocol().equals(other.getIpProtocol())) return false; - if (!getSrcRange().equals(other.getSrcRange())) return false; - if (!getDestRange().equals(other.getDestRange())) return false; - if (protocolVersion_ != other.protocolVersion_) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + IP_PROTOCOL_FIELD_NUMBER; - hash = (53 * hash) + getIpProtocol().hashCode(); - hash = (37 * hash) + SRC_RANGE_FIELD_NUMBER; - hash = (53 * hash) + getSrcRange().hashCode(); - hash = (37 * hash) + DEST_RANGE_FIELD_NUMBER; - hash = (53 * hash) + getDestRange().hashCode(); - hash = (37 * hash) + PROTOCOL_VERSION_FIELD_NUMBER; - hash = (53 * hash) + protocolVersion_; - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * Filter matches L4 traffic.
-     * 
- * - * Protobuf type {@code google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter) - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.FilterOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_Filter_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_Filter_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.class, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.Builder.class); - } - - // Construct using - // com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - ipProtocol_ = ""; - srcRange_ = ""; - destRange_ = ""; - protocolVersion_ = 0; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_Filter_descriptor; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter - getDefaultInstanceForType() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter build() { - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter buildPartial() { - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter result = - new com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.ipProtocol_ = ipProtocol_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.srcRange_ = srcRange_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.destRange_ = destRange_; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.protocolVersion_ = protocolVersion_; - } - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter) { - return mergeFrom((com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter other) { - if (other - == com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.getDefaultInstance()) - return this; - if (!other.getIpProtocol().isEmpty()) { - ipProtocol_ = other.ipProtocol_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (!other.getSrcRange().isEmpty()) { - srcRange_ = other.srcRange_; - bitField0_ |= 0x00000002; - onChanged(); - } - if (!other.getDestRange().isEmpty()) { - destRange_ = other.destRange_; - bitField0_ |= 0x00000004; - onChanged(); - } - if (other.protocolVersion_ != 0) { - setProtocolVersionValue(other.getProtocolVersionValue()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - ipProtocol_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: - { - srcRange_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000002; - break; - } // case 18 - case 26: - { - destRange_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000004; - break; - } // case 26 - case 48: - { - protocolVersion_ = input.readEnum(); - bitField0_ |= 0x00000008; - break; - } // case 48 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private java.lang.Object ipProtocol_ = ""; - /** - * - * - *
-       * Optional. The IP protocol that this policy based route applies to. Valid values are
-       * 'TCP', 'UDP', and 'ALL'. Default is 'ALL'.
-       * 
- * - * string ip_protocol = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The ipProtocol. - */ - public java.lang.String getIpProtocol() { - java.lang.Object ref = ipProtocol_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - ipProtocol_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * Optional. The IP protocol that this policy based route applies to. Valid values are
-       * 'TCP', 'UDP', and 'ALL'. Default is 'ALL'.
-       * 
- * - * string ip_protocol = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for ipProtocol. - */ - public com.google.protobuf.ByteString getIpProtocolBytes() { - java.lang.Object ref = ipProtocol_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - ipProtocol_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * Optional. The IP protocol that this policy based route applies to. Valid values are
-       * 'TCP', 'UDP', and 'ALL'. Default is 'ALL'.
-       * 
- * - * string ip_protocol = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The ipProtocol to set. - * @return This builder for chaining. - */ - public Builder setIpProtocol(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ipProtocol_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-       * Optional. The IP protocol that this policy based route applies to. Valid values are
-       * 'TCP', 'UDP', and 'ALL'. Default is 'ALL'.
-       * 
- * - * string ip_protocol = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return This builder for chaining. - */ - public Builder clearIpProtocol() { - ipProtocol_ = getDefaultInstance().getIpProtocol(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * - * - *
-       * Optional. The IP protocol that this policy based route applies to. Valid values are
-       * 'TCP', 'UDP', and 'ALL'. Default is 'ALL'.
-       * 
- * - * string ip_protocol = 1 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The bytes for ipProtocol to set. - * @return This builder for chaining. - */ - public Builder setIpProtocolBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ipProtocol_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private java.lang.Object srcRange_ = ""; - /** - * - * - *
-       * Optional. The source IP range of outgoing packets that this policy based route
-       * applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
-       * 
- * - * string src_range = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The srcRange. - */ - public java.lang.String getSrcRange() { - java.lang.Object ref = srcRange_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - srcRange_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * Optional. The source IP range of outgoing packets that this policy based route
-       * applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
-       * 
- * - * string src_range = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for srcRange. - */ - public com.google.protobuf.ByteString getSrcRangeBytes() { - java.lang.Object ref = srcRange_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - srcRange_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * Optional. The source IP range of outgoing packets that this policy based route
-       * applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
-       * 
- * - * string src_range = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The srcRange to set. - * @return This builder for chaining. - */ - public Builder setSrcRange(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - srcRange_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - * - * - *
-       * Optional. The source IP range of outgoing packets that this policy based route
-       * applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
-       * 
- * - * string src_range = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return This builder for chaining. - */ - public Builder clearSrcRange() { - srcRange_ = getDefaultInstance().getSrcRange(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - * - * - *
-       * Optional. The source IP range of outgoing packets that this policy based route
-       * applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
-       * 
- * - * string src_range = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The bytes for srcRange to set. - * @return This builder for chaining. - */ - public Builder setSrcRangeBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - srcRange_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - private java.lang.Object destRange_ = ""; - /** - * - * - *
-       * Optional. The destination IP range of outgoing packets that this policy based route
-       * applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
-       * 
- * - * string dest_range = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The destRange. - */ - public java.lang.String getDestRange() { - java.lang.Object ref = destRange_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - destRange_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * Optional. The destination IP range of outgoing packets that this policy based route
-       * applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
-       * 
- * - * string dest_range = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for destRange. - */ - public com.google.protobuf.ByteString getDestRangeBytes() { - java.lang.Object ref = destRange_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - destRange_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * Optional. The destination IP range of outgoing packets that this policy based route
-       * applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
-       * 
- * - * string dest_range = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The destRange to set. - * @return This builder for chaining. - */ - public Builder setDestRange(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - destRange_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-       * Optional. The destination IP range of outgoing packets that this policy based route
-       * applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
-       * 
- * - * string dest_range = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return This builder for chaining. - */ - public Builder clearDestRange() { - destRange_ = getDefaultInstance().getDestRange(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - /** - * - * - *
-       * Optional. The destination IP range of outgoing packets that this policy based route
-       * applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
-       * 
- * - * string dest_range = 3 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The bytes for destRange to set. - * @return This builder for chaining. - */ - public Builder setDestRangeBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - destRange_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - private int protocolVersion_ = 0; - /** - * - * - *
-       * Required. Internet protocol versions this policy based route applies to. For this
-       * version, only IPV4 is supported.
-       * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion protocol_version = 6 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The enum numeric value on the wire for protocolVersion. - */ - @java.lang.Override - public int getProtocolVersionValue() { - return protocolVersion_; - } - /** - * - * - *
-       * Required. Internet protocol versions this policy based route applies to. For this
-       * version, only IPV4 is supported.
-       * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion protocol_version = 6 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @param value The enum numeric value on the wire for protocolVersion to set. - * @return This builder for chaining. - */ - public Builder setProtocolVersionValue(int value) { - protocolVersion_ = value; - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - /** - * - * - *
-       * Required. Internet protocol versions this policy based route applies to. For this
-       * version, only IPV4 is supported.
-       * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion protocol_version = 6 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The protocolVersion. - */ - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion - getProtocolVersion() { - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion result = - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion - .forNumber(protocolVersion_); - return result == null - ? com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion - .UNRECOGNIZED - : result; - } - /** - * - * - *
-       * Required. Internet protocol versions this policy based route applies to. For this
-       * version, only IPV4 is supported.
-       * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion protocol_version = 6 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @param value The protocolVersion to set. - * @return This builder for chaining. - */ - public Builder setProtocolVersion( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000008; - protocolVersion_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-       * Required. Internet protocol versions this policy based route applies to. For this
-       * version, only IPV4 is supported.
-       * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion protocol_version = 6 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return This builder for chaining. - */ - public Builder clearProtocolVersion() { - bitField0_ = (bitField0_ & ~0x00000008); - protocolVersion_ = 0; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter) - } - - // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter) - private static final com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter(); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Filter parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException() - .setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface WarningsOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Output only. A warning code, if applicable.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The enum numeric value on the wire for code. - */ - int getCodeValue(); - /** - * - * - *
-     * Output only. A warning code, if applicable.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The code. - */ - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code getCode(); - - /** - * - * - *
-     * Output only. Metadata about this warning in key: value format. The key should provides
-     * more detail on the warning being returned. For example, for warnings
-     * where there are no results in a list request for a particular zone, this
-     * key might be scope and the key value might be the zone name. Other
-     * examples might be a key indicating a deprecated resource and a suggested
-     * replacement.
-     * 
- * - * map<string, string> data = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - int getDataCount(); - /** - * - * - *
-     * Output only. Metadata about this warning in key: value format. The key should provides
-     * more detail on the warning being returned. For example, for warnings
-     * where there are no results in a list request for a particular zone, this
-     * key might be scope and the key value might be the zone name. Other
-     * examples might be a key indicating a deprecated resource and a suggested
-     * replacement.
-     * 
- * - * map<string, string> data = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - boolean containsData(java.lang.String key); - /** Use {@link #getDataMap()} instead. */ - @java.lang.Deprecated - java.util.Map getData(); - /** - * - * - *
-     * Output only. Metadata about this warning in key: value format. The key should provides
-     * more detail on the warning being returned. For example, for warnings
-     * where there are no results in a list request for a particular zone, this
-     * key might be scope and the key value might be the zone name. Other
-     * examples might be a key indicating a deprecated resource and a suggested
-     * replacement.
-     * 
- * - * map<string, string> data = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - java.util.Map getDataMap(); - /** - * - * - *
-     * Output only. Metadata about this warning in key: value format. The key should provides
-     * more detail on the warning being returned. For example, for warnings
-     * where there are no results in a list request for a particular zone, this
-     * key might be scope and the key value might be the zone name. Other
-     * examples might be a key indicating a deprecated resource and a suggested
-     * replacement.
-     * 
- * - * map<string, string> data = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - /* nullable */ - java.lang.String getDataOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue); - /** - * - * - *
-     * Output only. Metadata about this warning in key: value format. The key should provides
-     * more detail on the warning being returned. For example, for warnings
-     * where there are no results in a list request for a particular zone, this
-     * key might be scope and the key value might be the zone name. Other
-     * examples might be a key indicating a deprecated resource and a suggested
-     * replacement.
-     * 
- * - * map<string, string> data = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - java.lang.String getDataOrThrow(java.lang.String key); - - /** - * - * - *
-     * Output only. A human-readable description of the warning code.
-     * 
- * - * string warning_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The warningMessage. - */ - java.lang.String getWarningMessage(); - /** - * - * - *
-     * Output only. A human-readable description of the warning code.
-     * 
- * - * string warning_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for warningMessage. - */ - com.google.protobuf.ByteString getWarningMessageBytes(); - } - /** - * - * - *
-   * Informational warning message.
-   * 
- * - * Protobuf type {@code google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings} - */ - public static final class Warnings extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings) - WarningsOrBuilder { - private static final long serialVersionUID = 0L; - // Use Warnings.newBuilder() to construct. - private Warnings(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Warnings() { - code_ = 0; - warningMessage_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Warnings(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_Warnings_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 2: - return internalGetData(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_Warnings_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.class, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Builder.class); - } - - /** - * - * - *
-     * Warning code for Policy Based Routing. Expect to add values in the
-     * future.
-     * 
- * - * Protobuf enum {@code google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code} - */ - public enum Code implements com.google.protobuf.ProtocolMessageEnum { - /** - * - * - *
-       * Default value.
-       * 
- * - * WARNING_UNSPECIFIED = 0; - */ - WARNING_UNSPECIFIED(0), - /** - * - * - *
-       * The policy based route is not active and functioning. Common causes are
-       * the dependent network was deleted or the resource project was turned
-       * off.
-       * 
- * - * RESOURCE_NOT_ACTIVE = 1; - */ - RESOURCE_NOT_ACTIVE(1), - /** - * - * - *
-       * The policy based route is being modified (e.g. created/deleted) at this
-       * time.
-       * 
- * - * RESOURCE_BEING_MODIFIED = 2; - */ - RESOURCE_BEING_MODIFIED(2), - UNRECOGNIZED(-1), - ; - - /** - * - * - *
-       * Default value.
-       * 
- * - * WARNING_UNSPECIFIED = 0; - */ - public static final int WARNING_UNSPECIFIED_VALUE = 0; - /** - * - * - *
-       * The policy based route is not active and functioning. Common causes are
-       * the dependent network was deleted or the resource project was turned
-       * off.
-       * 
- * - * RESOURCE_NOT_ACTIVE = 1; - */ - public static final int RESOURCE_NOT_ACTIVE_VALUE = 1; - /** - * - * - *
-       * The policy based route is being modified (e.g. created/deleted) at this
-       * time.
-       * 
- * - * RESOURCE_BEING_MODIFIED = 2; - */ - public static final int RESOURCE_BEING_MODIFIED_VALUE = 2; - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static Code valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static Code forNumber(int value) { - switch (value) { - case 0: - return WARNING_UNSPECIFIED; - case 1: - return RESOURCE_NOT_ACTIVE; - case 2: - return RESOURCE_BEING_MODIFIED; - default: - return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { - return internalValueMap; - } - - private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public Code findValueByNumber(int number) { - return Code.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - - public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { - return getDescriptor(); - } - - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.getDescriptor() - .getEnumTypes() - .get(0); - } - - private static final Code[] VALUES = values(); - - public static Code valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private Code(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code) - } - - public static final int CODE_FIELD_NUMBER = 1; - private int code_ = 0; - /** - * - * - *
-     * Output only. A warning code, if applicable.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The enum numeric value on the wire for code. - */ - @java.lang.Override - public int getCodeValue() { - return code_; - } - /** - * - * - *
-     * Output only. A warning code, if applicable.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The code. - */ - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code getCode() { - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code result = - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code.forNumber(code_); - return result == null - ? com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code.UNRECOGNIZED - : result; - } - - public static final int DATA_FIELD_NUMBER = 2; - - private static final class DataDefaultEntryHolder { - static final com.google.protobuf.MapEntry defaultEntry = - com.google.protobuf.MapEntry.newDefaultInstance( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_Warnings_DataEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - - @SuppressWarnings("serial") - private com.google.protobuf.MapField data_; - - private com.google.protobuf.MapField internalGetData() { - if (data_ == null) { - return com.google.protobuf.MapField.emptyMapField(DataDefaultEntryHolder.defaultEntry); - } - return data_; - } - - public int getDataCount() { - return internalGetData().getMap().size(); - } - /** - * - * - *
-     * Output only. Metadata about this warning in key: value format. The key should provides
-     * more detail on the warning being returned. For example, for warnings
-     * where there are no results in a list request for a particular zone, this
-     * key might be scope and the key value might be the zone name. Other
-     * examples might be a key indicating a deprecated resource and a suggested
-     * replacement.
-     * 
- * - * map<string, string> data = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - @java.lang.Override - public boolean containsData(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - return internalGetData().getMap().containsKey(key); - } - /** Use {@link #getDataMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getData() { - return getDataMap(); - } - /** - * - * - *
-     * Output only. Metadata about this warning in key: value format. The key should provides
-     * more detail on the warning being returned. For example, for warnings
-     * where there are no results in a list request for a particular zone, this
-     * key might be scope and the key value might be the zone name. Other
-     * examples might be a key indicating a deprecated resource and a suggested
-     * replacement.
-     * 
- * - * map<string, string> data = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - @java.lang.Override - public java.util.Map getDataMap() { - return internalGetData().getMap(); - } - /** - * - * - *
-     * Output only. Metadata about this warning in key: value format. The key should provides
-     * more detail on the warning being returned. For example, for warnings
-     * where there are no results in a list request for a particular zone, this
-     * key might be scope and the key value might be the zone name. Other
-     * examples might be a key indicating a deprecated resource and a suggested
-     * replacement.
-     * 
- * - * map<string, string> data = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - @java.lang.Override - public /* nullable */ java.lang.String getDataOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetData().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * - * - *
-     * Output only. Metadata about this warning in key: value format. The key should provides
-     * more detail on the warning being returned. For example, for warnings
-     * where there are no results in a list request for a particular zone, this
-     * key might be scope and the key value might be the zone name. Other
-     * examples might be a key indicating a deprecated resource and a suggested
-     * replacement.
-     * 
- * - * map<string, string> data = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - @java.lang.Override - public java.lang.String getDataOrThrow(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetData().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int WARNING_MESSAGE_FIELD_NUMBER = 3; - - @SuppressWarnings("serial") - private volatile java.lang.Object warningMessage_ = ""; - /** - * - * - *
-     * Output only. A human-readable description of the warning code.
-     * 
- * - * string warning_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The warningMessage. - */ - @java.lang.Override - public java.lang.String getWarningMessage() { - java.lang.Object ref = warningMessage_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - warningMessage_ = s; - return s; - } - } - /** - * - * - *
-     * Output only. A human-readable description of the warning code.
-     * 
- * - * string warning_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for warningMessage. - */ - @java.lang.Override - public com.google.protobuf.ByteString getWarningMessageBytes() { - java.lang.Object ref = warningMessage_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - warningMessage_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (code_ - != com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code - .WARNING_UNSPECIFIED - .getNumber()) { - output.writeEnum(1, code_); - } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( - output, internalGetData(), DataDefaultEntryHolder.defaultEntry, 2); - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(warningMessage_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, warningMessage_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (code_ - != com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code - .WARNING_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, code_); - } - for (java.util.Map.Entry entry : - internalGetData().getMap().entrySet()) { - com.google.protobuf.MapEntry data__ = - DataDefaultEntryHolder.defaultEntry - .newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, data__); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(warningMessage_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, warningMessage_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings)) { - return super.equals(obj); - } - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings other = - (com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings) obj; - - if (code_ != other.code_) return false; - if (!internalGetData().equals(other.internalGetData())) return false; - if (!getWarningMessage().equals(other.getWarningMessage())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + CODE_FIELD_NUMBER; - hash = (53 * hash) + code_; - if (!internalGetData().getMap().isEmpty()) { - hash = (37 * hash) + DATA_FIELD_NUMBER; - hash = (53 * hash) + internalGetData().hashCode(); - } - hash = (37 * hash) + WARNING_MESSAGE_FIELD_NUMBER; - hash = (53 * hash) + getWarningMessage().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * Informational warning message.
-     * 
- * - * Protobuf type {@code google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings) - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.WarningsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_Warnings_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 2: - return internalGetData(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { - switch (number) { - case 2: - return internalGetMutableData(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_Warnings_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.class, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Builder.class); - } - - // Construct using - // com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - code_ = 0; - internalGetMutableData().clear(); - warningMessage_ = ""; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_Warnings_descriptor; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings - getDefaultInstanceForType() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings build() { - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings buildPartial() { - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings result = - new com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.code_ = code_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.data_ = internalGetData(); - result.data_.makeImmutable(); - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.warningMessage_ = warningMessage_; - } - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings) { - return mergeFrom( - (com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings other) { - if (other - == com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings - .getDefaultInstance()) return this; - if (other.code_ != 0) { - setCodeValue(other.getCodeValue()); - } - internalGetMutableData().mergeFrom(other.internalGetData()); - bitField0_ |= 0x00000002; - if (!other.getWarningMessage().isEmpty()) { - warningMessage_ = other.warningMessage_; - bitField0_ |= 0x00000004; - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - code_ = input.readEnum(); - bitField0_ |= 0x00000001; - break; - } // case 8 - case 18: - { - com.google.protobuf.MapEntry data__ = - input.readMessage( - DataDefaultEntryHolder.defaultEntry.getParserForType(), - extensionRegistry); - internalGetMutableData().getMutableMap().put(data__.getKey(), data__.getValue()); - bitField0_ |= 0x00000002; - break; - } // case 18 - case 26: - { - warningMessage_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000004; - break; - } // case 26 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int bitField0_; - - private int code_ = 0; - /** - * - * - *
-       * Output only. A warning code, if applicable.
-       * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The enum numeric value on the wire for code. - */ - @java.lang.Override - public int getCodeValue() { - return code_; - } - /** - * - * - *
-       * Output only. A warning code, if applicable.
-       * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @param value The enum numeric value on the wire for code to set. - * @return This builder for chaining. - */ - public Builder setCodeValue(int value) { - code_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - /** - * - * - *
-       * Output only. A warning code, if applicable.
-       * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The code. - */ - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code getCode() { - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code result = - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code.forNumber(code_); - return result == null - ? com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code.UNRECOGNIZED - : result; - } - /** - * - * - *
-       * Output only. A warning code, if applicable.
-       * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @param value The code to set. - * @return This builder for chaining. - */ - public Builder setCode( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - code_ = value.getNumber(); - onChanged(); - return this; - } - /** - * - * - *
-       * Output only. A warning code, if applicable.
-       * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code code = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return This builder for chaining. - */ - public Builder clearCode() { - bitField0_ = (bitField0_ & ~0x00000001); - code_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.MapField data_; - - private com.google.protobuf.MapField internalGetData() { - if (data_ == null) { - return com.google.protobuf.MapField.emptyMapField(DataDefaultEntryHolder.defaultEntry); - } - return data_; - } - - private com.google.protobuf.MapField - internalGetMutableData() { - if (data_ == null) { - data_ = com.google.protobuf.MapField.newMapField(DataDefaultEntryHolder.defaultEntry); - } - if (!data_.isMutable()) { - data_ = data_.copy(); - } - bitField0_ |= 0x00000002; - onChanged(); - return data_; - } - - public int getDataCount() { - return internalGetData().getMap().size(); - } - /** - * - * - *
-       * Output only. Metadata about this warning in key: value format. The key should provides
-       * more detail on the warning being returned. For example, for warnings
-       * where there are no results in a list request for a particular zone, this
-       * key might be scope and the key value might be the zone name. Other
-       * examples might be a key indicating a deprecated resource and a suggested
-       * replacement.
-       * 
- * - * map<string, string> data = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - @java.lang.Override - public boolean containsData(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - return internalGetData().getMap().containsKey(key); - } - /** Use {@link #getDataMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getData() { - return getDataMap(); - } - /** - * - * - *
-       * Output only. Metadata about this warning in key: value format. The key should provides
-       * more detail on the warning being returned. For example, for warnings
-       * where there are no results in a list request for a particular zone, this
-       * key might be scope and the key value might be the zone name. Other
-       * examples might be a key indicating a deprecated resource and a suggested
-       * replacement.
-       * 
- * - * map<string, string> data = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - @java.lang.Override - public java.util.Map getDataMap() { - return internalGetData().getMap(); - } - /** - * - * - *
-       * Output only. Metadata about this warning in key: value format. The key should provides
-       * more detail on the warning being returned. For example, for warnings
-       * where there are no results in a list request for a particular zone, this
-       * key might be scope and the key value might be the zone name. Other
-       * examples might be a key indicating a deprecated resource and a suggested
-       * replacement.
-       * 
- * - * map<string, string> data = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - @java.lang.Override - public /* nullable */ java.lang.String getDataOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetData().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * - * - *
-       * Output only. Metadata about this warning in key: value format. The key should provides
-       * more detail on the warning being returned. For example, for warnings
-       * where there are no results in a list request for a particular zone, this
-       * key might be scope and the key value might be the zone name. Other
-       * examples might be a key indicating a deprecated resource and a suggested
-       * replacement.
-       * 
- * - * map<string, string> data = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - @java.lang.Override - public java.lang.String getDataOrThrow(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetData().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearData() { - bitField0_ = (bitField0_ & ~0x00000002); - internalGetMutableData().getMutableMap().clear(); - return this; - } - /** - * - * - *
-       * Output only. Metadata about this warning in key: value format. The key should provides
-       * more detail on the warning being returned. For example, for warnings
-       * where there are no results in a list request for a particular zone, this
-       * key might be scope and the key value might be the zone name. Other
-       * examples might be a key indicating a deprecated resource and a suggested
-       * replacement.
-       * 
- * - * map<string, string> data = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder removeData(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - internalGetMutableData().getMutableMap().remove(key); - return this; - } - /** Use alternate mutation accessors instead. */ - @java.lang.Deprecated - public java.util.Map getMutableData() { - bitField0_ |= 0x00000002; - return internalGetMutableData().getMutableMap(); - } - /** - * - * - *
-       * Output only. Metadata about this warning in key: value format. The key should provides
-       * more detail on the warning being returned. For example, for warnings
-       * where there are no results in a list request for a particular zone, this
-       * key might be scope and the key value might be the zone name. Other
-       * examples might be a key indicating a deprecated resource and a suggested
-       * replacement.
-       * 
- * - * map<string, string> data = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder putData(java.lang.String key, java.lang.String value) { - if (key == null) { - throw new NullPointerException("map key"); - } - if (value == null) { - throw new NullPointerException("map value"); - } - internalGetMutableData().getMutableMap().put(key, value); - bitField0_ |= 0x00000002; - return this; - } - /** - * - * - *
-       * Output only. Metadata about this warning in key: value format. The key should provides
-       * more detail on the warning being returned. For example, for warnings
-       * where there are no results in a list request for a particular zone, this
-       * key might be scope and the key value might be the zone name. Other
-       * examples might be a key indicating a deprecated resource and a suggested
-       * replacement.
-       * 
- * - * map<string, string> data = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder putAllData(java.util.Map values) { - internalGetMutableData().getMutableMap().putAll(values); - bitField0_ |= 0x00000002; - return this; - } - - private java.lang.Object warningMessage_ = ""; - /** - * - * - *
-       * Output only. A human-readable description of the warning code.
-       * 
- * - * string warning_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The warningMessage. - */ - public java.lang.String getWarningMessage() { - java.lang.Object ref = warningMessage_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - warningMessage_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * Output only. A human-readable description of the warning code.
-       * 
- * - * string warning_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for warningMessage. - */ - public com.google.protobuf.ByteString getWarningMessageBytes() { - java.lang.Object ref = warningMessage_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - warningMessage_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * Output only. A human-readable description of the warning code.
-       * 
- * - * string warning_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The warningMessage to set. - * @return This builder for chaining. - */ - public Builder setWarningMessage(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - warningMessage_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - /** - * - * - *
-       * Output only. A human-readable description of the warning code.
-       * 
- * - * string warning_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return This builder for chaining. - */ - public Builder clearWarningMessage() { - warningMessage_ = getDefaultInstance().getWarningMessage(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - /** - * - * - *
-       * Output only. A human-readable description of the warning code.
-       * 
- * - * string warning_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The bytes for warningMessage to set. - * @return This builder for chaining. - */ - public Builder setWarningMessageBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - warningMessage_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings) - } - - // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings) - private static final com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings(); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Warnings parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException() - .setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - private int targetCase_ = 0; - private java.lang.Object target_; - - public enum TargetCase - implements - com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - VIRTUAL_MACHINE(18), - INTERCONNECT_ATTACHMENT(9), - TARGET_NOT_SET(0); - private final int value; - - private TargetCase(int value) { - this.value = value; - } - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static TargetCase valueOf(int value) { - return forNumber(value); - } - - public static TargetCase forNumber(int value) { - switch (value) { - case 18: - return VIRTUAL_MACHINE; - case 9: - return INTERCONNECT_ATTACHMENT; - case 0: - return TARGET_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - }; - - public TargetCase getTargetCase() { - return TargetCase.forNumber(targetCase_); - } - - private int nextHopCase_ = 0; - private java.lang.Object nextHop_; - - public enum NextHopCase - implements - com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - NEXT_HOP_ILB_IP(12), - NEXTHOP_NOT_SET(0); - private final int value; - - private NextHopCase(int value) { - this.value = value; - } - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static NextHopCase valueOf(int value) { - return forNumber(value); - } - - public static NextHopCase forNumber(int value) { - switch (value) { - case 12: - return NEXT_HOP_ILB_IP; - case 0: - return NEXTHOP_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - }; - - public NextHopCase getNextHopCase() { - return NextHopCase.forNumber(nextHopCase_); - } - - public static final int VIRTUAL_MACHINE_FIELD_NUMBER = 18; - /** - * - * - *
-   * Optional. VM instances to which this policy based route applies to.
-   * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine virtual_machine = 18 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return Whether the virtualMachine field is set. - */ - @java.lang.Override - public boolean hasVirtualMachine() { - return targetCase_ == 18; - } - /** - * - * - *
-   * Optional. VM instances to which this policy based route applies to.
-   * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine virtual_machine = 18 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return The virtualMachine. - */ - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine - getVirtualMachine() { - if (targetCase_ == 18) { - return (com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine) target_; - } - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine - .getDefaultInstance(); - } - /** - * - * - *
-   * Optional. VM instances to which this policy based route applies to.
-   * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine virtual_machine = 18 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachineOrBuilder - getVirtualMachineOrBuilder() { - if (targetCase_ == 18) { - return (com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine) target_; - } - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine - .getDefaultInstance(); - } - - public static final int INTERCONNECT_ATTACHMENT_FIELD_NUMBER = 9; - /** - * - * - *
-   * Optional. The interconnect attachments to which this route applies to.
-   * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment interconnect_attachment = 9 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return Whether the interconnectAttachment field is set. - */ - @java.lang.Override - public boolean hasInterconnectAttachment() { - return targetCase_ == 9; - } - /** - * - * - *
-   * Optional. The interconnect attachments to which this route applies to.
-   * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment interconnect_attachment = 9 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return The interconnectAttachment. - */ - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - getInterconnectAttachment() { - if (targetCase_ == 9) { - return (com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment) - target_; - } - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - .getDefaultInstance(); - } - /** - * - * - *
-   * Optional. The interconnect attachments to which this route applies to.
-   * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment interconnect_attachment = 9 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachmentOrBuilder - getInterconnectAttachmentOrBuilder() { - if (targetCase_ == 9) { - return (com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment) - target_; - } - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - .getDefaultInstance(); - } - - public static final int NEXT_HOP_ILB_IP_FIELD_NUMBER = 12; - /** - * - * - *
-   * Optional. The IP of a global access enabled L4 ILB that should be the next hop to
-   * handle matching packets. For this version, only next_hop_ilb_ip is
-   * supported.
-   * 
- * - * string next_hop_ilb_ip = 12 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return Whether the nextHopIlbIp field is set. - */ - public boolean hasNextHopIlbIp() { - return nextHopCase_ == 12; - } - /** - * - * - *
-   * Optional. The IP of a global access enabled L4 ILB that should be the next hop to
-   * handle matching packets. For this version, only next_hop_ilb_ip is
-   * supported.
-   * 
- * - * string next_hop_ilb_ip = 12 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The nextHopIlbIp. - */ - public java.lang.String getNextHopIlbIp() { - java.lang.Object ref = ""; - if (nextHopCase_ == 12) { - ref = nextHop_; - } - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (nextHopCase_ == 12) { - nextHop_ = s; - } - return s; - } - } - /** - * - * - *
-   * Optional. The IP of a global access enabled L4 ILB that should be the next hop to
-   * handle matching packets. For this version, only next_hop_ilb_ip is
-   * supported.
-   * 
- * - * string next_hop_ilb_ip = 12 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for nextHopIlbIp. - */ - public com.google.protobuf.ByteString getNextHopIlbIpBytes() { - java.lang.Object ref = ""; - if (nextHopCase_ == 12) { - ref = nextHop_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - if (nextHopCase_ == 12) { - nextHop_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int NAME_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object name_ = ""; - /** - * - * - *
-   * Immutable. A unique name of the resource in the form of
-   * `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}`
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * - * - *
-   * Immutable. A unique name of the resource in the form of
-   * `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}`
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CREATE_TIME_FIELD_NUMBER = 2; - private com.google.protobuf.Timestamp createTime_; - /** - * - * - *
-   * Output only. Time when the PolicyBasedRoute was created.
-   * 
- * - * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the createTime field is set. - */ - @java.lang.Override - public boolean hasCreateTime() { - return createTime_ != null; - } - /** - * - * - *
-   * Output only. Time when the PolicyBasedRoute was created.
-   * 
- * - * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The createTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getCreateTime() { - return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; - } - /** - * - * - *
-   * Output only. Time when the PolicyBasedRoute was created.
-   * 
- * - * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { - return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; - } - - public static final int UPDATE_TIME_FIELD_NUMBER = 3; - private com.google.protobuf.Timestamp updateTime_; - /** - * - * - *
-   * Output only. Time when the PolicyBasedRoute was updated.
-   * 
- * - * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the updateTime field is set. - */ - @java.lang.Override - public boolean hasUpdateTime() { - return updateTime_ != null; - } - /** - * - * - *
-   * Output only. Time when the PolicyBasedRoute was updated.
-   * 
- * - * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The updateTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getUpdateTime() { - return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; - } - /** - * - * - *
-   * Output only. Time when the PolicyBasedRoute was updated.
-   * 
- * - * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { - return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; - } - - public static final int LABELS_FIELD_NUMBER = 4; - - private static final class LabelsDefaultEntryHolder { - static final com.google.protobuf.MapEntry defaultEntry = - com.google.protobuf.MapEntry.newDefaultInstance( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_LabelsEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - - @SuppressWarnings("serial") - private com.google.protobuf.MapField labels_; - - private com.google.protobuf.MapField internalGetLabels() { - if (labels_ == null) { - return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); - } - return labels_; - } - - public int getLabelsCount() { - return internalGetLabels().getMap().size(); - } - /** - * - * - *
-   * User-defined labels.
-   * 
- * - * map<string, string> labels = 4; - */ - @java.lang.Override - public boolean containsLabels(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - return internalGetLabels().getMap().containsKey(key); - } - /** Use {@link #getLabelsMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getLabels() { - return getLabelsMap(); - } - /** - * - * - *
-   * User-defined labels.
-   * 
- * - * map<string, string> labels = 4; - */ - @java.lang.Override - public java.util.Map getLabelsMap() { - return internalGetLabels().getMap(); - } - /** - * - * - *
-   * User-defined labels.
-   * 
- * - * map<string, string> labels = 4; - */ - @java.lang.Override - public /* nullable */ java.lang.String getLabelsOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetLabels().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * - * - *
-   * User-defined labels.
-   * 
- * - * map<string, string> labels = 4; - */ - @java.lang.Override - public java.lang.String getLabelsOrThrow(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetLabels().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int DESCRIPTION_FIELD_NUMBER = 5; - - @SuppressWarnings("serial") - private volatile java.lang.Object description_ = ""; - /** - * - * - *
-   * Optional. An optional description of this resource. Provide this field when you
-   * create the resource.
-   * 
- * - * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The description. - */ - @java.lang.Override - public java.lang.String getDescription() { - java.lang.Object ref = description_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - description_ = s; - return s; - } - } - /** - * - * - *
-   * Optional. An optional description of this resource. Provide this field when you
-   * create the resource.
-   * 
- * - * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for description. - */ - @java.lang.Override - public com.google.protobuf.ByteString getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int NETWORK_FIELD_NUMBER = 6; - - @SuppressWarnings("serial") - private volatile java.lang.Object network_ = ""; - /** - * - * - *
-   * Required. Fully-qualified URL of the network that this route applies to. e.g.
-   * projects/my-project/global/networks/my-network.
-   * 
- * - * - * string network = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The network. - */ - @java.lang.Override - public java.lang.String getNetwork() { - java.lang.Object ref = network_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - network_ = s; - return s; - } - } - /** - * - * - *
-   * Required. Fully-qualified URL of the network that this route applies to. e.g.
-   * projects/my-project/global/networks/my-network.
-   * 
- * - * - * string network = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for network. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNetworkBytes() { - java.lang.Object ref = network_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - network_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int FILTER_FIELD_NUMBER = 10; - private com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter filter_; - /** - * - * - *
-   * Required. The filter to match L4 traffic.
-   * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter filter = 10 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the filter field is set. - */ - @java.lang.Override - public boolean hasFilter() { - return filter_ != null; - } - /** - * - * - *
-   * Required. The filter to match L4 traffic.
-   * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter filter = 10 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The filter. - */ - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter getFilter() { - return filter_ == null - ? com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.getDefaultInstance() - : filter_; - } - /** - * - * - *
-   * Required. The filter to match L4 traffic.
-   * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter filter = 10 [(.google.api.field_behavior) = REQUIRED]; - * - */ - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.FilterOrBuilder - getFilterOrBuilder() { - return filter_ == null - ? com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.getDefaultInstance() - : filter_; - } - - public static final int PRIORITY_FIELD_NUMBER = 11; - private int priority_ = 0; - /** - * - * - *
-   * Optional. The priority of this policy based route. Priority is used to break ties in
-   * cases where there are more than one matching policy based routes found. In
-   * cases where multiple policy based routes are matched, the one with the
-   * lowest-numbered priority value wins. The default value is 1000. The
-   * priority value must be from 1 to 65535, inclusive.
-   * 
- * - * int32 priority = 11 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The priority. - */ - @java.lang.Override - public int getPriority() { - return priority_; - } - - public static final int WARNINGS_FIELD_NUMBER = 14; - - @SuppressWarnings("serial") - private java.util.List - warnings_; - /** - * - * - *
-   * Output only. If potential misconfigurations are detected for this route,
-   * this field will be populated with warning messages.
-   * 
- * - * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - @java.lang.Override - public java.util.List - getWarningsList() { - return warnings_; - } - /** - * - * - *
-   * Output only. If potential misconfigurations are detected for this route,
-   * this field will be populated with warning messages.
-   * 
- * - * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - @java.lang.Override - public java.util.List< - ? extends com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.WarningsOrBuilder> - getWarningsOrBuilderList() { - return warnings_; - } - /** - * - * - *
-   * Output only. If potential misconfigurations are detected for this route,
-   * this field will be populated with warning messages.
-   * 
- * - * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - @java.lang.Override - public int getWarningsCount() { - return warnings_.size(); - } - /** - * - * - *
-   * Output only. If potential misconfigurations are detected for this route,
-   * this field will be populated with warning messages.
-   * 
- * - * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings getWarnings(int index) { - return warnings_.get(index); - } - /** - * - * - *
-   * Output only. If potential misconfigurations are detected for this route,
-   * this field will be populated with warning messages.
-   * 
- * - * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.WarningsOrBuilder - getWarningsOrBuilder(int index) { - return warnings_.get(index); - } - - public static final int SELF_LINK_FIELD_NUMBER = 15; - - @SuppressWarnings("serial") - private volatile java.lang.Object selfLink_ = ""; - /** - * - * - *
-   * Output only. Server-defined fully-qualified URL for this resource.
-   * 
- * - * string self_link = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The selfLink. - */ - @java.lang.Override - public java.lang.String getSelfLink() { - java.lang.Object ref = selfLink_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - selfLink_ = s; - return s; - } - } - /** - * - * - *
-   * Output only. Server-defined fully-qualified URL for this resource.
-   * 
- * - * string self_link = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for selfLink. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSelfLinkBytes() { - java.lang.Object ref = selfLink_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - selfLink_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int KIND_FIELD_NUMBER = 16; - - @SuppressWarnings("serial") - private volatile java.lang.Object kind_ = ""; - /** - * - * - *
-   * Output only. Type of this resource. Always networkconnectivity#policyBasedRoute for
-   * Policy Based Route resources.
-   * 
- * - * string kind = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The kind. - */ - @java.lang.Override - public java.lang.String getKind() { - java.lang.Object ref = kind_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - kind_ = s; - return s; - } - } - /** - * - * - *
-   * Output only. Type of this resource. Always networkconnectivity#policyBasedRoute for
-   * Policy Based Route resources.
-   * 
- * - * string kind = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for kind. - */ - @java.lang.Override - public com.google.protobuf.ByteString getKindBytes() { - java.lang.Object ref = kind_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - kind_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (createTime_ != null) { - output.writeMessage(2, getCreateTime()); - } - if (updateTime_ != null) { - output.writeMessage(3, getUpdateTime()); - } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( - output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 4); - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, description_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, network_); - } - if (targetCase_ == 9) { - output.writeMessage( - 9, - (com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment) - target_); - } - if (filter_ != null) { - output.writeMessage(10, getFilter()); - } - if (priority_ != 0) { - output.writeInt32(11, priority_); - } - if (nextHopCase_ == 12) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 12, nextHop_); - } - for (int i = 0; i < warnings_.size(); i++) { - output.writeMessage(14, warnings_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selfLink_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 15, selfLink_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kind_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 16, kind_); - } - if (targetCase_ == 18) { - output.writeMessage( - 18, (com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine) target_); - } - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (createTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCreateTime()); - } - if (updateTime_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateTime()); - } - for (java.util.Map.Entry entry : - internalGetLabels().getMap().entrySet()) { - com.google.protobuf.MapEntry labels__ = - LabelsDefaultEntryHolder.defaultEntry - .newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, labels__); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, description_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, network_); - } - if (targetCase_ == 9) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 9, - (com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment) - target_); - } - if (filter_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getFilter()); - } - if (priority_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(11, priority_); - } - if (nextHopCase_ == 12) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, nextHop_); - } - for (int i = 0; i < warnings_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, warnings_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selfLink_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, selfLink_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kind_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(16, kind_); - } - if (targetCase_ == 18) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 18, - (com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine) target_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.networkconnectivity.v1.PolicyBasedRoute)) { - return super.equals(obj); - } - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute other = - (com.google.cloud.networkconnectivity.v1.PolicyBasedRoute) obj; - - if (!getName().equals(other.getName())) return false; - if (hasCreateTime() != other.hasCreateTime()) return false; - if (hasCreateTime()) { - if (!getCreateTime().equals(other.getCreateTime())) return false; - } - if (hasUpdateTime() != other.hasUpdateTime()) return false; - if (hasUpdateTime()) { - if (!getUpdateTime().equals(other.getUpdateTime())) return false; - } - if (!internalGetLabels().equals(other.internalGetLabels())) return false; - if (!getDescription().equals(other.getDescription())) return false; - if (!getNetwork().equals(other.getNetwork())) return false; - if (hasFilter() != other.hasFilter()) return false; - if (hasFilter()) { - if (!getFilter().equals(other.getFilter())) return false; - } - if (getPriority() != other.getPriority()) return false; - if (!getWarningsList().equals(other.getWarningsList())) return false; - if (!getSelfLink().equals(other.getSelfLink())) return false; - if (!getKind().equals(other.getKind())) return false; - if (!getTargetCase().equals(other.getTargetCase())) return false; - switch (targetCase_) { - case 18: - if (!getVirtualMachine().equals(other.getVirtualMachine())) return false; - break; - case 9: - if (!getInterconnectAttachment().equals(other.getInterconnectAttachment())) return false; - break; - case 0: - default: - } - if (!getNextHopCase().equals(other.getNextHopCase())) return false; - switch (nextHopCase_) { - case 12: - if (!getNextHopIlbIp().equals(other.getNextHopIlbIp())) return false; - break; - case 0: - default: - } - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - if (hasCreateTime()) { - hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; - hash = (53 * hash) + getCreateTime().hashCode(); - } - if (hasUpdateTime()) { - hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; - hash = (53 * hash) + getUpdateTime().hashCode(); - } - if (!internalGetLabels().getMap().isEmpty()) { - hash = (37 * hash) + LABELS_FIELD_NUMBER; - hash = (53 * hash) + internalGetLabels().hashCode(); - } - hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getDescription().hashCode(); - hash = (37 * hash) + NETWORK_FIELD_NUMBER; - hash = (53 * hash) + getNetwork().hashCode(); - if (hasFilter()) { - hash = (37 * hash) + FILTER_FIELD_NUMBER; - hash = (53 * hash) + getFilter().hashCode(); - } - hash = (37 * hash) + PRIORITY_FIELD_NUMBER; - hash = (53 * hash) + getPriority(); - if (getWarningsCount() > 0) { - hash = (37 * hash) + WARNINGS_FIELD_NUMBER; - hash = (53 * hash) + getWarningsList().hashCode(); - } - hash = (37 * hash) + SELF_LINK_FIELD_NUMBER; - hash = (53 * hash) + getSelfLink().hashCode(); - hash = (37 * hash) + KIND_FIELD_NUMBER; - hash = (53 * hash) + getKind().hashCode(); - switch (targetCase_) { - case 18: - hash = (37 * hash) + VIRTUAL_MACHINE_FIELD_NUMBER; - hash = (53 * hash) + getVirtualMachine().hashCode(); - break; - case 9: - hash = (37 * hash) + INTERCONNECT_ATTACHMENT_FIELD_NUMBER; - hash = (53 * hash) + getInterconnectAttachment().hashCode(); - break; - case 0: - default: - } - switch (nextHopCase_) { - case 12: - hash = (37 * hash) + NEXT_HOP_ILB_IP_FIELD_NUMBER; - hash = (53 * hash) + getNextHopIlbIp().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-   * Policy Based Routes (PBR) are more powerful routes that allows GCP customers
-   * to route their L4 network traffic based on not just destination IP, but also
-   * source IP, protocol and more. A PBR always take precedence when it conflicts
-   * with other types of routes.
-   * Next id: 19
-   * 
- * - * Protobuf type {@code google.cloud.networkconnectivity.v1.PolicyBasedRoute} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.networkconnectivity.v1.PolicyBasedRoute) - com.google.cloud.networkconnectivity.v1.PolicyBasedRouteOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 4: - return internalGetLabels(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { - switch (number) { - case 4: - return internalGetMutableLabels(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.class, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Builder.class); - } - - // Construct using com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.newBuilder() - private Builder() {} - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - if (virtualMachineBuilder_ != null) { - virtualMachineBuilder_.clear(); - } - if (interconnectAttachmentBuilder_ != null) { - interconnectAttachmentBuilder_.clear(); - } - name_ = ""; - createTime_ = null; - if (createTimeBuilder_ != null) { - createTimeBuilder_.dispose(); - createTimeBuilder_ = null; - } - updateTime_ = null; - if (updateTimeBuilder_ != null) { - updateTimeBuilder_.dispose(); - updateTimeBuilder_ = null; - } - internalGetMutableLabels().clear(); - description_ = ""; - network_ = ""; - filter_ = null; - if (filterBuilder_ != null) { - filterBuilder_.dispose(); - filterBuilder_ = null; - } - priority_ = 0; - if (warningsBuilder_ == null) { - warnings_ = java.util.Collections.emptyList(); - } else { - warnings_ = null; - warningsBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000800); - selfLink_ = ""; - kind_ = ""; - targetCase_ = 0; - target_ = null; - nextHopCase_ = 0; - nextHop_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingProto - .internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_descriptor; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute getDefaultInstanceForType() { - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute build() { - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute buildPartial() { - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute result = - new com.google.cloud.networkconnectivity.v1.PolicyBasedRoute(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - buildPartialOneofs(result); - onBuilt(); - return result; - } - - private void buildPartialRepeatedFields( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute result) { - if (warningsBuilder_ == null) { - if (((bitField0_ & 0x00000800) != 0)) { - warnings_ = java.util.Collections.unmodifiableList(warnings_); - bitField0_ = (bitField0_ & ~0x00000800); - } - result.warnings_ = warnings_; - } else { - result.warnings_ = warningsBuilder_.build(); - } - } - - private void buildPartial0(com.google.cloud.networkconnectivity.v1.PolicyBasedRoute result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000008) != 0)) { - result.name_ = name_; - } - if (((from_bitField0_ & 0x00000010) != 0)) { - result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); - } - if (((from_bitField0_ & 0x00000020) != 0)) { - result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); - } - if (((from_bitField0_ & 0x00000040) != 0)) { - result.labels_ = internalGetLabels(); - result.labels_.makeImmutable(); - } - if (((from_bitField0_ & 0x00000080) != 0)) { - result.description_ = description_; - } - if (((from_bitField0_ & 0x00000100) != 0)) { - result.network_ = network_; - } - if (((from_bitField0_ & 0x00000200) != 0)) { - result.filter_ = filterBuilder_ == null ? filter_ : filterBuilder_.build(); - } - if (((from_bitField0_ & 0x00000400) != 0)) { - result.priority_ = priority_; - } - if (((from_bitField0_ & 0x00001000) != 0)) { - result.selfLink_ = selfLink_; - } - if (((from_bitField0_ & 0x00002000) != 0)) { - result.kind_ = kind_; - } - } - - private void buildPartialOneofs( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute result) { - result.targetCase_ = targetCase_; - result.target_ = this.target_; - if (targetCase_ == 18 && virtualMachineBuilder_ != null) { - result.target_ = virtualMachineBuilder_.build(); - } - if (targetCase_ == 9 && interconnectAttachmentBuilder_ != null) { - result.target_ = interconnectAttachmentBuilder_.build(); - } - result.nextHopCase_ = nextHopCase_; - result.nextHop_ = this.nextHop_; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.networkconnectivity.v1.PolicyBasedRoute) { - return mergeFrom((com.google.cloud.networkconnectivity.v1.PolicyBasedRoute) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.networkconnectivity.v1.PolicyBasedRoute other) { - if (other == com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.getDefaultInstance()) - return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - bitField0_ |= 0x00000008; - onChanged(); - } - if (other.hasCreateTime()) { - mergeCreateTime(other.getCreateTime()); - } - if (other.hasUpdateTime()) { - mergeUpdateTime(other.getUpdateTime()); - } - internalGetMutableLabels().mergeFrom(other.internalGetLabels()); - bitField0_ |= 0x00000040; - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - bitField0_ |= 0x00000080; - onChanged(); - } - if (!other.getNetwork().isEmpty()) { - network_ = other.network_; - bitField0_ |= 0x00000100; - onChanged(); - } - if (other.hasFilter()) { - mergeFilter(other.getFilter()); - } - if (other.getPriority() != 0) { - setPriority(other.getPriority()); - } - if (warningsBuilder_ == null) { - if (!other.warnings_.isEmpty()) { - if (warnings_.isEmpty()) { - warnings_ = other.warnings_; - bitField0_ = (bitField0_ & ~0x00000800); - } else { - ensureWarningsIsMutable(); - warnings_.addAll(other.warnings_); - } - onChanged(); - } - } else { - if (!other.warnings_.isEmpty()) { - if (warningsBuilder_.isEmpty()) { - warningsBuilder_.dispose(); - warningsBuilder_ = null; - warnings_ = other.warnings_; - bitField0_ = (bitField0_ & ~0x00000800); - warningsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getWarningsFieldBuilder() - : null; - } else { - warningsBuilder_.addAllMessages(other.warnings_); - } - } - } - if (!other.getSelfLink().isEmpty()) { - selfLink_ = other.selfLink_; - bitField0_ |= 0x00001000; - onChanged(); - } - if (!other.getKind().isEmpty()) { - kind_ = other.kind_; - bitField0_ |= 0x00002000; - onChanged(); - } - switch (other.getTargetCase()) { - case VIRTUAL_MACHINE: - { - mergeVirtualMachine(other.getVirtualMachine()); - break; - } - case INTERCONNECT_ATTACHMENT: - { - mergeInterconnectAttachment(other.getInterconnectAttachment()); - break; - } - case TARGET_NOT_SET: - { - break; - } - } - switch (other.getNextHopCase()) { - case NEXT_HOP_ILB_IP: - { - nextHopCase_ = 12; - nextHop_ = other.nextHop_; - onChanged(); - break; - } - case NEXTHOP_NOT_SET: - { - break; - } - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - name_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000008; - break; - } // case 10 - case 18: - { - input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000010; - break; - } // case 18 - case 26: - { - input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000020; - break; - } // case 26 - case 34: - { - com.google.protobuf.MapEntry labels__ = - input.readMessage( - LabelsDefaultEntryHolder.defaultEntry.getParserForType(), - extensionRegistry); - internalGetMutableLabels() - .getMutableMap() - .put(labels__.getKey(), labels__.getValue()); - bitField0_ |= 0x00000040; - break; - } // case 34 - case 42: - { - description_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000080; - break; - } // case 42 - case 50: - { - network_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000100; - break; - } // case 50 - case 74: - { - input.readMessage( - getInterconnectAttachmentFieldBuilder().getBuilder(), extensionRegistry); - targetCase_ = 9; - break; - } // case 74 - case 82: - { - input.readMessage(getFilterFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000200; - break; - } // case 82 - case 88: - { - priority_ = input.readInt32(); - bitField0_ |= 0x00000400; - break; - } // case 88 - case 98: - { - java.lang.String s = input.readStringRequireUtf8(); - nextHopCase_ = 12; - nextHop_ = s; - break; - } // case 98 - case 114: - { - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings m = - input.readMessage( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.parser(), - extensionRegistry); - if (warningsBuilder_ == null) { - ensureWarningsIsMutable(); - warnings_.add(m); - } else { - warningsBuilder_.addMessage(m); - } - break; - } // case 114 - case 122: - { - selfLink_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00001000; - break; - } // case 122 - case 130: - { - kind_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00002000; - break; - } // case 130 - case 146: - { - input.readMessage(getVirtualMachineFieldBuilder().getBuilder(), extensionRegistry); - targetCase_ = 18; - break; - } // case 146 - default: - { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private int targetCase_ = 0; - private java.lang.Object target_; - - public TargetCase getTargetCase() { - return TargetCase.forNumber(targetCase_); - } - - public Builder clearTarget() { - targetCase_ = 0; - target_ = null; - onChanged(); - return this; - } - - private int nextHopCase_ = 0; - private java.lang.Object nextHop_; - - public NextHopCase getNextHopCase() { - return NextHopCase.forNumber(nextHopCase_); - } - - public Builder clearNextHop() { - nextHopCase_ = 0; - nextHop_ = null; - onChanged(); - return this; - } - - private int bitField0_; - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine.Builder, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachineOrBuilder> - virtualMachineBuilder_; - /** - * - * - *
-     * Optional. VM instances to which this policy based route applies to.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine virtual_machine = 18 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return Whether the virtualMachine field is set. - */ - @java.lang.Override - public boolean hasVirtualMachine() { - return targetCase_ == 18; - } - /** - * - * - *
-     * Optional. VM instances to which this policy based route applies to.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine virtual_machine = 18 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return The virtualMachine. - */ - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine - getVirtualMachine() { - if (virtualMachineBuilder_ == null) { - if (targetCase_ == 18) { - return (com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine) target_; - } - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine - .getDefaultInstance(); - } else { - if (targetCase_ == 18) { - return virtualMachineBuilder_.getMessage(); - } - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine - .getDefaultInstance(); - } - } - /** - * - * - *
-     * Optional. VM instances to which this policy based route applies to.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine virtual_machine = 18 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder setVirtualMachine( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine value) { - if (virtualMachineBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - target_ = value; - onChanged(); - } else { - virtualMachineBuilder_.setMessage(value); - } - targetCase_ = 18; - return this; - } - /** - * - * - *
-     * Optional. VM instances to which this policy based route applies to.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine virtual_machine = 18 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder setVirtualMachine( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine.Builder - builderForValue) { - if (virtualMachineBuilder_ == null) { - target_ = builderForValue.build(); - onChanged(); - } else { - virtualMachineBuilder_.setMessage(builderForValue.build()); - } - targetCase_ = 18; - return this; - } - /** - * - * - *
-     * Optional. VM instances to which this policy based route applies to.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine virtual_machine = 18 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder mergeVirtualMachine( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine value) { - if (virtualMachineBuilder_ == null) { - if (targetCase_ == 18 - && target_ - != com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine - .getDefaultInstance()) { - target_ = - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine.newBuilder( - (com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine) - target_) - .mergeFrom(value) - .buildPartial(); - } else { - target_ = value; - } - onChanged(); - } else { - if (targetCase_ == 18) { - virtualMachineBuilder_.mergeFrom(value); - } else { - virtualMachineBuilder_.setMessage(value); - } - } - targetCase_ = 18; - return this; - } - /** - * - * - *
-     * Optional. VM instances to which this policy based route applies to.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine virtual_machine = 18 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder clearVirtualMachine() { - if (virtualMachineBuilder_ == null) { - if (targetCase_ == 18) { - targetCase_ = 0; - target_ = null; - onChanged(); - } - } else { - if (targetCase_ == 18) { - targetCase_ = 0; - target_ = null; - } - virtualMachineBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Optional. VM instances to which this policy based route applies to.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine virtual_machine = 18 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine.Builder - getVirtualMachineBuilder() { - return getVirtualMachineFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Optional. VM instances to which this policy based route applies to.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine virtual_machine = 18 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachineOrBuilder - getVirtualMachineOrBuilder() { - if ((targetCase_ == 18) && (virtualMachineBuilder_ != null)) { - return virtualMachineBuilder_.getMessageOrBuilder(); - } else { - if (targetCase_ == 18) { - return (com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine) target_; - } - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine - .getDefaultInstance(); - } - } - /** - * - * - *
-     * Optional. VM instances to which this policy based route applies to.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine virtual_machine = 18 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine.Builder, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachineOrBuilder> - getVirtualMachineFieldBuilder() { - if (virtualMachineBuilder_ == null) { - if (!(targetCase_ == 18)) { - target_ = - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine - .getDefaultInstance(); - } - virtualMachineBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine.Builder, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachineOrBuilder>( - (com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine) target_, - getParentForChildren(), - isClean()); - target_ = null; - } - targetCase_ = 18; - onChanged(); - return virtualMachineBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment.Builder, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute - .InterconnectAttachmentOrBuilder> - interconnectAttachmentBuilder_; - /** - * - * - *
-     * Optional. The interconnect attachments to which this route applies to.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment interconnect_attachment = 9 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return Whether the interconnectAttachment field is set. - */ - @java.lang.Override - public boolean hasInterconnectAttachment() { - return targetCase_ == 9; - } - /** - * - * - *
-     * Optional. The interconnect attachments to which this route applies to.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment interconnect_attachment = 9 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return The interconnectAttachment. - */ - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - getInterconnectAttachment() { - if (interconnectAttachmentBuilder_ == null) { - if (targetCase_ == 9) { - return (com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment) - target_; - } - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - .getDefaultInstance(); - } else { - if (targetCase_ == 9) { - return interconnectAttachmentBuilder_.getMessage(); - } - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - .getDefaultInstance(); - } - } - /** - * - * - *
-     * Optional. The interconnect attachments to which this route applies to.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment interconnect_attachment = 9 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder setInterconnectAttachment( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment value) { - if (interconnectAttachmentBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - target_ = value; - onChanged(); - } else { - interconnectAttachmentBuilder_.setMessage(value); - } - targetCase_ = 9; - return this; - } - /** - * - * - *
-     * Optional. The interconnect attachments to which this route applies to.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment interconnect_attachment = 9 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder setInterconnectAttachment( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment.Builder - builderForValue) { - if (interconnectAttachmentBuilder_ == null) { - target_ = builderForValue.build(); - onChanged(); - } else { - interconnectAttachmentBuilder_.setMessage(builderForValue.build()); - } - targetCase_ = 9; - return this; - } - /** - * - * - *
-     * Optional. The interconnect attachments to which this route applies to.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment interconnect_attachment = 9 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder mergeInterconnectAttachment( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment value) { - if (interconnectAttachmentBuilder_ == null) { - if (targetCase_ == 9 - && target_ - != com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - .getDefaultInstance()) { - target_ = - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - .newBuilder( - (com.google.cloud.networkconnectivity.v1.PolicyBasedRoute - .InterconnectAttachment) - target_) - .mergeFrom(value) - .buildPartial(); - } else { - target_ = value; - } - onChanged(); - } else { - if (targetCase_ == 9) { - interconnectAttachmentBuilder_.mergeFrom(value); - } else { - interconnectAttachmentBuilder_.setMessage(value); - } - } - targetCase_ = 9; - return this; - } - /** - * - * - *
-     * Optional. The interconnect attachments to which this route applies to.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment interconnect_attachment = 9 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public Builder clearInterconnectAttachment() { - if (interconnectAttachmentBuilder_ == null) { - if (targetCase_ == 9) { - targetCase_ = 0; - target_ = null; - onChanged(); - } - } else { - if (targetCase_ == 9) { - targetCase_ = 0; - target_ = null; - } - interconnectAttachmentBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Optional. The interconnect attachments to which this route applies to.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment interconnect_attachment = 9 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment.Builder - getInterconnectAttachmentBuilder() { - return getInterconnectAttachmentFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Optional. The interconnect attachments to which this route applies to.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment interconnect_attachment = 9 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachmentOrBuilder - getInterconnectAttachmentOrBuilder() { - if ((targetCase_ == 9) && (interconnectAttachmentBuilder_ != null)) { - return interconnectAttachmentBuilder_.getMessageOrBuilder(); - } else { - if (targetCase_ == 9) { - return (com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment) - target_; - } - return com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - .getDefaultInstance(); - } - } - /** - * - * - *
-     * Optional. The interconnect attachments to which this route applies to.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment interconnect_attachment = 9 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment.Builder, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute - .InterconnectAttachmentOrBuilder> - getInterconnectAttachmentFieldBuilder() { - if (interconnectAttachmentBuilder_ == null) { - if (!(targetCase_ == 9)) { - target_ = - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - .getDefaultInstance(); - } - interconnectAttachmentBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - .Builder, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute - .InterconnectAttachmentOrBuilder>( - (com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment) - target_, - getParentForChildren(), - isClean()); - target_ = null; - } - targetCase_ = 9; - onChanged(); - return interconnectAttachmentBuilder_; - } - - /** - * - * - *
-     * Optional. The IP of a global access enabled L4 ILB that should be the next hop to
-     * handle matching packets. For this version, only next_hop_ilb_ip is
-     * supported.
-     * 
- * - * string next_hop_ilb_ip = 12 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return Whether the nextHopIlbIp field is set. - */ - @java.lang.Override - public boolean hasNextHopIlbIp() { - return nextHopCase_ == 12; - } - /** - * - * - *
-     * Optional. The IP of a global access enabled L4 ILB that should be the next hop to
-     * handle matching packets. For this version, only next_hop_ilb_ip is
-     * supported.
-     * 
- * - * string next_hop_ilb_ip = 12 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The nextHopIlbIp. - */ - @java.lang.Override - public java.lang.String getNextHopIlbIp() { - java.lang.Object ref = ""; - if (nextHopCase_ == 12) { - ref = nextHop_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (nextHopCase_ == 12) { - nextHop_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Optional. The IP of a global access enabled L4 ILB that should be the next hop to
-     * handle matching packets. For this version, only next_hop_ilb_ip is
-     * supported.
-     * 
- * - * string next_hop_ilb_ip = 12 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for nextHopIlbIp. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNextHopIlbIpBytes() { - java.lang.Object ref = ""; - if (nextHopCase_ == 12) { - ref = nextHop_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - if (nextHopCase_ == 12) { - nextHop_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Optional. The IP of a global access enabled L4 ILB that should be the next hop to
-     * handle matching packets. For this version, only next_hop_ilb_ip is
-     * supported.
-     * 
- * - * string next_hop_ilb_ip = 12 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The nextHopIlbIp to set. - * @return This builder for chaining. - */ - public Builder setNextHopIlbIp(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - nextHopCase_ = 12; - nextHop_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. The IP of a global access enabled L4 ILB that should be the next hop to
-     * handle matching packets. For this version, only next_hop_ilb_ip is
-     * supported.
-     * 
- * - * string next_hop_ilb_ip = 12 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return This builder for chaining. - */ - public Builder clearNextHopIlbIp() { - if (nextHopCase_ == 12) { - nextHopCase_ = 0; - nextHop_ = null; - onChanged(); - } - return this; - } - /** - * - * - *
-     * Optional. The IP of a global access enabled L4 ILB that should be the next hop to
-     * handle matching packets. For this version, only next_hop_ilb_ip is
-     * supported.
-     * 
- * - * string next_hop_ilb_ip = 12 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The bytes for nextHopIlbIp to set. - * @return This builder for chaining. - */ - public Builder setNextHopIlbIpBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - nextHopCase_ = 12; - nextHop_ = value; - onChanged(); - return this; - } - - private java.lang.Object name_ = ""; - /** - * - * - *
-     * Immutable. A unique name of the resource in the form of
-     * `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Immutable. A unique name of the resource in the form of
-     * `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Immutable. A unique name of the resource in the form of
-     * `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - name_ = value; - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - /** - * - * - *
-     * Immutable. A unique name of the resource in the form of
-     * `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return This builder for chaining. - */ - public Builder clearName() { - name_ = getDefaultInstance().getName(); - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - return this; - } - /** - * - * - *
-     * Immutable. A unique name of the resource in the form of
-     * `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - name_ = value; - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - - private com.google.protobuf.Timestamp createTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - createTimeBuilder_; - /** - * - * - *
-     * Output only. Time when the PolicyBasedRoute was created.
-     * 
- * - * - * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the createTime field is set. - */ - public boolean hasCreateTime() { - return ((bitField0_ & 0x00000010) != 0); - } - /** - * - * - *
-     * Output only. Time when the PolicyBasedRoute was created.
-     * 
- * - * - * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The createTime. - */ - public com.google.protobuf.Timestamp getCreateTime() { - if (createTimeBuilder_ == null) { - return createTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : createTime_; - } else { - return createTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Output only. Time when the PolicyBasedRoute was created.
-     * 
- * - * - * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setCreateTime(com.google.protobuf.Timestamp value) { - if (createTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - createTime_ = value; - } else { - createTimeBuilder_.setMessage(value); - } - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. Time when the PolicyBasedRoute was created.
-     * 
- * - * - * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (createTimeBuilder_ == null) { - createTime_ = builderForValue.build(); - } else { - createTimeBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. Time when the PolicyBasedRoute was created.
-     * 
- * - * - * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { - if (createTimeBuilder_ == null) { - if (((bitField0_ & 0x00000010) != 0) - && createTime_ != null - && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { - getCreateTimeBuilder().mergeFrom(value); - } else { - createTime_ = value; - } - } else { - createTimeBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. Time when the PolicyBasedRoute was created.
-     * 
- * - * - * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder clearCreateTime() { - bitField0_ = (bitField0_ & ~0x00000010); - createTime_ = null; - if (createTimeBuilder_ != null) { - createTimeBuilder_.dispose(); - createTimeBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. Time when the PolicyBasedRoute was created.
-     * 
- * - * - * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { - bitField0_ |= 0x00000010; - onChanged(); - return getCreateTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Output only. Time when the PolicyBasedRoute was created.
-     * 
- * - * - * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { - if (createTimeBuilder_ != null) { - return createTimeBuilder_.getMessageOrBuilder(); - } else { - return createTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : createTime_; - } - } - /** - * - * - *
-     * Output only. Time when the PolicyBasedRoute was created.
-     * 
- * - * - * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getCreateTimeFieldBuilder() { - if (createTimeBuilder_ == null) { - createTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getCreateTime(), getParentForChildren(), isClean()); - createTime_ = null; - } - return createTimeBuilder_; - } - - private com.google.protobuf.Timestamp updateTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - updateTimeBuilder_; - /** - * - * - *
-     * Output only. Time when the PolicyBasedRoute was updated.
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the updateTime field is set. - */ - public boolean hasUpdateTime() { - return ((bitField0_ & 0x00000020) != 0); - } - /** - * - * - *
-     * Output only. Time when the PolicyBasedRoute was updated.
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The updateTime. - */ - public com.google.protobuf.Timestamp getUpdateTime() { - if (updateTimeBuilder_ == null) { - return updateTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : updateTime_; - } else { - return updateTimeBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Output only. Time when the PolicyBasedRoute was updated.
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setUpdateTime(com.google.protobuf.Timestamp value) { - if (updateTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - updateTime_ = value; - } else { - updateTimeBuilder_.setMessage(value); - } - bitField0_ |= 0x00000020; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. Time when the PolicyBasedRoute was updated.
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { - if (updateTimeBuilder_ == null) { - updateTime_ = builderForValue.build(); - } else { - updateTimeBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000020; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. Time when the PolicyBasedRoute was updated.
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { - if (updateTimeBuilder_ == null) { - if (((bitField0_ & 0x00000020) != 0) - && updateTime_ != null - && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { - getUpdateTimeBuilder().mergeFrom(value); - } else { - updateTime_ = value; - } - } else { - updateTimeBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000020; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. Time when the PolicyBasedRoute was updated.
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder clearUpdateTime() { - bitField0_ = (bitField0_ & ~0x00000020); - updateTime_ = null; - if (updateTimeBuilder_ != null) { - updateTimeBuilder_.dispose(); - updateTimeBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. Time when the PolicyBasedRoute was updated.
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { - bitField0_ |= 0x00000020; - onChanged(); - return getUpdateTimeFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Output only. Time when the PolicyBasedRoute was updated.
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { - if (updateTimeBuilder_ != null) { - return updateTimeBuilder_.getMessageOrBuilder(); - } else { - return updateTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : updateTime_; - } - } - /** - * - * - *
-     * Output only. Time when the PolicyBasedRoute was updated.
-     * 
- * - * - * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getUpdateTimeFieldBuilder() { - if (updateTimeBuilder_ == null) { - updateTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getUpdateTime(), getParentForChildren(), isClean()); - updateTime_ = null; - } - return updateTimeBuilder_; - } - - private com.google.protobuf.MapField labels_; - - private com.google.protobuf.MapField internalGetLabels() { - if (labels_ == null) { - return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); - } - return labels_; - } - - private com.google.protobuf.MapField - internalGetMutableLabels() { - if (labels_ == null) { - labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); - } - if (!labels_.isMutable()) { - labels_ = labels_.copy(); - } - bitField0_ |= 0x00000040; - onChanged(); - return labels_; - } - - public int getLabelsCount() { - return internalGetLabels().getMap().size(); - } - /** - * - * - *
-     * User-defined labels.
-     * 
- * - * map<string, string> labels = 4; - */ - @java.lang.Override - public boolean containsLabels(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - return internalGetLabels().getMap().containsKey(key); - } - /** Use {@link #getLabelsMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getLabels() { - return getLabelsMap(); - } - /** - * - * - *
-     * User-defined labels.
-     * 
- * - * map<string, string> labels = 4; - */ - @java.lang.Override - public java.util.Map getLabelsMap() { - return internalGetLabels().getMap(); - } - /** - * - * - *
-     * User-defined labels.
-     * 
- * - * map<string, string> labels = 4; - */ - @java.lang.Override - public /* nullable */ java.lang.String getLabelsOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetLabels().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * - * - *
-     * User-defined labels.
-     * 
- * - * map<string, string> labels = 4; - */ - @java.lang.Override - public java.lang.String getLabelsOrThrow(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetLabels().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearLabels() { - bitField0_ = (bitField0_ & ~0x00000040); - internalGetMutableLabels().getMutableMap().clear(); - return this; - } - /** - * - * - *
-     * User-defined labels.
-     * 
- * - * map<string, string> labels = 4; - */ - public Builder removeLabels(java.lang.String key) { - if (key == null) { - throw new NullPointerException("map key"); - } - internalGetMutableLabels().getMutableMap().remove(key); - return this; - } - /** Use alternate mutation accessors instead. */ - @java.lang.Deprecated - public java.util.Map getMutableLabels() { - bitField0_ |= 0x00000040; - return internalGetMutableLabels().getMutableMap(); - } - /** - * - * - *
-     * User-defined labels.
-     * 
- * - * map<string, string> labels = 4; - */ - public Builder putLabels(java.lang.String key, java.lang.String value) { - if (key == null) { - throw new NullPointerException("map key"); - } - if (value == null) { - throw new NullPointerException("map value"); - } - internalGetMutableLabels().getMutableMap().put(key, value); - bitField0_ |= 0x00000040; - return this; - } - /** - * - * - *
-     * User-defined labels.
-     * 
- * - * map<string, string> labels = 4; - */ - public Builder putAllLabels(java.util.Map values) { - internalGetMutableLabels().getMutableMap().putAll(values); - bitField0_ |= 0x00000040; - return this; - } - - private java.lang.Object description_ = ""; - /** - * - * - *
-     * Optional. An optional description of this resource. Provide this field when you
-     * create the resource.
-     * 
- * - * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The description. - */ - public java.lang.String getDescription() { - java.lang.Object ref = description_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - description_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Optional. An optional description of this resource. Provide this field when you
-     * create the resource.
-     * 
- * - * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for description. - */ - public com.google.protobuf.ByteString getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Optional. An optional description of this resource. Provide this field when you
-     * create the resource.
-     * 
- * - * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The description to set. - * @return This builder for chaining. - */ - public Builder setDescription(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - description_ = value; - bitField0_ |= 0x00000080; - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. An optional description of this resource. Provide this field when you
-     * create the resource.
-     * 
- * - * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return This builder for chaining. - */ - public Builder clearDescription() { - description_ = getDefaultInstance().getDescription(); - bitField0_ = (bitField0_ & ~0x00000080); - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. An optional description of this resource. Provide this field when you
-     * create the resource.
-     * 
- * - * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The bytes for description to set. - * @return This builder for chaining. - */ - public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - description_ = value; - bitField0_ |= 0x00000080; - onChanged(); - return this; - } - - private java.lang.Object network_ = ""; - /** - * - * - *
-     * Required. Fully-qualified URL of the network that this route applies to. e.g.
-     * projects/my-project/global/networks/my-network.
-     * 
- * - * - * string network = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The network. - */ - public java.lang.String getNetwork() { - java.lang.Object ref = network_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - network_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Required. Fully-qualified URL of the network that this route applies to. e.g.
-     * projects/my-project/global/networks/my-network.
-     * 
- * - * - * string network = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for network. - */ - public com.google.protobuf.ByteString getNetworkBytes() { - java.lang.Object ref = network_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - network_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Required. Fully-qualified URL of the network that this route applies to. e.g.
-     * projects/my-project/global/networks/my-network.
-     * 
- * - * - * string network = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The network to set. - * @return This builder for chaining. - */ - public Builder setNetwork(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - network_ = value; - bitField0_ |= 0x00000100; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Fully-qualified URL of the network that this route applies to. e.g.
-     * projects/my-project/global/networks/my-network.
-     * 
- * - * - * string network = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return This builder for chaining. - */ - public Builder clearNetwork() { - network_ = getDefaultInstance().getNetwork(); - bitField0_ = (bitField0_ & ~0x00000100); - onChanged(); - return this; - } - /** - * - * - *
-     * Required. Fully-qualified URL of the network that this route applies to. e.g.
-     * projects/my-project/global/networks/my-network.
-     * 
- * - * - * string network = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @param value The bytes for network to set. - * @return This builder for chaining. - */ - public Builder setNetworkBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - network_ = value; - bitField0_ |= 0x00000100; - onChanged(); - return this; - } - - private com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter filter_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.Builder, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.FilterOrBuilder> - filterBuilder_; - /** - * - * - *
-     * Required. The filter to match L4 traffic.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter filter = 10 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the filter field is set. - */ - public boolean hasFilter() { - return ((bitField0_ & 0x00000200) != 0); - } - /** - * - * - *
-     * Required. The filter to match L4 traffic.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter filter = 10 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The filter. - */ - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter getFilter() { - if (filterBuilder_ == null) { - return filter_ == null - ? com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.getDefaultInstance() - : filter_; - } else { - return filterBuilder_.getMessage(); - } - } - /** - * - * - *
-     * Required. The filter to match L4 traffic.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter filter = 10 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setFilter( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter value) { - if (filterBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - filter_ = value; - } else { - filterBuilder_.setMessage(value); - } - bitField0_ |= 0x00000200; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The filter to match L4 traffic.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter filter = 10 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder setFilter( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.Builder builderForValue) { - if (filterBuilder_ == null) { - filter_ = builderForValue.build(); - } else { - filterBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000200; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The filter to match L4 traffic.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter filter = 10 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder mergeFilter( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter value) { - if (filterBuilder_ == null) { - if (((bitField0_ & 0x00000200) != 0) - && filter_ != null - && filter_ - != com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter - .getDefaultInstance()) { - getFilterBuilder().mergeFrom(value); - } else { - filter_ = value; - } - } else { - filterBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000200; - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The filter to match L4 traffic.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter filter = 10 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public Builder clearFilter() { - bitField0_ = (bitField0_ & ~0x00000200); - filter_ = null; - if (filterBuilder_ != null) { - filterBuilder_.dispose(); - filterBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * Required. The filter to match L4 traffic.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter filter = 10 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.Builder - getFilterBuilder() { - bitField0_ |= 0x00000200; - onChanged(); - return getFilterFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * Required. The filter to match L4 traffic.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter filter = 10 [(.google.api.field_behavior) = REQUIRED]; - * - */ - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.FilterOrBuilder - getFilterOrBuilder() { - if (filterBuilder_ != null) { - return filterBuilder_.getMessageOrBuilder(); - } else { - return filter_ == null - ? com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.getDefaultInstance() - : filter_; - } - } - /** - * - * - *
-     * Required. The filter to match L4 traffic.
-     * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter filter = 10 [(.google.api.field_behavior) = REQUIRED]; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.Builder, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.FilterOrBuilder> - getFilterFieldBuilder() { - if (filterBuilder_ == null) { - filterBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.Builder, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.FilterOrBuilder>( - getFilter(), getParentForChildren(), isClean()); - filter_ = null; - } - return filterBuilder_; - } - - private int priority_; - /** - * - * - *
-     * Optional. The priority of this policy based route. Priority is used to break ties in
-     * cases where there are more than one matching policy based routes found. In
-     * cases where multiple policy based routes are matched, the one with the
-     * lowest-numbered priority value wins. The default value is 1000. The
-     * priority value must be from 1 to 65535, inclusive.
-     * 
- * - * int32 priority = 11 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The priority. - */ - @java.lang.Override - public int getPriority() { - return priority_; - } - /** - * - * - *
-     * Optional. The priority of this policy based route. Priority is used to break ties in
-     * cases where there are more than one matching policy based routes found. In
-     * cases where multiple policy based routes are matched, the one with the
-     * lowest-numbered priority value wins. The default value is 1000. The
-     * priority value must be from 1 to 65535, inclusive.
-     * 
- * - * int32 priority = 11 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The priority to set. - * @return This builder for chaining. - */ - public Builder setPriority(int value) { - - priority_ = value; - bitField0_ |= 0x00000400; - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. The priority of this policy based route. Priority is used to break ties in
-     * cases where there are more than one matching policy based routes found. In
-     * cases where multiple policy based routes are matched, the one with the
-     * lowest-numbered priority value wins. The default value is 1000. The
-     * priority value must be from 1 to 65535, inclusive.
-     * 
- * - * int32 priority = 11 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return This builder for chaining. - */ - public Builder clearPriority() { - bitField0_ = (bitField0_ & ~0x00000400); - priority_ = 0; - onChanged(); - return this; - } - - private java.util.List - warnings_ = java.util.Collections.emptyList(); - - private void ensureWarningsIsMutable() { - if (!((bitField0_ & 0x00000800) != 0)) { - warnings_ = - new java.util.ArrayList< - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings>(warnings_); - bitField0_ |= 0x00000800; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Builder, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.WarningsOrBuilder> - warningsBuilder_; - - /** - * - * - *
-     * Output only. If potential misconfigurations are detected for this route,
-     * this field will be populated with warning messages.
-     * 
- * - * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public java.util.List - getWarningsList() { - if (warningsBuilder_ == null) { - return java.util.Collections.unmodifiableList(warnings_); - } else { - return warningsBuilder_.getMessageList(); - } - } - /** - * - * - *
-     * Output only. If potential misconfigurations are detected for this route,
-     * this field will be populated with warning messages.
-     * 
- * - * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public int getWarningsCount() { - if (warningsBuilder_ == null) { - return warnings_.size(); - } else { - return warningsBuilder_.getCount(); - } - } - /** - * - * - *
-     * Output only. If potential misconfigurations are detected for this route,
-     * this field will be populated with warning messages.
-     * 
- * - * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings getWarnings( - int index) { - if (warningsBuilder_ == null) { - return warnings_.get(index); - } else { - return warningsBuilder_.getMessage(index); - } - } - /** - * - * - *
-     * Output only. If potential misconfigurations are detected for this route,
-     * this field will be populated with warning messages.
-     * 
- * - * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setWarnings( - int index, com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings value) { - if (warningsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureWarningsIsMutable(); - warnings_.set(index, value); - onChanged(); - } else { - warningsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Output only. If potential misconfigurations are detected for this route,
-     * this field will be populated with warning messages.
-     * 
- * - * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder setWarnings( - int index, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Builder builderForValue) { - if (warningsBuilder_ == null) { - ensureWarningsIsMutable(); - warnings_.set(index, builderForValue.build()); - onChanged(); - } else { - warningsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Output only. If potential misconfigurations are detected for this route,
-     * this field will be populated with warning messages.
-     * 
- * - * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder addWarnings( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings value) { - if (warningsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureWarningsIsMutable(); - warnings_.add(value); - onChanged(); - } else { - warningsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-     * Output only. If potential misconfigurations are detected for this route,
-     * this field will be populated with warning messages.
-     * 
- * - * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder addWarnings( - int index, com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings value) { - if (warningsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureWarningsIsMutable(); - warnings_.add(index, value); - onChanged(); - } else { - warningsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-     * Output only. If potential misconfigurations are detected for this route,
-     * this field will be populated with warning messages.
-     * 
- * - * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder addWarnings( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Builder builderForValue) { - if (warningsBuilder_ == null) { - ensureWarningsIsMutable(); - warnings_.add(builderForValue.build()); - onChanged(); - } else { - warningsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Output only. If potential misconfigurations are detected for this route,
-     * this field will be populated with warning messages.
-     * 
- * - * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder addWarnings( - int index, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Builder builderForValue) { - if (warningsBuilder_ == null) { - ensureWarningsIsMutable(); - warnings_.add(index, builderForValue.build()); - onChanged(); - } else { - warningsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-     * Output only. If potential misconfigurations are detected for this route,
-     * this field will be populated with warning messages.
-     * 
- * - * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder addAllWarnings( - java.lang.Iterable< - ? extends com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings> - values) { - if (warningsBuilder_ == null) { - ensureWarningsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, warnings_); - onChanged(); - } else { - warningsBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-     * Output only. If potential misconfigurations are detected for this route,
-     * this field will be populated with warning messages.
-     * 
- * - * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder clearWarnings() { - if (warningsBuilder_ == null) { - warnings_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000800); - onChanged(); - } else { - warningsBuilder_.clear(); - } - return this; - } - /** - * - * - *
-     * Output only. If potential misconfigurations are detected for this route,
-     * this field will be populated with warning messages.
-     * 
- * - * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public Builder removeWarnings(int index) { - if (warningsBuilder_ == null) { - ensureWarningsIsMutable(); - warnings_.remove(index); - onChanged(); - } else { - warningsBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-     * Output only. If potential misconfigurations are detected for this route,
-     * this field will be populated with warning messages.
-     * 
- * - * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Builder - getWarningsBuilder(int index) { - return getWarningsFieldBuilder().getBuilder(index); - } - /** - * - * - *
-     * Output only. If potential misconfigurations are detected for this route,
-     * this field will be populated with warning messages.
-     * 
- * - * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.WarningsOrBuilder - getWarningsOrBuilder(int index) { - if (warningsBuilder_ == null) { - return warnings_.get(index); - } else { - return warningsBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-     * Output only. If potential misconfigurations are detected for this route,
-     * this field will be populated with warning messages.
-     * 
- * - * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public java.util.List< - ? extends com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.WarningsOrBuilder> - getWarningsOrBuilderList() { - if (warningsBuilder_ != null) { - return warningsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(warnings_); - } - } - /** - * - * - *
-     * Output only. If potential misconfigurations are detected for this route,
-     * this field will be populated with warning messages.
-     * 
- * - * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Builder - addWarningsBuilder() { - return getWarningsFieldBuilder() - .addBuilder( - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings - .getDefaultInstance()); - } - /** - * - * - *
-     * Output only. If potential misconfigurations are detected for this route,
-     * this field will be populated with warning messages.
-     * 
- * - * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Builder - addWarningsBuilder(int index) { - return getWarningsFieldBuilder() - .addBuilder( - index, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings - .getDefaultInstance()); - } - /** - * - * - *
-     * Output only. If potential misconfigurations are detected for this route,
-     * this field will be populated with warning messages.
-     * 
- * - * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - public java.util.List - getWarningsBuilderList() { - return getWarningsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Builder, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.WarningsOrBuilder> - getWarningsFieldBuilder() { - if (warningsBuilder_ == null) { - warningsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Builder, - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.WarningsOrBuilder>( - warnings_, ((bitField0_ & 0x00000800) != 0), getParentForChildren(), isClean()); - warnings_ = null; - } - return warningsBuilder_; - } - - private java.lang.Object selfLink_ = ""; - /** - * - * - *
-     * Output only. Server-defined fully-qualified URL for this resource.
-     * 
- * - * string self_link = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The selfLink. - */ - public java.lang.String getSelfLink() { - java.lang.Object ref = selfLink_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - selfLink_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Output only. Server-defined fully-qualified URL for this resource.
-     * 
- * - * string self_link = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for selfLink. - */ - public com.google.protobuf.ByteString getSelfLinkBytes() { - java.lang.Object ref = selfLink_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - selfLink_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Output only. Server-defined fully-qualified URL for this resource.
-     * 
- * - * string self_link = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The selfLink to set. - * @return This builder for chaining. - */ - public Builder setSelfLink(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - selfLink_ = value; - bitField0_ |= 0x00001000; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. Server-defined fully-qualified URL for this resource.
-     * 
- * - * string self_link = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return This builder for chaining. - */ - public Builder clearSelfLink() { - selfLink_ = getDefaultInstance().getSelfLink(); - bitField0_ = (bitField0_ & ~0x00001000); - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. Server-defined fully-qualified URL for this resource.
-     * 
- * - * string self_link = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The bytes for selfLink to set. - * @return This builder for chaining. - */ - public Builder setSelfLinkBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - selfLink_ = value; - bitField0_ |= 0x00001000; - onChanged(); - return this; - } - - private java.lang.Object kind_ = ""; - /** - * - * - *
-     * Output only. Type of this resource. Always networkconnectivity#policyBasedRoute for
-     * Policy Based Route resources.
-     * 
- * - * string kind = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The kind. - */ - public java.lang.String getKind() { - java.lang.Object ref = kind_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - kind_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Output only. Type of this resource. Always networkconnectivity#policyBasedRoute for
-     * Policy Based Route resources.
-     * 
- * - * string kind = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for kind. - */ - public com.google.protobuf.ByteString getKindBytes() { - java.lang.Object ref = kind_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - kind_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Output only. Type of this resource. Always networkconnectivity#policyBasedRoute for
-     * Policy Based Route resources.
-     * 
- * - * string kind = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The kind to set. - * @return This builder for chaining. - */ - public Builder setKind(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - bitField0_ |= 0x00002000; - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. Type of this resource. Always networkconnectivity#policyBasedRoute for
-     * Policy Based Route resources.
-     * 
- * - * string kind = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return This builder for chaining. - */ - public Builder clearKind() { - kind_ = getDefaultInstance().getKind(); - bitField0_ = (bitField0_ & ~0x00002000); - onChanged(); - return this; - } - /** - * - * - *
-     * Output only. Type of this resource. Always networkconnectivity#policyBasedRoute for
-     * Policy Based Route resources.
-     * 
- * - * string kind = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @param value The bytes for kind to set. - * @return This builder for chaining. - */ - public Builder setKindBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - kind_ = value; - bitField0_ |= 0x00002000; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.cloud.networkconnectivity.v1.PolicyBasedRoute) - } - - // @@protoc_insertion_point(class_scope:google.cloud.networkconnectivity.v1.PolicyBasedRoute) - private static final com.google.cloud.networkconnectivity.v1.PolicyBasedRoute DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.cloud.networkconnectivity.v1.PolicyBasedRoute(); - } - - public static com.google.cloud.networkconnectivity.v1.PolicyBasedRoute getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PolicyBasedRoute parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } -} diff --git a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRouteName.java b/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRouteName.java deleted file mode 100644 index 653b1a5507d8..000000000000 --- a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRouteName.java +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.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 PolicyBasedRouteName implements ResourceName { - private static final PathTemplate PROJECT_LOCATION_POLICY_BASED_ROUTE = - PathTemplate.createWithoutUrlEncoding( - "projects/{project}/{location}/global/PolicyBasedRoutes/{policy_based_route}"); - private volatile Map fieldValuesMap; - private final String project; - private final String location; - private final String policyBasedRoute; - - @Deprecated - protected PolicyBasedRouteName() { - project = null; - location = null; - policyBasedRoute = null; - } - - private PolicyBasedRouteName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - policyBasedRoute = Preconditions.checkNotNull(builder.getPolicyBasedRoute()); - } - - public String getProject() { - return project; - } - - public String getLocation() { - return location; - } - - public String getPolicyBasedRoute() { - return policyBasedRoute; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static PolicyBasedRouteName of(String project, String location, String policyBasedRoute) { - return newBuilder() - .setProject(project) - .setLocation(location) - .setPolicyBasedRoute(policyBasedRoute) - .build(); - } - - public static String format(String project, String location, String policyBasedRoute) { - return newBuilder() - .setProject(project) - .setLocation(location) - .setPolicyBasedRoute(policyBasedRoute) - .build() - .toString(); - } - - public static PolicyBasedRouteName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - PROJECT_LOCATION_POLICY_BASED_ROUTE.validatedMatch( - formattedString, "PolicyBasedRouteName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), matchMap.get("location"), matchMap.get("policy_based_route")); - } - - 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 (PolicyBasedRouteName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PROJECT_LOCATION_POLICY_BASED_ROUTE.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 (location != null) { - fieldMapBuilder.put("location", location); - } - if (policyBasedRoute != null) { - fieldMapBuilder.put("policy_based_route", policyBasedRoute); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PROJECT_LOCATION_POLICY_BASED_ROUTE.instantiate( - "project", project, "location", location, "policy_based_route", policyBasedRoute); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - PolicyBasedRouteName that = ((PolicyBasedRouteName) o); - return Objects.equals(this.project, that.project) - && Objects.equals(this.location, that.location) - && Objects.equals(this.policyBasedRoute, that.policyBasedRoute); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(project); - h *= 1000003; - h ^= Objects.hashCode(location); - h *= 1000003; - h ^= Objects.hashCode(policyBasedRoute); - return h; - } - - /** Builder for projects/{project}/{location}/global/PolicyBasedRoutes/{policy_based_route}. */ - public static class Builder { - private String project; - private String location; - private String policyBasedRoute; - - protected Builder() {} - - public String getProject() { - return project; - } - - public String getLocation() { - return location; - } - - public String getPolicyBasedRoute() { - return policyBasedRoute; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - public Builder setLocation(String location) { - this.location = location; - return this; - } - - public Builder setPolicyBasedRoute(String policyBasedRoute) { - this.policyBasedRoute = policyBasedRoute; - return this; - } - - private Builder(PolicyBasedRouteName policyBasedRouteName) { - this.project = policyBasedRouteName.project; - this.location = policyBasedRouteName.location; - this.policyBasedRoute = policyBasedRouteName.policyBasedRoute; - } - - public PolicyBasedRouteName build() { - return new PolicyBasedRouteName(this); - } - } -} diff --git a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRouteOrBuilder.java b/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRouteOrBuilder.java deleted file mode 100644 index 86836923ee85..000000000000 --- a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRouteOrBuilder.java +++ /dev/null @@ -1,556 +0,0 @@ -/* - * Copyright 2020 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. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/networkconnectivity/v1/policy_based_routing.proto - -package com.google.cloud.networkconnectivity.v1; - -public interface PolicyBasedRouteOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.networkconnectivity.v1.PolicyBasedRoute) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-   * Optional. VM instances to which this policy based route applies to.
-   * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine virtual_machine = 18 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return Whether the virtualMachine field is set. - */ - boolean hasVirtualMachine(); - /** - * - * - *
-   * Optional. VM instances to which this policy based route applies to.
-   * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine virtual_machine = 18 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return The virtualMachine. - */ - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine getVirtualMachine(); - /** - * - * - *
-   * Optional. VM instances to which this policy based route applies to.
-   * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine virtual_machine = 18 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachineOrBuilder - getVirtualMachineOrBuilder(); - - /** - * - * - *
-   * Optional. The interconnect attachments to which this route applies to.
-   * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment interconnect_attachment = 9 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return Whether the interconnectAttachment field is set. - */ - boolean hasInterconnectAttachment(); - /** - * - * - *
-   * Optional. The interconnect attachments to which this route applies to.
-   * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment interconnect_attachment = 9 [(.google.api.field_behavior) = OPTIONAL]; - * - * - * @return The interconnectAttachment. - */ - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment - getInterconnectAttachment(); - /** - * - * - *
-   * Optional. The interconnect attachments to which this route applies to.
-   * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment interconnect_attachment = 9 [(.google.api.field_behavior) = OPTIONAL]; - * - */ - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachmentOrBuilder - getInterconnectAttachmentOrBuilder(); - - /** - * - * - *
-   * Optional. The IP of a global access enabled L4 ILB that should be the next hop to
-   * handle matching packets. For this version, only next_hop_ilb_ip is
-   * supported.
-   * 
- * - * string next_hop_ilb_ip = 12 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return Whether the nextHopIlbIp field is set. - */ - boolean hasNextHopIlbIp(); - /** - * - * - *
-   * Optional. The IP of a global access enabled L4 ILB that should be the next hop to
-   * handle matching packets. For this version, only next_hop_ilb_ip is
-   * supported.
-   * 
- * - * string next_hop_ilb_ip = 12 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The nextHopIlbIp. - */ - java.lang.String getNextHopIlbIp(); - /** - * - * - *
-   * Optional. The IP of a global access enabled L4 ILB that should be the next hop to
-   * handle matching packets. For this version, only next_hop_ilb_ip is
-   * supported.
-   * 
- * - * string next_hop_ilb_ip = 12 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for nextHopIlbIp. - */ - com.google.protobuf.ByteString getNextHopIlbIpBytes(); - - /** - * - * - *
-   * Immutable. A unique name of the resource in the form of
-   * `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}`
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-   * Immutable. A unique name of the resource in the form of
-   * `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}`
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * - * - *
-   * Output only. Time when the PolicyBasedRoute was created.
-   * 
- * - * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the createTime field is set. - */ - boolean hasCreateTime(); - /** - * - * - *
-   * Output only. Time when the PolicyBasedRoute was created.
-   * 
- * - * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The createTime. - */ - com.google.protobuf.Timestamp getCreateTime(); - /** - * - * - *
-   * Output only. Time when the PolicyBasedRoute was created.
-   * 
- * - * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); - - /** - * - * - *
-   * Output only. Time when the PolicyBasedRoute was updated.
-   * 
- * - * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return Whether the updateTime field is set. - */ - boolean hasUpdateTime(); - /** - * - * - *
-   * Output only. Time when the PolicyBasedRoute was updated.
-   * 
- * - * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The updateTime. - */ - com.google.protobuf.Timestamp getUpdateTime(); - /** - * - * - *
-   * Output only. Time when the PolicyBasedRoute was updated.
-   * 
- * - * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); - - /** - * - * - *
-   * User-defined labels.
-   * 
- * - * map<string, string> labels = 4; - */ - int getLabelsCount(); - /** - * - * - *
-   * User-defined labels.
-   * 
- * - * map<string, string> labels = 4; - */ - boolean containsLabels(java.lang.String key); - /** Use {@link #getLabelsMap()} instead. */ - @java.lang.Deprecated - java.util.Map getLabels(); - /** - * - * - *
-   * User-defined labels.
-   * 
- * - * map<string, string> labels = 4; - */ - java.util.Map getLabelsMap(); - /** - * - * - *
-   * User-defined labels.
-   * 
- * - * map<string, string> labels = 4; - */ - /* nullable */ - java.lang.String getLabelsOrDefault( - java.lang.String key, - /* nullable */ - java.lang.String defaultValue); - /** - * - * - *
-   * User-defined labels.
-   * 
- * - * map<string, string> labels = 4; - */ - java.lang.String getLabelsOrThrow(java.lang.String key); - - /** - * - * - *
-   * Optional. An optional description of this resource. Provide this field when you
-   * create the resource.
-   * 
- * - * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The description. - */ - java.lang.String getDescription(); - /** - * - * - *
-   * Optional. An optional description of this resource. Provide this field when you
-   * create the resource.
-   * 
- * - * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for description. - */ - com.google.protobuf.ByteString getDescriptionBytes(); - - /** - * - * - *
-   * Required. Fully-qualified URL of the network that this route applies to. e.g.
-   * projects/my-project/global/networks/my-network.
-   * 
- * - * - * string network = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The network. - */ - java.lang.String getNetwork(); - /** - * - * - *
-   * Required. Fully-qualified URL of the network that this route applies to. e.g.
-   * projects/my-project/global/networks/my-network.
-   * 
- * - * - * string network = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * - * - * @return The bytes for network. - */ - com.google.protobuf.ByteString getNetworkBytes(); - - /** - * - * - *
-   * Required. The filter to match L4 traffic.
-   * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter filter = 10 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return Whether the filter field is set. - */ - boolean hasFilter(); - /** - * - * - *
-   * Required. The filter to match L4 traffic.
-   * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter filter = 10 [(.google.api.field_behavior) = REQUIRED]; - * - * - * @return The filter. - */ - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter getFilter(); - /** - * - * - *
-   * Required. The filter to match L4 traffic.
-   * 
- * - * - * .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter filter = 10 [(.google.api.field_behavior) = REQUIRED]; - * - */ - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.FilterOrBuilder getFilterOrBuilder(); - - /** - * - * - *
-   * Optional. The priority of this policy based route. Priority is used to break ties in
-   * cases where there are more than one matching policy based routes found. In
-   * cases where multiple policy based routes are matched, the one with the
-   * lowest-numbered priority value wins. The default value is 1000. The
-   * priority value must be from 1 to 65535, inclusive.
-   * 
- * - * int32 priority = 11 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The priority. - */ - int getPriority(); - - /** - * - * - *
-   * Output only. If potential misconfigurations are detected for this route,
-   * this field will be populated with warning messages.
-   * 
- * - * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - java.util.List - getWarningsList(); - /** - * - * - *
-   * Output only. If potential misconfigurations are detected for this route,
-   * this field will be populated with warning messages.
-   * 
- * - * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings getWarnings(int index); - /** - * - * - *
-   * Output only. If potential misconfigurations are detected for this route,
-   * this field will be populated with warning messages.
-   * 
- * - * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - int getWarningsCount(); - /** - * - * - *
-   * Output only. If potential misconfigurations are detected for this route,
-   * this field will be populated with warning messages.
-   * 
- * - * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - java.util.List< - ? extends com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.WarningsOrBuilder> - getWarningsOrBuilderList(); - /** - * - * - *
-   * Output only. If potential misconfigurations are detected for this route,
-   * this field will be populated with warning messages.
-   * 
- * - * - * repeated .google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - */ - com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.WarningsOrBuilder getWarningsOrBuilder( - int index); - - /** - * - * - *
-   * Output only. Server-defined fully-qualified URL for this resource.
-   * 
- * - * string self_link = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The selfLink. - */ - java.lang.String getSelfLink(); - /** - * - * - *
-   * Output only. Server-defined fully-qualified URL for this resource.
-   * 
- * - * string self_link = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for selfLink. - */ - com.google.protobuf.ByteString getSelfLinkBytes(); - - /** - * - * - *
-   * Output only. Type of this resource. Always networkconnectivity#policyBasedRoute for
-   * Policy Based Route resources.
-   * 
- * - * string kind = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The kind. - */ - java.lang.String getKind(); - /** - * - * - *
-   * Output only. Type of this resource. Always networkconnectivity#policyBasedRoute for
-   * Policy Based Route resources.
-   * 
- * - * string kind = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The bytes for kind. - */ - com.google.protobuf.ByteString getKindBytes(); - - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.TargetCase getTargetCase(); - - public com.google.cloud.networkconnectivity.v1.PolicyBasedRoute.NextHopCase getNextHopCase(); -} diff --git a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRoutingProto.java b/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRoutingProto.java deleted file mode 100644 index 35f1499abf05..000000000000 --- a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/java/com/google/cloud/networkconnectivity/v1/PolicyBasedRoutingProto.java +++ /dev/null @@ -1,349 +0,0 @@ -/* - * Copyright 2020 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. - */ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/networkconnectivity/v1/policy_based_routing.proto - -package com.google.cloud.networkconnectivity.v1; - -public final class PolicyBasedRoutingProto { - private PolicyBasedRoutingProto() {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); - } - - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_VirtualMachine_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_VirtualMachine_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_InterconnectAttachment_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_InterconnectAttachment_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_Filter_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_Filter_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_Warnings_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_Warnings_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_Warnings_DataEntry_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_Warnings_DataEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_LabelsEntry_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_LabelsEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_networkconnectivity_v1_ListPolicyBasedRoutesRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_networkconnectivity_v1_ListPolicyBasedRoutesRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_networkconnectivity_v1_ListPolicyBasedRoutesResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_networkconnectivity_v1_ListPolicyBasedRoutesResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_networkconnectivity_v1_GetPolicyBasedRouteRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_networkconnectivity_v1_GetPolicyBasedRouteRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_networkconnectivity_v1_CreatePolicyBasedRouteRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_networkconnectivity_v1_CreatePolicyBasedRouteRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_networkconnectivity_v1_DeletePolicyBasedRouteRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_networkconnectivity_v1_DeletePolicyBasedRouteRequest_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - return descriptor; - } - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - - static { - java.lang.String[] descriptorData = { - "\n>google/cloud/networkconnectivity/v1/po" - + "licy_based_routing.proto\022#google.cloud.n" - + "etworkconnectivity.v1\032\034google/api/annota" - + "tions.proto\032\027google/api/client.proto\032\037go" - + "ogle/api/field_behavior.proto\032\031google/ap" - + "i/resource.proto\032#google/longrunning/ope" - + "rations.proto\032\037google/protobuf/timestamp" - + ".proto\"\247\r\n\020PolicyBasedRoute\022d\n\017virtual_m" - + "achine\030\022 \001(\0132D.google.cloud.networkconne" - + "ctivity.v1.PolicyBasedRoute.VirtualMachi" - + "neB\003\340A\001H\000\022t\n\027interconnect_attachment\030\t \001" - + "(\0132L.google.cloud.networkconnectivity.v1" - + ".PolicyBasedRoute.InterconnectAttachment" - + "B\003\340A\001H\000\022\036\n\017next_hop_ilb_ip\030\014 \001(\tB\003\340A\001H\001\022" - + "\021\n\004name\030\001 \001(\tB\003\340A\005\0224\n\013create_time\030\002 \001(\0132" - + "\032.google.protobuf.TimestampB\003\340A\003\0224\n\013upda" - + "te_time\030\003 \001(\0132\032.google.protobuf.Timestam" - + "pB\003\340A\003\022Q\n\006labels\030\004 \003(\0132A.google.cloud.ne" - + "tworkconnectivity.v1.PolicyBasedRoute.La" - + "belsEntry\022\030\n\013description\030\005 \001(\tB\003\340A\001\0227\n\007n" - + "etwork\030\006 \001(\tB&\340A\002\372A \n\036compute.googleapis" - + ".com/Network\022Q\n\006filter\030\n \001(\0132<.google.cl" - + "oud.networkconnectivity.v1.PolicyBasedRo" - + "ute.FilterB\003\340A\002\022\025\n\010priority\030\013 \001(\005B\003\340A\001\022U" - + "\n\010warnings\030\016 \003(\0132>.google.cloud.networkc" - + "onnectivity.v1.PolicyBasedRoute.Warnings" - + "B\003\340A\003\022\026\n\tself_link\030\017 \001(\tB\003\340A\003\022\021\n\004kind\030\020 " - + "\001(\tB\003\340A\003\032#\n\016VirtualMachine\022\021\n\004tags\030\001 \003(\t" - + "B\003\340A\001\032-\n\026InterconnectAttachment\022\023\n\006regio" - + "n\030\001 \001(\tB\003\340A\001\032\377\001\n\006Filter\022\030\n\013ip_protocol\030\001" - + " \001(\tB\003\340A\001\022\026\n\tsrc_range\030\002 \001(\tB\003\340A\001\022\027\n\ndes" - + "t_range\030\003 \001(\tB\003\340A\001\022k\n\020protocol_version\030\006" - + " \001(\0162L.google.cloud.networkconnectivity." - + "v1.PolicyBasedRoute.Filter.ProtocolVersi" - + "onB\003\340A\002\"=\n\017ProtocolVersion\022 \n\034PROTOCOL_V" - + "ERSION_UNSPECIFIED\020\000\022\010\n\004IPV4\020\001\032\341\002\n\010Warni" - + "ngs\022V\n\004code\030\001 \001(\0162C.google.cloud.network" - + "connectivity.v1.PolicyBasedRoute.Warning" - + "s.CodeB\003\340A\003\022[\n\004data\030\002 \003(\0132H.google.cloud" - + ".networkconnectivity.v1.PolicyBasedRoute" - + ".Warnings.DataEntryB\003\340A\003\022\034\n\017warning_mess" - + "age\030\003 \001(\tB\003\340A\003\032+\n\tDataEntry\022\013\n\003key\030\001 \001(\t" - + "\022\r\n\005value\030\002 \001(\t:\0028\001\"U\n\004Code\022\027\n\023WARNING_U" - + "NSPECIFIED\020\000\022\027\n\023RESOURCE_NOT_ACTIVE\020\001\022\033\n" - + "\027RESOURCE_BEING_MODIFIED\020\002\032-\n\013LabelsEntr" - + "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:\206\001\352A\202\001" - + "\n3networkconnectivity.googleapis.com/Pol" - + "icyBasedRoute\022Kprojects/{project}/{locat" - + "ion}/global/PolicyBasedRoutes/{policy_ba" - + "sed_route}B\010\n\006targetB\n\n\010next_hop\"\242\001\n\034Lis" - + "tPolicyBasedRoutesRequest\0229\n\006parent\030\001 \001(" - + "\tB)\340A\002\372A#\n!locations.googleapis.com/Loca" - + "tion\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 " - + "\001(\t\022\016\n\006filter\030\004 \001(\t\022\020\n\010order_by\030\005 \001(\t\"\241\001" - + "\n\035ListPolicyBasedRoutesResponse\022R\n\023polic" - + "y_based_routes\030\001 \003(\01325.google.cloud.netw" - + "orkconnectivity.v1.PolicyBasedRoute\022\027\n\017n" - + "ext_page_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(" - + "\t\"g\n\032GetPolicyBasedRouteRequest\022I\n\004name\030" - + "\001 \001(\tB;\340A\002\372A5\n3networkconnectivity.googl" - + "eapis.com/PolicyBasedRoute\"\357\001\n\035CreatePol" - + "icyBasedRouteRequest\0229\n\006parent\030\001 \001(\tB)\340A" - + "\002\372A#\n!locations.googleapis.com/Location\022" - + "\"\n\025policy_based_route_id\030\002 \001(\tB\003\340A\001\022V\n\022p" - + "olicy_based_route\030\003 \001(\01325.google.cloud.n" - + "etworkconnectivity.v1.PolicyBasedRouteB\003" - + "\340A\002\022\027\n\nrequest_id\030\004 \001(\tB\003\340A\001\"\203\001\n\035DeleteP" - + "olicyBasedRouteRequest\022I\n\004name\030\001 \001(\tB;\340A" - + "\002\372A5\n3networkconnectivity.googleapis.com" - + "/PolicyBasedRoute\022\027\n\nrequest_id\030\002 \001(\tB\003\340" - + "A\0012\343\010\n\031PolicyBasedRoutingService\022\353\001\n\025Lis" - + "tPolicyBasedRoutes\022A.google.cloud.networ" - + "kconnectivity.v1.ListPolicyBasedRoutesRe" - + "quest\032B.google.cloud.networkconnectivity" - + ".v1.ListPolicyBasedRoutesResponse\"K\202\323\344\223\002" - + "<\022:/v1/{parent=projects/*/locations/glob" - + "al}/policyBasedRoutes\332A\006parent\022\330\001\n\023GetPo" - + "licyBasedRoute\022?.google.cloud.networkcon" - + "nectivity.v1.GetPolicyBasedRouteRequest\032" - + "5.google.cloud.networkconnectivity.v1.Po" - + "licyBasedRoute\"I\202\323\344\223\002<\022:/v1/{name=projec" - + "ts/*/locations/global/policyBasedRoutes/" - + "*}\332A\004name\022\256\002\n\026CreatePolicyBasedRoute\022B.g" - + "oogle.cloud.networkconnectivity.v1.Creat" - + "ePolicyBasedRouteRequest\032\035.google.longru" - + "nning.Operation\"\260\001\202\323\344\223\002P\":/v1/{parent=pr" - + "ojects/*/locations/global}/policyBasedRo" - + "utes:\022policy_based_route\332A/parent,policy" - + "_based_route,policy_based_route_id\312A%\n\020P" - + "olicyBasedRoute\022\021OperationMetadata\022\363\001\n\026D" - + "eletePolicyBasedRoute\022B.google.cloud.net" - + "workconnectivity.v1.DeletePolicyBasedRou" - + "teRequest\032\035.google.longrunning.Operation" - + "\"v\202\323\344\223\002<*:/v1/{name=projects/*/locations" - + "/global/policyBasedRoutes/*}\332A\004name\312A*\n\025" - + "google.protobuf.Empty\022\021OperationMetadata" - + "\032V\312A\"networkconnectivity.googleapis.com\322" - + "A.https://www.googleapis.com/auth/cloud-" - + "platformB\221\002\n\'com.google.cloud.networkcon" - + "nectivity.v1B\027PolicyBasedRoutingProtoP\001Z" - + "Vgoogle.golang.org/genproto/googleapis/c" - + "loud/networkconnectivity/v1;networkconne" - + "ctivity\252\002#Google.Cloud.NetworkConnectivi" - + "ty.V1\312\002#Google\\Cloud\\NetworkConnectivity" - + "\\V1\352\002&Google::Cloud::NetworkConnectivity" - + "::V1b\006proto3" - }; - descriptor = - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.api.AnnotationsProto.getDescriptor(), - com.google.api.ClientProto.getDescriptor(), - com.google.api.FieldBehaviorProto.getDescriptor(), - com.google.api.ResourceProto.getDescriptor(), - com.google.longrunning.OperationsProto.getDescriptor(), - com.google.protobuf.TimestampProto.getDescriptor(), - }); - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_descriptor, - new java.lang.String[] { - "VirtualMachine", - "InterconnectAttachment", - "NextHopIlbIp", - "Name", - "CreateTime", - "UpdateTime", - "Labels", - "Description", - "Network", - "Filter", - "Priority", - "Warnings", - "SelfLink", - "Kind", - "Target", - "NextHop", - }); - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_VirtualMachine_descriptor = - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_descriptor - .getNestedTypes() - .get(0); - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_VirtualMachine_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_VirtualMachine_descriptor, - new java.lang.String[] { - "Tags", - }); - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_InterconnectAttachment_descriptor = - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_descriptor - .getNestedTypes() - .get(1); - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_InterconnectAttachment_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_InterconnectAttachment_descriptor, - new java.lang.String[] { - "Region", - }); - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_Filter_descriptor = - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_descriptor - .getNestedTypes() - .get(2); - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_Filter_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_Filter_descriptor, - new java.lang.String[] { - "IpProtocol", "SrcRange", "DestRange", "ProtocolVersion", - }); - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_Warnings_descriptor = - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_descriptor - .getNestedTypes() - .get(3); - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_Warnings_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_Warnings_descriptor, - new java.lang.String[] { - "Code", "Data", "WarningMessage", - }); - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_Warnings_DataEntry_descriptor = - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_Warnings_descriptor - .getNestedTypes() - .get(0); - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_Warnings_DataEntry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_Warnings_DataEntry_descriptor, - new java.lang.String[] { - "Key", "Value", - }); - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_LabelsEntry_descriptor = - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_descriptor - .getNestedTypes() - .get(4); - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_LabelsEntry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_networkconnectivity_v1_PolicyBasedRoute_LabelsEntry_descriptor, - new java.lang.String[] { - "Key", "Value", - }); - internal_static_google_cloud_networkconnectivity_v1_ListPolicyBasedRoutesRequest_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_google_cloud_networkconnectivity_v1_ListPolicyBasedRoutesRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_networkconnectivity_v1_ListPolicyBasedRoutesRequest_descriptor, - new java.lang.String[] { - "Parent", "PageSize", "PageToken", "Filter", "OrderBy", - }); - internal_static_google_cloud_networkconnectivity_v1_ListPolicyBasedRoutesResponse_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_google_cloud_networkconnectivity_v1_ListPolicyBasedRoutesResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_networkconnectivity_v1_ListPolicyBasedRoutesResponse_descriptor, - new java.lang.String[] { - "PolicyBasedRoutes", "NextPageToken", "Unreachable", - }); - internal_static_google_cloud_networkconnectivity_v1_GetPolicyBasedRouteRequest_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_google_cloud_networkconnectivity_v1_GetPolicyBasedRouteRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_networkconnectivity_v1_GetPolicyBasedRouteRequest_descriptor, - new java.lang.String[] { - "Name", - }); - internal_static_google_cloud_networkconnectivity_v1_CreatePolicyBasedRouteRequest_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_google_cloud_networkconnectivity_v1_CreatePolicyBasedRouteRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_networkconnectivity_v1_CreatePolicyBasedRouteRequest_descriptor, - new java.lang.String[] { - "Parent", "PolicyBasedRouteId", "PolicyBasedRoute", "RequestId", - }); - internal_static_google_cloud_networkconnectivity_v1_DeletePolicyBasedRouteRequest_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_google_cloud_networkconnectivity_v1_DeletePolicyBasedRouteRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_networkconnectivity_v1_DeletePolicyBasedRouteRequest_descriptor, - new java.lang.String[] { - "Name", "RequestId", - }); - com.google.protobuf.ExtensionRegistry registry = - com.google.protobuf.ExtensionRegistry.newInstance(); - registry.add(com.google.api.ClientProto.defaultHost); - registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); - registry.add(com.google.api.AnnotationsProto.http); - registry.add(com.google.api.ClientProto.methodSignature); - registry.add(com.google.api.ClientProto.oauthScopes); - registry.add(com.google.api.ResourceProto.resource); - registry.add(com.google.api.ResourceProto.resourceReference); - registry.add(com.google.longrunning.OperationsProto.operationInfo); - com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( - descriptor, registry); - com.google.api.AnnotationsProto.getDescriptor(); - com.google.api.ClientProto.getDescriptor(); - com.google.api.FieldBehaviorProto.getDescriptor(); - com.google.api.ResourceProto.getDescriptor(); - com.google.longrunning.OperationsProto.getDescriptor(); - com.google.protobuf.TimestampProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/proto/google/cloud/networkconnectivity/v1/policy_based_routing.proto b/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/proto/google/cloud/networkconnectivity/v1/policy_based_routing.proto deleted file mode 100644 index 74c24bd39710..000000000000 --- a/java-networkconnectivity/proto-google-cloud-networkconnectivity-v1/src/main/proto/google/cloud/networkconnectivity/v1/policy_based_routing.proto +++ /dev/null @@ -1,338 +0,0 @@ -// Copyright 2022 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 -// -// http://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. - -syntax = "proto3"; - -package google.cloud.networkconnectivity.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.NetworkConnectivity.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/networkconnectivity/v1;networkconnectivity"; -option java_multiple_files = true; -option java_outer_classname = "PolicyBasedRoutingProto"; -option java_package = "com.google.cloud.networkconnectivity.v1"; -option php_namespace = "Google\\Cloud\\NetworkConnectivity\\V1"; -option ruby_package = "Google::Cloud::NetworkConnectivity::V1"; - -// Policy-Based Routing allows GCP customers to specify flexibile routing -// policies for Layer 4 traffic traversing through the connected service. -service PolicyBasedRoutingService { - option (google.api.default_host) = "networkconnectivity.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Lists PolicyBasedRoutes in a given project and location. - rpc ListPolicyBasedRoutes(ListPolicyBasedRoutesRequest) returns (ListPolicyBasedRoutesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/global}/policyBasedRoutes" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets details of a single PolicyBasedRoute. - rpc GetPolicyBasedRoute(GetPolicyBasedRouteRequest) returns (PolicyBasedRoute) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/global/policyBasedRoutes/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new PolicyBasedRoute in a given project and location. - rpc CreatePolicyBasedRoute(CreatePolicyBasedRouteRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/global}/policyBasedRoutes" - body: "policy_based_route" - }; - option (google.api.method_signature) = "parent,policy_based_route,policy_based_route_id"; - option (google.longrunning.operation_info) = { - response_type: "PolicyBasedRoute" - metadata_type: "OperationMetadata" - }; - } - - // Deletes a single PolicyBasedRoute. - rpc DeletePolicyBasedRoute(DeletePolicyBasedRouteRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/global/policyBasedRoutes/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "OperationMetadata" - }; - } -} - -// Policy Based Routes (PBR) are more powerful routes that allows GCP customers -// to route their L4 network traffic based on not just destination IP, but also -// source IP, protocol and more. A PBR always take precedence when it conflicts -// with other types of routes. -// Next id: 19 -message PolicyBasedRoute { - option (google.api.resource) = { - type: "networkconnectivity.googleapis.com/PolicyBasedRoute" - pattern: "projects/{project}/{location}/global/PolicyBasedRoutes/{policy_based_route}" - }; - - // VM instances to which this policy based route applies to. - message VirtualMachine { - // Optional. A list of VM instance tags to which this policy based route applies to. - // VM instances that have ANY of tags specified here will install this - // PBR. - repeated string tags = 1 [(google.api.field_behavior) = OPTIONAL]; - } - - // InterconnectAttachment to which this route applies to. - message InterconnectAttachment { - // Optional. Cloud region to install this policy based route on interconnect - // attachment. Use `all` to install it on all interconnect attachments. - string region = 1 [(google.api.field_behavior) = OPTIONAL]; - } - - // Filter matches L4 traffic. - message Filter { - // The internet protocol version. - enum ProtocolVersion { - // Default value. - PROTOCOL_VERSION_UNSPECIFIED = 0; - - // The PBR is for IPv4 internet protocol traffic. - IPV4 = 1; - } - - // Optional. The IP protocol that this policy based route applies to. Valid values are - // 'TCP', 'UDP', and 'ALL'. Default is 'ALL'. - string ip_protocol = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The source IP range of outgoing packets that this policy based route - // applies to. Default is "0.0.0.0/0" if protocol version is IPv4. - string src_range = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The destination IP range of outgoing packets that this policy based route - // applies to. Default is "0.0.0.0/0" if protocol version is IPv4. - string dest_range = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Required. Internet protocol versions this policy based route applies to. For this - // version, only IPV4 is supported. - ProtocolVersion protocol_version = 6 [(google.api.field_behavior) = REQUIRED]; - } - - // Informational warning message. - message Warnings { - // Warning code for Policy Based Routing. Expect to add values in the - // future. - enum Code { - // Default value. - WARNING_UNSPECIFIED = 0; - - // The policy based route is not active and functioning. Common causes are - // the dependent network was deleted or the resource project was turned - // off. - RESOURCE_NOT_ACTIVE = 1; - - // The policy based route is being modified (e.g. created/deleted) at this - // time. - RESOURCE_BEING_MODIFIED = 2; - } - - // Output only. A warning code, if applicable. - Code code = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Metadata about this warning in key: value format. The key should provides - // more detail on the warning being returned. For example, for warnings - // where there are no results in a list request for a particular zone, this - // key might be scope and the key value might be the zone name. Other - // examples might be a key indicating a deprecated resource and a suggested - // replacement. - map data = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A human-readable description of the warning code. - string warning_message = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Target specifies network endpoints to which this policy based route applies - // to. If none of the target is specified, the PBR will be installed on all - // network endpoints (e.g. VMs, VPNs, and Interconnects) in the VPC. - oneof target { - // Optional. VM instances to which this policy based route applies to. - VirtualMachine virtual_machine = 18 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The interconnect attachments to which this route applies to. - InterconnectAttachment interconnect_attachment = 9 [(google.api.field_behavior) = OPTIONAL]; - } - - oneof next_hop { - // Optional. The IP of a global access enabled L4 ILB that should be the next hop to - // handle matching packets. For this version, only next_hop_ilb_ip is - // supported. - string next_hop_ilb_ip = 12 [(google.api.field_behavior) = OPTIONAL]; - } - - // Immutable. A unique name of the resource in the form of - // `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}` - string name = 1 [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. Time when the PolicyBasedRoute was created. - google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Time when the PolicyBasedRoute was updated. - google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // User-defined labels. - map labels = 4; - - // Optional. An optional description of this resource. Provide this field when you - // create the resource. - string description = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Required. Fully-qualified URL of the network that this route applies to. e.g. - // projects/my-project/global/networks/my-network. - string network = 6 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "compute.googleapis.com/Network" - } - ]; - - // Required. The filter to match L4 traffic. - Filter filter = 10 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The priority of this policy based route. Priority is used to break ties in - // cases where there are more than one matching policy based routes found. In - // cases where multiple policy based routes are matched, the one with the - // lowest-numbered priority value wins. The default value is 1000. The - // priority value must be from 1 to 65535, inclusive. - int32 priority = 11 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. If potential misconfigurations are detected for this route, - // this field will be populated with warning messages. - repeated Warnings warnings = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Server-defined fully-qualified URL for this resource. - string self_link = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Type of this resource. Always networkconnectivity#policyBasedRoute for - // Policy Based Route resources. - string kind = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Request for [PolicyBasedRouting.ListPolicyBasedRoutes][] method. -message ListPolicyBasedRoutesRequest { - // Required. The parent resource's name. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The maximum number of results per page that should be returned. - int32 page_size = 2; - - // The page token. - string page_token = 3; - - // A filter expression that filters the results listed in the response. - string filter = 4; - - // Sort the results by a certain order. - string order_by = 5; -} - -// Response for [PolicyBasedRouting.ListPolicyBasedRoutes][] method. -message ListPolicyBasedRoutesResponse { - // Policy based routes to be returned. - repeated PolicyBasedRoute policy_based_routes = 1; - - // The next pagination token in the List response. It should be used as - // page_token for the following request. An empty value means no more result. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Request for [PolicyBasedRouting.GetPolicyBasedRoute][] method. -message GetPolicyBasedRouteRequest { - // Required. Name of the PolicyBasedRoute resource to get. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "networkconnectivity.googleapis.com/PolicyBasedRoute" - } - ]; -} - -// Request for [PolicyBasedRouting.CreatePolicyBasedRoute][] method. -message CreatePolicyBasedRouteRequest { - // Required. The parent resource's name of the PolicyBasedRoute. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Optional. Unique id for the Policy Based Route to create. - string policy_based_route_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Required. Initial values for a new Policy Based Route. - PolicyBasedRoute policy_based_route = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. An optional request ID to identify requests. Specify a unique request ID - // so that if you must retry your request, the server will know to ignore - // the request if it has already been completed. The server will guarantee - // that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and t - // he request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request for [PolicyBasedRouting.DeletePolicyBasedRoute][] method. -message DeletePolicyBasedRouteRequest { - // Required. Name of the PolicyBasedRoute resource to delete. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "networkconnectivity.googleapis.com/PolicyBasedRoute" - } - ]; - - // Optional. An optional request ID to identify requests. Specify a unique request ID - // so that if you must retry your request, the server will know to ignore - // the request if it has already been completed. The server will guarantee - // that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and t - // he request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/create/SyncCreateSetCredentialsProvider.java b/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/create/SyncCreateSetCredentialsProvider.java deleted file mode 100644 index 0e18ff84d24e..000000000000 --- a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/create/SyncCreateSetCredentialsProvider.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1.samples; - -// [START networkconnectivity_v1_generated_PolicyBasedRoutingService_Create_SetCredentialsProvider_sync] -import com.google.api.gax.core.FixedCredentialsProvider; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceSettings; -import com.google.cloud.networkconnectivity.v1.myCredentials; - -public class SyncCreateSetCredentialsProvider { - - public static void main(String[] args) throws Exception { - syncCreateSetCredentialsProvider(); - } - - public static void syncCreateSetCredentialsProvider() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - PolicyBasedRoutingServiceSettings policyBasedRoutingServiceSettings = - PolicyBasedRoutingServiceSettings.newBuilder() - .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) - .build(); - PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = - PolicyBasedRoutingServiceClient.create(policyBasedRoutingServiceSettings); - } -} -// [END networkconnectivity_v1_generated_PolicyBasedRoutingService_Create_SetCredentialsProvider_sync] diff --git a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/create/SyncCreateSetEndpoint.java b/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/create/SyncCreateSetEndpoint.java deleted file mode 100644 index c25cc40b7c86..000000000000 --- a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/create/SyncCreateSetEndpoint.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1.samples; - -// [START networkconnectivity_v1_generated_PolicyBasedRoutingService_Create_SetEndpoint_sync] -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceSettings; -import com.google.cloud.networkconnectivity.v1.myEndpoint; - -public class SyncCreateSetEndpoint { - - public static void main(String[] args) throws Exception { - syncCreateSetEndpoint(); - } - - public static void syncCreateSetEndpoint() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - PolicyBasedRoutingServiceSettings policyBasedRoutingServiceSettings = - PolicyBasedRoutingServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); - PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = - PolicyBasedRoutingServiceClient.create(policyBasedRoutingServiceSettings); - } -} -// [END networkconnectivity_v1_generated_PolicyBasedRoutingService_Create_SetEndpoint_sync] diff --git a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/createpolicybasedroute/AsyncCreatePolicyBasedRoute.java b/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/createpolicybasedroute/AsyncCreatePolicyBasedRoute.java deleted file mode 100644 index 2e9ac23874ff..000000000000 --- a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/createpolicybasedroute/AsyncCreatePolicyBasedRoute.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1.samples; - -// [START networkconnectivity_v1_generated_PolicyBasedRoutingService_CreatePolicyBasedRoute_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest; -import com.google.cloud.networkconnectivity.v1.LocationName; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoute; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient; -import com.google.longrunning.Operation; - -public class AsyncCreatePolicyBasedRoute { - - public static void main(String[] args) throws Exception { - asyncCreatePolicyBasedRoute(); - } - - public static void asyncCreatePolicyBasedRoute() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = - PolicyBasedRoutingServiceClient.create()) { - CreatePolicyBasedRouteRequest request = - CreatePolicyBasedRouteRequest.newBuilder() - .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - .setPolicyBasedRouteId("policyBasedRouteId-18034589") - .setPolicyBasedRoute(PolicyBasedRoute.newBuilder().build()) - .setRequestId("requestId693933066") - .build(); - ApiFuture future = - policyBasedRoutingServiceClient.createPolicyBasedRouteCallable().futureCall(request); - // Do something. - Operation response = future.get(); - } - } -} -// [END networkconnectivity_v1_generated_PolicyBasedRoutingService_CreatePolicyBasedRoute_async] diff --git a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/createpolicybasedroute/AsyncCreatePolicyBasedRouteLRO.java b/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/createpolicybasedroute/AsyncCreatePolicyBasedRouteLRO.java deleted file mode 100644 index cd0c58c53a5b..000000000000 --- a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/createpolicybasedroute/AsyncCreatePolicyBasedRouteLRO.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1.samples; - -// [START networkconnectivity_v1_generated_PolicyBasedRoutingService_CreatePolicyBasedRoute_LRO_async] -import com.google.api.gax.longrunning.OperationFuture; -import com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest; -import com.google.cloud.networkconnectivity.v1.LocationName; -import com.google.cloud.networkconnectivity.v1.OperationMetadata; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoute; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient; - -public class AsyncCreatePolicyBasedRouteLRO { - - public static void main(String[] args) throws Exception { - asyncCreatePolicyBasedRouteLRO(); - } - - public static void asyncCreatePolicyBasedRouteLRO() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = - PolicyBasedRoutingServiceClient.create()) { - CreatePolicyBasedRouteRequest request = - CreatePolicyBasedRouteRequest.newBuilder() - .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - .setPolicyBasedRouteId("policyBasedRouteId-18034589") - .setPolicyBasedRoute(PolicyBasedRoute.newBuilder().build()) - .setRequestId("requestId693933066") - .build(); - OperationFuture future = - policyBasedRoutingServiceClient - .createPolicyBasedRouteOperationCallable() - .futureCall(request); - // Do something. - PolicyBasedRoute response = future.get(); - } - } -} -// [END networkconnectivity_v1_generated_PolicyBasedRoutingService_CreatePolicyBasedRoute_LRO_async] diff --git a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/createpolicybasedroute/SyncCreatePolicyBasedRoute.java b/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/createpolicybasedroute/SyncCreatePolicyBasedRoute.java deleted file mode 100644 index c38346f59456..000000000000 --- a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/createpolicybasedroute/SyncCreatePolicyBasedRoute.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1.samples; - -// [START networkconnectivity_v1_generated_PolicyBasedRoutingService_CreatePolicyBasedRoute_sync] -import com.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest; -import com.google.cloud.networkconnectivity.v1.LocationName; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoute; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient; - -public class SyncCreatePolicyBasedRoute { - - public static void main(String[] args) throws Exception { - syncCreatePolicyBasedRoute(); - } - - public static void syncCreatePolicyBasedRoute() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = - PolicyBasedRoutingServiceClient.create()) { - CreatePolicyBasedRouteRequest request = - CreatePolicyBasedRouteRequest.newBuilder() - .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - .setPolicyBasedRouteId("policyBasedRouteId-18034589") - .setPolicyBasedRoute(PolicyBasedRoute.newBuilder().build()) - .setRequestId("requestId693933066") - .build(); - PolicyBasedRoute response = - policyBasedRoutingServiceClient.createPolicyBasedRouteAsync(request).get(); - } - } -} -// [END networkconnectivity_v1_generated_PolicyBasedRoutingService_CreatePolicyBasedRoute_sync] diff --git a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/createpolicybasedroute/SyncCreatePolicyBasedRouteLocationnamePolicybasedrouteString.java b/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/createpolicybasedroute/SyncCreatePolicyBasedRouteLocationnamePolicybasedrouteString.java deleted file mode 100644 index a6c175209bab..000000000000 --- a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/createpolicybasedroute/SyncCreatePolicyBasedRouteLocationnamePolicybasedrouteString.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1.samples; - -// [START networkconnectivity_v1_generated_PolicyBasedRoutingService_CreatePolicyBasedRoute_LocationnamePolicybasedrouteString_sync] -import com.google.cloud.networkconnectivity.v1.LocationName; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoute; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient; - -public class SyncCreatePolicyBasedRouteLocationnamePolicybasedrouteString { - - public static void main(String[] args) throws Exception { - syncCreatePolicyBasedRouteLocationnamePolicybasedrouteString(); - } - - public static void syncCreatePolicyBasedRouteLocationnamePolicybasedrouteString() - throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = - PolicyBasedRoutingServiceClient.create()) { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - PolicyBasedRoute policyBasedRoute = PolicyBasedRoute.newBuilder().build(); - String policyBasedRouteId = "policyBasedRouteId-18034589"; - PolicyBasedRoute response = - policyBasedRoutingServiceClient - .createPolicyBasedRouteAsync(parent, policyBasedRoute, policyBasedRouteId) - .get(); - } - } -} -// [END networkconnectivity_v1_generated_PolicyBasedRoutingService_CreatePolicyBasedRoute_LocationnamePolicybasedrouteString_sync] diff --git a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/createpolicybasedroute/SyncCreatePolicyBasedRouteStringPolicybasedrouteString.java b/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/createpolicybasedroute/SyncCreatePolicyBasedRouteStringPolicybasedrouteString.java deleted file mode 100644 index 4b9e769b8ff3..000000000000 --- a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/createpolicybasedroute/SyncCreatePolicyBasedRouteStringPolicybasedrouteString.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1.samples; - -// [START networkconnectivity_v1_generated_PolicyBasedRoutingService_CreatePolicyBasedRoute_StringPolicybasedrouteString_sync] -import com.google.cloud.networkconnectivity.v1.LocationName; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoute; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient; - -public class SyncCreatePolicyBasedRouteStringPolicybasedrouteString { - - public static void main(String[] args) throws Exception { - syncCreatePolicyBasedRouteStringPolicybasedrouteString(); - } - - public static void syncCreatePolicyBasedRouteStringPolicybasedrouteString() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = - PolicyBasedRoutingServiceClient.create()) { - String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); - PolicyBasedRoute policyBasedRoute = PolicyBasedRoute.newBuilder().build(); - String policyBasedRouteId = "policyBasedRouteId-18034589"; - PolicyBasedRoute response = - policyBasedRoutingServiceClient - .createPolicyBasedRouteAsync(parent, policyBasedRoute, policyBasedRouteId) - .get(); - } - } -} -// [END networkconnectivity_v1_generated_PolicyBasedRoutingService_CreatePolicyBasedRoute_StringPolicybasedrouteString_sync] diff --git a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/deletepolicybasedroute/AsyncDeletePolicyBasedRoute.java b/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/deletepolicybasedroute/AsyncDeletePolicyBasedRoute.java deleted file mode 100644 index 0bff00a01f98..000000000000 --- a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/deletepolicybasedroute/AsyncDeletePolicyBasedRoute.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1.samples; - -// [START networkconnectivity_v1_generated_PolicyBasedRoutingService_DeletePolicyBasedRoute_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRouteName; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient; -import com.google.longrunning.Operation; - -public class AsyncDeletePolicyBasedRoute { - - public static void main(String[] args) throws Exception { - asyncDeletePolicyBasedRoute(); - } - - public static void asyncDeletePolicyBasedRoute() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = - PolicyBasedRoutingServiceClient.create()) { - DeletePolicyBasedRouteRequest request = - DeletePolicyBasedRouteRequest.newBuilder() - .setName( - PolicyBasedRouteName.of("[PROJECT]", "[LOCATION]", "[POLICY_BASED_ROUTE]") - .toString()) - .setRequestId("requestId693933066") - .build(); - ApiFuture future = - policyBasedRoutingServiceClient.deletePolicyBasedRouteCallable().futureCall(request); - // Do something. - future.get(); - } - } -} -// [END networkconnectivity_v1_generated_PolicyBasedRoutingService_DeletePolicyBasedRoute_async] diff --git a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/deletepolicybasedroute/AsyncDeletePolicyBasedRouteLRO.java b/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/deletepolicybasedroute/AsyncDeletePolicyBasedRouteLRO.java deleted file mode 100644 index 0f2ed3f57753..000000000000 --- a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/deletepolicybasedroute/AsyncDeletePolicyBasedRouteLRO.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1.samples; - -// [START networkconnectivity_v1_generated_PolicyBasedRoutingService_DeletePolicyBasedRoute_LRO_async] -import com.google.api.gax.longrunning.OperationFuture; -import com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest; -import com.google.cloud.networkconnectivity.v1.OperationMetadata; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRouteName; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient; -import com.google.protobuf.Empty; - -public class AsyncDeletePolicyBasedRouteLRO { - - public static void main(String[] args) throws Exception { - asyncDeletePolicyBasedRouteLRO(); - } - - public static void asyncDeletePolicyBasedRouteLRO() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = - PolicyBasedRoutingServiceClient.create()) { - DeletePolicyBasedRouteRequest request = - DeletePolicyBasedRouteRequest.newBuilder() - .setName( - PolicyBasedRouteName.of("[PROJECT]", "[LOCATION]", "[POLICY_BASED_ROUTE]") - .toString()) - .setRequestId("requestId693933066") - .build(); - OperationFuture future = - policyBasedRoutingServiceClient - .deletePolicyBasedRouteOperationCallable() - .futureCall(request); - // Do something. - future.get(); - } - } -} -// [END networkconnectivity_v1_generated_PolicyBasedRoutingService_DeletePolicyBasedRoute_LRO_async] diff --git a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/deletepolicybasedroute/SyncDeletePolicyBasedRoute.java b/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/deletepolicybasedroute/SyncDeletePolicyBasedRoute.java deleted file mode 100644 index e827f253b362..000000000000 --- a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/deletepolicybasedroute/SyncDeletePolicyBasedRoute.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1.samples; - -// [START networkconnectivity_v1_generated_PolicyBasedRoutingService_DeletePolicyBasedRoute_sync] -import com.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRouteName; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient; -import com.google.protobuf.Empty; - -public class SyncDeletePolicyBasedRoute { - - public static void main(String[] args) throws Exception { - syncDeletePolicyBasedRoute(); - } - - public static void syncDeletePolicyBasedRoute() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = - PolicyBasedRoutingServiceClient.create()) { - DeletePolicyBasedRouteRequest request = - DeletePolicyBasedRouteRequest.newBuilder() - .setName( - PolicyBasedRouteName.of("[PROJECT]", "[LOCATION]", "[POLICY_BASED_ROUTE]") - .toString()) - .setRequestId("requestId693933066") - .build(); - policyBasedRoutingServiceClient.deletePolicyBasedRouteAsync(request).get(); - } - } -} -// [END networkconnectivity_v1_generated_PolicyBasedRoutingService_DeletePolicyBasedRoute_sync] diff --git a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/deletepolicybasedroute/SyncDeletePolicyBasedRoutePolicybasedroutename.java b/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/deletepolicybasedroute/SyncDeletePolicyBasedRoutePolicybasedroutename.java deleted file mode 100644 index d319ba4559c5..000000000000 --- a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/deletepolicybasedroute/SyncDeletePolicyBasedRoutePolicybasedroutename.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1.samples; - -// [START networkconnectivity_v1_generated_PolicyBasedRoutingService_DeletePolicyBasedRoute_Policybasedroutename_sync] -import com.google.cloud.networkconnectivity.v1.PolicyBasedRouteName; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient; -import com.google.protobuf.Empty; - -public class SyncDeletePolicyBasedRoutePolicybasedroutename { - - public static void main(String[] args) throws Exception { - syncDeletePolicyBasedRoutePolicybasedroutename(); - } - - public static void syncDeletePolicyBasedRoutePolicybasedroutename() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = - PolicyBasedRoutingServiceClient.create()) { - PolicyBasedRouteName name = - PolicyBasedRouteName.of("[PROJECT]", "[LOCATION]", "[POLICY_BASED_ROUTE]"); - policyBasedRoutingServiceClient.deletePolicyBasedRouteAsync(name).get(); - } - } -} -// [END networkconnectivity_v1_generated_PolicyBasedRoutingService_DeletePolicyBasedRoute_Policybasedroutename_sync] diff --git a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/deletepolicybasedroute/SyncDeletePolicyBasedRouteString.java b/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/deletepolicybasedroute/SyncDeletePolicyBasedRouteString.java deleted file mode 100644 index f11380a6868b..000000000000 --- a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/deletepolicybasedroute/SyncDeletePolicyBasedRouteString.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1.samples; - -// [START networkconnectivity_v1_generated_PolicyBasedRoutingService_DeletePolicyBasedRoute_String_sync] -import com.google.cloud.networkconnectivity.v1.PolicyBasedRouteName; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient; -import com.google.protobuf.Empty; - -public class SyncDeletePolicyBasedRouteString { - - public static void main(String[] args) throws Exception { - syncDeletePolicyBasedRouteString(); - } - - public static void syncDeletePolicyBasedRouteString() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = - PolicyBasedRoutingServiceClient.create()) { - String name = - PolicyBasedRouteName.of("[PROJECT]", "[LOCATION]", "[POLICY_BASED_ROUTE]").toString(); - policyBasedRoutingServiceClient.deletePolicyBasedRouteAsync(name).get(); - } - } -} -// [END networkconnectivity_v1_generated_PolicyBasedRoutingService_DeletePolicyBasedRoute_String_sync] diff --git a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/getpolicybasedroute/AsyncGetPolicyBasedRoute.java b/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/getpolicybasedroute/AsyncGetPolicyBasedRoute.java deleted file mode 100644 index d635942640e1..000000000000 --- a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/getpolicybasedroute/AsyncGetPolicyBasedRoute.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1.samples; - -// [START networkconnectivity_v1_generated_PolicyBasedRoutingService_GetPolicyBasedRoute_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoute; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRouteName; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient; - -public class AsyncGetPolicyBasedRoute { - - public static void main(String[] args) throws Exception { - asyncGetPolicyBasedRoute(); - } - - public static void asyncGetPolicyBasedRoute() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = - PolicyBasedRoutingServiceClient.create()) { - GetPolicyBasedRouteRequest request = - GetPolicyBasedRouteRequest.newBuilder() - .setName( - PolicyBasedRouteName.of("[PROJECT]", "[LOCATION]", "[POLICY_BASED_ROUTE]") - .toString()) - .build(); - ApiFuture future = - policyBasedRoutingServiceClient.getPolicyBasedRouteCallable().futureCall(request); - // Do something. - PolicyBasedRoute response = future.get(); - } - } -} -// [END networkconnectivity_v1_generated_PolicyBasedRoutingService_GetPolicyBasedRoute_async] diff --git a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/getpolicybasedroute/SyncGetPolicyBasedRoute.java b/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/getpolicybasedroute/SyncGetPolicyBasedRoute.java deleted file mode 100644 index 16c3941ea7c8..000000000000 --- a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/getpolicybasedroute/SyncGetPolicyBasedRoute.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1.samples; - -// [START networkconnectivity_v1_generated_PolicyBasedRoutingService_GetPolicyBasedRoute_sync] -import com.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoute; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRouteName; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient; - -public class SyncGetPolicyBasedRoute { - - public static void main(String[] args) throws Exception { - syncGetPolicyBasedRoute(); - } - - public static void syncGetPolicyBasedRoute() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = - PolicyBasedRoutingServiceClient.create()) { - GetPolicyBasedRouteRequest request = - GetPolicyBasedRouteRequest.newBuilder() - .setName( - PolicyBasedRouteName.of("[PROJECT]", "[LOCATION]", "[POLICY_BASED_ROUTE]") - .toString()) - .build(); - PolicyBasedRoute response = policyBasedRoutingServiceClient.getPolicyBasedRoute(request); - } - } -} -// [END networkconnectivity_v1_generated_PolicyBasedRoutingService_GetPolicyBasedRoute_sync] diff --git a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/getpolicybasedroute/SyncGetPolicyBasedRoutePolicybasedroutename.java b/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/getpolicybasedroute/SyncGetPolicyBasedRoutePolicybasedroutename.java deleted file mode 100644 index dc7b9b61a3ef..000000000000 --- a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/getpolicybasedroute/SyncGetPolicyBasedRoutePolicybasedroutename.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1.samples; - -// [START networkconnectivity_v1_generated_PolicyBasedRoutingService_GetPolicyBasedRoute_Policybasedroutename_sync] -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoute; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRouteName; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient; - -public class SyncGetPolicyBasedRoutePolicybasedroutename { - - public static void main(String[] args) throws Exception { - syncGetPolicyBasedRoutePolicybasedroutename(); - } - - public static void syncGetPolicyBasedRoutePolicybasedroutename() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = - PolicyBasedRoutingServiceClient.create()) { - PolicyBasedRouteName name = - PolicyBasedRouteName.of("[PROJECT]", "[LOCATION]", "[POLICY_BASED_ROUTE]"); - PolicyBasedRoute response = policyBasedRoutingServiceClient.getPolicyBasedRoute(name); - } - } -} -// [END networkconnectivity_v1_generated_PolicyBasedRoutingService_GetPolicyBasedRoute_Policybasedroutename_sync] diff --git a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/getpolicybasedroute/SyncGetPolicyBasedRouteString.java b/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/getpolicybasedroute/SyncGetPolicyBasedRouteString.java deleted file mode 100644 index 46bdd59470d5..000000000000 --- a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/getpolicybasedroute/SyncGetPolicyBasedRouteString.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1.samples; - -// [START networkconnectivity_v1_generated_PolicyBasedRoutingService_GetPolicyBasedRoute_String_sync] -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoute; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRouteName; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient; - -public class SyncGetPolicyBasedRouteString { - - public static void main(String[] args) throws Exception { - syncGetPolicyBasedRouteString(); - } - - public static void syncGetPolicyBasedRouteString() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = - PolicyBasedRoutingServiceClient.create()) { - String name = - PolicyBasedRouteName.of("[PROJECT]", "[LOCATION]", "[POLICY_BASED_ROUTE]").toString(); - PolicyBasedRoute response = policyBasedRoutingServiceClient.getPolicyBasedRoute(name); - } - } -} -// [END networkconnectivity_v1_generated_PolicyBasedRoutingService_GetPolicyBasedRoute_String_sync] diff --git a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/listpolicybasedroutes/AsyncListPolicyBasedRoutes.java b/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/listpolicybasedroutes/AsyncListPolicyBasedRoutes.java deleted file mode 100644 index eb8cc1abef51..000000000000 --- a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/listpolicybasedroutes/AsyncListPolicyBasedRoutes.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1.samples; - -// [START networkconnectivity_v1_generated_PolicyBasedRoutingService_ListPolicyBasedRoutes_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest; -import com.google.cloud.networkconnectivity.v1.LocationName; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoute; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient; - -public class AsyncListPolicyBasedRoutes { - - public static void main(String[] args) throws Exception { - asyncListPolicyBasedRoutes(); - } - - public static void asyncListPolicyBasedRoutes() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = - PolicyBasedRoutingServiceClient.create()) { - ListPolicyBasedRoutesRequest request = - ListPolicyBasedRoutesRequest.newBuilder() - .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .setFilter("filter-1274492040") - .setOrderBy("orderBy-1207110587") - .build(); - ApiFuture future = - policyBasedRoutingServiceClient.listPolicyBasedRoutesPagedCallable().futureCall(request); - // Do something. - for (PolicyBasedRoute element : future.get().iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END networkconnectivity_v1_generated_PolicyBasedRoutingService_ListPolicyBasedRoutes_async] diff --git a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/listpolicybasedroutes/AsyncListPolicyBasedRoutesPaged.java b/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/listpolicybasedroutes/AsyncListPolicyBasedRoutesPaged.java deleted file mode 100644 index a0c7ac9eb18b..000000000000 --- a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/listpolicybasedroutes/AsyncListPolicyBasedRoutesPaged.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1.samples; - -// [START networkconnectivity_v1_generated_PolicyBasedRoutingService_ListPolicyBasedRoutes_Paged_async] -import com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest; -import com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse; -import com.google.cloud.networkconnectivity.v1.LocationName; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoute; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient; -import com.google.common.base.Strings; - -public class AsyncListPolicyBasedRoutesPaged { - - public static void main(String[] args) throws Exception { - asyncListPolicyBasedRoutesPaged(); - } - - public static void asyncListPolicyBasedRoutesPaged() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = - PolicyBasedRoutingServiceClient.create()) { - ListPolicyBasedRoutesRequest request = - ListPolicyBasedRoutesRequest.newBuilder() - .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .setFilter("filter-1274492040") - .setOrderBy("orderBy-1207110587") - .build(); - while (true) { - ListPolicyBasedRoutesResponse response = - policyBasedRoutingServiceClient.listPolicyBasedRoutesCallable().call(request); - for (PolicyBasedRoute element : response.getPolicyBasedRoutesList()) { - // doThingsWith(element); - } - String nextPageToken = response.getNextPageToken(); - if (!Strings.isNullOrEmpty(nextPageToken)) { - request = request.toBuilder().setPageToken(nextPageToken).build(); - } else { - break; - } - } - } - } -} -// [END networkconnectivity_v1_generated_PolicyBasedRoutingService_ListPolicyBasedRoutes_Paged_async] diff --git a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/listpolicybasedroutes/SyncListPolicyBasedRoutes.java b/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/listpolicybasedroutes/SyncListPolicyBasedRoutes.java deleted file mode 100644 index 3b39b2b51744..000000000000 --- a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/listpolicybasedroutes/SyncListPolicyBasedRoutes.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1.samples; - -// [START networkconnectivity_v1_generated_PolicyBasedRoutingService_ListPolicyBasedRoutes_sync] -import com.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest; -import com.google.cloud.networkconnectivity.v1.LocationName; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoute; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient; - -public class SyncListPolicyBasedRoutes { - - public static void main(String[] args) throws Exception { - syncListPolicyBasedRoutes(); - } - - public static void syncListPolicyBasedRoutes() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = - PolicyBasedRoutingServiceClient.create()) { - ListPolicyBasedRoutesRequest request = - ListPolicyBasedRoutesRequest.newBuilder() - .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .setFilter("filter-1274492040") - .setOrderBy("orderBy-1207110587") - .build(); - for (PolicyBasedRoute element : - policyBasedRoutingServiceClient.listPolicyBasedRoutes(request).iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END networkconnectivity_v1_generated_PolicyBasedRoutingService_ListPolicyBasedRoutes_sync] diff --git a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/listpolicybasedroutes/SyncListPolicyBasedRoutesLocationname.java b/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/listpolicybasedroutes/SyncListPolicyBasedRoutesLocationname.java deleted file mode 100644 index 24af9caa5beb..000000000000 --- a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/listpolicybasedroutes/SyncListPolicyBasedRoutesLocationname.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1.samples; - -// [START networkconnectivity_v1_generated_PolicyBasedRoutingService_ListPolicyBasedRoutes_Locationname_sync] -import com.google.cloud.networkconnectivity.v1.LocationName; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoute; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient; - -public class SyncListPolicyBasedRoutesLocationname { - - public static void main(String[] args) throws Exception { - syncListPolicyBasedRoutesLocationname(); - } - - public static void syncListPolicyBasedRoutesLocationname() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = - PolicyBasedRoutingServiceClient.create()) { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - for (PolicyBasedRoute element : - policyBasedRoutingServiceClient.listPolicyBasedRoutes(parent).iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END networkconnectivity_v1_generated_PolicyBasedRoutingService_ListPolicyBasedRoutes_Locationname_sync] diff --git a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/listpolicybasedroutes/SyncListPolicyBasedRoutesString.java b/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/listpolicybasedroutes/SyncListPolicyBasedRoutesString.java deleted file mode 100644 index ee527aedb77a..000000000000 --- a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservice/listpolicybasedroutes/SyncListPolicyBasedRoutesString.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1.samples; - -// [START networkconnectivity_v1_generated_PolicyBasedRoutingService_ListPolicyBasedRoutes_String_sync] -import com.google.cloud.networkconnectivity.v1.LocationName; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoute; -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient; - -public class SyncListPolicyBasedRoutesString { - - public static void main(String[] args) throws Exception { - syncListPolicyBasedRoutesString(); - } - - public static void syncListPolicyBasedRoutesString() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (PolicyBasedRoutingServiceClient policyBasedRoutingServiceClient = - PolicyBasedRoutingServiceClient.create()) { - String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); - for (PolicyBasedRoute element : - policyBasedRoutingServiceClient.listPolicyBasedRoutes(parent).iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END networkconnectivity_v1_generated_PolicyBasedRoutingService_ListPolicyBasedRoutes_String_sync] diff --git a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservicesettings/getpolicybasedroute/SyncGetPolicyBasedRoute.java b/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservicesettings/getpolicybasedroute/SyncGetPolicyBasedRoute.java deleted file mode 100644 index d48c4e1b12c2..000000000000 --- a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/policybasedroutingservicesettings/getpolicybasedroute/SyncGetPolicyBasedRoute.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1.samples; - -// [START networkconnectivity_v1_generated_PolicyBasedRoutingServiceSettings_GetPolicyBasedRoute_sync] -import com.google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceSettings; -import java.time.Duration; - -public class SyncGetPolicyBasedRoute { - - public static void main(String[] args) throws Exception { - syncGetPolicyBasedRoute(); - } - - public static void syncGetPolicyBasedRoute() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - PolicyBasedRoutingServiceSettings.Builder policyBasedRoutingServiceSettingsBuilder = - PolicyBasedRoutingServiceSettings.newBuilder(); - policyBasedRoutingServiceSettingsBuilder - .getPolicyBasedRouteSettings() - .setRetrySettings( - policyBasedRoutingServiceSettingsBuilder - .getPolicyBasedRouteSettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - PolicyBasedRoutingServiceSettings policyBasedRoutingServiceSettings = - policyBasedRoutingServiceSettingsBuilder.build(); - } -} -// [END networkconnectivity_v1_generated_PolicyBasedRoutingServiceSettings_GetPolicyBasedRoute_sync] diff --git a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/stub/policybasedroutingservicestubsettings/getpolicybasedroute/SyncGetPolicyBasedRoute.java b/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/stub/policybasedroutingservicestubsettings/getpolicybasedroute/SyncGetPolicyBasedRoute.java deleted file mode 100644 index 7a68c4310f48..000000000000 --- a/java-networkconnectivity/samples/snippets/generated/com/google/cloud/networkconnectivity/v1/stub/policybasedroutingservicestubsettings/getpolicybasedroute/SyncGetPolicyBasedRoute.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2022 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.networkconnectivity.v1.stub.samples; - -// [START networkconnectivity_v1_generated_PolicyBasedRoutingServiceStubSettings_GetPolicyBasedRoute_sync] -import com.google.cloud.networkconnectivity.v1.stub.PolicyBasedRoutingServiceStubSettings; -import java.time.Duration; - -public class SyncGetPolicyBasedRoute { - - public static void main(String[] args) throws Exception { - syncGetPolicyBasedRoute(); - } - - public static void syncGetPolicyBasedRoute() throws Exception { - // This snippet has been automatically generated and should be regarded as a code template only. - // It will require modifications to work: - // - It may require correct/in-range values for request initialization. - // - It may require specifying regional endpoints when creating the service client as shown in - // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - PolicyBasedRoutingServiceStubSettings.Builder policyBasedRoutingServiceSettingsBuilder = - PolicyBasedRoutingServiceStubSettings.newBuilder(); - policyBasedRoutingServiceSettingsBuilder - .getPolicyBasedRouteSettings() - .setRetrySettings( - policyBasedRoutingServiceSettingsBuilder - .getPolicyBasedRouteSettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - PolicyBasedRoutingServiceStubSettings policyBasedRoutingServiceSettings = - policyBasedRoutingServiceSettingsBuilder.build(); - } -} -// [END networkconnectivity_v1_generated_PolicyBasedRoutingServiceStubSettings_GetPolicyBasedRoute_sync]